Skip to content

Commit

Permalink
Make PassJSON enums Encodable
Browse files Browse the repository at this point in the history
  • Loading branch information
fpseverino committed Jun 28, 2024
1 parent 4aa6f10 commit 11c4cf4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/Passes/DTOs/PassJSON.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ public protocol BoardingPass: Encodable {
///
/// The system may use the value to display more information,
/// such as showing an airplane icon for the pass on watchOS when the value is set to `PKTransitTypeAir`.
var transitType: TransitType.RawValue { get }
var transitType: TransitType { get }
}

/// The type of transit for a boarding pass.
public enum TransitType: String {
public enum TransitType: String, Encodable {
case air = "PKTransitTypeAir"
case boat = "PKTransitTypeBoat"
case bus = "PKTransitTypeBus"
Expand All @@ -80,7 +80,7 @@ public protocol Barcodes: Encodable {
/// The format of the barcode.
///
/// The barcode format `PKBarcodeFormatCode128` isn’t supported for watchOS.
var format: BarcodeFormat.RawValue { get }
var format: BarcodeFormat { get }

/// The message or payload to display as a barcode.
var message: String { get }
Expand All @@ -97,7 +97,7 @@ public extension Barcodes {
}

/// The format of the barcode.
public enum BarcodeFormat: String {
public enum BarcodeFormat: String, Encodable {
case pdf417 = "PKBarcodeFormatPDF417"
case qr = "PKBarcodeFormatQR"
case aztec = "PKBarcodeFormatAztec"
Expand Down

0 comments on commit 11c4cf4

Please sign in to comment.