@fintekkers/ledger-models 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/catalog/measures.json +25 -18
  2. package/node/fintekkers/models/portfolio/amortisation_elections_grpc_pb.js +1 -0
  3. package/node/fintekkers/models/portfolio/amortisation_elections_pb.d.ts +51 -0
  4. package/node/fintekkers/models/portfolio/amortisation_elections_pb.js +266 -0
  5. package/node/fintekkers/models/portfolio/portfolio_pb.d.ts +7 -0
  6. package/node/fintekkers/models/portfolio/portfolio_pb.js +54 -1
  7. package/node/fintekkers/models/position/tax_lot_grpc_pb.js +1 -0
  8. package/node/fintekkers/models/position/tax_lot_pb.d.ts +44 -0
  9. package/node/fintekkers/models/position/tax_lot_pb.js +303 -0
  10. package/node/fintekkers/requests/valuation/cost_basis_input.test.d.ts +7 -0
  11. package/node/fintekkers/requests/valuation/cost_basis_input.test.js +69 -0
  12. package/node/fintekkers/requests/valuation/cost_basis_input.test.js.map +1 -0
  13. package/node/fintekkers/requests/valuation/cost_basis_input.test.ts +78 -0
  14. package/node/fintekkers/requests/valuation/product_inputs_pb.d.ts +48 -0
  15. package/node/fintekkers/requests/valuation/product_inputs_pb.js +393 -3
  16. package/node/wrappers/models/security/BondSecurity.test.js +3 -3
  17. package/node/wrappers/models/security/BondSecurity.test.js.map +1 -1
  18. package/node/wrappers/models/security/BondSecurity.test.ts +3 -3
  19. package/node/wrappers/models/security/security-roundtrip.test.js +4 -4
  20. package/node/wrappers/models/security/security-roundtrip.test.js.map +1 -1
  21. package/node/wrappers/models/security/security-roundtrip.test.ts +4 -4
  22. package/node/wrappers/models/security/security.d.ts +2 -2
  23. package/node/wrappers/models/security/security.js +3 -3
  24. package/node/wrappers/models/security/security.js.map +1 -1
  25. package/node/wrappers/models/security/security.test.js +6 -0
  26. package/node/wrappers/models/security/security.test.js.map +1 -1
  27. package/node/wrappers/models/security/security.test.ts +7 -0
  28. package/node/wrappers/models/security/security.ts +3 -3
  29. package/node/wrappers/models/transaction/transaction.js +1 -1
  30. package/node/wrappers/models/transaction/transaction.js.map +1 -1
  31. package/node/wrappers/models/transaction/transaction.ts +1 -1
  32. package/package.json +1 -1
@@ -1,4 +1,5 @@
1
1
  {
2
+ "_doc": "applies_to lists the products a measure covers. Each entry is a ProductTypeProto name (e.g. TIPS, TREASURY_FRN) or a node name from ../hierarchy.json (e.g. BOND, STOCK, CASH_INSTRUMENT), which covers every product type under it.",
2
3
  "schema_version": "1.0",
3
4
  "measures": [
4
5
  {
@@ -21,7 +22,7 @@
21
22
  "formula": null,
22
23
  "units": "Units of the security (shares for equity, face-value dollars for bonds)",
23
24
  "category": "input",
24
- "applies_to": ["BOND_SECURITY", "TIPS", "FRN", "EQUITY_SECURITY", "CASH_SECURITY"],
25
+ "applies_to": ["BOND", "TIPS", "TREASURY_FRN", "STOCK", "CASH_INSTRUMENT"],
25
26
  "model_assumptions": [],
26
27
  "implemented": true
27
28
  },
@@ -33,7 +34,7 @@
33
34
  "formula": "MarketValue = price / 100 * directed_quantity; TIPS: clean_price / 100 * index_ratio * directed_quantity (index_ratio unrounded, unfloored)",
34
35
  "units": "Dollars (or settlement currency)",
35
36
  "category": "valuation",
36
- "applies_to": ["BOND_SECURITY", "TIPS", "FRN", "EQUITY_SECURITY", "CASH_SECURITY"],
37
+ "applies_to": ["BOND", "TIPS", "TREASURY_FRN", "STOCK", "CASH_INSTRUMENT"],
37
38
  "model_assumptions": [
38
39
  "None — direct mark-to-market calculation"
39
40
  ],
@@ -47,7 +48,7 @@
47
48
  "formula": "Returns the price_input as-is (quoted as % of par for bonds)",
48
49
  "units": "Quoted price (% of par for bonds; dollar price for equities)",
49
50
  "category": "cost",
50
- "applies_to": ["BOND_SECURITY", "TIPS", "FRN", "EQUITY_SECURITY", "CASH_SECURITY"],
51
+ "applies_to": ["BOND", "TIPS", "TREASURY_FRN", "STOCK", "CASH_INSTRUMENT"],
51
52
  "model_assumptions": [
52
53
  "None — pass-through of the input price"
53
54
  ],
@@ -57,12 +58,18 @@
57
58
  "name": "ADJUSTED_COST_BASIS",
58
59
  "enum_value": 4,
59
60
  "display_name": "Adjusted Cost Basis",
60
- "description": "The cost basis adjusted for amortization of premium, accretion of discount, or corporate actions (e.g. stock splits, return of capital). Reserved for future use.",
61
- "formula": null,
62
- "units": "Quoted price (% of par for bonds; dollar price for equities)",
61
+ "description": "Tax amortised cost, per 100 face, quantity-weighted over the open lots. Tax basis only; book (GAAP/IFRS) cost is out of scope. Inputs: cost_basis (CostBasisInput) on BondInput, TipsInput or FrnInput.",
62
+ "formula": "AdjustedCostBasis = sum(open_quantity_i * acb_i) / sum(open_quantity_i) over CostBasisInput.lots, where acb_i is lot i's amortised cost per 100 face at the valuation date. OID: always accreted (mandatory, whatever the elections) at constant yield from the issue price (IssuanceProto.price_for_single_price_auction, MDI-82), reduced by any acquisition premium. Premium (IRC §171): amortised at constant yield if elected. Market discount: accreted only with INCLUDE_CURRENTLY, ratably or at constant yield per market_discount_accrual; otherwise left until disposition. De minimis: OID and market discount below 0.25% × complete years to maturity are treated as zero.",
63
+ "units": "Price per 100 face (% of par). TIPS: per 100 original face, in nominal dollars",
63
64
  "category": "cost",
64
- "applies_to": ["BOND_SECURITY", "TIPS", "FRN", "EQUITY_SECURITY"],
65
- "model_assumptions": [],
65
+ "applies_to": ["TREASURY_NOTE", "TREASURY_BOND", "SOVEREIGN_BOND", "CORP_BOND", "MUNI_BOND", "TIPS", "TREASURY_FRN"],
66
+ "model_assumptions": [
67
+ "Accrual start: from each lot's open_date plus the product's settlement lag (e.g. T+1 for Treasuries)",
68
+ "Elections: CostBasisInput.elections, copied from PortfolioProto.amortisation_elections; unset fields use the defaults (PREMIUM_ELECTED, AT_DISPOSITION, RATABLE)",
69
+ "TIPS: amortise in real terms, then multiply by the index ratio at the valuation date, giving a figure per 100 original face in nominal dollars",
70
+ "FRN: use the equivalent fixed rate from the fixing at settlement",
71
+ "No lots: the measure is absent, with a \"no open lots\" warning, never 0"
72
+ ],
66
73
  "implemented": false
67
74
  },
68
75
  {
@@ -73,7 +80,7 @@
73
80
  "formula": "CurrentYield = (coupon_rate * principal) / (price * face_value / 100). For zero-coupon: (face_value / dollar_price)^(1 / years_to_maturity) - 1",
74
81
  "units": "Decimal (0-1 scale; e.g. 0.0526 = 5.26%)",
75
82
  "category": "yield",
76
- "applies_to": ["BOND_SECURITY", "TIPS"],
83
+ "applies_to": ["BOND", "TIPS"],
77
84
  "model_assumptions": [
78
85
  "Assumes coupon income is constant (no reinvestment assumption)",
79
86
  "For TIPS, uses the inflation-adjusted principal for the annual coupon calculation",
@@ -89,7 +96,7 @@
89
96
  "formula": "Solve for r: price * (face / 100) = Sum[C / (1 + r/m)^t] + F / (1 + r/m)^N",
90
97
  "units": "Decimal (0-1 scale; e.g. 0.06 = 6.00% annual)",
91
98
  "category": "yield",
92
- "applies_to": ["BOND_SECURITY", "TIPS"],
99
+ "applies_to": ["BOND", "TIPS"],
93
100
  "model_assumptions": [
94
101
  "Coupon reinvestment at the YTM rate (standard bond math assumption)",
95
102
  "For TIPS: returns the same value as REAL_YIELD, with the response summary warning \"YIELD_TO_MATURITY for TIPS is the real yield (same as REAL_YIELD); a nominal yield needs an inflation forecast\"",
@@ -107,7 +114,7 @@
107
114
  "formula": "D = Sum[(t / m) * PV_t / TotalPV]",
108
115
  "units": "Years (e.g. 4.41 = 4.41 years)",
109
116
  "category": "risk",
110
- "applies_to": ["BOND_SECURITY", "TIPS"],
117
+ "applies_to": ["BOND", "TIPS"],
111
118
  "model_assumptions": [
112
119
  "Uses the bond's YTM (from Newton-Raphson solver) as the discount rate",
113
120
  "Flat yield curve (single rate for all maturities)",
@@ -123,7 +130,7 @@
123
130
  "formula": "PV = Sum[C / (1 + r/m)^t] + F / (1 + r/m)^N, returned as quoted price (% of par)",
124
131
  "units": "Quoted price (% of par; e.g. 95.00 = $95 per $100 face)",
125
132
  "category": "valuation",
126
- "applies_to": ["BOND_SECURITY", "TIPS"],
133
+ "applies_to": ["BOND", "TIPS"],
127
134
  "model_assumptions": [
128
135
  "Same as YIELD_TO_MATURITY (the discount rate is derived from the input price)",
129
136
  "For TIPS: inflation-adjusted cash flows discounted at REAL_YIELD, consistent with clean_price × index_ratio",
@@ -169,7 +176,7 @@
169
176
  "formula": "Each CashflowProto contains: cashflow_date, fv_amount, pv_amount, coupon_rate. Sum of pv_amounts equals PRESENT_VALUE.",
170
177
  "units": "fv_amount and pv_amount in dollars; coupon_rate as percentage",
171
178
  "category": "valuation",
172
- "applies_to": ["BOND_SECURITY", "TIPS", "FRN"],
179
+ "applies_to": ["BOND", "TIPS", "TREASURY_FRN"],
173
180
  "model_assumptions": [
174
181
  "Same as PRESENT_VALUE",
175
182
  "Three-way invariant: sum(pv_amounts) == present_value == price"
@@ -184,7 +191,7 @@
184
191
  "formula": "Solve for DM: price = Sum[(R + QM)/m * FV / (1 + (R + DM)/m)^t] + FV / (1 + (R + DM)/m)^N",
185
192
  "units": "Decimal (0-1 scale; e.g. 0.0075 = 75 basis points)",
186
193
  "category": "yield",
187
- "applies_to": ["FRN"],
194
+ "applies_to": ["TREASURY_FRN"],
188
195
  "model_assumptions": [
189
196
  "Flat forward rates: all future reference rate fixings assumed equal to current observation",
190
197
  "When DM = QM, price = par (100) on a reset date",
@@ -201,7 +208,7 @@
201
208
  "formula": "SpreadDuration = (P_down - P_up) / (2 * 0.0001 * P_base)",
202
209
  "units": "Years (e.g. 1.90 = a 1bp spread widening causes ~1.90bp price decline)",
203
210
  "category": "risk",
204
- "applies_to": ["FRN"],
211
+ "applies_to": ["TREASURY_FRN"],
205
212
  "model_assumptions": [
206
213
  "Same flat-forward assumption as DISCOUNT_MARGIN",
207
214
  "Uses a symmetric 1bp bump for numerical differentiation",
@@ -217,7 +224,7 @@
217
224
  "formula": "Solve for c: 100 = Sum[c/m / (1 + r_t)^t] + 100 / (1 + r_N)^N",
218
225
  "units": "Decimal (0-1 scale; e.g. 0.045 = 4.50% annual)",
219
226
  "category": "curve",
220
- "applies_to": ["BOND_SECURITY", "TIPS"],
227
+ "applies_to": ["BOND", "TIPS"],
221
228
  "model_assumptions": [
222
229
  "Coupon frequency matches market convention (semiannual for US Treasuries)",
223
230
  "Interpolation between observed maturities uses method specified in CurveRequestProto"
@@ -232,7 +239,7 @@
232
239
  "formula": "Bootstrapped from par curve: s_N = ((100 + c/m) / (100 - Sum[c/m / (1+s_t)^t]))^(1/N) - 1",
233
240
  "units": "Decimal (0-1 scale; e.g. 0.046 = 4.60% annual)",
234
241
  "category": "curve",
235
- "applies_to": ["BOND_SECURITY", "TIPS"],
242
+ "applies_to": ["BOND", "TIPS"],
236
243
  "model_assumptions": [
237
244
  "Requires a complete par yield curve as input",
238
245
  "Bootstrap assumes exact coupon dates"
@@ -247,7 +254,7 @@
247
254
  "formula": "f(t1,t2) = [(1 + s_t2)^t2 / (1 + s_t1)^t1]^(1/(t2-t1)) - 1",
248
255
  "units": "Decimal (0-1 scale; e.g. 0.048 = 4.80% annual forward rate)",
249
256
  "category": "curve",
250
- "applies_to": ["BOND_SECURITY", "TIPS"],
257
+ "applies_to": ["BOND", "TIPS"],
251
258
  "model_assumptions": [
252
259
  "Derived from spot curve (bootstrapped from par)",
253
260
  "No-arbitrage between spot and forward rates",
@@ -0,0 +1 @@
1
+ // GENERATED CODE -- NO SERVICES IN PROTO
@@ -0,0 +1,51 @@
1
+ // package: fintekkers.models.portfolio
2
+ // file: fintekkers/models/portfolio/amortisation_elections.proto
3
+
4
+ /* tslint:disable */
5
+ /* eslint-disable */
6
+
7
+ import * as jspb from "google-protobuf";
8
+
9
+ export class AmortisationElectionsProto extends jspb.Message {
10
+ getBondPremium(): PremiumAmortisationElectionProto;
11
+ setBondPremium(value: PremiumAmortisationElectionProto): AmortisationElectionsProto;
12
+ getMarketDiscountInclusion(): MarketDiscountInclusionProto;
13
+ setMarketDiscountInclusion(value: MarketDiscountInclusionProto): AmortisationElectionsProto;
14
+ getMarketDiscountAccrual(): MarketDiscountAccrualMethodProto;
15
+ setMarketDiscountAccrual(value: MarketDiscountAccrualMethodProto): AmortisationElectionsProto;
16
+
17
+ serializeBinary(): Uint8Array;
18
+ toObject(includeInstance?: boolean): AmortisationElectionsProto.AsObject;
19
+ static toObject(includeInstance: boolean, msg: AmortisationElectionsProto): AmortisationElectionsProto.AsObject;
20
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
21
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
22
+ static serializeBinaryToWriter(message: AmortisationElectionsProto, writer: jspb.BinaryWriter): void;
23
+ static deserializeBinary(bytes: Uint8Array): AmortisationElectionsProto;
24
+ static deserializeBinaryFromReader(message: AmortisationElectionsProto, reader: jspb.BinaryReader): AmortisationElectionsProto;
25
+ }
26
+
27
+ export namespace AmortisationElectionsProto {
28
+ export type AsObject = {
29
+ bondPremium: PremiumAmortisationElectionProto,
30
+ marketDiscountInclusion: MarketDiscountInclusionProto,
31
+ marketDiscountAccrual: MarketDiscountAccrualMethodProto,
32
+ }
33
+ }
34
+
35
+ export enum PremiumAmortisationElectionProto {
36
+ UNSPECIFIED_PREMIUM_ELECTION = 0,
37
+ PREMIUM_ELECTED = 1,
38
+ PREMIUM_NOT_ELECTED = 2,
39
+ }
40
+
41
+ export enum MarketDiscountInclusionProto {
42
+ UNSPECIFIED_MARKET_DISCOUNT_INCLUSION = 0,
43
+ AT_DISPOSITION = 1,
44
+ INCLUDE_CURRENTLY = 2,
45
+ }
46
+
47
+ export enum MarketDiscountAccrualMethodProto {
48
+ UNSPECIFIED_ACCRUAL_METHOD = 0,
49
+ RATABLE = 1,
50
+ CONSTANT_YIELD = 2,
51
+ }
@@ -0,0 +1,266 @@
1
+ // source: fintekkers/models/portfolio/amortisation_elections.proto
2
+ /**
3
+ * @fileoverview
4
+ * @enhanceable
5
+ * @suppress {missingRequire} reports error on implicit type usages.
6
+ * @suppress {messageConventions} JS Compiler reports an error if a variable or
7
+ * field starts with 'MSG_' and isn't a translatable message.
8
+ * @public
9
+ */
10
+ // GENERATED CODE -- DO NOT EDIT!
11
+ /* eslint-disable */
12
+ // @ts-nocheck
13
+
14
+ var jspb = require('google-protobuf');
15
+ var goog = jspb;
16
+ var global = (function() {
17
+ if (this) { return this; }
18
+ if (typeof window !== 'undefined') { return window; }
19
+ if (typeof global !== 'undefined') { return global; }
20
+ if (typeof self !== 'undefined') { return self; }
21
+ return Function('return this')();
22
+ }.call(null));
23
+
24
+ goog.exportSymbol('proto.fintekkers.models.portfolio.AmortisationElectionsProto', null, global);
25
+ goog.exportSymbol('proto.fintekkers.models.portfolio.MarketDiscountAccrualMethodProto', null, global);
26
+ goog.exportSymbol('proto.fintekkers.models.portfolio.MarketDiscountInclusionProto', null, global);
27
+ goog.exportSymbol('proto.fintekkers.models.portfolio.PremiumAmortisationElectionProto', null, global);
28
+ /**
29
+ * Generated by JsPbCodeGenerator.
30
+ * @param {Array=} opt_data Optional initial data array, typically from a
31
+ * server response, or constructed directly in Javascript. The array is used
32
+ * in place and becomes part of the constructed object. It is not cloned.
33
+ * If no data is provided, the constructed object will be empty, but still
34
+ * valid.
35
+ * @extends {jspb.Message}
36
+ * @constructor
37
+ */
38
+ proto.fintekkers.models.portfolio.AmortisationElectionsProto = function(opt_data) {
39
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
40
+ };
41
+ goog.inherits(proto.fintekkers.models.portfolio.AmortisationElectionsProto, jspb.Message);
42
+ if (goog.DEBUG && !COMPILED) {
43
+ /**
44
+ * @public
45
+ * @override
46
+ */
47
+ proto.fintekkers.models.portfolio.AmortisationElectionsProto.displayName = 'proto.fintekkers.models.portfolio.AmortisationElectionsProto';
48
+ }
49
+
50
+
51
+
52
+ if (jspb.Message.GENERATE_TO_OBJECT) {
53
+ /**
54
+ * Creates an object representation of this proto.
55
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
56
+ * Optional fields that are not set will be set to undefined.
57
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
58
+ * For the list of reserved names please see:
59
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
60
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
61
+ * JSPB instance for transitional soy proto support:
62
+ * http://goto/soy-param-migration
63
+ * @return {!Object}
64
+ */
65
+ proto.fintekkers.models.portfolio.AmortisationElectionsProto.prototype.toObject = function(opt_includeInstance) {
66
+ return proto.fintekkers.models.portfolio.AmortisationElectionsProto.toObject(opt_includeInstance, this);
67
+ };
68
+
69
+
70
+ /**
71
+ * Static version of the {@see toObject} method.
72
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
73
+ * the JSPB instance for transitional soy proto support:
74
+ * http://goto/soy-param-migration
75
+ * @param {!proto.fintekkers.models.portfolio.AmortisationElectionsProto} msg The msg instance to transform.
76
+ * @return {!Object}
77
+ * @suppress {unusedLocalVariables} f is only used for nested messages
78
+ */
79
+ proto.fintekkers.models.portfolio.AmortisationElectionsProto.toObject = function(includeInstance, msg) {
80
+ var f, obj = {
81
+ bondPremium: jspb.Message.getFieldWithDefault(msg, 10, 0),
82
+ marketDiscountInclusion: jspb.Message.getFieldWithDefault(msg, 11, 0),
83
+ marketDiscountAccrual: jspb.Message.getFieldWithDefault(msg, 12, 0)
84
+ };
85
+
86
+ if (includeInstance) {
87
+ obj.$jspbMessageInstance = msg;
88
+ }
89
+ return obj;
90
+ };
91
+ }
92
+
93
+
94
+ /**
95
+ * Deserializes binary data (in protobuf wire format).
96
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
97
+ * @return {!proto.fintekkers.models.portfolio.AmortisationElectionsProto}
98
+ */
99
+ proto.fintekkers.models.portfolio.AmortisationElectionsProto.deserializeBinary = function(bytes) {
100
+ var reader = new jspb.BinaryReader(bytes);
101
+ var msg = new proto.fintekkers.models.portfolio.AmortisationElectionsProto;
102
+ return proto.fintekkers.models.portfolio.AmortisationElectionsProto.deserializeBinaryFromReader(msg, reader);
103
+ };
104
+
105
+
106
+ /**
107
+ * Deserializes binary data (in protobuf wire format) from the
108
+ * given reader into the given message object.
109
+ * @param {!proto.fintekkers.models.portfolio.AmortisationElectionsProto} msg The message object to deserialize into.
110
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
111
+ * @return {!proto.fintekkers.models.portfolio.AmortisationElectionsProto}
112
+ */
113
+ proto.fintekkers.models.portfolio.AmortisationElectionsProto.deserializeBinaryFromReader = function(msg, reader) {
114
+ while (reader.nextField()) {
115
+ if (reader.isEndGroup()) {
116
+ break;
117
+ }
118
+ var field = reader.getFieldNumber();
119
+ switch (field) {
120
+ case 10:
121
+ var value = /** @type {!proto.fintekkers.models.portfolio.PremiumAmortisationElectionProto} */ (reader.readEnum());
122
+ msg.setBondPremium(value);
123
+ break;
124
+ case 11:
125
+ var value = /** @type {!proto.fintekkers.models.portfolio.MarketDiscountInclusionProto} */ (reader.readEnum());
126
+ msg.setMarketDiscountInclusion(value);
127
+ break;
128
+ case 12:
129
+ var value = /** @type {!proto.fintekkers.models.portfolio.MarketDiscountAccrualMethodProto} */ (reader.readEnum());
130
+ msg.setMarketDiscountAccrual(value);
131
+ break;
132
+ default:
133
+ reader.skipField();
134
+ break;
135
+ }
136
+ }
137
+ return msg;
138
+ };
139
+
140
+
141
+ /**
142
+ * Serializes the message to binary data (in protobuf wire format).
143
+ * @return {!Uint8Array}
144
+ */
145
+ proto.fintekkers.models.portfolio.AmortisationElectionsProto.prototype.serializeBinary = function() {
146
+ var writer = new jspb.BinaryWriter();
147
+ proto.fintekkers.models.portfolio.AmortisationElectionsProto.serializeBinaryToWriter(this, writer);
148
+ return writer.getResultBuffer();
149
+ };
150
+
151
+
152
+ /**
153
+ * Serializes the given message to binary data (in protobuf wire
154
+ * format), writing to the given BinaryWriter.
155
+ * @param {!proto.fintekkers.models.portfolio.AmortisationElectionsProto} message
156
+ * @param {!jspb.BinaryWriter} writer
157
+ * @suppress {unusedLocalVariables} f is only used for nested messages
158
+ */
159
+ proto.fintekkers.models.portfolio.AmortisationElectionsProto.serializeBinaryToWriter = function(message, writer) {
160
+ var f = undefined;
161
+ f = message.getBondPremium();
162
+ if (f !== 0.0) {
163
+ writer.writeEnum(
164
+ 10,
165
+ f
166
+ );
167
+ }
168
+ f = message.getMarketDiscountInclusion();
169
+ if (f !== 0.0) {
170
+ writer.writeEnum(
171
+ 11,
172
+ f
173
+ );
174
+ }
175
+ f = message.getMarketDiscountAccrual();
176
+ if (f !== 0.0) {
177
+ writer.writeEnum(
178
+ 12,
179
+ f
180
+ );
181
+ }
182
+ };
183
+
184
+
185
+ /**
186
+ * optional PremiumAmortisationElectionProto bond_premium = 10;
187
+ * @return {!proto.fintekkers.models.portfolio.PremiumAmortisationElectionProto}
188
+ */
189
+ proto.fintekkers.models.portfolio.AmortisationElectionsProto.prototype.getBondPremium = function() {
190
+ return /** @type {!proto.fintekkers.models.portfolio.PremiumAmortisationElectionProto} */ (jspb.Message.getFieldWithDefault(this, 10, 0));
191
+ };
192
+
193
+
194
+ /**
195
+ * @param {!proto.fintekkers.models.portfolio.PremiumAmortisationElectionProto} value
196
+ * @return {!proto.fintekkers.models.portfolio.AmortisationElectionsProto} returns this
197
+ */
198
+ proto.fintekkers.models.portfolio.AmortisationElectionsProto.prototype.setBondPremium = function(value) {
199
+ return jspb.Message.setProto3EnumField(this, 10, value);
200
+ };
201
+
202
+
203
+ /**
204
+ * optional MarketDiscountInclusionProto market_discount_inclusion = 11;
205
+ * @return {!proto.fintekkers.models.portfolio.MarketDiscountInclusionProto}
206
+ */
207
+ proto.fintekkers.models.portfolio.AmortisationElectionsProto.prototype.getMarketDiscountInclusion = function() {
208
+ return /** @type {!proto.fintekkers.models.portfolio.MarketDiscountInclusionProto} */ (jspb.Message.getFieldWithDefault(this, 11, 0));
209
+ };
210
+
211
+
212
+ /**
213
+ * @param {!proto.fintekkers.models.portfolio.MarketDiscountInclusionProto} value
214
+ * @return {!proto.fintekkers.models.portfolio.AmortisationElectionsProto} returns this
215
+ */
216
+ proto.fintekkers.models.portfolio.AmortisationElectionsProto.prototype.setMarketDiscountInclusion = function(value) {
217
+ return jspb.Message.setProto3EnumField(this, 11, value);
218
+ };
219
+
220
+
221
+ /**
222
+ * optional MarketDiscountAccrualMethodProto market_discount_accrual = 12;
223
+ * @return {!proto.fintekkers.models.portfolio.MarketDiscountAccrualMethodProto}
224
+ */
225
+ proto.fintekkers.models.portfolio.AmortisationElectionsProto.prototype.getMarketDiscountAccrual = function() {
226
+ return /** @type {!proto.fintekkers.models.portfolio.MarketDiscountAccrualMethodProto} */ (jspb.Message.getFieldWithDefault(this, 12, 0));
227
+ };
228
+
229
+
230
+ /**
231
+ * @param {!proto.fintekkers.models.portfolio.MarketDiscountAccrualMethodProto} value
232
+ * @return {!proto.fintekkers.models.portfolio.AmortisationElectionsProto} returns this
233
+ */
234
+ proto.fintekkers.models.portfolio.AmortisationElectionsProto.prototype.setMarketDiscountAccrual = function(value) {
235
+ return jspb.Message.setProto3EnumField(this, 12, value);
236
+ };
237
+
238
+
239
+ /**
240
+ * @enum {number}
241
+ */
242
+ proto.fintekkers.models.portfolio.PremiumAmortisationElectionProto = {
243
+ UNSPECIFIED_PREMIUM_ELECTION: 0,
244
+ PREMIUM_ELECTED: 1,
245
+ PREMIUM_NOT_ELECTED: 2
246
+ };
247
+
248
+ /**
249
+ * @enum {number}
250
+ */
251
+ proto.fintekkers.models.portfolio.MarketDiscountInclusionProto = {
252
+ UNSPECIFIED_MARKET_DISCOUNT_INCLUSION: 0,
253
+ AT_DISPOSITION: 1,
254
+ INCLUDE_CURRENTLY: 2
255
+ };
256
+
257
+ /**
258
+ * @enum {number}
259
+ */
260
+ proto.fintekkers.models.portfolio.MarketDiscountAccrualMethodProto = {
261
+ UNSPECIFIED_ACCRUAL_METHOD: 0,
262
+ RATABLE: 1,
263
+ CONSTANT_YIELD: 2
264
+ };
265
+
266
+ goog.object.extend(exports, proto.fintekkers.models.portfolio);
@@ -5,6 +5,7 @@
5
5
  /* eslint-disable */
6
6
 
7
7
  import * as jspb from "google-protobuf";
8
+ import * as fintekkers_models_portfolio_amortisation_elections_pb from "../../../fintekkers/models/portfolio/amortisation_elections_pb";
8
9
  import * as fintekkers_models_util_local_timestamp_pb from "../../../fintekkers/models/util/local_timestamp_pb";
9
10
  import * as fintekkers_models_util_uuid_pb from "../../../fintekkers/models/util/uuid_pb";
10
11
  import * as fintekkers_models_util_object_type_pb from "../../../fintekkers/models/util/object_type_pb";
@@ -43,6 +44,11 @@ export class PortfolioProto extends jspb.Message {
43
44
  getPortfolioName(): string;
44
45
  setPortfolioName(value: string): PortfolioProto;
45
46
 
47
+ hasAmortisationElections(): boolean;
48
+ clearAmortisationElections(): void;
49
+ getAmortisationElections(): fintekkers_models_portfolio_amortisation_elections_pb.AmortisationElectionsProto | undefined;
50
+ setAmortisationElections(value?: fintekkers_models_portfolio_amortisation_elections_pb.AmortisationElectionsProto): PortfolioProto;
51
+
46
52
  serializeBinary(): Uint8Array;
47
53
  toObject(includeInstance?: boolean): PortfolioProto.AsObject;
48
54
  static toObject(includeInstance: boolean, msg: PortfolioProto): PortfolioProto.AsObject;
@@ -63,5 +69,6 @@ export namespace PortfolioProto {
63
69
  validFrom?: fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.AsObject,
64
70
  validTo?: fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.AsObject,
65
71
  portfolioName: string,
72
+ amortisationElections?: fintekkers_models_portfolio_amortisation_elections_pb.AmortisationElectionsProto.AsObject,
66
73
  }
67
74
  }
@@ -21,6 +21,8 @@ var global = (function() {
21
21
  return Function('return this')();
22
22
  }.call(null));
23
23
 
24
+ var fintekkers_models_portfolio_amortisation_elections_pb = require('../../../fintekkers/models/portfolio/amortisation_elections_pb.js');
25
+ goog.object.extend(proto, fintekkers_models_portfolio_amortisation_elections_pb);
24
26
  var fintekkers_models_util_local_timestamp_pb = require('../../../fintekkers/models/util/local_timestamp_pb.js');
25
27
  goog.object.extend(proto, fintekkers_models_util_local_timestamp_pb);
26
28
  var fintekkers_models_util_uuid_pb = require('../../../fintekkers/models/util/uuid_pb.js');
@@ -90,7 +92,8 @@ proto.fintekkers.models.portfolio.PortfolioProto.toObject = function(includeInst
90
92
  isLink: jspb.Message.getBooleanFieldWithDefault(msg, 7, false),
91
93
  validFrom: (f = msg.getValidFrom()) && fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.toObject(includeInstance, f),
92
94
  validTo: (f = msg.getValidTo()) && fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.toObject(includeInstance, f),
93
- portfolioName: jspb.Message.getFieldWithDefault(msg, 10, "")
95
+ portfolioName: jspb.Message.getFieldWithDefault(msg, 10, ""),
96
+ amortisationElections: (f = msg.getAmortisationElections()) && fintekkers_models_portfolio_amortisation_elections_pb.AmortisationElectionsProto.toObject(includeInstance, f)
94
97
  };
95
98
 
96
99
  if (includeInstance) {
@@ -164,6 +167,11 @@ proto.fintekkers.models.portfolio.PortfolioProto.deserializeBinaryFromReader = f
164
167
  var value = /** @type {string} */ (reader.readString());
165
168
  msg.setPortfolioName(value);
166
169
  break;
170
+ case 11:
171
+ var value = new fintekkers_models_portfolio_amortisation_elections_pb.AmortisationElectionsProto;
172
+ reader.readMessage(value,fintekkers_models_portfolio_amortisation_elections_pb.AmortisationElectionsProto.deserializeBinaryFromReader);
173
+ msg.setAmortisationElections(value);
174
+ break;
167
175
  default:
168
176
  reader.skipField();
169
177
  break;
@@ -254,6 +262,14 @@ proto.fintekkers.models.portfolio.PortfolioProto.serializeBinaryToWriter = funct
254
262
  f
255
263
  );
256
264
  }
265
+ f = message.getAmortisationElections();
266
+ if (f != null) {
267
+ writer.writeMessage(
268
+ 11,
269
+ f,
270
+ fintekkers_models_portfolio_amortisation_elections_pb.AmortisationElectionsProto.serializeBinaryToWriter
271
+ );
272
+ }
257
273
  };
258
274
 
259
275
 
@@ -496,4 +512,41 @@ proto.fintekkers.models.portfolio.PortfolioProto.prototype.setPortfolioName = fu
496
512
  };
497
513
 
498
514
 
515
+ /**
516
+ * optional AmortisationElectionsProto amortisation_elections = 11;
517
+ * @return {?proto.fintekkers.models.portfolio.AmortisationElectionsProto}
518
+ */
519
+ proto.fintekkers.models.portfolio.PortfolioProto.prototype.getAmortisationElections = function() {
520
+ return /** @type{?proto.fintekkers.models.portfolio.AmortisationElectionsProto} */ (
521
+ jspb.Message.getWrapperField(this, fintekkers_models_portfolio_amortisation_elections_pb.AmortisationElectionsProto, 11));
522
+ };
523
+
524
+
525
+ /**
526
+ * @param {?proto.fintekkers.models.portfolio.AmortisationElectionsProto|undefined} value
527
+ * @return {!proto.fintekkers.models.portfolio.PortfolioProto} returns this
528
+ */
529
+ proto.fintekkers.models.portfolio.PortfolioProto.prototype.setAmortisationElections = function(value) {
530
+ return jspb.Message.setWrapperField(this, 11, value);
531
+ };
532
+
533
+
534
+ /**
535
+ * Clears the message field making it undefined.
536
+ * @return {!proto.fintekkers.models.portfolio.PortfolioProto} returns this
537
+ */
538
+ proto.fintekkers.models.portfolio.PortfolioProto.prototype.clearAmortisationElections = function() {
539
+ return this.setAmortisationElections(undefined);
540
+ };
541
+
542
+
543
+ /**
544
+ * Returns whether this field is set.
545
+ * @return {boolean}
546
+ */
547
+ proto.fintekkers.models.portfolio.PortfolioProto.prototype.hasAmortisationElections = function() {
548
+ return jspb.Message.getField(this, 11) != null;
549
+ };
550
+
551
+
499
552
  goog.object.extend(exports, proto.fintekkers.models.portfolio);
@@ -0,0 +1 @@
1
+ // GENERATED CODE -- NO SERVICES IN PROTO
@@ -0,0 +1,44 @@
1
+ // package: fintekkers.models.position
2
+ // file: fintekkers/models/position/tax_lot.proto
3
+
4
+ /* tslint:disable */
5
+ /* eslint-disable */
6
+
7
+ import * as jspb from "google-protobuf";
8
+ import * as fintekkers_models_util_decimal_value_pb from "../../../fintekkers/models/util/decimal_value_pb";
9
+ import * as fintekkers_models_util_local_date_pb from "../../../fintekkers/models/util/local_date_pb";
10
+
11
+ export class TaxLotProto extends jspb.Message {
12
+
13
+ hasOpenDate(): boolean;
14
+ clearOpenDate(): void;
15
+ getOpenDate(): fintekkers_models_util_local_date_pb.LocalDateProto | undefined;
16
+ setOpenDate(value?: fintekkers_models_util_local_date_pb.LocalDateProto): TaxLotProto;
17
+
18
+ hasOpenQuantity(): boolean;
19
+ clearOpenQuantity(): void;
20
+ getOpenQuantity(): fintekkers_models_util_decimal_value_pb.DecimalValueProto | undefined;
21
+ setOpenQuantity(value?: fintekkers_models_util_decimal_value_pb.DecimalValueProto): TaxLotProto;
22
+
23
+ hasPrice(): boolean;
24
+ clearPrice(): void;
25
+ getPrice(): fintekkers_models_util_decimal_value_pb.DecimalValueProto | undefined;
26
+ setPrice(value?: fintekkers_models_util_decimal_value_pb.DecimalValueProto): TaxLotProto;
27
+
28
+ serializeBinary(): Uint8Array;
29
+ toObject(includeInstance?: boolean): TaxLotProto.AsObject;
30
+ static toObject(includeInstance: boolean, msg: TaxLotProto): TaxLotProto.AsObject;
31
+ static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
32
+ static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
33
+ static serializeBinaryToWriter(message: TaxLotProto, writer: jspb.BinaryWriter): void;
34
+ static deserializeBinary(bytes: Uint8Array): TaxLotProto;
35
+ static deserializeBinaryFromReader(message: TaxLotProto, reader: jspb.BinaryReader): TaxLotProto;
36
+ }
37
+
38
+ export namespace TaxLotProto {
39
+ export type AsObject = {
40
+ openDate?: fintekkers_models_util_local_date_pb.LocalDateProto.AsObject,
41
+ openQuantity?: fintekkers_models_util_decimal_value_pb.DecimalValueProto.AsObject,
42
+ price?: fintekkers_models_util_decimal_value_pb.DecimalValueProto.AsObject,
43
+ }
44
+ }