diff --git a/PadelClub/Data/Club.swift b/PadelClub/Data/Club.swift new file mode 100644 index 0000000..5f47fc6 --- /dev/null +++ b/PadelClub/Data/Club.swift @@ -0,0 +1,8 @@ +// +// Club.swift +// PadelClub +// +// Created by Laurent Morvillier on 02/02/2024. +// + +import Foundation diff --git a/PadelClub/Data/DataStore.swift b/PadelClub/Data/DataStore.swift new file mode 100644 index 0000000..87eb65f --- /dev/null +++ b/PadelClub/Data/DataStore.swift @@ -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 + + init() { + let store = Store(synchronizationApiURL: "http://127.0.0.1:8000/") + self.tournaments = store.registerCollection(synchronized: true) + + self._store = store + } + +} diff --git a/PadelClub/Data/Tournament.swift b/PadelClub/Data/Tournament.swift new file mode 100644 index 0000000..038fc4c --- /dev/null +++ b/PadelClub/Data/Tournament.swift @@ -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 +}