-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ee3139
commit cd2461b
Showing
27 changed files
with
2,493 additions
and
73 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
Sources/code/application/Models/Cart/CartCommonConfigCartAppModel.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
|
||
|
||
import Foundation | ||
public extension ApplicationClient.Cart { | ||
/* | ||
Model: CartCommonConfig | ||
Used By: Cart | ||
*/ | ||
class CartCommonConfig: Codable { | ||
|
||
public var deliveryChargesConfig: DeliveryChargesConfig? | ||
|
||
|
||
public enum CodingKeys: String, CodingKey { | ||
|
||
case deliveryChargesConfig = "delivery_charges_config" | ||
|
||
} | ||
|
||
public init(deliveryChargesConfig: DeliveryChargesConfig? = nil) { | ||
|
||
self.deliveryChargesConfig = deliveryChargesConfig | ||
|
||
} | ||
|
||
required public init(from decoder: Decoder) throws { | ||
let container = try decoder.container(keyedBy: CodingKeys.self) | ||
|
||
|
||
do { | ||
deliveryChargesConfig = try container.decode(DeliveryChargesConfig.self, forKey: .deliveryChargesConfig) | ||
|
||
} catch DecodingError.typeMismatch(let type, let context) { | ||
print("Type '\(type)' mismatch:", context.debugDescription) | ||
print("codingPath:", context.codingPath) | ||
} catch { | ||
|
||
} | ||
|
||
|
||
} | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
|
||
|
||
|
||
try? container.encodeIfPresent(deliveryChargesConfig, forKey: .deliveryChargesConfig) | ||
|
||
|
||
} | ||
|
||
} | ||
} |
Oops, something went wrong.