base commit

multistore
Laurent 2 years ago
parent 28cd6abd86
commit fecda22494
  1. 8
      PadelClub/Data/Club.swift
  2. 25
      PadelClub/Data/DataStore.swift
  3. 17
      PadelClub/Data/Tournament.swift

@ -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…
Cancel
Save