@fintekkers/ledger-models 0.1.64 → 0.1.67

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 (25) hide show
  1. package/.env +1 -1
  2. package/README.md +2 -0
  3. package/node/fintekkers/models/security/bond/issuance_pb.d.ts +17 -5
  4. package/node/fintekkers/models/security/bond/issuance_pb.js +112 -10
  5. package/node/wrappers/models/position/positionfilter.js +9 -1
  6. package/node/wrappers/models/position/positionfilter.js.map +1 -1
  7. package/node/wrappers/models/position/positionfilter.ts +10 -2
  8. package/node/wrappers/services/portfolio-service/portfolio.test.js +2 -1
  9. package/node/wrappers/services/portfolio-service/portfolio.test.js.map +1 -1
  10. package/node/wrappers/services/portfolio-service/portfolio.test.ts +2 -1
  11. package/node/wrappers/services/position-service/position.test.js +1 -1
  12. package/node/wrappers/services/position-service/position.test.js.map +1 -1
  13. package/node/wrappers/services/position-service/position.test.ts +1 -1
  14. package/node/wrappers/services/security-service/security.maturityLadder.test.js +27 -4
  15. package/node/wrappers/services/security-service/security.maturityLadder.test.js.map +1 -1
  16. package/node/wrappers/services/security-service/security.maturityLadder.test.ts +36 -18
  17. package/node/wrappers/services/security-service/security.test.js +9 -3
  18. package/node/wrappers/services/security-service/security.test.js.map +1 -1
  19. package/node/wrappers/services/security-service/security.test.ts +9 -2
  20. package/node/wrappers/services/transaction-service/transaction.test.js +3 -3
  21. package/node/wrappers/services/transaction-service/transaction.test.js.map +1 -1
  22. package/node/wrappers/services/transaction-service/transaction.test.ts +3 -3
  23. package/package.json +1 -1
  24. package/web/fintekkers/models/security/bond/issuance_pb.d.ts +17 -5
  25. package/web/fintekkers/models/security/bond/issuance_pb.js +112 -10
package/.env CHANGED
@@ -1,3 +1,3 @@
1
1
  # API_URL=api.fintekkers.org #this will be the default value so doesn't need to be set unless you override
2
- # API_URL=localhost #this is the value to use when running services locally
2
+ API_URL=localhost #this is the value to use when running services locally
3
3
 
package/README.md CHANGED
@@ -15,6 +15,8 @@ TODO: Are there env variables required?
15
15
 
16
16
  The *js files are compiled using tsc. The tsconfig.json is used by VS code to determine when to run (by default on-save). Additionally the *.js.map files are generated to allow for setting debug breakpoints in .ts code. Those files can be not autogenerated by setting sourceMap=False in the tsconfig.json. Probably don't need those files in a production environment.
17
17
 
18
+ You can run transpilation via pressing Ctrl+Shift+B to open a list of tasks in VS Code and select tsc: watch - tsconfig.json
19
+
18
20
  # Publishing
19
21
 
20
22
  Please see the .github/workflows/npm-publish.yml for the workflow file that deploys the package to a private GitHub repository manager.
@@ -41,10 +41,10 @@ export class IssuanceProto extends jspb.Message {
41
41
  getAuctionIssueDate(): fintekkers_models_util_local_date_pb.LocalDateProto | undefined;
42
42
  setAuctionIssueDate(value?: fintekkers_models_util_local_date_pb.LocalDateProto): IssuanceProto;
43
43
 
44
- hasPreauctionOutstandingQuantity(): boolean;
45
- clearPreauctionOutstandingQuantity(): void;
46
- getPreauctionOutstandingQuantity(): fintekkers_models_util_decimal_value_pb.DecimalValueProto | undefined;
47
- setPreauctionOutstandingQuantity(value?: fintekkers_models_util_decimal_value_pb.DecimalValueProto): IssuanceProto;
44
+ hasPostAuctionOutstandingQuantity(): boolean;
45
+ clearPostAuctionOutstandingQuantity(): void;
46
+ getPostAuctionOutstandingQuantity(): fintekkers_models_util_decimal_value_pb.DecimalValueProto | undefined;
47
+ setPostAuctionOutstandingQuantity(value?: fintekkers_models_util_decimal_value_pb.DecimalValueProto): IssuanceProto;
48
48
 
49
49
  hasAuctionOfferingAmount(): boolean;
50
50
  clearAuctionOfferingAmount(): void;
@@ -58,6 +58,16 @@ export class IssuanceProto extends jspb.Message {
58
58
  getPriceForSinglePriceAuction(): fintekkers_models_util_decimal_value_pb.DecimalValueProto | undefined;
59
59
  setPriceForSinglePriceAuction(value?: fintekkers_models_util_decimal_value_pb.DecimalValueProto): IssuanceProto;
60
60
 
61
+ hasTotalAccepted(): boolean;
62
+ clearTotalAccepted(): void;
63
+ getTotalAccepted(): fintekkers_models_util_decimal_value_pb.DecimalValueProto | undefined;
64
+ setTotalAccepted(value?: fintekkers_models_util_decimal_value_pb.DecimalValueProto): IssuanceProto;
65
+
66
+ hasMatureSecurityAmount(): boolean;
67
+ clearMatureSecurityAmount(): void;
68
+ getMatureSecurityAmount(): fintekkers_models_util_decimal_value_pb.DecimalValueProto | undefined;
69
+ setMatureSecurityAmount(value?: fintekkers_models_util_decimal_value_pb.DecimalValueProto): IssuanceProto;
70
+
61
71
  serializeBinary(): Uint8Array;
62
72
  toObject(includeInstance?: boolean): IssuanceProto.AsObject;
63
73
  static toObject(includeInstance: boolean, msg: IssuanceProto): IssuanceProto.AsObject;
@@ -77,9 +87,11 @@ export namespace IssuanceProto {
77
87
  validTo?: fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.AsObject,
78
88
  auctionAnnouncementDate?: fintekkers_models_util_local_date_pb.LocalDateProto.AsObject,
79
89
  auctionIssueDate?: fintekkers_models_util_local_date_pb.LocalDateProto.AsObject,
80
- preauctionOutstandingQuantity?: fintekkers_models_util_decimal_value_pb.DecimalValueProto.AsObject,
90
+ postAuctionOutstandingQuantity?: fintekkers_models_util_decimal_value_pb.DecimalValueProto.AsObject,
81
91
  auctionOfferingAmount?: fintekkers_models_util_decimal_value_pb.DecimalValueProto.AsObject,
82
92
  auctionType: fintekkers_models_security_bond_auction_type_pb.AuctionTypeProto,
83
93
  priceForSinglePriceAuction?: fintekkers_models_util_decimal_value_pb.DecimalValueProto.AsObject,
94
+ totalAccepted?: fintekkers_models_util_decimal_value_pb.DecimalValueProto.AsObject,
95
+ matureSecurityAmount?: fintekkers_models_util_decimal_value_pb.DecimalValueProto.AsObject,
84
96
  }
85
97
  }
@@ -90,10 +90,12 @@ proto.fintekkers.models.security.bond.IssuanceProto.toObject = function(includeI
90
90
  validTo: (f = msg.getValidTo()) && fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.toObject(includeInstance, f),
91
91
  auctionAnnouncementDate: (f = msg.getAuctionAnnouncementDate()) && fintekkers_models_util_local_date_pb.LocalDateProto.toObject(includeInstance, f),
92
92
  auctionIssueDate: (f = msg.getAuctionIssueDate()) && fintekkers_models_util_local_date_pb.LocalDateProto.toObject(includeInstance, f),
93
- preauctionOutstandingQuantity: (f = msg.getPreauctionOutstandingQuantity()) && fintekkers_models_util_decimal_value_pb.DecimalValueProto.toObject(includeInstance, f),
93
+ postAuctionOutstandingQuantity: (f = msg.getPostAuctionOutstandingQuantity()) && fintekkers_models_util_decimal_value_pb.DecimalValueProto.toObject(includeInstance, f),
94
94
  auctionOfferingAmount: (f = msg.getAuctionOfferingAmount()) && fintekkers_models_util_decimal_value_pb.DecimalValueProto.toObject(includeInstance, f),
95
95
  auctionType: jspb.Message.getFieldWithDefault(msg, 24, 0),
96
- priceForSinglePriceAuction: (f = msg.getPriceForSinglePriceAuction()) && fintekkers_models_util_decimal_value_pb.DecimalValueProto.toObject(includeInstance, f)
96
+ priceForSinglePriceAuction: (f = msg.getPriceForSinglePriceAuction()) && fintekkers_models_util_decimal_value_pb.DecimalValueProto.toObject(includeInstance, f),
97
+ totalAccepted: (f = msg.getTotalAccepted()) && fintekkers_models_util_decimal_value_pb.DecimalValueProto.toObject(includeInstance, f),
98
+ matureSecurityAmount: (f = msg.getMatureSecurityAmount()) && fintekkers_models_util_decimal_value_pb.DecimalValueProto.toObject(includeInstance, f)
97
99
  };
98
100
 
99
101
  if (includeInstance) {
@@ -166,7 +168,7 @@ proto.fintekkers.models.security.bond.IssuanceProto.deserializeBinaryFromReader
166
168
  case 22:
167
169
  var value = new fintekkers_models_util_decimal_value_pb.DecimalValueProto;
168
170
  reader.readMessage(value,fintekkers_models_util_decimal_value_pb.DecimalValueProto.deserializeBinaryFromReader);
169
- msg.setPreauctionOutstandingQuantity(value);
171
+ msg.setPostAuctionOutstandingQuantity(value);
170
172
  break;
171
173
  case 23:
172
174
  var value = new fintekkers_models_util_decimal_value_pb.DecimalValueProto;
@@ -182,6 +184,16 @@ proto.fintekkers.models.security.bond.IssuanceProto.deserializeBinaryFromReader
182
184
  reader.readMessage(value,fintekkers_models_util_decimal_value_pb.DecimalValueProto.deserializeBinaryFromReader);
183
185
  msg.setPriceForSinglePriceAuction(value);
184
186
  break;
187
+ case 26:
188
+ var value = new fintekkers_models_util_decimal_value_pb.DecimalValueProto;
189
+ reader.readMessage(value,fintekkers_models_util_decimal_value_pb.DecimalValueProto.deserializeBinaryFromReader);
190
+ msg.setTotalAccepted(value);
191
+ break;
192
+ case 27:
193
+ var value = new fintekkers_models_util_decimal_value_pb.DecimalValueProto;
194
+ reader.readMessage(value,fintekkers_models_util_decimal_value_pb.DecimalValueProto.deserializeBinaryFromReader);
195
+ msg.setMatureSecurityAmount(value);
196
+ break;
185
197
  default:
186
198
  reader.skipField();
187
199
  break;
@@ -265,7 +277,7 @@ proto.fintekkers.models.security.bond.IssuanceProto.serializeBinaryToWriter = fu
265
277
  fintekkers_models_util_local_date_pb.LocalDateProto.serializeBinaryToWriter
266
278
  );
267
279
  }
268
- f = message.getPreauctionOutstandingQuantity();
280
+ f = message.getPostAuctionOutstandingQuantity();
269
281
  if (f != null) {
270
282
  writer.writeMessage(
271
283
  22,
@@ -296,6 +308,22 @@ proto.fintekkers.models.security.bond.IssuanceProto.serializeBinaryToWriter = fu
296
308
  fintekkers_models_util_decimal_value_pb.DecimalValueProto.serializeBinaryToWriter
297
309
  );
298
310
  }
311
+ f = message.getTotalAccepted();
312
+ if (f != null) {
313
+ writer.writeMessage(
314
+ 26,
315
+ f,
316
+ fintekkers_models_util_decimal_value_pb.DecimalValueProto.serializeBinaryToWriter
317
+ );
318
+ }
319
+ f = message.getMatureSecurityAmount();
320
+ if (f != null) {
321
+ writer.writeMessage(
322
+ 27,
323
+ f,
324
+ fintekkers_models_util_decimal_value_pb.DecimalValueProto.serializeBinaryToWriter
325
+ );
326
+ }
299
327
  };
300
328
 
301
329
 
@@ -521,10 +549,10 @@ proto.fintekkers.models.security.bond.IssuanceProto.prototype.hasAuctionIssueDat
521
549
 
522
550
 
523
551
  /**
524
- * optional fintekkers.models.util.DecimalValueProto preauction_outstanding_quantity = 22;
552
+ * optional fintekkers.models.util.DecimalValueProto post_auction_outstanding_quantity = 22;
525
553
  * @return {?proto.fintekkers.models.util.DecimalValueProto}
526
554
  */
527
- proto.fintekkers.models.security.bond.IssuanceProto.prototype.getPreauctionOutstandingQuantity = function() {
555
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.getPostAuctionOutstandingQuantity = function() {
528
556
  return /** @type{?proto.fintekkers.models.util.DecimalValueProto} */ (
529
557
  jspb.Message.getWrapperField(this, fintekkers_models_util_decimal_value_pb.DecimalValueProto, 22));
530
558
  };
@@ -534,7 +562,7 @@ proto.fintekkers.models.security.bond.IssuanceProto.prototype.getPreauctionOutst
534
562
  * @param {?proto.fintekkers.models.util.DecimalValueProto|undefined} value
535
563
  * @return {!proto.fintekkers.models.security.bond.IssuanceProto} returns this
536
564
  */
537
- proto.fintekkers.models.security.bond.IssuanceProto.prototype.setPreauctionOutstandingQuantity = function(value) {
565
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.setPostAuctionOutstandingQuantity = function(value) {
538
566
  return jspb.Message.setWrapperField(this, 22, value);
539
567
  };
540
568
 
@@ -543,8 +571,8 @@ proto.fintekkers.models.security.bond.IssuanceProto.prototype.setPreauctionOutst
543
571
  * Clears the message field making it undefined.
544
572
  * @return {!proto.fintekkers.models.security.bond.IssuanceProto} returns this
545
573
  */
546
- proto.fintekkers.models.security.bond.IssuanceProto.prototype.clearPreauctionOutstandingQuantity = function() {
547
- return this.setPreauctionOutstandingQuantity(undefined);
574
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.clearPostAuctionOutstandingQuantity = function() {
575
+ return this.setPostAuctionOutstandingQuantity(undefined);
548
576
  };
549
577
 
550
578
 
@@ -552,7 +580,7 @@ proto.fintekkers.models.security.bond.IssuanceProto.prototype.clearPreauctionOut
552
580
  * Returns whether this field is set.
553
581
  * @return {boolean}
554
582
  */
555
- proto.fintekkers.models.security.bond.IssuanceProto.prototype.hasPreauctionOutstandingQuantity = function() {
583
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.hasPostAuctionOutstandingQuantity = function() {
556
584
  return jspb.Message.getField(this, 22) != null;
557
585
  };
558
586
 
@@ -649,4 +677,78 @@ proto.fintekkers.models.security.bond.IssuanceProto.prototype.hasPriceForSingleP
649
677
  };
650
678
 
651
679
 
680
+ /**
681
+ * optional fintekkers.models.util.DecimalValueProto total_accepted = 26;
682
+ * @return {?proto.fintekkers.models.util.DecimalValueProto}
683
+ */
684
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.getTotalAccepted = function() {
685
+ return /** @type{?proto.fintekkers.models.util.DecimalValueProto} */ (
686
+ jspb.Message.getWrapperField(this, fintekkers_models_util_decimal_value_pb.DecimalValueProto, 26));
687
+ };
688
+
689
+
690
+ /**
691
+ * @param {?proto.fintekkers.models.util.DecimalValueProto|undefined} value
692
+ * @return {!proto.fintekkers.models.security.bond.IssuanceProto} returns this
693
+ */
694
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.setTotalAccepted = function(value) {
695
+ return jspb.Message.setWrapperField(this, 26, value);
696
+ };
697
+
698
+
699
+ /**
700
+ * Clears the message field making it undefined.
701
+ * @return {!proto.fintekkers.models.security.bond.IssuanceProto} returns this
702
+ */
703
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.clearTotalAccepted = function() {
704
+ return this.setTotalAccepted(undefined);
705
+ };
706
+
707
+
708
+ /**
709
+ * Returns whether this field is set.
710
+ * @return {boolean}
711
+ */
712
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.hasTotalAccepted = function() {
713
+ return jspb.Message.getField(this, 26) != null;
714
+ };
715
+
716
+
717
+ /**
718
+ * optional fintekkers.models.util.DecimalValueProto mature_security_amount = 27;
719
+ * @return {?proto.fintekkers.models.util.DecimalValueProto}
720
+ */
721
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.getMatureSecurityAmount = function() {
722
+ return /** @type{?proto.fintekkers.models.util.DecimalValueProto} */ (
723
+ jspb.Message.getWrapperField(this, fintekkers_models_util_decimal_value_pb.DecimalValueProto, 27));
724
+ };
725
+
726
+
727
+ /**
728
+ * @param {?proto.fintekkers.models.util.DecimalValueProto|undefined} value
729
+ * @return {!proto.fintekkers.models.security.bond.IssuanceProto} returns this
730
+ */
731
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.setMatureSecurityAmount = function(value) {
732
+ return jspb.Message.setWrapperField(this, 27, value);
733
+ };
734
+
735
+
736
+ /**
737
+ * Clears the message field making it undefined.
738
+ * @return {!proto.fintekkers.models.security.bond.IssuanceProto} returns this
739
+ */
740
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.clearMatureSecurityAmount = function() {
741
+ return this.setMatureSecurityAmount(undefined);
742
+ };
743
+
744
+
745
+ /**
746
+ * Returns whether this field is set.
747
+ * @return {boolean}
748
+ */
749
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.hasMatureSecurityAmount = function() {
750
+ return jspb.Message.getField(this, 27) != null;
751
+ };
752
+
753
+
652
754
  goog.object.extend(exports, proto.fintekkers.models.security.bond);
@@ -12,10 +12,18 @@ var PositionFilter = /** @class */ (function () {
12
12
  * @param {*} field FieldProto.ASSET_CLASS, as an example
13
13
  * @param {*} fieldValue The appropriate value for the FieldProto, e.g. FieldProto.ASSET_CLASS would have a string fieldValue
14
14
  */
15
- PositionFilter.prototype.addFilter = function (field, fieldValue) {
15
+ PositionFilter.prototype.addEqualsFilter = function (field, fieldValue) {
16
+ return this.addFilter(field, fieldValue, position_util_pb_1.PositionFilterOperator.EQUALS);
17
+ };
18
+ /**
19
+ * @param {*} field FieldProto.ASSET_CLASS, as an example
20
+ * @param {*} fieldValue The appropriate value for the FieldProto, e.g. FieldProto.ASSET_CLASS would have a string fieldValue
21
+ */
22
+ PositionFilter.prototype.addFilter = function (field, fieldValue, operator) {
16
23
  var fieldMapEntry = new position_util_pb_1.FieldMapEntry();
17
24
  fieldMapEntry.setField(field); //FieldProto.ASSET_CLASS);
18
25
  fieldMapEntry.setFieldValuePacked((0, serialization_util_1.pack)(fieldValue));
26
+ fieldMapEntry.setOperator(operator);
19
27
  this.filters.push(fieldMapEntry);
20
28
  return this;
21
29
  };
@@ -1 +1 @@
1
- {"version":3,"file":"positionfilter.js","sourceRoot":"","sources":["positionfilter.ts"],"names":[],"mappings":";;;AAAA,yFAAqF;AAErF,kEAAmD;AACnD,6FAA6F;AAE7F;IAGI;QACI,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,kCAAS,GAAT,UAAU,KAAiB,EAAE,UAAe;QACxC,IAAM,aAAa,GAAG,IAAI,gCAAa,EAAE,CAAC;QAC1C,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,0BAA0B;QACzD,aAAa,CAAC,mBAAmB,CAAC,IAAA,yBAAI,EAAC,UAAU,CAAC,CAAC,CAAC;QAEpD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,mCAAU,GAAV;QACI,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,gCAAO,GAAP;QACI,IAAM,mBAAmB,GAAG,IAAI,wCAAmB,EAAE,CAAC;QACtD,mBAAmB,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;QACrD,mBAAmB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACxC,mBAAmB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEjD,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IACL,qBAAC;AAAD,CAAC,AAhCD,IAgCC;AAhCY,wCAAc"}
1
+ {"version":3,"file":"positionfilter.js","sourceRoot":"","sources":["positionfilter.ts"],"names":[],"mappings":";;;AAAA,yFAA6G;AAE7G,kEAAmD;AACnD,6FAA6F;AAE7F;IAGI;QACI,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,wCAAe,GAAf,UAAgB,KAAiB,EAAE,UAAe;QAC9C,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,yCAAsB,CAAC,MAAM,CAAC,CAAC;IAC5E,CAAC;IACD;;;OAGG;IACH,kCAAS,GAAT,UAAU,KAAiB,EAAE,UAAe,EAAE,QAAgC;QAC1E,IAAM,aAAa,GAAG,IAAI,gCAAa,EAAE,CAAC;QAC1C,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,0BAA0B;QACzD,aAAa,CAAC,mBAAmB,CAAC,IAAA,yBAAI,EAAC,UAAU,CAAC,CAAC,CAAC;QACpD,aAAa,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAEpC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,mCAAU,GAAV;QACI,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,gCAAO,GAAP;QACI,IAAM,mBAAmB,GAAG,IAAI,wCAAmB,EAAE,CAAC;QACtD,mBAAmB,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;QACrD,mBAAmB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACxC,mBAAmB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEjD,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IACL,qBAAC;AAAD,CAAC,AAxCD,IAwCC;AAxCY,wCAAc"}
@@ -1,4 +1,4 @@
1
- import { FieldMapEntry } from '../../../fintekkers/models/position/position_util_pb';
1
+ import { FieldMapEntry, PositionFilterOperator } from '../../../fintekkers/models/position/position_util_pb';
2
2
  import { FieldProto } from '../../../fintekkers/models/position/field_pb';
3
3
  import { pack } from '../utils/serialization.util';
4
4
  import { PositionFilterProto } from '../../../fintekkers/models/position/position_filter_pb';
@@ -14,10 +14,18 @@ export class PositionFilter {
14
14
  * @param {*} field FieldProto.ASSET_CLASS, as an example
15
15
  * @param {*} fieldValue The appropriate value for the FieldProto, e.g. FieldProto.ASSET_CLASS would have a string fieldValue
16
16
  */
17
- addFilter(field: FieldProto, fieldValue: any): PositionFilter {
17
+ addEqualsFilter(field: FieldProto, fieldValue: any): PositionFilter {
18
+ return this.addFilter(field, fieldValue, PositionFilterOperator.EQUALS);
19
+ }
20
+ /**
21
+ * @param {*} field FieldProto.ASSET_CLASS, as an example
22
+ * @param {*} fieldValue The appropriate value for the FieldProto, e.g. FieldProto.ASSET_CLASS would have a string fieldValue
23
+ */
24
+ addFilter(field: FieldProto, fieldValue: any, operator: PositionFilterOperator): PositionFilter {
18
25
  const fieldMapEntry = new FieldMapEntry();
19
26
  fieldMapEntry.setField(field); //FieldProto.ASSET_CLASS);
20
27
  fieldMapEntry.setFieldValuePacked(pack(fieldValue));
28
+ fieldMapEntry.setOperator(operator);
21
29
 
22
30
  this.filters.push(fieldMapEntry);
23
31
  return this;
@@ -67,10 +67,11 @@ test('test creating a portfolio against the api.fintekkers.org portfolio service
67
67
  case 2:
68
68
  createPortfolioResponse = _a.sent();
69
69
  expect(createPortfolioResponse.getPortfolioResponseList().length).toBe(1);
70
- return [4 /*yield*/, portfolioService.searchPortfolio(now.toProto(), new positionfilter_1.PositionFilter().addFilter(field_pb_1.FieldProto.PORTFOLIO_NAME, 'Federal Reserve SOMA Holdings'))];
70
+ return [4 /*yield*/, portfolioService.searchPortfolio(now.toProto(), new positionfilter_1.PositionFilter().addEqualsFilter(field_pb_1.FieldProto.PORTFOLIO_NAME, 'Federal Reserve SOMA Holdings'))];
71
71
  case 3:
72
72
  searchResults = _a.sent();
73
73
  expect(searchResults.length > 0).toBe(true);
74
+ console.log(searchResults[0].getPortfolioName());
74
75
  return [2 /*return*/];
75
76
  }
76
77
  });
@@ -1 +1 @@
1
- {"version":3,"file":"portfolio.test.js","sourceRoot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AgB,CAAC,eAAe,CAAC,SAAS,CAAC,EAAA;;gBAAzG,uBAAuB,GAAiC,SAAiD;gBAC7G,MAAM,CAAC,uBAAuB,CAAC,wBAAwB,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAEtD,qBAAM,gBAAgB,CAAC,eAAe,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,IAAI,+BAAc,EAAE,CAAC,eAAe,CAAC,qBAAU,CAAC,cAAc,EAAE,+BAA+B,CAAC,CAAC,EAAA;;gBAAvK,aAAa,GAAG,SAAuJ;gBAC3K,MAAM,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC5C,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC,CAAC;;;;KAClD,EAAE,KAAK,CAAC,CAAC"}
@@ -31,6 +31,7 @@ test('test creating a portfolio against the api.fintekkers.org portfolio service
31
31
  var createPortfolioResponse: CreatePortfolioResponseProto = await portfolioService.createPortfolio(portfolio);
32
32
  expect(createPortfolioResponse.getPortfolioResponseList().length).toBe(1);
33
33
 
34
- var searchResults = await portfolioService.searchPortfolio(now.toProto(), new PositionFilter().addFilter(FieldProto.PORTFOLIO_NAME, 'Federal Reserve SOMA Holdings'));
34
+ var searchResults = await portfolioService.searchPortfolio(now.toProto(), new PositionFilter().addEqualsFilter(FieldProto.PORTFOLIO_NAME, 'Federal Reserve SOMA Holdings'));
35
35
  expect(searchResults.length > 0).toBe(true);
36
+ console.log(searchResults[0].getPortfolioName());
36
37
  }, 30000);
@@ -121,7 +121,7 @@ function testPosition() {
121
121
  case 0:
122
122
  now = datetime_1.ZonedDateTime.now();
123
123
  portfolioService = new PortfolioService_1.PortfolioService();
124
- return [4 /*yield*/, portfolioService.searchPortfolio(now.toProto(), new positionfilter_1.PositionFilter().addFilter(field_pb_1.FieldProto.PORTFOLIO_NAME, 'Federal Reserve SOMA Holdings'))];
124
+ return [4 /*yield*/, portfolioService.searchPortfolio(now.toProto(), new positionfilter_1.PositionFilter().addEqualsFilter(field_pb_1.FieldProto.PORTFOLIO_NAME, 'Federal Reserve SOMA Holdings'))];
125
125
  case 1:
126
126
  portfolios = _a.sent();
127
127
  fedReservePortfolio = portfolios[0];
@@ -1 +1 @@
1
- {"version":3,"file":"position.test.js","sourceRoot":"","sources":["position.test.ts"],"names":[],"mappings":";AAAA,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAET,8FAA+F;AAC/F,+EAAuG;AAEvG,6EAA8E;AAG9E,cAAc;AACd,yEAA0E;AAC1E,yFAAqF;AACrF,6FAA6F;AAC7F,wDAA4D;AAE5D,4EAA6D;AAC7D,iEAA6D;AAE7D,qBAAqB;AACrB,sFAAqF;AACrF,mFAAkF;AAClF,6GAA4G;AAC5G,uEAAsE;AAEtE,IAAI,CAAC,yEAAyE,EAAE;;;;oBAC/D,qBAAM,YAAY,EAAE,EAAA;;gBAA7B,MAAM,GAAG,SAAoB;gBACnC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;;;KAC3B,EAAE,KAAK,CAAC,CAAC;AAEV,SAAe,YAAY,CAAC,QAAuB,EACjD,SAAyB,EACzB,QAAwB,EACxB,aAAgC,EAChC,MAAoD,EACpD,kBAAuB,EAAE,KAA2B;IADpD,uBAAA,EAAA,UAAU,qBAAU,CAAC,SAAS,EAAE,qBAAU,CAAC,QAAQ,CAAC;IACpD,mCAAA,EAAA,uBAAuB;IAAE,sBAAA,EAAA,QAAQ,wBAAa,CAAC,GAAG,EAAE;;;;;;oBAC9C,OAAO,GAAG,EAAE,CAAC;oBAEnB,IAAI,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,EAAE;wBACzC,QAAQ,GAAG,IAAI,+BAAe,EAAE,CAAC;wBACvC,QAAQ,CAAC,kBAAkB,CAAC,QAAQ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CAAe,EAAE,CAAC;oBAE3B,qBAAM,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAA;;oBAAlD,SAAS,GAAG,SAAsC;oBAExD,sBAAO,SAAS,EAAC;;;;CAClB;AAED,SAAe,YAAY;;;;;;oBAEnB,GAAG,GAAG,wBAAa,CAAC,GAAG,EAAE,CAAC;oBAE1B,gBAAgB,GAAG,IAAI,mCAAgB,EAAE,CAAC;oBAE/B,qBAAM,gBAAgB,CAAC,eAAe,CACrD,GAAG,CAAC,OAAO,EAAE,EACb,IAAI,+BAAc,EAAE,CAAC,eAAe,CAAC,qBAAU,CAAC,cAAc,EAAE,+BAA+B,CAAC,CAAC,EAAA;;oBAF/F,UAAU,GAAG,SAEkF;oBAC7F,mBAAmB,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;oBAE1B,qBAAM,YAAY,CAAC,IAAI,EAAE,mBAAmB,CAAC,KAAK,EAChE,CAAC,yBAAY,CAAC,iBAAiB,CAAC,EAChC,+BAAiB,CAAC,WAAW,EAC7B,CAAC,qBAAU,CAAC,cAAc,EAAE,qBAAU,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,EAAA;;oBAH3D,SAAS,GAAG,SAG+C;oBAG/D,IAAI,SAAS,EAAE;wBACb,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,qBAAqB,CAAC,CAAA;qBACtD;yBAAM;wBACL,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;qBACnC;oBACD,sBAAO,IAAI,EAAC;;;;CACb"}
@@ -89,7 +89,7 @@ async function testPosition(): Promise<boolean> {
89
89
 
90
90
  let portfolios = await portfolioService.searchPortfolio(
91
91
  now.toProto(),
92
- new PositionFilter().addFilter(FieldProto.PORTFOLIO_NAME, 'Federal Reserve SOMA Holdings'));
92
+ new PositionFilter().addEqualsFilter(FieldProto.PORTFOLIO_NAME, 'Federal Reserve SOMA Holdings'));
93
93
  const fedReservePortfolio = portfolios[0];
94
94
 
95
95
  let positions = await get_position(null, fedReservePortfolio.proto,
@@ -36,24 +36,47 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
+ var assert = require("assert");
40
+ // Models
39
41
  // Model Utils
40
42
  var field_pb_1 = require("../../../fintekkers/models/position/field_pb");
41
43
  var SecurityService_1 = require("./SecurityService");
42
44
  var positionfilter_1 = require("../../models/position/positionfilter");
45
+ var serialization_1 = require("../../models/utils/serialization");
43
46
  test('test the api.fintekkers.org security service by creating a maturity ladder for the US government', function () { return __awaiter(void 0, void 0, void 0, function () {
44
- var securityService, positionFilter, securities;
47
+ var securityService, positionFilter, securities, results, index, security, issuanceList, issuance, postAuctionQuantity, id, result;
45
48
  return __generator(this, function (_a) {
46
49
  switch (_a.label) {
47
50
  case 0:
48
51
  securityService = new SecurityService_1.SecurityService();
49
52
  positionFilter = new positionfilter_1.PositionFilter();
50
- positionFilter.addFilter(field_pb_1.FieldProto.SECURITY_ISSUER_NAME, "US Government");
53
+ positionFilter.addEqualsFilter(field_pb_1.FieldProto.ASSET_CLASS, 'Fixed Income');
51
54
  return [4 /*yield*/, securityService.searchSecurityAsOfNow(positionFilter)];
52
55
  case 1:
53
56
  securities = _a.sent();
54
- console.log(securities.length);
57
+ assert(securities.length > 0);
58
+ results = [];
59
+ //Map results into list of maps -> Date, Amount
60
+ for (index in securities) {
61
+ security = securities[index];
62
+ issuanceList = security.proto.getIssuanceInfoList();
63
+ issuance = issuanceList && issuanceList.length > 0 ? issuanceList[0] : null;
64
+ if (issuance) {
65
+ postAuctionQuantity = serialization_1.ProtoSerializationUtil.deserialize(issuance.getPostAuctionOutstandingQuantity());
66
+ id = security.getSecurityID() ? security.getSecurityID().getIdentifierValue() : security.getID().toString();
67
+ result = {
68
+ 'cusip': id,
69
+ 'issueDate': security.getIssueDate(),
70
+ 'outstandingAmount': postAuctionQuantity,
71
+ 'maturityDate': security.getMaturityDate()
72
+ };
73
+ results.push(result);
74
+ }
75
+ }
76
+ console.log(results);
77
+ console.log("Done");
55
78
  return [2 /*return*/];
56
79
  }
57
80
  });
58
- }); }, 30000);
81
+ }); }, 90000);
59
82
  //# sourceMappingURL=security.maturityLadder.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"security.maturityLadder.test.js","sourceRoot":"","sources":["security.maturityLadder.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,cAAc;AACd,yEAA0E;AAM1E,qDAAoD;AACpD,uEAAsE;AAEtE,IAAI,CAAC,kGAAkG,EAAE;;;;;gBAG/F,eAAe,GAAG,IAAI,iCAAe,EAAE,CAAC;gBAExC,cAAc,GAAG,IAAI,+BAAc,EAAE,CAAC;gBAC5C,cAAc,CAAC,SAAS,CAAC,qBAAU,CAAC,oBAAoB,EAAE,eAAe,CAAC,CAAC;gBACxD,qBAAM,eAAe,CAAC,qBAAqB,CAAC,cAAc,CAAC,EAAA;;gBAAxE,UAAU,GAAG,SAA2D;gBAG9E,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;;;;KASlC,EAAE,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"security.maturityLadder.test.js","sourceRoot":"","sources":["security.maturityLadder.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAkC;AAElC,SAAS;AAET,cAAc;AACd,yEAA0E;AAC1E,qDAAoD;AACpD,uEAAsE;AAGtE,kEAA0E;AAE1E,IAAI,CAAC,kGAAkG,EAAE;;;;;gBAE/F,eAAe,GAAG,IAAI,iCAAe,EAAE,CAAC;gBAExC,cAAc,GAAG,IAAI,+BAAc,EAAE,CAAC;gBAC5C,cAAc,CAAC,eAAe,CAAC,qBAAU,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;gBAGtD,qBAAM,eAAe,CAAC,qBAAqB,CAAC,cAAc,CAAC,EAAA;;gBAAxE,UAAU,GAAG,SAA2D;gBAE5E,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;gBAC1B,OAAO,GAAG,EAAE,CAAC;gBAEjB,+CAA+C;gBAC/C,KAAS,KAAK,IAAI,UAAU,EAAE;oBACtB,QAAQ,GAAa,UAAU,CAAC,KAAK,CAAC,CAAC;oBAEvC,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,mBAAmB,EAAE,CAAC;oBACpD,QAAQ,GAAG,YAAY,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;oBAEhF,IAAI,QAAQ,EAAE;wBACN,mBAAmB,GAAW,sCAAsB,CAAC,WAAW,CAAC,QAAQ,CAAC,iCAAiC,EAAE,CAAC,CAAC;wBAC/G,EAAE,GAAW,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC;wBAEpH,MAAM,GAAG;4BACT,OAAO,EAAE,EAAE;4BACX,WAAW,EAAE,QAAQ,CAAC,YAAY,EAAE;4BACpC,mBAAmB,EAAE,mBAAmB;4BACxC,cAAc,EAAE,QAAQ,CAAC,eAAe,EAAE;yBAC7C,CAAC;wBACF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;qBACxB;iBACJ;gBAED,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBACrB,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;;;;KAQvB,EAAE,KAAK,CAAC,CAAC"}
@@ -1,39 +1,57 @@
1
+ import assert = require('assert');
2
+
1
3
  // Models
2
- import { SecurityProto } from '../../../fintekkers/models/security/security_pb';
3
- import { CouponFrequencyProto } from '../../../fintekkers/models/security/coupon_frequency_pb';
4
- import { DecimalValueProto } from '../../../fintekkers/models/util/decimal_value_pb';
5
- import { CouponTypeProto } from '../../../fintekkers/models/security/coupon_type_pb';
6
- import { SecurityTypeProto } from '../../../fintekkers/models/security/security_type_pb';
7
- import { LocalDateProto } from '../../../fintekkers/models/util/local_date_pb';
8
4
 
9
5
  // Model Utils
10
6
  import { FieldProto } from '../../../fintekkers/models/position/field_pb';
11
-
12
- import * as uuid from '../../models/utils/uuid';
13
- import * as dt from '../../models/utils/datetime';
14
-
15
- import { CreateSecurityResponseProto } from '../../../fintekkers/requests/security/create_security_response_pb';
16
7
  import { SecurityService } from './SecurityService';
17
8
  import { PositionFilter } from '../../models/position/positionfilter';
9
+ import { PositionFilterOperator } from '../../../fintekkers/models/position/position_util_pb';
10
+ import Security from '../../models/security/security';
11
+ import { ProtoSerializationUtil } from '../../models/utils/serialization';
18
12
 
19
13
  test('test the api.fintekkers.org security service by creating a maturity ladder for the US government', async () => {
20
- //TODO: Get list of all securities from the US government, with a maturity data beyond today's date
21
-
14
+ //Get list of all securities from the US government, with a maturity data beyond today's date
22
15
  const securityService = new SecurityService();
23
16
 
24
17
  const positionFilter = new PositionFilter();
25
- positionFilter.addFilter(FieldProto.SECURITY_ISSUER_NAME, "US Government");
26
- const securities = await securityService.searchSecurityAsOfNow(positionFilter);
18
+ positionFilter.addEqualsFilter(FieldProto.ASSET_CLASS, 'Fixed Income');
19
+ // positionFilter.addFilter(FieldProto.MATURITY_DATE, new Date(), PositionFilterOperator.MORE_THAN);
20
+
21
+ var securities = await securityService.searchSecurityAsOfNow(positionFilter);
22
+
23
+ assert(securities.length > 0);
24
+ let results = [];
25
+
26
+ //Map results into list of maps -> Date, Amount
27
+ for (let index in securities) {
28
+ let security: Security = securities[index];
29
+
30
+ let issuanceList = security.proto.getIssuanceInfoList();
31
+ let issuance = issuanceList && issuanceList.length > 0 ? issuanceList[0] : null;
32
+
33
+ if (issuance) {
34
+ let postAuctionQuantity: number = ProtoSerializationUtil.deserialize(issuance.getPostAuctionOutstandingQuantity());
35
+ let id: string = security.getSecurityID() ? security.getSecurityID().getIdentifierValue() : security.getID().toString();
27
36
 
37
+ let result = {
38
+ 'cusip': id,
39
+ 'issueDate': security.getIssueDate(),
40
+ 'outstandingAmount': postAuctionQuantity,
41
+ 'maturityDate': security.getMaturityDate()
42
+ };
43
+ results.push(result);
44
+ }
45
+ }
28
46
 
29
- console.log(securities.length);
47
+ console.log(results);
48
+ console.log("Done");
30
49
  //TODO: Get oustanding amount of bond
31
50
 
32
51
 
33
- //TODO: Map results into Map -> Date, Amount
34
52
 
35
53
 
36
54
  //TODO: Loose end. Asset Class is a string. Maybe should be an 'extendible' enum
37
55
  //TODO: Loose end. Security coupon rate, need to add validation logic so that coupon rate is a sensible number
38
- }, 30000);
56
+ }, 90000);
39
57
 
@@ -49,6 +49,8 @@ var uuid = require("../../models/utils/uuid");
49
49
  var dt = require("../../models/utils/datetime");
50
50
  var SecurityService_1 = require("./SecurityService");
51
51
  var positionfilter_1 = require("../../models/position/positionfilter");
52
+ var issuance_pb_1 = require("../../../fintekkers/models/security/bond/issuance_pb");
53
+ var serialization_1 = require("../../models/utils/serialization");
52
54
  test('test creating a security against the api.fintekkers.org security service', function () { return __awaiter(void 0, void 0, void 0, function () {
53
55
  var isTrue;
54
56
  return __generator(this, function (_a) {
@@ -63,7 +65,7 @@ test('test creating a security against the api.fintekkers.org security service',
63
65
  }); }, 30000);
64
66
  function testSecurity() {
65
67
  return __awaiter(this, void 0, void 0, function () {
66
- var id_proto, now, securityService, usd_security, security, faceValue, couponRate, issueDate, maturityDate, validationSummary, createSecurityResponse, searchResults;
68
+ var id_proto, now, securityService, usd_security, security, faceValue, couponRate, issueDate, maturityDate, issuance, validationSummary, createSecurityResponse, searchResults;
67
69
  return __generator(this, function (_a) {
68
70
  switch (_a.label) {
69
71
  case 0:
@@ -71,7 +73,7 @@ function testSecurity() {
71
73
  now = dt.ZonedDateTime.now();
72
74
  securityService = new SecurityService_1.SecurityService();
73
75
  return [4 /*yield*/, securityService
74
- .searchSecurity(now.toProto(), new positionfilter_1.PositionFilter().addFilter(field_pb_1.FieldProto.ASSET_CLASS, 'Cash'))
76
+ .searchSecurity(now.toProto(), new positionfilter_1.PositionFilter().addEqualsFilter(field_pb_1.FieldProto.ASSET_CLASS, 'Cash'))
75
77
  .then(function (securities) {
76
78
  return securities[0];
77
79
  })];
@@ -106,6 +108,10 @@ function testSecurity() {
106
108
  security.setMaturityDate(maturityDate);
107
109
  security.setIssuerName('US Treasury');
108
110
  security.setDescription('Dummy US Treasury 10Y Bond');
111
+ issuance = new issuance_pb_1.IssuanceProto();
112
+ issuance.setPostAuctionOutstandingQuantity(serialization_1.ProtoSerializationUtil.serialize(1000000.00));
113
+ issuance.setTotalAccepted(serialization_1.ProtoSerializationUtil.serialize(100000000.00));
114
+ security.addIssuanceInfo(issuance);
109
115
  return [4 /*yield*/, securityService.validateCreateSecurity(security)];
110
116
  case 2:
111
117
  validationSummary = _a.sent();
@@ -114,7 +120,7 @@ function testSecurity() {
114
120
  case 3:
115
121
  createSecurityResponse = _a.sent();
116
122
  expect(createSecurityResponse.getSecurityResponse()).toBeTruthy();
117
- return [4 /*yield*/, securityService.searchSecurity(now.toProto(), new positionfilter_1.PositionFilter().addFilter(field_pb_1.FieldProto.ASSET_CLASS, 'Fixed Income'))];
123
+ return [4 /*yield*/, securityService.searchSecurity(now.toProto(), new positionfilter_1.PositionFilter().addEqualsFilter(field_pb_1.FieldProto.ASSET_CLASS, 'Fixed Income'))];
118
124
  case 4:
119
125
  searchResults = _a.sent();
120
126
  expect(searchResults.length).toBeGreaterThan(0);
@@ -1 +1 @@
1
- {"version":3,"file":"security.test.js","sourceRoot":"","sources":["security.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS;AACT,+EAAgF;AAChF,+FAA+F;AAC/F,qFAAqF;AACrF,qFAAqF;AACrF,yFAAyF;AACzF,+EAA+E;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mBAAmB,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC;oBAE9C,qBAAM,eAAe,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,IAAI,+BAAc,EAAE,CAAC,eAAe,CAAC,qBAAU,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,EAAA;;oBAAjJ,aAAa,GAAG,SAAiI;oBACrJ,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;oBAEhD,sBAAO,IAAI,EAAC;;;;CACb"}
@@ -15,6 +15,8 @@ import * as dt from '../../models/utils/datetime';
15
15
  import { CreateSecurityResponseProto } from '../../../fintekkers/requests/security/create_security_response_pb';
16
16
  import { SecurityService } from './SecurityService';
17
17
  import { PositionFilter } from '../../models/position/positionfilter';
18
+ import { IssuanceProto } from '../../../fintekkers/models/security/bond/issuance_pb';
19
+ import { ProtoSerializationUtil } from '../../models/utils/serialization';
18
20
 
19
21
  test('test creating a security against the api.fintekkers.org security service', async () => {
20
22
  const isTrue = await testSecurity();
@@ -28,7 +30,7 @@ async function testSecurity(): Promise<boolean> {
28
30
  const securityService = new SecurityService();
29
31
 
30
32
  let usd_security = await securityService
31
- .searchSecurity(now.toProto(), new PositionFilter().addFilter(FieldProto.ASSET_CLASS, 'Cash'))
33
+ .searchSecurity(now.toProto(), new PositionFilter().addEqualsFilter(FieldProto.ASSET_CLASS, 'Cash'))
32
34
  .then((securities) => {
33
35
  return securities[0];
34
36
  });
@@ -68,13 +70,18 @@ async function testSecurity(): Promise<boolean> {
68
70
  security.setIssuerName('US Treasury');
69
71
  security.setDescription('Dummy US Treasury 10Y Bond');
70
72
 
73
+ const issuance = new IssuanceProto();
74
+ issuance.setPostAuctionOutstandingQuantity(ProtoSerializationUtil.serialize(1000000.00));
75
+ issuance.setTotalAccepted(ProtoSerializationUtil.serialize(100000000.00));
76
+ security.addIssuanceInfo(issuance);
77
+
71
78
  var validationSummary = await securityService.validateCreateSecurity(security);
72
79
  expect(validationSummary.getErrorsList().length).toBe(0);
73
80
 
74
81
  var createSecurityResponse: CreateSecurityResponseProto = await securityService.createSecurity(security);
75
82
  expect(createSecurityResponse.getSecurityResponse()).toBeTruthy();
76
83
 
77
- var searchResults = await securityService.searchSecurity(now.toProto(), new PositionFilter().addFilter(FieldProto.ASSET_CLASS, 'Fixed Income'));
84
+ var searchResults = await securityService.searchSecurity(now.toProto(), new PositionFilter().addEqualsFilter(FieldProto.ASSET_CLASS, 'Fixed Income'));
78
85
  expect(searchResults.length).toBeGreaterThan(0);
79
86
 
80
87
  return true;
@@ -77,7 +77,7 @@ function testTransaction() {
77
77
  portfolioService = new PortfolioService_1.PortfolioService();
78
78
  transactionService = new TransactionService_1.TransactionService();
79
79
  positionFilter = new positionfilter_1.PositionFilter();
80
- positionFilter.addFilter(field_pb_1.FieldProto.ASSET_CLASS, 'Fixed Income');
80
+ positionFilter.addEqualsFilter(field_pb_1.FieldProto.ASSET_CLASS, 'Fixed Income');
81
81
  console.time("searchSecurity");
82
82
  return [4 /*yield*/, securityService
83
83
  .searchSecurity(now.toProto(), positionFilter)
@@ -89,7 +89,7 @@ function testTransaction() {
89
89
  console.timeEnd("searchSecurity");
90
90
  security = fixedIncomeSecurities[0];
91
91
  console.time("searchPortfolio");
92
- return [4 /*yield*/, portfolioService.searchPortfolio(now.toProto(), new positionfilter_1.PositionFilter().addFilter(field_pb_1.FieldProto.PORTFOLIO_NAME, 'TEST PORTFOLIO'))];
92
+ return [4 /*yield*/, portfolioService.searchPortfolio(now.toProto(), new positionfilter_1.PositionFilter().addEqualsFilter(field_pb_1.FieldProto.PORTFOLIO_NAME, 'TEST PORTFOLIO'))];
93
93
  case 2:
94
94
  portfolios = _a.sent();
95
95
  console.timeEnd("searchPortfolio");
@@ -130,7 +130,7 @@ function testTransaction() {
130
130
  console.log("Searching transaction");
131
131
  console.time("searchTransaction");
132
132
  transactionID = uuid.UUID.fromU8Array(transactionResponse.getUuid().getRawUuid_asU8());
133
- positionFilter.addFilter(field_pb_1.FieldProto.ID, transactionID);
133
+ positionFilter.addEqualsFilter(field_pb_1.FieldProto.ID, transactionID);
134
134
  return [4 /*yield*/, transactionService.searchTransaction(now.toProto(), positionFilter)];
135
135
  case 4:
136
136
  transactions = _a.sent();
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.test.js","sourceRoot":"","sources":["transaction.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS;AACT,qFAAqF;AACrF,+EAA+E;AAE/E,cAAc;AACd,yEAA0E;AAE1E,8CAAgD;AAChD,gDAAkD;AAElD,uEAAsE;AACtE,kGAAkG;AAClG,wFAAyF;AACzF,sEAAuE;AACvE,0EAAyE;AACzE,2DAA0D;AAC1D,oEAA+D;AAG/D,+BAAkC;AAClC,uEAAsE;AAEtE,IAAI,CAAC,2DAA2D,EAAE;;;;oBACjD,qBAAM,eAAe,EAAE,EAAA;;gBAAhC,MAAM,GAAG,SAAuB;gBACtC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;;;KAC3B,EAAE,KAAK,CAAC,CAAC;AAEV,SAAe,eAAe;;;;;;oBACtB,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,CAAC;oBAC5C,GAAG,GAAG,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;oBAC7B,KAAK,GAAG,IAAI,8BAAc,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;oBAEjE,eAAe,GAAG,IAAI,iCAAe,EAAE,CAAC;oBACxC,gBAAgB,GAAG,IAAI,mCAAgB,EAAE,CAAC;oBAC1C,kBAAkB,GAAG,IAAI,uCAAkB,EAAE,CAAC;oBAE9C,cAAc,GAAG,IAAI,+BAAc,EAAE,CAAC;oBAC5C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Service();
36
36
 
37
37
  const positionFilter = new PositionFilter();
38
- positionFilter.addFilter(FieldProto.ASSET_CLASS, 'Fixed Income');
38
+ positionFilter.addEqualsFilter(FieldProto.ASSET_CLASS, 'Fixed Income');
39
39
 
40
40
  console.time("searchSecurity");
41
41
  let fixedIncomeSecurities = await securityService
@@ -50,7 +50,7 @@ async function testTransaction(): Promise<boolean> {
50
50
  console.time("searchPortfolio");
51
51
  let portfolios = await portfolioService.searchPortfolio(
52
52
  now.toProto(),
53
- new PositionFilter().addFilter(FieldProto.PORTFOLIO_NAME, 'TEST PORTFOLIO'));
53
+ new PositionFilter().addEqualsFilter(FieldProto.PORTFOLIO_NAME, 'TEST PORTFOLIO'));
54
54
  console.timeEnd("searchPortfolio");
55
55
 
56
56
  if (portfolios === undefined) {
@@ -100,7 +100,7 @@ async function testTransaction(): Promise<boolean> {
100
100
  console.time("searchTransaction");
101
101
 
102
102
  const transactionID = uuid.UUID.fromU8Array(transactionResponse.getUuid().getRawUuid_asU8());
103
- positionFilter.addFilter(FieldProto.ID, transactionID);
103
+ positionFilter.addEqualsFilter(FieldProto.ID, transactionID);
104
104
  const transactions = await transactionService.searchTransaction(now.toProto(), positionFilter);
105
105
  console.timeEnd("searchTransaction");
106
106
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fintekkers/ledger-models",
3
3
  "todo": "Replace the version with build script version number",
4
- "version": "0.1.64",
4
+ "version": "0.1.67",
5
5
  "description": "ledger model protos ",
6
6
  "authors": [
7
7
  "David Doherty",
@@ -38,10 +38,10 @@ export class IssuanceProto extends jspb.Message {
38
38
  hasAuctionIssueDate(): boolean;
39
39
  clearAuctionIssueDate(): IssuanceProto;
40
40
 
41
- getPreauctionOutstandingQuantity(): fintekkers_models_util_decimal_value_pb.DecimalValueProto | undefined;
42
- setPreauctionOutstandingQuantity(value?: fintekkers_models_util_decimal_value_pb.DecimalValueProto): IssuanceProto;
43
- hasPreauctionOutstandingQuantity(): boolean;
44
- clearPreauctionOutstandingQuantity(): IssuanceProto;
41
+ getPostAuctionOutstandingQuantity(): fintekkers_models_util_decimal_value_pb.DecimalValueProto | undefined;
42
+ setPostAuctionOutstandingQuantity(value?: fintekkers_models_util_decimal_value_pb.DecimalValueProto): IssuanceProto;
43
+ hasPostAuctionOutstandingQuantity(): boolean;
44
+ clearPostAuctionOutstandingQuantity(): IssuanceProto;
45
45
 
46
46
  getAuctionOfferingAmount(): fintekkers_models_util_decimal_value_pb.DecimalValueProto | undefined;
47
47
  setAuctionOfferingAmount(value?: fintekkers_models_util_decimal_value_pb.DecimalValueProto): IssuanceProto;
@@ -56,6 +56,16 @@ export class IssuanceProto extends jspb.Message {
56
56
  hasPriceForSinglePriceAuction(): boolean;
57
57
  clearPriceForSinglePriceAuction(): IssuanceProto;
58
58
 
59
+ getTotalAccepted(): fintekkers_models_util_decimal_value_pb.DecimalValueProto | undefined;
60
+ setTotalAccepted(value?: fintekkers_models_util_decimal_value_pb.DecimalValueProto): IssuanceProto;
61
+ hasTotalAccepted(): boolean;
62
+ clearTotalAccepted(): IssuanceProto;
63
+
64
+ getMatureSecurityAmount(): fintekkers_models_util_decimal_value_pb.DecimalValueProto | undefined;
65
+ setMatureSecurityAmount(value?: fintekkers_models_util_decimal_value_pb.DecimalValueProto): IssuanceProto;
66
+ hasMatureSecurityAmount(): boolean;
67
+ clearMatureSecurityAmount(): IssuanceProto;
68
+
59
69
  serializeBinary(): Uint8Array;
60
70
  toObject(includeInstance?: boolean): IssuanceProto.AsObject;
61
71
  static toObject(includeInstance: boolean, msg: IssuanceProto): IssuanceProto.AsObject;
@@ -73,10 +83,12 @@ export namespace IssuanceProto {
73
83
  validTo?: fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.AsObject,
74
84
  auctionAnnouncementDate?: fintekkers_models_util_local_date_pb.LocalDateProto.AsObject,
75
85
  auctionIssueDate?: fintekkers_models_util_local_date_pb.LocalDateProto.AsObject,
76
- preauctionOutstandingQuantity?: fintekkers_models_util_decimal_value_pb.DecimalValueProto.AsObject,
86
+ postAuctionOutstandingQuantity?: fintekkers_models_util_decimal_value_pb.DecimalValueProto.AsObject,
77
87
  auctionOfferingAmount?: fintekkers_models_util_decimal_value_pb.DecimalValueProto.AsObject,
78
88
  auctionType: fintekkers_models_security_bond_auction_type_pb.AuctionTypeProto,
79
89
  priceForSinglePriceAuction?: fintekkers_models_util_decimal_value_pb.DecimalValueProto.AsObject,
90
+ totalAccepted?: fintekkers_models_util_decimal_value_pb.DecimalValueProto.AsObject,
91
+ matureSecurityAmount?: fintekkers_models_util_decimal_value_pb.DecimalValueProto.AsObject,
80
92
  }
81
93
  }
82
94
 
@@ -84,10 +84,12 @@ proto.fintekkers.models.security.bond.IssuanceProto.toObject = function(includeI
84
84
  validTo: (f = msg.getValidTo()) && fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.toObject(includeInstance, f),
85
85
  auctionAnnouncementDate: (f = msg.getAuctionAnnouncementDate()) && fintekkers_models_util_local_date_pb.LocalDateProto.toObject(includeInstance, f),
86
86
  auctionIssueDate: (f = msg.getAuctionIssueDate()) && fintekkers_models_util_local_date_pb.LocalDateProto.toObject(includeInstance, f),
87
- preauctionOutstandingQuantity: (f = msg.getPreauctionOutstandingQuantity()) && fintekkers_models_util_decimal_value_pb.DecimalValueProto.toObject(includeInstance, f),
87
+ postAuctionOutstandingQuantity: (f = msg.getPostAuctionOutstandingQuantity()) && fintekkers_models_util_decimal_value_pb.DecimalValueProto.toObject(includeInstance, f),
88
88
  auctionOfferingAmount: (f = msg.getAuctionOfferingAmount()) && fintekkers_models_util_decimal_value_pb.DecimalValueProto.toObject(includeInstance, f),
89
89
  auctionType: jspb.Message.getFieldWithDefault(msg, 24, 0),
90
- priceForSinglePriceAuction: (f = msg.getPriceForSinglePriceAuction()) && fintekkers_models_util_decimal_value_pb.DecimalValueProto.toObject(includeInstance, f)
90
+ priceForSinglePriceAuction: (f = msg.getPriceForSinglePriceAuction()) && fintekkers_models_util_decimal_value_pb.DecimalValueProto.toObject(includeInstance, f),
91
+ totalAccepted: (f = msg.getTotalAccepted()) && fintekkers_models_util_decimal_value_pb.DecimalValueProto.toObject(includeInstance, f),
92
+ matureSecurityAmount: (f = msg.getMatureSecurityAmount()) && fintekkers_models_util_decimal_value_pb.DecimalValueProto.toObject(includeInstance, f)
91
93
  };
92
94
 
93
95
  if (includeInstance) {
@@ -160,7 +162,7 @@ proto.fintekkers.models.security.bond.IssuanceProto.deserializeBinaryFromReader
160
162
  case 22:
161
163
  var value = new fintekkers_models_util_decimal_value_pb.DecimalValueProto;
162
164
  reader.readMessage(value,fintekkers_models_util_decimal_value_pb.DecimalValueProto.deserializeBinaryFromReader);
163
- msg.setPreauctionOutstandingQuantity(value);
165
+ msg.setPostAuctionOutstandingQuantity(value);
164
166
  break;
165
167
  case 23:
166
168
  var value = new fintekkers_models_util_decimal_value_pb.DecimalValueProto;
@@ -176,6 +178,16 @@ proto.fintekkers.models.security.bond.IssuanceProto.deserializeBinaryFromReader
176
178
  reader.readMessage(value,fintekkers_models_util_decimal_value_pb.DecimalValueProto.deserializeBinaryFromReader);
177
179
  msg.setPriceForSinglePriceAuction(value);
178
180
  break;
181
+ case 26:
182
+ var value = new fintekkers_models_util_decimal_value_pb.DecimalValueProto;
183
+ reader.readMessage(value,fintekkers_models_util_decimal_value_pb.DecimalValueProto.deserializeBinaryFromReader);
184
+ msg.setTotalAccepted(value);
185
+ break;
186
+ case 27:
187
+ var value = new fintekkers_models_util_decimal_value_pb.DecimalValueProto;
188
+ reader.readMessage(value,fintekkers_models_util_decimal_value_pb.DecimalValueProto.deserializeBinaryFromReader);
189
+ msg.setMatureSecurityAmount(value);
190
+ break;
179
191
  default:
180
192
  reader.skipField();
181
193
  break;
@@ -259,7 +271,7 @@ proto.fintekkers.models.security.bond.IssuanceProto.serializeBinaryToWriter = fu
259
271
  fintekkers_models_util_local_date_pb.LocalDateProto.serializeBinaryToWriter
260
272
  );
261
273
  }
262
- f = message.getPreauctionOutstandingQuantity();
274
+ f = message.getPostAuctionOutstandingQuantity();
263
275
  if (f != null) {
264
276
  writer.writeMessage(
265
277
  22,
@@ -290,6 +302,22 @@ proto.fintekkers.models.security.bond.IssuanceProto.serializeBinaryToWriter = fu
290
302
  fintekkers_models_util_decimal_value_pb.DecimalValueProto.serializeBinaryToWriter
291
303
  );
292
304
  }
305
+ f = message.getTotalAccepted();
306
+ if (f != null) {
307
+ writer.writeMessage(
308
+ 26,
309
+ f,
310
+ fintekkers_models_util_decimal_value_pb.DecimalValueProto.serializeBinaryToWriter
311
+ );
312
+ }
313
+ f = message.getMatureSecurityAmount();
314
+ if (f != null) {
315
+ writer.writeMessage(
316
+ 27,
317
+ f,
318
+ fintekkers_models_util_decimal_value_pb.DecimalValueProto.serializeBinaryToWriter
319
+ );
320
+ }
293
321
  };
294
322
 
295
323
 
@@ -515,10 +543,10 @@ proto.fintekkers.models.security.bond.IssuanceProto.prototype.hasAuctionIssueDat
515
543
 
516
544
 
517
545
  /**
518
- * optional fintekkers.models.util.DecimalValueProto preauction_outstanding_quantity = 22;
546
+ * optional fintekkers.models.util.DecimalValueProto post_auction_outstanding_quantity = 22;
519
547
  * @return {?proto.fintekkers.models.util.DecimalValueProto}
520
548
  */
521
- proto.fintekkers.models.security.bond.IssuanceProto.prototype.getPreauctionOutstandingQuantity = function() {
549
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.getPostAuctionOutstandingQuantity = function() {
522
550
  return /** @type{?proto.fintekkers.models.util.DecimalValueProto} */ (
523
551
  jspb.Message.getWrapperField(this, fintekkers_models_util_decimal_value_pb.DecimalValueProto, 22));
524
552
  };
@@ -528,7 +556,7 @@ proto.fintekkers.models.security.bond.IssuanceProto.prototype.getPreauctionOutst
528
556
  * @param {?proto.fintekkers.models.util.DecimalValueProto|undefined} value
529
557
  * @return {!proto.fintekkers.models.security.bond.IssuanceProto} returns this
530
558
  */
531
- proto.fintekkers.models.security.bond.IssuanceProto.prototype.setPreauctionOutstandingQuantity = function(value) {
559
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.setPostAuctionOutstandingQuantity = function(value) {
532
560
  return jspb.Message.setWrapperField(this, 22, value);
533
561
  };
534
562
 
@@ -537,8 +565,8 @@ proto.fintekkers.models.security.bond.IssuanceProto.prototype.setPreauctionOutst
537
565
  * Clears the message field making it undefined.
538
566
  * @return {!proto.fintekkers.models.security.bond.IssuanceProto} returns this
539
567
  */
540
- proto.fintekkers.models.security.bond.IssuanceProto.prototype.clearPreauctionOutstandingQuantity = function() {
541
- return this.setPreauctionOutstandingQuantity(undefined);
568
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.clearPostAuctionOutstandingQuantity = function() {
569
+ return this.setPostAuctionOutstandingQuantity(undefined);
542
570
  };
543
571
 
544
572
 
@@ -546,7 +574,7 @@ proto.fintekkers.models.security.bond.IssuanceProto.prototype.clearPreauctionOut
546
574
  * Returns whether this field is set.
547
575
  * @return {boolean}
548
576
  */
549
- proto.fintekkers.models.security.bond.IssuanceProto.prototype.hasPreauctionOutstandingQuantity = function() {
577
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.hasPostAuctionOutstandingQuantity = function() {
550
578
  return jspb.Message.getField(this, 22) != null;
551
579
  };
552
580
 
@@ -643,4 +671,78 @@ proto.fintekkers.models.security.bond.IssuanceProto.prototype.hasPriceForSingleP
643
671
  };
644
672
 
645
673
 
674
+ /**
675
+ * optional fintekkers.models.util.DecimalValueProto total_accepted = 26;
676
+ * @return {?proto.fintekkers.models.util.DecimalValueProto}
677
+ */
678
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.getTotalAccepted = function() {
679
+ return /** @type{?proto.fintekkers.models.util.DecimalValueProto} */ (
680
+ jspb.Message.getWrapperField(this, fintekkers_models_util_decimal_value_pb.DecimalValueProto, 26));
681
+ };
682
+
683
+
684
+ /**
685
+ * @param {?proto.fintekkers.models.util.DecimalValueProto|undefined} value
686
+ * @return {!proto.fintekkers.models.security.bond.IssuanceProto} returns this
687
+ */
688
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.setTotalAccepted = function(value) {
689
+ return jspb.Message.setWrapperField(this, 26, value);
690
+ };
691
+
692
+
693
+ /**
694
+ * Clears the message field making it undefined.
695
+ * @return {!proto.fintekkers.models.security.bond.IssuanceProto} returns this
696
+ */
697
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.clearTotalAccepted = function() {
698
+ return this.setTotalAccepted(undefined);
699
+ };
700
+
701
+
702
+ /**
703
+ * Returns whether this field is set.
704
+ * @return {boolean}
705
+ */
706
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.hasTotalAccepted = function() {
707
+ return jspb.Message.getField(this, 26) != null;
708
+ };
709
+
710
+
711
+ /**
712
+ * optional fintekkers.models.util.DecimalValueProto mature_security_amount = 27;
713
+ * @return {?proto.fintekkers.models.util.DecimalValueProto}
714
+ */
715
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.getMatureSecurityAmount = function() {
716
+ return /** @type{?proto.fintekkers.models.util.DecimalValueProto} */ (
717
+ jspb.Message.getWrapperField(this, fintekkers_models_util_decimal_value_pb.DecimalValueProto, 27));
718
+ };
719
+
720
+
721
+ /**
722
+ * @param {?proto.fintekkers.models.util.DecimalValueProto|undefined} value
723
+ * @return {!proto.fintekkers.models.security.bond.IssuanceProto} returns this
724
+ */
725
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.setMatureSecurityAmount = function(value) {
726
+ return jspb.Message.setWrapperField(this, 27, value);
727
+ };
728
+
729
+
730
+ /**
731
+ * Clears the message field making it undefined.
732
+ * @return {!proto.fintekkers.models.security.bond.IssuanceProto} returns this
733
+ */
734
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.clearMatureSecurityAmount = function() {
735
+ return this.setMatureSecurityAmount(undefined);
736
+ };
737
+
738
+
739
+ /**
740
+ * Returns whether this field is set.
741
+ * @return {boolean}
742
+ */
743
+ proto.fintekkers.models.security.bond.IssuanceProto.prototype.hasMatureSecurityAmount = function() {
744
+ return jspb.Message.getField(this, 27) != null;
745
+ };
746
+
747
+
646
748
  goog.object.extend(exports, proto.fintekkers.models.security.bond);