Skip to content

Commit 1c05ab7

Browse files
committed
fix uuids
1 parent 9463925 commit 1c05ab7

File tree

7 files changed

+23
-15
lines changed

7 files changed

+23
-15
lines changed

Sources/ParseCareKit/Models/PCKCarePlan.swift

+2
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ public struct PCKCarePlan: PCKVersionable {
146146
public static func copyValues(from other: PCKCarePlan, to here: PCKCarePlan) throws -> Self {
147147
var here = here
148148
here.copyVersionedValues(from: other)
149+
here.previousVersionUUIDs = other.previousVersionUUIDs
150+
here.nextVersionUUIDs = other.nextVersionUUIDs
149151
here.patient = other.patient
150152
here.title = other.title
151153
return here

Sources/ParseCareKit/Models/PCKContact.swift

+12-10
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,18 @@ public struct PCKContact: PCKVersionable {
175175
}
176176

177177
public static func copyValues(from other: PCKContact, to here: PCKContact) throws -> Self {
178-
var copy = here
179-
copy.copyVersionedValues(from: other)
180-
copy.address = other.address
181-
copy.category = other.category
182-
copy.title = other.title
183-
copy.name = other.name
184-
copy.organization = other.organization
185-
copy.role = other.role
186-
copy.carePlan = other.carePlan
187-
return copy
178+
var here = here
179+
here.copyVersionedValues(from: other)
180+
here.previousVersionUUIDs = other.previousVersionUUIDs
181+
here.nextVersionUUIDs = other.nextVersionUUIDs
182+
here.address = other.address
183+
here.category = other.category
184+
here.title = other.title
185+
here.name = other.name
186+
here.organization = other.organization
187+
here.role = other.role
188+
here.carePlan = other.carePlan
189+
return here
188190
}
189191

190192
public static func copyCareKit(_ contactAny: OCKAnyContact) throws -> PCKContact {

Sources/ParseCareKit/Models/PCKHealthKitTask.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ public struct PCKHealthKitTask: PCKVersionable {
161161
public static func copyValues(from other: PCKHealthKitTask, to here: PCKHealthKitTask) throws -> PCKHealthKitTask {
162162
var here = here
163163
here.copyVersionedValues(from: other)
164-
164+
here.previousVersionUUIDs = other.previousVersionUUIDs
165+
here.nextVersionUUIDs = other.nextVersionUUIDs
165166
here.impactsAdherence = other.impactsAdherence
166167
here.instructions = other.instructions
167168
here.title = other.title

Sources/ParseCareKit/Models/PCKOutcome.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ public struct PCKOutcome: PCKVersionable {
161161

162162
public static func copyValues(from other: PCKOutcome, to here: PCKOutcome) throws -> Self {
163163
var here = here
164-
here.copyCommonValues(from: other)
164+
here.copyVersionedValues(from: other)
165+
here.previousVersionUUIDs = other.previousVersionUUIDs
166+
here.nextVersionUUIDs = other.nextVersionUUIDs
165167
here.taskOccurrenceIndex = other.taskOccurrenceIndex
166168
here.values = other.values
167169
here.task = other.task

Sources/ParseCareKit/Models/PCKPatient.swift

+2
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ public struct PCKPatient: PCKVersionable {
142142
public static func copyValues(from other: PCKPatient, to here: PCKPatient) throws -> Self {
143143
var here = here
144144
here.copyVersionedValues(from: other)
145+
here.previousVersionUUIDs = other.previousVersionUUIDs
146+
here.nextVersionUUIDs = other.nextVersionUUIDs
145147
here.name = other.name
146148
here.birthday = other.birthday
147149
here.sex = other.sex

Sources/ParseCareKit/Models/PCKTask.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ public struct PCKTask: PCKVersionable {
158158
public static func copyValues(from other: PCKTask, to here: PCKTask) throws -> PCKTask {
159159
var here = here
160160
here.copyVersionedValues(from: other)
161-
161+
here.previousVersionUUIDs = other.previousVersionUUIDs
162+
here.nextVersionUUIDs = other.nextVersionUUIDs
162163
here.impactsAdherence = other.impactsAdherence
163164
here.instructions = other.instructions
164165
here.title = other.title

Sources/ParseCareKit/Protocols/PCKVersionable.swift

-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ extension PCKVersionable {
5050
mutating public func copyVersionedValues(from other: Self) {
5151
self.effectiveDate = other.effectiveDate
5252
self.deletedDate = other.deletedDate
53-
self.previousVersionUUIDs = other.previousVersionUUIDs
54-
self.nextVersionUUIDs = other.nextVersionUUIDs
5553
self.copyCommonValues(from: other)
5654
}
5755
}

0 commit comments

Comments
 (0)