You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
768 B
32 lines
768 B
//
|
|
// Purchase.swift
|
|
// LeStorage
|
|
//
|
|
// Created by Laurent Morvillier on 12/04/2024.
|
|
//
|
|
|
|
import Foundation
|
|
import LeStorage
|
|
|
|
class Purchase: ModelObject, Storable {
|
|
|
|
static func resourceName() -> String { return "purchases" }
|
|
static func tokenExemptedMethods() -> [HTTPMethod] { return [] }
|
|
|
|
var id: String = Store.randomId()
|
|
|
|
var user: String
|
|
var identifier: UInt64
|
|
var purchaseDate: Date
|
|
var productId: String
|
|
var quantity: Int?
|
|
|
|
init(user: String, identifier: UInt64, purchaseDate: Date, productId: String, quantity: Int? = nil) {
|
|
self.user = user
|
|
self.identifier = identifier
|
|
self.purchaseDate = purchaseDate
|
|
self.productId = productId
|
|
self.quantity = quantity
|
|
}
|
|
|
|
}
|
|
|