Login flow fixed
This commit is contained in:
44
pedi-foods/Sources/PediFoods/State/AppState.swift
Normal file
44
pedi-foods/Sources/PediFoods/State/AppState.swift
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user