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.
34 lines
719 B
34 lines
719 B
//
|
|
// WaitingOperation.swift
|
|
// LeStorage
|
|
//
|
|
// Created by Laurent Morvillier on 01/04/2025.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
enum StorageMethod: String, Codable {
|
|
case add
|
|
case update
|
|
case delete
|
|
case deleteUnusedShared
|
|
}
|
|
|
|
class PendingOperation<T : Storable>: Codable, Equatable {
|
|
|
|
var id: String = Store.randomId()
|
|
var method: StorageMethod
|
|
var data: T
|
|
var actionOption: ActionOption
|
|
|
|
init(method: StorageMethod, data: T, actionOption: ActionOption) {
|
|
self.method = method
|
|
self.data = data
|
|
self.actionOption = actionOption
|
|
}
|
|
|
|
static func == (lhs: PendingOperation, rhs: PendingOperation) -> Bool {
|
|
return lhs.id == rhs.id
|
|
}
|
|
|
|
}
|
|
|