Skip to content

Commit a864348

Browse files
authored
Merge pull request #6082 from woocommerce/issue/5976-wcpaycharges-storage
[Mobile Payments] WCPayCharge CoreData storage
2 parents 39641cb + 054ca52 commit a864348

15 files changed

+1158
-2
lines changed

Storage/Storage.xcodeproj/project.pbxproj

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@
3434
02DA64172313C26400284168 /* StatsVersionBySite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02DA64162313C26400284168 /* StatsVersionBySite.swift */; };
3535
02DA64192313C2AA00284168 /* StatsVersion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02DA64182313C2AA00284168 /* StatsVersion.swift */; };
3636
02EAB6D72480A86D00FD873C /* CrashLogger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02EAB6D62480A86D00FD873C /* CrashLogger.swift */; };
37+
031C1EA127AD3AFE00298699 /* WCPayCharge+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031C1E9927AD3AFE00298699 /* WCPayCharge+CoreDataClass.swift */; };
38+
031C1EA227AD3AFE00298699 /* WCPayCharge+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031C1E9A27AD3AFE00298699 /* WCPayCharge+CoreDataProperties.swift */; };
39+
031C1EA327AD3AFE00298699 /* WCPayCardPresentPaymentDetails+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031C1E9B27AD3AFE00298699 /* WCPayCardPresentPaymentDetails+CoreDataClass.swift */; };
40+
031C1EA427AD3AFE00298699 /* WCPayCardPresentPaymentDetails+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031C1E9C27AD3AFE00298699 /* WCPayCardPresentPaymentDetails+CoreDataProperties.swift */; };
41+
031C1EA527AD3AFE00298699 /* WCPayCardPaymentDetails+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031C1E9D27AD3AFE00298699 /* WCPayCardPaymentDetails+CoreDataClass.swift */; };
42+
031C1EA627AD3AFE00298699 /* WCPayCardPaymentDetails+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031C1E9E27AD3AFE00298699 /* WCPayCardPaymentDetails+CoreDataProperties.swift */; };
43+
031C1EA727AD3AFE00298699 /* WCPayCardPresentReceiptDetails+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031C1E9F27AD3AFE00298699 /* WCPayCardPresentReceiptDetails+CoreDataClass.swift */; };
44+
031C1EA827AD3AFE00298699 /* WCPayCardPresentReceiptDetails+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031C1EA027AD3AFE00298699 /* WCPayCardPresentReceiptDetails+CoreDataProperties.swift */; };
3745
077F39C4269F1F4600ABEADC /* SystemPlugin+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 077F39C3269F1F4600ABEADC /* SystemPlugin+CoreDataClass.swift */; };
3846
077F39C6269F1F7C00ABEADC /* SystemPlugin+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 077F39C5269F1F7C00ABEADC /* SystemPlugin+CoreDataProperties.swift */; };
3947
2618707325409C65006522A1 /* ShippingLineTax+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2618707125409C65006522A1 /* ShippingLineTax+CoreDataClass.swift */; };
@@ -264,6 +272,15 @@
264272
02DA64162313C26400284168 /* StatsVersionBySite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsVersionBySite.swift; sourceTree = "<group>"; };
265273
02DA64182313C2AA00284168 /* StatsVersion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsVersion.swift; sourceTree = "<group>"; };
266274
02EAB6D62480A86D00FD873C /* CrashLogger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrashLogger.swift; sourceTree = "<group>"; };
275+
0306C18227BAB09D0070B617 /* Model 65.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Model 65.xcdatamodel"; sourceTree = "<group>"; };
276+
031C1E9927AD3AFE00298699 /* WCPayCharge+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WCPayCharge+CoreDataClass.swift"; sourceTree = "<group>"; };
277+
031C1E9A27AD3AFE00298699 /* WCPayCharge+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WCPayCharge+CoreDataProperties.swift"; sourceTree = "<group>"; };
278+
031C1E9B27AD3AFE00298699 /* WCPayCardPresentPaymentDetails+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WCPayCardPresentPaymentDetails+CoreDataClass.swift"; sourceTree = "<group>"; };
279+
031C1E9C27AD3AFE00298699 /* WCPayCardPresentPaymentDetails+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WCPayCardPresentPaymentDetails+CoreDataProperties.swift"; sourceTree = "<group>"; };
280+
031C1E9D27AD3AFE00298699 /* WCPayCardPaymentDetails+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WCPayCardPaymentDetails+CoreDataClass.swift"; sourceTree = "<group>"; };
281+
031C1E9E27AD3AFE00298699 /* WCPayCardPaymentDetails+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WCPayCardPaymentDetails+CoreDataProperties.swift"; sourceTree = "<group>"; };
282+
031C1E9F27AD3AFE00298699 /* WCPayCardPresentReceiptDetails+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WCPayCardPresentReceiptDetails+CoreDataClass.swift"; sourceTree = "<group>"; };
283+
031C1EA027AD3AFE00298699 /* WCPayCardPresentReceiptDetails+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "WCPayCardPresentReceiptDetails+CoreDataProperties.swift"; sourceTree = "<group>"; };
267284
0345DB4527A8122700B02D0C /* Model 63.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "Model 63.xcdatamodel"; sourceTree = "<group>"; };
268285
077F39C3269F1F4600ABEADC /* SystemPlugin+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SystemPlugin+CoreDataClass.swift"; sourceTree = "<group>"; };
269286
077F39C5269F1F7C00ABEADC /* SystemPlugin+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SystemPlugin+CoreDataProperties.swift"; sourceTree = "<group>"; };
@@ -913,6 +930,14 @@
913930
D87F614D22657C2F0031A13B /* PreselectedProvider.swift */,
914931
077F39C3269F1F4600ABEADC /* SystemPlugin+CoreDataClass.swift */,
915932
077F39C5269F1F7C00ABEADC /* SystemPlugin+CoreDataProperties.swift */,
933+
031C1E9927AD3AFE00298699 /* WCPayCharge+CoreDataClass.swift */,
934+
031C1E9A27AD3AFE00298699 /* WCPayCharge+CoreDataProperties.swift */,
935+
031C1E9B27AD3AFE00298699 /* WCPayCardPresentPaymentDetails+CoreDataClass.swift */,
936+
031C1E9C27AD3AFE00298699 /* WCPayCardPresentPaymentDetails+CoreDataProperties.swift */,
937+
031C1E9D27AD3AFE00298699 /* WCPayCardPaymentDetails+CoreDataClass.swift */,
938+
031C1E9E27AD3AFE00298699 /* WCPayCardPaymentDetails+CoreDataProperties.swift */,
939+
031C1E9F27AD3AFE00298699 /* WCPayCardPresentReceiptDetails+CoreDataClass.swift */,
940+
031C1EA027AD3AFE00298699 /* WCPayCardPresentReceiptDetails+CoreDataProperties.swift */,
916941
);
917942
path = Model;
918943
sourceTree = "<group>";
@@ -1154,6 +1179,7 @@
11541179
7471A514216CF0FE00219F7E /* SiteVisitStats+CoreDataClass.swift in Sources */,
11551180
D8FBFF5722D66A06006E3336 /* OrderStatsV4Totals+CoreDataClass.swift in Sources */,
11561181
7474539C2242C85E00E0B5EE /* ProductDimensions+CoreDataProperties.swift in Sources */,
1182+
031C1EA327AD3AFE00298699 /* WCPayCardPresentPaymentDetails+CoreDataClass.swift in Sources */,
11571183
7426A05120F69D00002A4E07 /* OrderCoupon+CoreDataProperties.swift in Sources */,
11581184
021EAA4825493A1600AA8CCD /* OrderItemAttribute+CoreDataProperties.swift in Sources */,
11591185
262B27182621412D00A421CF /* ProductAddOnOption+CoreDataProperties.swift in Sources */,
@@ -1166,6 +1192,7 @@
11661192
268BF6DB2642CBA6003948D8 /* Models+Copiable.generated.swift in Sources */,
11671193
D4ABCACF26D6E7E400CD18F4 /* Announcement.swift in Sources */,
11681194
AE93BE90272C0E9F001B55EA /* GeneralStoreSettings.swift in Sources */,
1195+
031C1EA227AD3AFE00298699 /* WCPayCharge+CoreDataProperties.swift in Sources */,
11691196
D87F61552265AA900031A13B /* PListFileStorage.swift in Sources */,
11701197
B5B914C620EFF03500F2F832 /* Site+CoreDataProperties.swift in Sources */,
11711198
45E462072684BCEE00011BF2 /* StateOfACountry+CoreDataClass.swift in Sources */,
@@ -1188,6 +1215,7 @@
11881215
02C254EC2563B12E00A04423 /* ShippingLabelSettings+CoreDataProperties.swift in Sources */,
11891216
B5FD111E21D4046E00560344 /* OrderSearchResults+CoreDataProperties.swift in Sources */,
11901217
7471A515216CF0FE00219F7E /* SiteVisitStatsItem+CoreDataProperties.swift in Sources */,
1218+
031C1EA627AD3AFE00298699 /* WCPayCardPaymentDetails+CoreDataProperties.swift in Sources */,
11911219
CE12FBCE221F0E1A00C59248 /* Order+CoreDataClass.swift in Sources */,
11921220
B54CA5BD20A4BD3B00F38CD1 /* NSManagedObjectContext+Storage.swift in Sources */,
11931221
455C0C9125DD6D93007B6F38 /* AccountSettings+CoreDataProperties.swift in Sources */,
@@ -1214,6 +1242,7 @@
12141242
028296F4237D404F00E84012 /* GenericAttribute+CoreDataClass.swift in Sources */,
12151243
262B270E2621412000A421CF /* ProductAddOn+CoreDataProperties.swift in Sources */,
12161244
7492FAD6217FA9C100ED2C69 /* SiteSetting+CoreDataClass.swift in Sources */,
1245+
031C1EA427AD3AFE00298699 /* WCPayCardPresentPaymentDetails+CoreDataProperties.swift in Sources */,
12171246
B505F6E020BEEA8100BB1B69 /* StorageType.swift in Sources */,
12181247
747453A82242C85E00E0B5EE /* ProductTag+CoreDataProperties.swift in Sources */,
12191248
D8FBFF5A22D66A06006E3336 /* OrderStatsV4+CoreDataProperties.swift in Sources */,
@@ -1222,6 +1251,7 @@
12221251
2685C108263C88B000D9EE97 /* AddOnGroup+CoreDataClass.swift in Sources */,
12231252
7474539F2242C85E00E0B5EE /* ProductImage+CoreDataClass.swift in Sources */,
12241253
7474539D2242C85E00E0B5EE /* ProductAttribute+CoreDataClass.swift in Sources */,
1254+
031C1EA127AD3AFE00298699 /* WCPayCharge+CoreDataClass.swift in Sources */,
12251255
023FA29623316A4D008C1769 /* ProductSearchResults+CoreDataProperties.swift in Sources */,
12261256
746A9D22214078080013F6FF /* TopEarnerStats+CoreDataProperties.swift in Sources */,
12271257
023FA29523316A4D008C1769 /* Product+CoreDataProperties.swift in Sources */,
@@ -1256,6 +1286,7 @@
12561286
CE3B7AD22225E62C0050FE4B /* OrderStatus+CoreDataClass.swift in Sources */,
12571287
027D3E6E23A0EEA4007D91B0 /* StorageType+Deletions.swift in Sources */,
12581288
D8FBFF5922D66A06006E3336 /* OrderStatsV4+CoreDataClass.swift in Sources */,
1289+
031C1EA727AD3AFE00298699 /* WCPayCardPresentReceiptDetails+CoreDataClass.swift in Sources */,
12591290
74B7D6AE20F90CBB002667AC /* OrderNote+CoreDataProperties.swift in Sources */,
12601291
02C254EF2563B12E00A04423 /* ShippingLabelRefund+CoreDataClass.swift in Sources */,
12611292
025CA2BE238EB86200B05C81 /* ProductShippingClass+CoreDataProperties.swift in Sources */,
@@ -1275,13 +1306,15 @@
12751306
2618707425409C65006522A1 /* ShippingLineTax+CoreDataProperties.swift in Sources */,
12761307
B52B0F7B20AA28A800477698 /* Object.swift in Sources */,
12771308
02C254F12563B12E00A04423 /* ShippingLabelAddress+CoreDataClass.swift in Sources */,
1309+
031C1EA827AD3AFE00298699 /* WCPayCardPresentReceiptDetails+CoreDataProperties.swift in Sources */,
12781310
02D45649231CFB27008CF0A9 /* StatsVersionBannerVisibility.swift in Sources */,
12791311
7426A05020F69D00002A4E07 /* OrderCoupon+CoreDataClass.swift in Sources */,
12801312
02C254F22563B12E00A04423 /* ShippingLabelAddress+CoreDataProperties.swift in Sources */,
12811313
02C254F02563B12E00A04423 /* ShippingLabelRefund+CoreDataProperties.swift in Sources */,
12821314
746A9D23214078080013F6FF /* TopEarnerStatsItem+CoreDataClass.swift in Sources */,
12831315
4501068B2399AC9B00E24722 /* TaxClass+CoreDataProperties.swift in Sources */,
12841316
74F009C02183B99B002B4566 /* Note+CoreDataClass.swift in Sources */,
1317+
031C1EA527AD3AFE00298699 /* WCPayCardPaymentDetails+CoreDataClass.swift in Sources */,
12851318
CC2C030B262DCC6900928C9C /* ShippingLabelAccountSettings+CoreDataClass.swift in Sources */,
12861319
7499FA44221C7A60004EC0B4 /* ShipmentTracking+CoreDataClass.swift in Sources */,
12871320
D87F61532265AA230031A13B /* FileStorage.swift in Sources */,
@@ -1739,6 +1772,7 @@
17391772
DEC51AA4275B41BE009F3DF4 /* WooCommerce.xcdatamodeld */ = {
17401773
isa = XCVersionGroup;
17411774
children = (
1775+
0306C18227BAB09D0070B617 /* Model 65.xcdatamodel */,
17421776
459E342327B4069E0054FF01 /* Model 64.xcdatamodel */,
17431777
0345DB4527A8122700B02D0C /* Model 63.xcdatamodel */,
17441778
DE001324279FD7D900EB0350 /* Model 62.xcdatamodel */,
@@ -1804,7 +1838,7 @@
18041838
DEC51ADE275B41BE009F3DF4 /* Model 47.xcdatamodel */,
18051839
DEC51ADF275B41BE009F3DF4 /* Model 19.xcdatamodel */,
18061840
);
1807-
currentVersion = 459E342327B4069E0054FF01 /* Model 64.xcdatamodel */;
1841+
currentVersion = 0306C18227BAB09D0070B617 /* Model 65.xcdatamodel */;
18081842
path = WooCommerce.xcdatamodeld;
18091843
sourceTree = "<group>";
18101844
versionGroupType = wrapper.xcdatamodel;

Storage/Storage/Model/MIGRATIONS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
This file documents changes in the WCiOS Storage data model. Please explain any changes to the data model as well as any custom migrations.
44

5+
## Model 65 (Release 8.6.0.0)
6+
- @joshheald 2022-02-14
7+
- Added `WCPayCharge` entity.
8+
- Added `WCPayCardPresentPaymentDetails` entity.
9+
- Added `WCPayCardPaymentDetails` entity.
10+
- Added `WCPayCardPresentReceiptDetails` entity.
11+
512
## Model 64 (Release 8.6.0.0)
613
- @pmusolino 2022-02-09
714
- Added `InboxNote` entity.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Foundation
2+
import CoreData
3+
4+
@objc(WCPayCardPaymentDetails)
5+
public class WCPayCardPaymentDetails: NSManagedObject {
6+
7+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import Foundation
2+
import CoreData
3+
4+
5+
extension WCPayCardPaymentDetails {
6+
7+
@nonobjc public class func fetchRequest() -> NSFetchRequest<WCPayCardPaymentDetails> {
8+
return NSFetchRequest<WCPayCardPaymentDetails>(entityName: "WCPayCardPaymentDetails")
9+
}
10+
11+
@NSManaged public var brand: String
12+
@NSManaged public var last4: String
13+
@NSManaged public var funding: String
14+
@NSManaged public var charge: WCPayCharge?
15+
16+
}
17+
18+
extension WCPayCardPaymentDetails: Identifiable {
19+
20+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Foundation
2+
import CoreData
3+
4+
@objc(WCPayCardPresentPaymentDetails)
5+
public class WCPayCardPresentPaymentDetails: NSManagedObject {
6+
7+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import Foundation
2+
import CoreData
3+
4+
5+
extension WCPayCardPresentPaymentDetails {
6+
7+
@nonobjc public class func fetchRequest() -> NSFetchRequest<WCPayCardPresentPaymentDetails> {
8+
return NSFetchRequest<WCPayCardPresentPaymentDetails>(entityName: "WCPayCardPresentPaymentDetails")
9+
}
10+
11+
@NSManaged public var brand: String
12+
@NSManaged public var last4: String
13+
@NSManaged public var funding: String
14+
@NSManaged public var receipt: WCPayCardPresentReceiptDetails?
15+
@NSManaged public var charge: WCPayCharge?
16+
17+
}
18+
19+
extension WCPayCardPresentPaymentDetails: Identifiable {
20+
21+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Foundation
2+
import CoreData
3+
4+
@objc(WCPayCardPresentReceiptDetails)
5+
public class WCPayCardPresentReceiptDetails: NSManagedObject {
6+
7+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import Foundation
2+
import CoreData
3+
4+
5+
extension WCPayCardPresentReceiptDetails {
6+
7+
@nonobjc public class func fetchRequest() -> NSFetchRequest<WCPayCardPresentReceiptDetails> {
8+
return NSFetchRequest<WCPayCardPresentReceiptDetails>(entityName: "WCPayCardPresentReceiptDetails")
9+
}
10+
11+
@NSManaged public var accountType: String
12+
@NSManaged public var applicationPreferredName: String?
13+
@NSManaged public var dedicatedFileName: String?
14+
@NSManaged public var cardPresentPayment: WCPayCardPresentPaymentDetails?
15+
16+
}
17+
18+
extension WCPayCardPresentReceiptDetails: Identifiable {
19+
20+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Foundation
2+
import CoreData
3+
4+
@objc(WCPayCharge)
5+
public class WCPayCharge: NSManagedObject {
6+
7+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import Foundation
2+
import CoreData
3+
4+
5+
extension WCPayCharge {
6+
7+
@nonobjc public class func fetchRequest() -> NSFetchRequest<WCPayCharge> {
8+
return NSFetchRequest<WCPayCharge>(entityName: "WCPayCharge")
9+
}
10+
11+
@NSManaged public var siteID: Int64
12+
@NSManaged public var chargeID: String
13+
@NSManaged public var amount: Int64
14+
@NSManaged public var amountCaptured: Int64
15+
@NSManaged public var amountRefunded: Int64
16+
@NSManaged public var authorizationCode: String?
17+
@NSManaged public var captured: Bool
18+
@NSManaged public var created: Date
19+
@NSManaged public var currency: String
20+
@NSManaged public var paid: Bool
21+
@NSManaged public var paymentIntentID: String?
22+
@NSManaged public var paymentMethodID: String
23+
@NSManaged public var refunded: Bool
24+
@NSManaged public var status: String
25+
@NSManaged public var paymentMethodType: String
26+
@NSManaged public var cardDetails: WCPayCardPaymentDetails?
27+
@NSManaged public var cardPresentDetails: WCPayCardPresentPaymentDetails?
28+
29+
}
30+
31+
extension WCPayCharge: Identifiable {
32+
33+
}

0 commit comments

Comments
 (0)