parent
28cd6abd86
commit
fecda22494
@ -0,0 +1,8 @@ |
|||||||
|
// |
||||||
|
// Club.swift |
||||||
|
// PadelClub |
||||||
|
// |
||||||
|
// Created by Laurent Morvillier on 02/02/2024. |
||||||
|
// |
||||||
|
|
||||||
|
import Foundation |
||||||
@ -0,0 +1,25 @@ |
|||||||
|
// |
||||||
|
// DataStore.swift |
||||||
|
// PadelClub |
||||||
|
// |
||||||
|
// Created by Laurent Morvillier on 02/02/2024. |
||||||
|
// |
||||||
|
|
||||||
|
import Foundation |
||||||
|
import LeStorage |
||||||
|
|
||||||
|
class DataStore { |
||||||
|
|
||||||
|
static let main: DataStore = DataStore() |
||||||
|
fileprivate var _store: Store |
||||||
|
|
||||||
|
fileprivate(set) var tournaments: StoredCollection<Tournament> |
||||||
|
|
||||||
|
init() { |
||||||
|
let store = Store(synchronizationApiURL: "http://127.0.0.1:8000/") |
||||||
|
self.tournaments = store.registerCollection(synchronized: true) |
||||||
|
|
||||||
|
self._store = store |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,17 @@ |
|||||||
|
// |
||||||
|
// Tournament.swift |
||||||
|
// PadelClub |
||||||
|
// |
||||||
|
// Created by Laurent Morvillier on 02/02/2024. |
||||||
|
// |
||||||
|
|
||||||
|
import Foundation |
||||||
|
import LeStorage |
||||||
|
|
||||||
|
class Tournament: Storable { |
||||||
|
|
||||||
|
static var resourceName: String = "tournaments" |
||||||
|
|
||||||
|
var id: String = UUID().uuidString |
||||||
|
var name: String |
||||||
|
} |
||||||
Loading…
Reference in new issue