@@ -21,7 +21,7 @@ extension PersistedProduct {
2121 stockStatusKey: posProduct. stockStatusKey
2222 )
2323 }
24-
24+
2525 func toPOSProduct( images: [ ProductImage ] = [ ] , attributes: [ ProductAttribute ] = [ ] ) -> POSProduct {
2626 return POSProduct (
2727 siteID: siteID,
@@ -42,7 +42,7 @@ extension PersistedProduct {
4242 stockStatusKey: stockStatusKey
4343 )
4444 }
45-
45+
4646 func toPOSProduct( db: GRDBDatabaseConnection ) throws -> POSProduct {
4747 let images = try db. read { db in
4848 return try request ( for: PersistedProduct . images) . fetchAll ( db)
@@ -55,7 +55,7 @@ extension PersistedProduct {
5555 attributes: attributes. map { $0. toProductAttribute ( siteID: siteID) }
5656 )
5757 }
58-
58+
5959}
6060
6161// MARK: - POSProduct Storage Extensions
@@ -64,13 +64,13 @@ extension POSProduct {
6464 try db. write { db in
6565 let product = PersistedProduct ( from: self )
6666 try product. insert ( db)
67-
67+
6868 // Save related images
6969 for image in self . images {
7070 let persistedImage = PersistedProductImage ( from: image, productID: self . productID)
7171 try persistedImage. insert ( db)
7272 }
73-
73+
7474 // Save related attributes
7575 for attribute in self . attributes {
7676 var persistedAttribute = PersistedProductAttribute ( from: attribute, productID: self . productID)
@@ -92,7 +92,7 @@ extension PersistedProductAttribute {
9292 options: productAttribute. options
9393 )
9494 }
95-
95+
9696 func toProductAttribute( siteID: Int64 ) -> ProductAttribute {
9797 return ProductAttribute (
9898 siteID: siteID,
@@ -119,7 +119,7 @@ extension PersistedProductImage {
119119 alt: productImage. alt
120120 )
121121 }
122-
122+
123123 func toProductImage( ) -> ProductImage {
124124 return ProductImage (
125125 imageID: id,
0 commit comments