Login flow fixed

This commit is contained in:
Daniel Arantes Loverde
2026-02-05 16:57:27 -03:00
parent 01c1da0430
commit 51d02f6715
12 changed files with 859 additions and 108 deletions

View File

@@ -0,0 +1,44 @@
import Foundation
struct AppState {
var session = SessionState()
var profile = ProfileState()
var cart = CartState()
var address = AddressState()
var favorites = FavoritesState()
}
struct SessionState {
var isAuthenticated: Bool = false
var jwt: String? = nil
}
struct ProfileState {
var id: String? = nil
var name: String = ""
var email: String = ""
var phone: String = ""
}
struct AddressState {
var selectedId: String? = nil
var display: String = "Rua das Flores, 123"
var latitude: Double? = nil
var longitude: Double? = nil
}
struct FavoritesState {
var storeIds: Set<String> = []
}
struct CartState {
var items: [CartItemState] = []
var total: Double = 0
}
struct CartItemState: Identifiable {
let id: String
var name: String
var quantity: Int
var price: Double
}