Skip to content

Commit 4d1d30a

Browse files
author
Reed Es
committed
Bulk cleanup of Openalloc repos for new Workspace repo.
1 parent 2e4873d commit 4d1d30a

22 files changed

+129
-128
lines changed

Sources/Model/Account/MAccount+Key.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,26 @@
1818
import Foundation
1919

2020
extension MAccount: Identifiable {
21-
public var id: MAccount.Key { self.primaryKey }
21+
public var id: MAccount.Key { primaryKey }
2222
}
2323

2424
extension MAccount: AllocKeyed {
2525
public struct Key: Hashable, Equatable, Codable {
2626
public let accountNormID: NormalizedID
27-
27+
2828
public init(accountID: String) {
29-
self.accountNormID = MAccount.normalizeID(accountID)
29+
accountNormID = MAccount.normalizeID(accountID)
3030
}
31-
31+
3232
public init(_ element: MAccount) {
3333
self.init(accountID: element.accountID)
3434
}
3535
}
36-
36+
3737
public var primaryKey: Key {
3838
Key(self)
3939
}
40-
40+
4141
public static var emptyKey: Key {
4242
Key(accountID: "")
4343
}

Sources/Model/Allocation/MAllocation+Key.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,28 @@
1818
import Foundation
1919

2020
extension MAllocation: Identifiable {
21-
public var id: MAllocation.Key { self.primaryKey }
21+
public var id: MAllocation.Key { primaryKey }
2222
}
2323

2424
extension MAllocation: AllocKeyed {
2525
public struct Key: Hashable, Equatable, Codable {
2626
public let strategyNormID: NormalizedID
2727
public let assetNormID: NormalizedID
28-
28+
2929
public init(strategyID: String, assetID: String) {
30-
self.strategyNormID = MAllocation.normalizeID(strategyID)
31-
self.assetNormID = MAllocation.normalizeID(assetID)
30+
strategyNormID = MAllocation.normalizeID(strategyID)
31+
assetNormID = MAllocation.normalizeID(assetID)
3232
}
33-
33+
3434
public init(_ element: MAllocation) {
3535
self.init(strategyID: element.strategyID, assetID: element.assetID)
36-
}
36+
}
3737
}
38-
38+
3939
public var primaryKey: Key {
4040
Key(self)
4141
}
42-
42+
4343
public static var emptyKey: Key {
4444
Key(strategyID: "", assetID: "")
4545
}

Sources/Model/Asset/MAsset+Key.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,26 @@
1818
import Foundation
1919

2020
extension MAsset: Identifiable {
21-
public var id: MAsset.Key { self.primaryKey }
21+
public var id: MAsset.Key { primaryKey }
2222
}
2323

2424
extension MAsset: AllocKeyed {
2525
public struct Key: Hashable, Equatable, Codable {
2626
public let assetNormID: NormalizedID
27-
27+
2828
public init(assetID: String) {
29-
self.assetNormID = MAsset.normalizeID(assetID)
29+
assetNormID = MAsset.normalizeID(assetID)
3030
}
31-
31+
3232
public init(_ element: MAsset) {
3333
self.init(assetID: element.assetID)
3434
}
3535
}
36-
36+
3737
public var primaryKey: Key {
3838
Key(self)
3939
}
40-
40+
4141
public static var emptyKey: Key {
4242
Key(assetID: "")
4343
}

Sources/Model/Cap/MCap+Key.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,29 @@
1818
import Foundation
1919

2020
extension MCap: Identifiable {
21-
public var id: MCap.Key { self.primaryKey }
21+
public var id: MCap.Key { primaryKey }
2222
}
2323

2424
extension MCap: AllocKeyed {
2525
public struct Key: Hashable, Equatable, Codable {
2626
public let accountNormID: NormalizedID
2727
public let assetNormID: NormalizedID
28-
28+
2929
public init(accountID: String, assetID: String) {
30-
self.accountNormID = MCap.normalizeID(accountID)
31-
self.assetNormID = MCap.normalizeID(assetID)
30+
accountNormID = MCap.normalizeID(accountID)
31+
assetNormID = MCap.normalizeID(assetID)
3232
}
33-
33+
3434
public init(_ element: MCap) {
3535
self.init(accountID: element.accountID,
3636
assetID: element.assetID)
3737
}
3838
}
39-
39+
4040
public var primaryKey: Key {
4141
Key(self)
4242
}
43-
43+
4444
public static var emptyKey: Key {
4545
Key(accountID: "", assetID: "")
4646
}

Sources/Model/Holding/MHolding+Key.swift

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import Foundation
1919

2020
extension MHolding: Identifiable {
21-
public var id: MHolding.Key { self.primaryKey }
21+
public var id: MHolding.Key { primaryKey }
2222
}
2323

2424
extension 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
}

Sources/Model/Rebalance/Allocation/MRebalanceAllocation+Key.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,29 +18,29 @@
1818
import Foundation
1919

2020
extension MRebalanceAllocation: Identifiable {
21-
public var id: MRebalanceAllocation.Key { self.primaryKey }
21+
public var id: MRebalanceAllocation.Key { primaryKey }
2222
}
2323

2424
extension MRebalanceAllocation: AllocKeyed {
2525
public struct Key: Hashable, Equatable, Codable {
2626
public let accountNormID: NormalizedID
2727
public let assetNormID: NormalizedID
28-
28+
2929
public init(accountID: String, assetID: String) {
30-
self.accountNormID = MRebalanceAllocation.normalizeID(accountID)
31-
self.assetNormID = MRebalanceAllocation.normalizeID(assetID)
30+
accountNormID = MRebalanceAllocation.normalizeID(accountID)
31+
assetNormID = MRebalanceAllocation.normalizeID(assetID)
3232
}
33-
33+
3434
public init(_ element: MRebalanceAllocation) {
3535
self.init(accountID: element.accountID,
3636
assetID: element.assetID)
3737
}
3838
}
39-
39+
4040
public var primaryKey: Key {
4141
Key(self)
4242
}
43-
43+
4444
public static var emptyKey: Key {
4545
Key(accountID: "", assetID: "")
4646
}

Sources/Model/Rebalance/Allocation/MRebalanceAllocation+Row.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ extension MRebalanceAllocation: AllocRowed {
3838
guard let _accountID = getStr(row, CodingKeys.accountID.rawValue),
3939
let _assetID = getStr(row, CodingKeys.assetID.rawValue)
4040
else { throw AllocDataError.invalidPrimaryKey("Rebalance Allocation") }
41-
return Key(accountID: _accountID, assetID: _assetID)
41+
return Key(accountID: _accountID, assetID: _assetID)
4242
}
4343

4444
public static func decode(_ rawRows: [RawRow], rejectedRows: inout [RawRow]) throws -> [DecodedRow] {

Sources/Model/Rebalance/Purchase/MRebalancePurchase+Key.swift

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,29 @@
1818
import Foundation
1919

2020
extension MRebalancePurchase: Identifiable {
21-
public var id: MRebalancePurchase.Key { self.primaryKey }
21+
public var id: MRebalancePurchase.Key { primaryKey }
2222
}
2323

2424
extension MRebalancePurchase: AllocKeyed {
2525
public struct Key: Hashable, Equatable, Codable {
2626
public let accountNormID: NormalizedID
2727
public let assetNormID: NormalizedID
28-
28+
2929
public init(accountID: String, assetID: String) {
30-
self.accountNormID = MRebalancePurchase.normalizeID(accountID)
31-
self.assetNormID = MRebalancePurchase.normalizeID(assetID)
30+
accountNormID = MRebalancePurchase.normalizeID(accountID)
31+
assetNormID = MRebalancePurchase.normalizeID(assetID)
3232
}
33-
33+
3434
public init(_ element: MRebalancePurchase) {
3535
self.init(accountID: element.accountID,
3636
assetID: element.assetID)
3737
}
38-
3938
}
40-
39+
4140
public var primaryKey: Key {
4241
Key(self)
4342
}
44-
43+
4544
public static var emptyKey: Key {
4645
Key(accountID: "", assetID: "")
4746
}

Sources/Model/Rebalance/Sale/MRebalanceSale+Key.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,32 @@
1818
import Foundation
1919

2020
extension MRebalanceSale: Identifiable {
21-
public var id: MRebalanceSale.Key { self.primaryKey }
21+
public var id: MRebalanceSale.Key { primaryKey }
2222
}
2323

2424
extension MRebalanceSale: AllocKeyed {
2525
public struct Key: Hashable, Equatable, Codable {
2626
public let accountNormID: NormalizedID
2727
public let securityNormID: NormalizedID
2828
public let lotNormID: NormalizedID
29-
29+
3030
public init(accountID: String, securityID: String, lotID: String) {
31-
self.accountNormID = MRebalanceSale.normalizeID(accountID)
32-
self.securityNormID = MRebalanceSale.normalizeID(securityID)
33-
self.lotNormID = MRebalanceSale.normalizeID(lotID)
31+
accountNormID = MRebalanceSale.normalizeID(accountID)
32+
securityNormID = MRebalanceSale.normalizeID(securityID)
33+
lotNormID = MRebalanceSale.normalizeID(lotID)
3434
}
35-
35+
3636
public init(_ element: MRebalanceSale) {
3737
self.init(accountID: element.accountID,
3838
securityID: element.securityID,
3939
lotID: element.lotID)
4040
}
4141
}
42-
42+
4343
public var primaryKey: Key {
4444
Key(self)
4545
}
46-
46+
4747
public static var emptyKey: Key {
4848
Key(accountID: "", securityID: "", lotID: "")
4949
}

Sources/Model/Security/MSecurity+Key.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,26 @@
1818
import Foundation
1919

2020
extension MSecurity: Identifiable {
21-
public var id: MSecurity.Key { self.primaryKey }
21+
public var id: MSecurity.Key { primaryKey }
2222
}
2323

2424
extension MSecurity: AllocKeyed {
2525
public struct Key: Hashable, Equatable, Codable {
2626
public let securityNormID: NormalizedID
27-
27+
2828
public init(securityID: String) {
29-
self.securityNormID = MSecurity.normalizeID(securityID)
29+
securityNormID = MSecurity.normalizeID(securityID)
3030
}
31-
31+
3232
public init(_ element: MSecurity) {
3333
self.init(securityID: element.securityID)
3434
}
3535
}
36-
36+
3737
public var primaryKey: Key {
3838
Key(self)
3939
}
40-
40+
4141
public static var emptyKey: Key {
4242
Key(securityID: "")
4343
}

0 commit comments

Comments
 (0)