feat(orders-ui): alinhar lista/detalhe ao layout e corrigir build

This commit is contained in:
Daniel Arantes Loverde
2026-03-05 10:23:04 -03:00
parent 1407f0b9de
commit 83882538c2
3 changed files with 259 additions and 92 deletions

View File

@@ -81,6 +81,9 @@ struct PublicOrderResult: Codable, Identifiable {
let nextAction: String?
let deliveryType: String?
let deliveryTypeLabel: String?
let subtotal: Double?
let deliveryFee: Double?
let discount: Double?
let total: Double?
let storeName: String?
let storeLogoURL: String?
@@ -111,6 +114,15 @@ struct PublicOrderResult: Codable, Identifiable {
case nextAction
case deliveryType
case deliveryTypeLabel
case subtotal
case subTotal
case itemsTotal
case deliveryFee
case delivery_fee
case fee
case discount
case desconto
case couponDiscount
case total
case storeName
case storeLogo
@@ -148,6 +160,9 @@ struct PublicOrderResult: Codable, Identifiable {
nextAction: String? = nil,
deliveryType: String? = nil,
deliveryTypeLabel: String? = nil,
subtotal: Double? = nil,
deliveryFee: Double? = nil,
discount: Double? = nil,
total: Double? = nil,
storeName: String? = nil,
storeLogoURL: String? = nil,
@@ -176,6 +191,9 @@ struct PublicOrderResult: Codable, Identifiable {
self.nextAction = nextAction
self.deliveryType = deliveryType
self.deliveryTypeLabel = deliveryTypeLabel
self.subtotal = subtotal
self.deliveryFee = deliveryFee
self.discount = discount
self.total = total
self.storeName = storeName
self.storeLogoURL = storeLogoURL
@@ -217,6 +235,9 @@ struct PublicOrderResult: Codable, Identifiable {
}
deliveryType = ApiService.decodeFlexibleString(from: container, keys: [.deliveryType])
deliveryTypeLabel = ApiService.decodeFlexibleString(from: container, keys: [.deliveryTypeLabel])
subtotal = ApiService.decodeFlexibleDouble(from: container, keys: [.subtotal, .subTotal, .itemsTotal])
deliveryFee = ApiService.decodeFlexibleDouble(from: container, keys: [.deliveryFee, .delivery_fee, .fee])
discount = ApiService.decodeFlexibleDouble(from: container, keys: [.discount, .desconto, .couponDiscount])
total = ApiService.decodeFlexibleDouble(from: container, keys: [.total])
storeName = ApiService.decodeFlexibleString(from: container, keys: [.storeName])
storeLogoURL = ApiService.decodeFlexibleString(from: container, keys: [.storeLogo, .store_logo, .logo])
@@ -253,6 +274,9 @@ struct PublicOrderResult: Codable, Identifiable {
try container.encodeIfPresent(nextAction, forKey: .nextAction)
try container.encodeIfPresent(deliveryType, forKey: .deliveryType)
try container.encodeIfPresent(deliveryTypeLabel, forKey: .deliveryTypeLabel)
try container.encodeIfPresent(subtotal, forKey: .subtotal)
try container.encodeIfPresent(deliveryFee, forKey: .deliveryFee)
try container.encodeIfPresent(discount, forKey: .discount)
try container.encodeIfPresent(total, forKey: .total)
try container.encodeIfPresent(storeName, forKey: .storeName)
try container.encodeIfPresent(createdAt, forKey: .createdAt)