1818import Foundation
1919
2020extension MHolding : Identifiable {
21- public var id : MHolding . Key { self . primaryKey }
21+ public var id : MHolding . Key { primaryKey }
2222}
2323
2424extension MHolding : AllocKeyed {
@@ -29,21 +29,22 @@ extension MHolding: AllocKeyed {
2929 public var shareCount : Double ?
3030 public var shareBasis : Double ?
3131 public var acquiredAt : Date ?
32-
32+
3333 public init ( accountID: String ,
3434 securityID: String ,
3535 lotID: String ,
3636 shareCount: Double ? = nil ,
3737 shareBasis: Double ? = nil ,
38- acquiredAt: Date ? = nil ) {
39- self . accountNormID = MHolding . normalizeID ( accountID)
40- self . securityNormID = MHolding . normalizeID ( securityID)
41- self . lotNormID = MHolding . normalizeID ( lotID)
38+ acquiredAt: Date ? = nil )
39+ {
40+ accountNormID = MHolding . normalizeID ( accountID)
41+ securityNormID = MHolding . normalizeID ( securityID)
42+ lotNormID = MHolding . normalizeID ( lotID)
4243 self . shareCount = shareCount
4344 self . shareBasis = shareBasis
4445 self . acquiredAt = acquiredAt
4546 }
46-
47+
4748 public init ( _ element: MHolding ) {
4849 self . init ( accountID: element. accountID,
4950 securityID: element. securityID,
@@ -53,12 +54,12 @@ extension MHolding: AllocKeyed {
5354 acquiredAt: element. acquiredAt)
5455 }
5556 }
56-
57+
5758 public var primaryKey : Key {
5859 Key ( self )
5960 }
60-
61+
6162 public static var emptyKey : Key {
62- Key ( accountID: " " , securityID: " " , lotID: " " , shareCount: nil , shareBasis: nil , acquiredAt: Date . init ( timeIntervalSinceReferenceDate: 0 ) )
63+ Key ( accountID: " " , securityID: " " , lotID: " " , shareCount: nil , shareBasis: nil , acquiredAt: Date ( timeIntervalSinceReferenceDate: 0 ) )
6364 }
6465}
0 commit comments