0% found this document useful (0 votes)
6 views

FOS Models

Uploaded by

fadysameh10
Copyright
© © All Rights Reserved
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

FOS Models

Uploaded by

fadysameh10
Copyright
© © All Rights Reserved
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 5

Struct Customer {

var name: String?


var email: String?
var phone: String?
var id: String?
var addresses: [Address]?
var lastOrders : [Order]?
var appLanguage: String?
}

Struct CustomerAddress {
var addresses: [Address]?
}

Struct Address {
var title, addressType: String?
var lang, lat: Double?
var id, customer_id: String?
}

enum OrderType {
case Delivery
case DriveThru
case DineIn
case Pickup
}

struct Delivery {
var address: Address?
var branchId: Int?
}

struct DriveThru {
var time: String? //“06:30 PM”
var date: String? //“09-04-2024”
var branchId: Int?
var carType: String?
var carColor: String?
var carNumber: String?
}

struct DineIn {
var time: String? //“06:30 PM”
var date: String? //“09-04-2024”
var branchId: Int?
var persons: Int?
}

struct Pickup {
var time: String? //“06:30 PM”
var branchId: Int?
}

struct Category {
var title : String?
var id: Int?
}

struct Item{
var id: Int?
var title: String?
var defaultSize: String?
var description: String?
var product_categoryId: Int?
var variants: Variants?
var notes: String?
var image: ImageUrl?
var previousPrice, currentPrice : Double?
var quantity : Int? //optional
}

struct Variants{
var rollCategory : RollCategory?
var burgerCategory : BurgerCategory?
var friedCategory : FriedCategory?
var pizzaCategory : PizzaCategory?
}

struct RollCategory{
var size : String?
var addons : [Addons]?
}

struct BurgerCategory{
var size : Size? //single & price &&& double & price
var drink : [Drink]? //[Required] Title & Price
var addons : [Addons]? //[optional]
}

struct FriedCategory{
var size : Size? //pics & price
var drink : [Drink]? //[Required] Title & Price
var addons : [Addons]? //[optional]
}

struct PizzaCategory{
var size : Size? //smal & price &&& medium & price …..
var drink : [Drink]? //[Required] Title & Price
var addons : [Addons]? //[optional]
}

class Cart : Codable {


var id : Int?
var phone: String?
var line_items : [LineItem]?
var token : String?
}

class LineItem : Codable {


var item_id : Int?
var product_id : Int?
var title : String?
var price : String?
var quantity : Int?
}

struct OrderInfo {
var id :Int?
var orderType: OrderType?
var confirmed: Bool?
var contact_phone: String?
var created_at: String?
var estimatedArrivalTime: String?
var subtotal_price: Double?
var discounts: Double?
var sericeFee: Double?
var DeliveryFee: Double?
var totalPrice: Double?
var order_number : Int?
var order_status_url: String? // or orderStatusId from range
1 to 4
var paymentMethod: Payment? //choose between cash or
card
}

struct Payment {
var cards: [Card]?
var cashOnDelivery: Double?
}

struct Card {
var isCurrent: Bool?
var cardImage: ImageUrl?
var cardNumber: String?
var expiryDate: String?
var cardCVVCode: String?
}

class DiscountCode {
var discount_codes : [Discount]?
}

class Discount {
var code : String?
var token : String?
}

You might also like