[iOS & Android] iOS 1.2.3 and Android 1.7.2
All checks were successful
OpenClimb Docker Deploy / build-and-push (push) Successful in 2m32s
All checks were successful
OpenClimb Docker Deploy / build-and-push (push) Successful in 2m32s
This commit is contained in:
@@ -336,6 +336,7 @@ struct BackupAttempt: Codable {
|
||||
let restTime: Int64? // Rest time in seconds
|
||||
let timestamp: String
|
||||
let createdAt: String
|
||||
let updatedAt: String?
|
||||
|
||||
/// Initialize from native iOS Attempt model
|
||||
init(from attempt: Attempt) {
|
||||
@@ -352,6 +353,7 @@ struct BackupAttempt: Codable {
|
||||
formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
|
||||
self.timestamp = formatter.string(from: attempt.timestamp)
|
||||
self.createdAt = formatter.string(from: attempt.createdAt)
|
||||
self.updatedAt = formatter.string(from: attempt.updatedAt)
|
||||
}
|
||||
|
||||
/// Initialize with explicit parameters for import
|
||||
@@ -365,7 +367,8 @@ struct BackupAttempt: Codable {
|
||||
duration: Int64?,
|
||||
restTime: Int64?,
|
||||
timestamp: String,
|
||||
createdAt: String
|
||||
createdAt: String,
|
||||
updatedAt: String?
|
||||
) {
|
||||
self.id = id
|
||||
self.sessionId = sessionId
|
||||
@@ -377,6 +380,7 @@ struct BackupAttempt: Codable {
|
||||
self.restTime = restTime
|
||||
self.timestamp = timestamp
|
||||
self.createdAt = createdAt
|
||||
self.updatedAt = updatedAt
|
||||
}
|
||||
|
||||
/// Convert to native iOS Attempt model
|
||||
@@ -385,13 +389,15 @@ struct BackupAttempt: Codable {
|
||||
formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
|
||||
|
||||
guard let uuid = UUID(uuidString: id),
|
||||
let sessionUuid = UUID(uuidString: sessionId),
|
||||
let problemUuid = UUID(uuidString: problemId),
|
||||
let timestampDate = formatter.date(from: timestamp),
|
||||
let createdDate = formatter.date(from: createdAt)
|
||||
let sessionUuid = UUID(uuidString: sessionId),
|
||||
let problemUuid = UUID(uuidString: problemId),
|
||||
let timestampDate = formatter.date(from: timestamp),
|
||||
let createdDate = formatter.date(from: createdAt)
|
||||
else {
|
||||
throw BackupError.invalidDateFormat
|
||||
}
|
||||
let updatedDateParsed = updatedAt.flatMap { formatter.date(from: $0) }
|
||||
let updatedDate = updatedDateParsed ?? createdDate
|
||||
|
||||
let durationValue = duration.map { Int($0) }
|
||||
let restTimeValue = restTime.map { Int($0) }
|
||||
@@ -406,7 +412,8 @@ struct BackupAttempt: Codable {
|
||||
duration: durationValue,
|
||||
restTime: restTimeValue,
|
||||
timestamp: timestampDate,
|
||||
createdAt: createdDate
|
||||
createdAt: createdDate,
|
||||
updatedAt: updatedDate
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user