[All Platforms] 2.1.0 - Sync Optimizations
This commit is contained in:
@@ -55,7 +55,6 @@ struct BackupGym: Codable {
|
||||
let createdAt: String
|
||||
let updatedAt: String
|
||||
|
||||
/// Initialize from native iOS Gym model
|
||||
init(from gym: Gym) {
|
||||
self.id = gym.id.uuidString
|
||||
self.name = gym.name
|
||||
@@ -71,7 +70,6 @@ struct BackupGym: Codable {
|
||||
self.updatedAt = formatter.string(from: gym.updatedAt)
|
||||
}
|
||||
|
||||
/// Initialize with explicit parameters for import
|
||||
init(
|
||||
id: String,
|
||||
name: String,
|
||||
@@ -94,7 +92,6 @@ struct BackupGym: Codable {
|
||||
self.updatedAt = updatedAt
|
||||
}
|
||||
|
||||
/// Convert to native iOS Gym model
|
||||
func toGym() throws -> Gym {
|
||||
let formatter = ISO8601DateFormatter()
|
||||
formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
|
||||
@@ -137,7 +134,6 @@ struct BackupProblem: Codable {
|
||||
let createdAt: String
|
||||
let updatedAt: String
|
||||
|
||||
/// Initialize from native iOS Problem model
|
||||
init(from problem: Problem) {
|
||||
self.id = problem.id.uuidString
|
||||
self.gymId = problem.gymId.uuidString
|
||||
@@ -158,7 +154,6 @@ struct BackupProblem: Codable {
|
||||
self.updatedAt = formatter.string(from: problem.updatedAt)
|
||||
}
|
||||
|
||||
/// Initialize with explicit parameters for import
|
||||
init(
|
||||
id: String,
|
||||
gymId: String,
|
||||
@@ -191,7 +186,6 @@ struct BackupProblem: Codable {
|
||||
self.updatedAt = updatedAt
|
||||
}
|
||||
|
||||
/// Convert to native iOS Problem model
|
||||
func toProblem() throws -> Problem {
|
||||
let formatter = ISO8601DateFormatter()
|
||||
formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
|
||||
@@ -224,7 +218,6 @@ struct BackupProblem: Codable {
|
||||
)
|
||||
}
|
||||
|
||||
/// Create a copy with updated image paths for import processing
|
||||
func withUpdatedImagePaths(_ newImagePaths: [String]) -> BackupProblem {
|
||||
return BackupProblem(
|
||||
id: self.id,
|
||||
@@ -258,7 +251,6 @@ struct BackupClimbSession: Codable {
|
||||
let createdAt: String
|
||||
let updatedAt: String
|
||||
|
||||
/// Initialize from native iOS ClimbSession model
|
||||
init(from session: ClimbSession) {
|
||||
self.id = session.id.uuidString
|
||||
self.gymId = session.gymId.uuidString
|
||||
@@ -275,7 +267,6 @@ struct BackupClimbSession: Codable {
|
||||
self.updatedAt = formatter.string(from: session.updatedAt)
|
||||
}
|
||||
|
||||
/// Initialize with explicit parameters for import
|
||||
init(
|
||||
id: String,
|
||||
gymId: String,
|
||||
@@ -300,7 +291,6 @@ struct BackupClimbSession: Codable {
|
||||
self.updatedAt = updatedAt
|
||||
}
|
||||
|
||||
/// Convert to native iOS ClimbSession model
|
||||
func toClimbSession() throws -> ClimbSession {
|
||||
let formatter = ISO8601DateFormatter()
|
||||
formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
|
||||
@@ -347,7 +337,6 @@ struct BackupAttempt: Codable {
|
||||
let createdAt: String
|
||||
let updatedAt: String?
|
||||
|
||||
/// Initialize from native iOS Attempt model
|
||||
init(from attempt: Attempt) {
|
||||
self.id = attempt.id.uuidString
|
||||
self.sessionId = attempt.sessionId.uuidString
|
||||
@@ -365,7 +354,6 @@ struct BackupAttempt: Codable {
|
||||
self.updatedAt = formatter.string(from: attempt.updatedAt)
|
||||
}
|
||||
|
||||
/// Initialize with explicit parameters for import
|
||||
init(
|
||||
id: String,
|
||||
sessionId: String,
|
||||
@@ -392,7 +380,6 @@ struct BackupAttempt: Codable {
|
||||
self.updatedAt = updatedAt
|
||||
}
|
||||
|
||||
/// Convert to native iOS Attempt model
|
||||
func toAttempt() throws -> Attempt {
|
||||
let formatter = ISO8601DateFormatter()
|
||||
formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
|
||||
|
||||
Reference in New Issue
Block a user