@fintekkers/ledger-models 0.1.119 → 0.1.129
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.
- package/.npmrc.example +4 -0
- package/catalog/fields.json +275 -0
- package/catalog/measures.json +259 -0
- package/node/fintekkers/models/portfolio/portfolio_pb.js +13 -19
- package/node/fintekkers/models/position/field_pb.js +1 -7
- package/node/fintekkers/models/position/measure_pb.d.ts +18 -0
- package/node/fintekkers/models/position/measure_pb.js +20 -8
- package/node/fintekkers/models/position/position_filter_pb.js +7 -13
- package/node/fintekkers/models/position/position_pb.d.ts +7 -0
- package/node/fintekkers/models/position/position_pb.js +64 -17
- package/node/fintekkers/models/position/position_status_pb.js +1 -7
- package/node/fintekkers/models/position/position_util_pb.js +11 -17
- package/node/fintekkers/models/price/price_pb.d.ts +4 -0
- package/node/fintekkers/models/price/price_pb.js +45 -19
- package/node/fintekkers/models/price/price_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/price/price_type_pb.d.ts +15 -0
- package/node/fintekkers/models/price/price_type_pb.js +30 -0
- package/node/fintekkers/models/security/bond/auction_type_pb.js +1 -7
- package/node/fintekkers/models/security/bond/issuance_pb.js +17 -23
- package/node/fintekkers/models/security/coupon_frequency_pb.js +1 -7
- package/node/fintekkers/models/security/coupon_type_pb.js +1 -7
- package/node/fintekkers/models/security/identifier/identifier_pb.js +9 -15
- package/node/fintekkers/models/security/identifier/identifier_type_pb.d.ts +1 -0
- package/node/fintekkers/models/security/identifier/identifier_type_pb.js +2 -7
- package/node/fintekkers/models/security/index/index_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/index/index_type_pb.d.ts +26 -0
- package/node/fintekkers/models/security/index/index_type_pb.js +41 -0
- package/node/fintekkers/models/security/index_composition_pb.d.ts +126 -0
- package/node/fintekkers/models/security/index_composition_pb.js +992 -0
- package/node/fintekkers/models/security/security_pb.d.ts +382 -0
- package/node/fintekkers/models/security/security_pb.js +3183 -57
- package/node/fintekkers/models/security/security_quantity_type_pb.js +1 -7
- package/node/fintekkers/models/security/security_type_pb.d.ts +3 -0
- package/node/fintekkers/models/security/security_type_pb.js +5 -8
- package/node/fintekkers/models/security/tenor_pb.js +9 -15
- package/node/fintekkers/models/security/tenor_type_pb.js +1 -7
- package/node/fintekkers/models/strategy/strategy_allocation_pb.js +13 -19
- package/node/fintekkers/models/strategy/strategy_pb.js +14 -20
- package/node/fintekkers/models/transaction/transaction_pb.js +24 -30
- package/node/fintekkers/models/transaction/transaction_type_pb.js +1 -7
- package/node/fintekkers/models/util/api/api_key_pb.js +10 -16
- package/node/fintekkers/models/util/currency_pb.d.ts +27 -0
- package/node/fintekkers/models/util/currency_pb.js +170 -0
- package/node/fintekkers/models/util/date_range_pb.js +8 -14
- package/node/fintekkers/models/util/decimal_value_pb.js +4 -10
- package/node/fintekkers/models/util/endpoint_pb.js +7 -13
- package/node/fintekkers/models/util/local_date_pb.js +5 -11
- package/node/fintekkers/models/util/local_timestamp_pb.js +5 -11
- package/node/fintekkers/models/util/lock/node_partition_pb.js +9 -15
- package/node/fintekkers/models/util/lock/node_state_pb.js +10 -16
- package/node/fintekkers/models/util/uuid_pb.js +3 -9
- package/node/fintekkers/models/valuation/cashflow_pb.d.ts +57 -0
- package/node/fintekkers/models/valuation/cashflow_pb.js +401 -0
- package/node/fintekkers/requests/index_composition/create_index_composition_request_pb.d.ts +79 -0
- package/node/fintekkers/requests/index_composition/create_index_composition_request_pb.js +599 -0
- package/node/fintekkers/requests/index_composition/get_index_composition_request_pb.d.ts +84 -0
- package/node/fintekkers/requests/index_composition/get_index_composition_request_pb.js +624 -0
- package/node/fintekkers/requests/portfolio/create_portfolio_request_pb.js +7 -13
- package/node/fintekkers/requests/portfolio/create_portfolio_response_pb.js +8 -14
- package/node/fintekkers/requests/portfolio/query_portfolio_request_pb.d.ts +3 -0
- package/node/fintekkers/requests/portfolio/query_portfolio_request_pb.js +39 -15
- package/node/fintekkers/requests/portfolio/query_portfolio_response_pb.js +8 -14
- package/node/fintekkers/requests/position/query_position_request_pb.js +15 -27
- package/node/fintekkers/requests/position/query_position_response_pb.js +10 -16
- package/node/fintekkers/requests/price/create_price_request_pb.js +7 -13
- package/node/fintekkers/requests/price/create_price_response_pb.js +8 -14
- package/node/fintekkers/requests/price/query_price_request_pb.js +12 -18
- package/node/fintekkers/requests/price/query_price_response_pb.js +8 -14
- package/node/fintekkers/requests/security/create_security_request_pb.js +7 -13
- package/node/fintekkers/requests/security/create_security_response_pb.js +9 -15
- package/node/fintekkers/requests/security/get_field_values_request_pb.js +7 -13
- package/node/fintekkers/requests/security/get_field_values_response_pb.js +7 -13
- package/node/fintekkers/requests/security/get_fields_response_pb.js +8 -17
- package/node/fintekkers/requests/security/query_security_request_pb.d.ts +3 -0
- package/node/fintekkers/requests/security/query_security_request_pb.js +39 -15
- package/node/fintekkers/requests/security/query_security_response_pb.js +9 -15
- package/node/fintekkers/requests/transaction/create_transaction_request_pb.js +7 -13
- package/node/fintekkers/requests/transaction/create_transaction_response_pb.js +8 -14
- package/node/fintekkers/requests/transaction/query_transaction_request_pb.js +10 -16
- package/node/fintekkers/requests/transaction/query_transaction_response_pb.js +9 -15
- package/node/fintekkers/requests/util/delete_request_pb.d.ts +135 -0
- package/node/fintekkers/requests/util/delete_request_pb.js +1051 -0
- package/node/fintekkers/requests/util/errors/error_pb.js +7 -13
- package/node/fintekkers/requests/util/errors/message_pb.js +6 -12
- package/node/fintekkers/requests/util/errors/summary_pb.js +4 -10
- package/node/fintekkers/requests/util/lock/lock_request_pb.js +8 -14
- package/node/fintekkers/requests/util/lock/lock_response_pb.js +9 -15
- package/node/fintekkers/requests/util/operation_pb.js +1 -7
- package/node/fintekkers/requests/valuation/curve_request_pb.d.ts +85 -0
- package/node/fintekkers/requests/valuation/curve_request_pb.js +646 -0
- package/node/fintekkers/requests/valuation/curve_response_pb.d.ts +105 -0
- package/node/fintekkers/requests/valuation/curve_response_pb.js +806 -0
- package/node/fintekkers/requests/valuation/product_inputs.test.ts +172 -0
- package/node/fintekkers/requests/valuation/product_inputs_pb.d.ts +239 -0
- package/node/fintekkers/requests/valuation/product_inputs_pb.js +1801 -0
- package/node/fintekkers/requests/valuation/valuation_request_pb.d.ts +19 -0
- package/node/fintekkers/requests/valuation/valuation_request_pb.js +168 -22
- package/node/fintekkers/requests/valuation/valuation_response_pb.d.ts +13 -0
- package/node/fintekkers/requests/valuation/valuation_response_pb.js +118 -16
- package/node/fintekkers/services/index-composition-service/index_composition_service_grpc_pb.d.ts +60 -0
- package/node/fintekkers/services/index-composition-service/index_composition_service_grpc_pb.js +87 -0
- package/node/fintekkers/services/index-composition-service/index_composition_service_pb.d.ts +9 -0
- package/node/fintekkers/services/index-composition-service/index_composition_service_pb.js +21 -0
- package/node/fintekkers/services/lock-service/lock_service_grpc_pb.js +22 -22
- package/node/fintekkers/services/lock-service/lock_service_pb.js +15 -21
- package/node/fintekkers/services/portfolio-service/portfolio_service_grpc_pb.d.ts +18 -0
- package/node/fintekkers/services/portfolio-service/portfolio_service_grpc_pb.js +39 -5
- package/node/fintekkers/services/portfolio-service/portfolio_service_pb.d.ts +1 -0
- package/node/fintekkers/services/portfolio-service/portfolio_service_pb.js +3 -7
- package/node/fintekkers/services/position-service/position_service_grpc_pb.d.ts +37 -0
- package/node/fintekkers/services/position-service/position_service_grpc_pb.js +64 -6
- package/node/fintekkers/services/position-service/position_service_pb.d.ts +3 -0
- package/node/fintekkers/services/position-service/position_service_pb.js +7 -7
- package/node/fintekkers/services/price-service/price_service_grpc_pb.js +5 -5
- package/node/fintekkers/services/price-service/price_service_pb.js +1 -7
- package/node/fintekkers/services/security-service/security_service_grpc_pb.d.ts +18 -0
- package/node/fintekkers/services/security-service/security_service_grpc_pb.js +43 -9
- package/node/fintekkers/services/security-service/security_service_pb.d.ts +1 -0
- package/node/fintekkers/services/security-service/security_service_pb.js +3 -7
- package/node/fintekkers/services/transaction-service/transaction_service_grpc_pb.d.ts +55 -0
- package/node/fintekkers/services/transaction-service/transaction_service_grpc_pb.js +97 -5
- package/node/fintekkers/services/transaction-service/transaction_service_pb.d.ts +4 -0
- package/node/fintekkers/services/transaction-service/transaction_service_pb.js +9 -7
- package/node/fintekkers/services/valuation-service/valuation_service_grpc_pb.d.ts +19 -0
- package/node/fintekkers/services/valuation-service/valuation_service_grpc_pb.js +37 -2
- package/node/fintekkers/services/valuation-service/valuation_service_pb.d.ts +2 -0
- package/node/fintekkers/services/valuation-service/valuation_service_pb.js +5 -7
- package/node/wrappers/models/portfolio/portfolio.js.map +1 -1
- package/node/wrappers/models/portfolio/portfolio.test.d.ts +2 -0
- package/node/wrappers/models/portfolio/portfolio.test.js +29 -0
- package/node/wrappers/models/portfolio/portfolio.test.js.map +1 -0
- package/node/wrappers/models/portfolio/portfolio.test.ts +28 -0
- package/node/wrappers/models/position/position.js +25 -13
- package/node/wrappers/models/position/position.js.map +1 -1
- package/node/wrappers/models/position/position.test.js +20 -0
- package/node/wrappers/models/position/position.test.js.map +1 -1
- package/node/wrappers/models/position/position.test.ts +23 -0
- package/node/wrappers/models/position/position.ts +27 -13
- package/node/wrappers/models/position/positionfilter.js +1 -1
- package/node/wrappers/models/position/positionfilter.js.map +1 -1
- package/node/wrappers/models/position/positionfilter.test.js.map +1 -1
- package/node/wrappers/models/price/Price.cash.test.d.ts +1 -0
- package/node/wrappers/models/price/Price.cash.test.js +42 -0
- package/node/wrappers/models/price/Price.cash.test.js.map +1 -0
- package/node/wrappers/models/price/Price.cash.test.ts +43 -0
- package/node/wrappers/models/price/Price.d.ts +38 -0
- package/node/wrappers/models/price/Price.js +111 -0
- package/node/wrappers/models/price/Price.js.map +1 -0
- package/node/wrappers/models/price/Price.test.d.ts +1 -0
- package/node/wrappers/models/price/Price.test.js +55 -0
- package/node/wrappers/models/price/Price.test.js.map +1 -0
- package/node/wrappers/models/price/Price.test.ts +63 -0
- package/node/wrappers/models/price/Price.ts +123 -0
- package/node/wrappers/models/security/BondSecurity.d.ts +17 -2
- package/node/wrappers/models/security/BondSecurity.js +59 -11
- package/node/wrappers/models/security/BondSecurity.js.map +1 -1
- package/node/wrappers/models/security/BondSecurity.priceScale.test.d.ts +1 -0
- package/node/wrappers/models/security/BondSecurity.priceScale.test.js +36 -0
- package/node/wrappers/models/security/BondSecurity.priceScale.test.js.map +1 -0
- package/node/wrappers/models/security/BondSecurity.priceScale.test.ts +36 -0
- package/node/wrappers/models/security/BondSecurity.test.js +34 -1
- package/node/wrappers/models/security/BondSecurity.test.js.map +1 -1
- package/node/wrappers/models/security/BondSecurity.test.ts +42 -1
- package/node/wrappers/models/security/BondSecurity.ts +63 -11
- package/node/wrappers/models/security/security-roundtrip.test.d.ts +1 -0
- package/node/wrappers/models/security/security-roundtrip.test.js +173 -0
- package/node/wrappers/models/security/security-roundtrip.test.js.map +1 -0
- package/node/wrappers/models/security/security-roundtrip.test.ts +192 -0
- package/node/wrappers/models/security/security.d.ts +8 -0
- package/node/wrappers/models/security/security.js +24 -2
- package/node/wrappers/models/security/security.js.map +1 -1
- package/node/wrappers/models/security/security.ts +26 -2
- package/node/wrappers/models/security/term.js +31 -6
- package/node/wrappers/models/security/term.js.map +1 -1
- package/node/wrappers/models/security/term.test.js +21 -2
- package/node/wrappers/models/security/term.test.js.map +1 -1
- package/node/wrappers/models/security/term.test.ts +28 -2
- package/node/wrappers/models/security/term.ts +34 -6
- package/node/wrappers/models/transaction/transaction.d.ts +59 -1
- package/node/wrappers/models/transaction/transaction.derived.test.d.ts +1 -0
- package/node/wrappers/models/transaction/transaction.derived.test.js +199 -0
- package/node/wrappers/models/transaction/transaction.derived.test.js.map +1 -0
- package/node/wrappers/models/transaction/transaction.derived.test.ts +251 -0
- package/node/wrappers/models/transaction/transaction.js +350 -2
- package/node/wrappers/models/transaction/transaction.js.map +1 -1
- package/node/wrappers/models/transaction/transaction.ts +416 -2
- package/node/wrappers/models/transaction/transaction_constructor.test.d.ts +1 -0
- package/node/wrappers/models/transaction/transaction_constructor.test.js +100 -0
- package/node/wrappers/models/transaction/transaction_constructor.test.js.map +1 -0
- package/node/wrappers/models/transaction/transaction_constructor.test.ts +111 -0
- package/node/wrappers/models/transaction/transaction_type.js.map +1 -1
- package/node/wrappers/models/utils/datetime.d.ts +6 -0
- package/node/wrappers/models/utils/datetime.js +14 -6
- package/node/wrappers/models/utils/datetime.js.map +1 -1
- package/node/wrappers/models/utils/datetime.ts +15 -6
- package/node/wrappers/models/utils/protoEnum.js.map +1 -1
- package/node/wrappers/models/utils/requestcontext.d.ts +17 -3
- package/node/wrappers/models/utils/requestcontext.js +39 -7
- package/node/wrappers/models/utils/requestcontext.js.map +1 -1
- package/node/wrappers/models/utils/requestcontext.test.d.ts +1 -0
- package/node/wrappers/models/utils/requestcontext.test.js +108 -0
- package/node/wrappers/models/utils/requestcontext.test.js.map +1 -0
- package/node/wrappers/models/utils/requestcontext.test.ts +85 -0
- package/node/wrappers/models/utils/requestcontext.ts +49 -9
- package/node/wrappers/models/utils/serialization.d.ts +2 -1
- package/node/wrappers/models/utils/serialization.js +4 -0
- package/node/wrappers/models/utils/serialization.js.map +1 -1
- package/node/wrappers/models/utils/serialization.test.js +15 -0
- package/node/wrappers/models/utils/serialization.test.js.map +1 -1
- package/node/wrappers/models/utils/serialization.test.ts +19 -1
- package/node/wrappers/models/utils/serialization.ts +5 -4
- package/node/wrappers/models/utils/serialization.util.js.map +1 -1
- package/node/wrappers/models/utils/uuid.js +9 -1
- package/node/wrappers/models/utils/uuid.js.map +1 -1
- package/node/wrappers/models/utils/uuid.test.js +22 -4
- package/node/wrappers/models/utils/uuid.test.js.map +1 -1
- package/node/wrappers/models/utils/uuid.test.ts +26 -5
- package/node/wrappers/models/utils/uuid.ts +7 -1
- package/node/wrappers/services/apikey.test.d.ts +7 -0
- package/node/wrappers/services/apikey.test.js +56 -0
- package/node/wrappers/services/apikey.test.js.map +1 -0
- package/node/wrappers/services/apikey.test.ts +65 -0
- package/node/wrappers/services/portfolio-service/PortfolioService.d.ts +1 -1
- package/node/wrappers/services/portfolio-service/PortfolioService.js +8 -2
- package/node/wrappers/services/portfolio-service/PortfolioService.js.map +1 -1
- package/node/wrappers/services/portfolio-service/PortfolioService.ts +7 -2
- package/node/wrappers/services/position-service/PositionService.d.ts +1 -1
- package/node/wrappers/services/position-service/PositionService.js +8 -2
- package/node/wrappers/services/position-service/PositionService.js.map +1 -1
- package/node/wrappers/services/position-service/PositionService.ts +7 -2
- package/node/wrappers/services/position-service/position.test.js.map +1 -1
- package/node/wrappers/services/price-service/PriceService.d.ts +29 -0
- package/node/wrappers/services/price-service/PriceService.js +151 -0
- package/node/wrappers/services/price-service/PriceService.js.map +1 -0
- package/node/wrappers/services/price-service/PriceService.ts +127 -0
- package/node/wrappers/services/price-service/price-wrapper.test.d.ts +1 -0
- package/node/wrappers/services/price-service/price-wrapper.test.js +132 -0
- package/node/wrappers/services/price-service/price-wrapper.test.js.map +1 -0
- package/node/wrappers/services/price-service/price-wrapper.test.ts +120 -0
- package/node/wrappers/services/price-service/price.test.d.ts +1 -0
- package/node/wrappers/services/price-service/price.test.js +198 -0
- package/node/wrappers/services/price-service/price.test.js.map +1 -0
- package/node/wrappers/services/price-service/price.test.ts +205 -0
- package/node/wrappers/services/security-service/SecurityService.d.ts +1 -1
- package/node/wrappers/services/security-service/SecurityService.js +8 -2
- package/node/wrappers/services/security-service/SecurityService.js.map +1 -1
- package/node/wrappers/services/security-service/SecurityService.searchByUuid.test.d.ts +1 -0
- package/node/wrappers/services/security-service/SecurityService.searchByUuid.test.js +38 -0
- package/node/wrappers/services/security-service/SecurityService.searchByUuid.test.js.map +1 -0
- package/node/wrappers/services/security-service/SecurityService.searchByUuid.test.ts +32 -0
- package/node/wrappers/services/security-service/SecurityService.ts +7 -2
- package/node/wrappers/services/security-service/security.maturityLadder.test.js.map +1 -1
- package/node/wrappers/services/transaction-service/TransactionService.d.ts +1 -1
- package/node/wrappers/services/transaction-service/TransactionService.js +8 -2
- package/node/wrappers/services/transaction-service/TransactionService.js.map +1 -1
- package/node/wrappers/services/transaction-service/TransactionService.ts +7 -2
- package/node/wrappers/services/transaction-service/transaction.search.test.js.map +1 -1
- package/node/wrappers/services/transaction-service/transaction.test.js.map +1 -1
- package/package.json +3 -2
- package/.env +0 -3
|
@@ -20,6 +20,9 @@ test('test Security.create returns BondSecurity with correct coupon type and fre
|
|
|
20
20
|
test('test BondSecurity.getTenor() returns correct Tenor for 10-year bond', () => {
|
|
21
21
|
testBondSecurityTenor();
|
|
22
22
|
});
|
|
23
|
+
test('test BondSecurity.getTenor() returns correct Tenor for 10-year bond with as of date', () => {
|
|
24
|
+
testBondSecurityTenorWithAsOfDate();
|
|
25
|
+
});
|
|
23
26
|
function testBondSecurityCreation() {
|
|
24
27
|
// Create a SecurityProto with BOND_SECURITY type, coupon type, and coupon frequency
|
|
25
28
|
const securityProto = new security_pb_1.SecurityProto();
|
|
@@ -112,6 +115,36 @@ function testBondSecurityTenor() {
|
|
|
112
115
|
assert(period2.months === 6, `Expected 6 months, got ${period2.months}`);
|
|
113
116
|
assert(period2.days === 5, `Expected 5 days, got ${period2.days}`);
|
|
114
117
|
}
|
|
115
|
-
|
|
118
|
+
// Days are discarded when there are no weeks (rounding logic: 6M1D -> 6M)
|
|
119
|
+
// So 2Y6M5D becomes 2Y6M
|
|
120
|
+
assert(tenor2.toString() === 'TERM: 2Y6M', `Expected "TERM: 2Y6M", got "${tenor2.toString()}"`);
|
|
121
|
+
}
|
|
122
|
+
function testBondSecurityTenorWithAsOfDate() {
|
|
123
|
+
// Create a SecurityProto with BOND_SECURITY type and dates for a 10-year bond
|
|
124
|
+
const securityProto = new security_pb_1.SecurityProto();
|
|
125
|
+
securityProto.setSecurityType(security_type_pb_1.SecurityTypeProto.BOND_SECURITY);
|
|
126
|
+
securityProto.setIssueDate(new local_date_pb_1.LocalDateProto().setYear(2021).setMonth(1).setDay(1));
|
|
127
|
+
// Set maturity date: January 1, 2031 (exactly 10 years later)
|
|
128
|
+
securityProto.setMaturityDate(new local_date_pb_1.LocalDateProto().setYear(2031).setMonth(1).setDay(1));
|
|
129
|
+
// Create BondSecurity
|
|
130
|
+
const security = security_1.default.create(securityProto);
|
|
131
|
+
const bondSecurity = security;
|
|
132
|
+
// Test getTenor()
|
|
133
|
+
const asOfDate = new Date(2026, 0, 1);
|
|
134
|
+
const tenor = bondSecurity.getTenor(asOfDate);
|
|
135
|
+
assert(tenor !== null, 'Tenor should not be null');
|
|
136
|
+
assert(tenor.getType() === tenor_type_pb_1.TenorTypeProto.TERM, 'Tenor type should be TERM');
|
|
137
|
+
const period = tenor.getTenor();
|
|
138
|
+
assert(period !== null, 'Period should not be null');
|
|
139
|
+
if (period) {
|
|
140
|
+
assert(period.years === 5, `Expected 5 years, got ${period.years}`);
|
|
141
|
+
assert(period.months === 0, `Expected 0 months, got ${period.months}`);
|
|
142
|
+
assert(period.days === 0, `Expected 0 days, got ${period.days}`);
|
|
143
|
+
}
|
|
144
|
+
// Test tenor description
|
|
145
|
+
const tenorDescription = tenor.getTenorDescription();
|
|
146
|
+
assert(tenorDescription === '5Y', `Expected tenor description "5Y", got "${tenorDescription}"`);
|
|
147
|
+
const tenorString = tenor.toString();
|
|
148
|
+
assert(tenorString === 'TERM: 5Y', `Expected "TERM: 5Y", got "${tenorString}"`);
|
|
116
149
|
}
|
|
117
150
|
//# sourceMappingURL=BondSecurity.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BondSecurity.test.js","sourceRoot":"","sources":["BondSecurity.test.ts"],"names":[],"mappings":";;;;;AAAA,iCAAkC;AAClC,0DAAkC;AAClC,kEAA0C;AAC1C,iFAAgF;AAChF,2FAAyF;AACzF,uFAAqF;AACrF,iGAA+F;AAC/F,iFAA+E;AAC/E,uFAAqF;AACrF,wCAAqC;AAErC,qFAAmF;AAEnF,IAAI,CAAC,kFAAkF,EAAE,GAAG,EAAE;IAC1F,wBAAwB,EAAE,CAAC;AAC/B,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,qEAAqE,EAAE,GAAG,EAAE;IAC7E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AyB;IACzB,MAAM,gBAAgB,GAAG,KAAK,CAAC,mBAAmB,EAAE,CAAC;IACrD,MAAM,CAAC,gBAAgB,KAAK,IAAI,EAAE,yCAAyC,gBAAgB,GAAG,CAAC,CAAC;IAEhG,MAAM,WAAW,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;IACrC,MAAM,CAAC,WAAW,KAAK,UAAU,EAAE,6BAA6B,WAAW,GAAG,CAAC,CAAC;AACpF,CAAC"}
|
|
@@ -19,6 +19,10 @@ test('test BondSecurity.getTenor() returns correct Tenor for 10-year bond', () =
|
|
|
19
19
|
testBondSecurityTenor();
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
+
test('test BondSecurity.getTenor() returns correct Tenor for 10-year bond with as of date', () => {
|
|
23
|
+
testBondSecurityTenorWithAsOfDate();
|
|
24
|
+
});
|
|
25
|
+
|
|
22
26
|
function testBondSecurityCreation(): void {
|
|
23
27
|
// Create a SecurityProto with BOND_SECURITY type, coupon type, and coupon frequency
|
|
24
28
|
const securityProto = new SecurityProto();
|
|
@@ -127,6 +131,43 @@ function testBondSecurityTenor(): void {
|
|
|
127
131
|
assert(period2.days === 5, `Expected 5 days, got ${period2.days}`);
|
|
128
132
|
}
|
|
129
133
|
|
|
130
|
-
|
|
134
|
+
// Days are discarded when there are no weeks (rounding logic: 6M1D -> 6M)
|
|
135
|
+
// So 2Y6M5D becomes 2Y6M
|
|
136
|
+
assert(tenor2.toString() === 'TERM: 2Y6M', `Expected "TERM: 2Y6M", got "${tenor2.toString()}"`);
|
|
131
137
|
}
|
|
132
138
|
|
|
139
|
+
function testBondSecurityTenorWithAsOfDate(): void {
|
|
140
|
+
// Create a SecurityProto with BOND_SECURITY type and dates for a 10-year bond
|
|
141
|
+
const securityProto = new SecurityProto();
|
|
142
|
+
|
|
143
|
+
securityProto.setSecurityType(SecurityTypeProto.BOND_SECURITY);
|
|
144
|
+
securityProto.setIssueDate(new LocalDateProto().setYear(2021).setMonth(1).setDay(1));
|
|
145
|
+
// Set maturity date: January 1, 2031 (exactly 10 years later)
|
|
146
|
+
securityProto.setMaturityDate(new LocalDateProto().setYear(2031).setMonth(1).setDay(1));
|
|
147
|
+
|
|
148
|
+
// Create BondSecurity
|
|
149
|
+
const security = Security.create(securityProto);
|
|
150
|
+
const bondSecurity = security as BondSecurity;
|
|
151
|
+
|
|
152
|
+
// Test getTenor()
|
|
153
|
+
const asOfDate = new Date(2026, 0, 1);
|
|
154
|
+
const tenor = bondSecurity.getTenor(asOfDate);
|
|
155
|
+
|
|
156
|
+
assert(tenor !== null, 'Tenor should not be null');
|
|
157
|
+
assert(tenor.getType() === TenorTypeProto.TERM, 'Tenor type should be TERM');
|
|
158
|
+
|
|
159
|
+
const period = tenor.getTenor();
|
|
160
|
+
assert(period !== null, 'Period should not be null');
|
|
161
|
+
if (period) {
|
|
162
|
+
assert(period.years === 5, `Expected 5 years, got ${period.years}`);
|
|
163
|
+
assert(period.months === 0, `Expected 0 months, got ${period.months}`);
|
|
164
|
+
assert(period.days === 0, `Expected 0 days, got ${period.days}`);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Test tenor description
|
|
168
|
+
const tenorDescription = tenor.getTenorDescription();
|
|
169
|
+
assert(tenorDescription === '5Y', `Expected tenor description "5Y", got "${tenorDescription}"`);
|
|
170
|
+
|
|
171
|
+
const tenorString = tenor.toString();
|
|
172
|
+
assert(tenorString === 'TERM: 5Y', `Expected "TERM: 5Y", got "${tenorString}"`);
|
|
173
|
+
}
|
|
@@ -8,24 +8,31 @@ import { CouponFrequency } from './coupon_frequency';
|
|
|
8
8
|
import { CouponType } from './coupon_type';
|
|
9
9
|
import { Tenor, Period } from './term';
|
|
10
10
|
import { TenorTypeProto } from '../../../fintekkers/models/security/tenor_type_pb';
|
|
11
|
+
import { Decimal } from 'decimal.js';
|
|
11
12
|
|
|
12
13
|
class BondSecurity extends Security {
|
|
13
14
|
constructor(proto: SecurityProto) {
|
|
14
15
|
super(proto);
|
|
15
|
-
if (proto.getSecurityType() !== SecurityTypeProto.BOND_SECURITY) {
|
|
16
|
+
if (proto.getSecurityType() !== SecurityTypeProto.BOND_SECURITY && proto.getSecurityType() !== SecurityTypeProto.TIPS && proto.getSecurityType() !== SecurityTypeProto.FRN) {
|
|
16
17
|
throw new Error(
|
|
17
18
|
`BondSecurity requires BOND_SECURITY type, got ${SecurityTypeProto[proto.getSecurityType()]}`
|
|
18
19
|
);
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
/** Returns the tenor (term) of the bond as a Tenor object
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
/** Returns the tenor (term) of the bond as a Tenor object.
|
|
24
|
+
*
|
|
25
|
+
* If an 'as of date' is provided the term will be based on
|
|
26
|
+
* maturity date - as of date, instead of maturity date - issue date.
|
|
27
|
+
* @param asOfDate - [Optional]The 'as of date' to use for the tenor calculation.
|
|
28
|
+
* @returns The tenor (term) of the bond as a Tenor object.
|
|
29
|
+
*/
|
|
30
|
+
getTenor(asOfDate?: Date): Tenor {
|
|
31
|
+
const startDate = asOfDate ? asOfDate : this.getIssueDate().toDate();
|
|
25
32
|
const maturityDate = this.getMaturityDate().toDate();
|
|
26
33
|
|
|
27
34
|
// Calculate the period between issue date and maturity date
|
|
28
|
-
const period = this.calculatePeriod(
|
|
35
|
+
const period = this.calculatePeriod(startDate, maturityDate);
|
|
29
36
|
|
|
30
37
|
return new Tenor(TenorTypeProto.TERM, period);
|
|
31
38
|
}
|
|
@@ -61,36 +68,81 @@ class BondSecurity extends Security {
|
|
|
61
68
|
}
|
|
62
69
|
|
|
63
70
|
getCouponRate(): DecimalValueProto {
|
|
64
|
-
const
|
|
71
|
+
const bond = this.getBondLikeDetails();
|
|
72
|
+
const rate = bond ? bond.getCouponRate() : this.proto.getCouponRate();
|
|
65
73
|
if (!rate) throw new Error("Coupon rate is required for bonds");
|
|
66
74
|
return rate;
|
|
67
75
|
}
|
|
68
76
|
|
|
69
77
|
getFaceValue(): DecimalValueProto {
|
|
70
|
-
const
|
|
78
|
+
const bond = this.getBondLikeDetails();
|
|
79
|
+
const faceValue = bond ? bond.getFaceValue() : this.proto.getFaceValue();
|
|
71
80
|
if (!faceValue) throw new Error("Face value is required for bonds");
|
|
72
81
|
return faceValue;
|
|
73
82
|
}
|
|
74
83
|
|
|
75
84
|
getCouponType(): CouponType {
|
|
76
|
-
const
|
|
85
|
+
const bond = this.getBondLikeDetails();
|
|
86
|
+
const couponType = bond ? bond.getCouponType() : this.proto.getCouponType();
|
|
77
87
|
if (!couponType) throw new Error("Coupon Type is required for bonds");
|
|
78
88
|
return new CouponType(couponType);
|
|
79
89
|
}
|
|
80
90
|
|
|
81
91
|
getCouponFrequency(): CouponFrequency {
|
|
82
|
-
const
|
|
92
|
+
const bond = this.getBondLikeDetails();
|
|
93
|
+
const couponFrequency = bond ? bond.getCouponFrequency() : this.proto.getCouponFrequency();
|
|
83
94
|
if (!couponFrequency) throw new Error("Coupon Frequency is required for bonds");
|
|
84
95
|
return new CouponFrequency(couponFrequency);
|
|
85
96
|
}
|
|
86
97
|
|
|
87
98
|
getDatedDate(): LocalDate | undefined {
|
|
88
|
-
const
|
|
99
|
+
const bond = this.getBondLikeDetails();
|
|
100
|
+
const datedDate = bond ? bond.getDatedDate() : this.proto.getDatedDate();
|
|
89
101
|
return datedDate ? new LocalDate(datedDate) : undefined;
|
|
90
102
|
}
|
|
91
103
|
|
|
92
104
|
getIssuanceInfo(): IssuanceProto[] {
|
|
93
|
-
|
|
105
|
+
const bond = this.getBondLikeDetails();
|
|
106
|
+
return bond ? bond.getIssuanceInfoList() : this.proto.getIssuanceInfoList();
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Returns the price scale factor for bonds.
|
|
111
|
+
* Bonds are typically priced as percentages (e.g., 99.5 means 99.5%),
|
|
112
|
+
* so the price scale factor converts percentage to decimal (0.01).
|
|
113
|
+
* @returns The price scale factor as a Decimal (0.01)
|
|
114
|
+
*/
|
|
115
|
+
getPriceScaleFactor(): Decimal {
|
|
116
|
+
return new Decimal('0.01');
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
getProductType(): string {
|
|
120
|
+
// Only BondSecurity has getTenor implemented
|
|
121
|
+
// Check if getTenor method exists (it's only in BondSecurity)
|
|
122
|
+
if (typeof (this as any).getTenor !== 'function') {
|
|
123
|
+
throw new Error('getProductType() is only supported for BondSecurity');
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const tenor = (this as any).getTenor();
|
|
127
|
+
if (!tenor) {
|
|
128
|
+
throw new Error('Tenor is required to determine product type');
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const period = tenor.getTenor();
|
|
132
|
+
if (!period) {
|
|
133
|
+
throw new Error('Period is required to determine product type');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const years = period.years;
|
|
137
|
+
const months = period.months;
|
|
138
|
+
|
|
139
|
+
if (years < 1 || (years === 1 && months === 0)) {
|
|
140
|
+
return 'BILL';
|
|
141
|
+
} else if (years > 19) {
|
|
142
|
+
return 'BOND';
|
|
143
|
+
} else {
|
|
144
|
+
return 'NOTE';
|
|
145
|
+
}
|
|
94
146
|
}
|
|
95
147
|
}
|
|
96
148
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* ISSUE #7: SecurityProto round-trip serialization tests for all 6 security types.
|
|
5
|
+
*
|
|
6
|
+
* For each type: construct → serialize to bytes → deserialize → verify all fields match.
|
|
7
|
+
*/
|
|
8
|
+
const security_pb_1 = require("../../../fintekkers/models/security/security_pb");
|
|
9
|
+
const security_type_pb_1 = require("../../../fintekkers/models/security/security_type_pb");
|
|
10
|
+
const coupon_frequency_pb_1 = require("../../../fintekkers/models/security/coupon_frequency_pb");
|
|
11
|
+
const coupon_type_pb_1 = require("../../../fintekkers/models/security/coupon_type_pb");
|
|
12
|
+
const security_quantity_type_pb_1 = require("../../../fintekkers/models/security/security_quantity_type_pb");
|
|
13
|
+
const identifier_pb_1 = require("../../../fintekkers/models/security/identifier/identifier_pb");
|
|
14
|
+
const identifier_type_pb_1 = require("../../../fintekkers/models/security/identifier/identifier_type_pb");
|
|
15
|
+
const index_type_pb_1 = require("../../../fintekkers/models/security/index/index_type_pb");
|
|
16
|
+
const decimal_value_pb_1 = require("../../../fintekkers/models/util/decimal_value_pb");
|
|
17
|
+
const local_date_pb_1 = require("../../../fintekkers/models/util/local_date_pb");
|
|
18
|
+
function makeDecimal(value) {
|
|
19
|
+
return new decimal_value_pb_1.DecimalValueProto().setArbitraryPrecisionValue(value);
|
|
20
|
+
}
|
|
21
|
+
function makeDate(year, month, day) {
|
|
22
|
+
return new local_date_pb_1.LocalDateProto().setYear(year).setMonth(month).setDay(day);
|
|
23
|
+
}
|
|
24
|
+
function makeIdentifier(type, value) {
|
|
25
|
+
return new identifier_pb_1.IdentifierProto().setIdentifierType(type).setIdentifierValue(value);
|
|
26
|
+
}
|
|
27
|
+
describe('SecurityProto Round-Trip Serialization — All 6 Security Types', () => {
|
|
28
|
+
test('BOND_SECURITY: all bond fields survive round-trip', () => {
|
|
29
|
+
const original = new security_pb_1.SecurityProto();
|
|
30
|
+
original.setObjectClass('Security');
|
|
31
|
+
original.setVersion('0.0.1');
|
|
32
|
+
original.setSecurityType(security_type_pb_1.SecurityTypeProto.BOND_SECURITY);
|
|
33
|
+
original.setAssetClass('Fixed Income');
|
|
34
|
+
original.setIssuerName('US Treasury');
|
|
35
|
+
original.setQuantityType(security_quantity_type_pb_1.SecurityQuantityTypeProto.ORIGINAL_FACE_VALUE);
|
|
36
|
+
original.setIdentifier(makeIdentifier(identifier_type_pb_1.IdentifierTypeProto.CUSIP, '912828ZT0'));
|
|
37
|
+
original.setDescription('UST 5% 2030');
|
|
38
|
+
original.setCouponRate(makeDecimal('5.0'));
|
|
39
|
+
original.setCouponType(coupon_type_pb_1.CouponTypeProto.FIXED);
|
|
40
|
+
original.setCouponFrequency(coupon_frequency_pb_1.CouponFrequencyProto.SEMIANNUALLY);
|
|
41
|
+
original.setFaceValue(makeDecimal('1000'));
|
|
42
|
+
original.setIssueDate(makeDate(2020, 1, 15));
|
|
43
|
+
original.setDatedDate(makeDate(2020, 1, 15));
|
|
44
|
+
original.setMaturityDate(makeDate(2030, 1, 15));
|
|
45
|
+
const bytes = original.serializeBinary();
|
|
46
|
+
const parsed = security_pb_1.SecurityProto.deserializeBinary(bytes);
|
|
47
|
+
expect(parsed.getSecurityType()).toBe(security_type_pb_1.SecurityTypeProto.BOND_SECURITY);
|
|
48
|
+
expect(parsed.getAssetClass()).toBe('Fixed Income');
|
|
49
|
+
expect(parsed.getIssuerName()).toBe('US Treasury');
|
|
50
|
+
expect(parsed.getDescription()).toBe('UST 5% 2030');
|
|
51
|
+
expect(parsed.getQuantityType()).toBe(security_quantity_type_pb_1.SecurityQuantityTypeProto.ORIGINAL_FACE_VALUE);
|
|
52
|
+
expect(parsed.getCouponRate().getArbitraryPrecisionValue()).toBe('5.0');
|
|
53
|
+
expect(parsed.getCouponType()).toBe(coupon_type_pb_1.CouponTypeProto.FIXED);
|
|
54
|
+
expect(parsed.getCouponFrequency()).toBe(coupon_frequency_pb_1.CouponFrequencyProto.SEMIANNUALLY);
|
|
55
|
+
expect(parsed.getFaceValue().getArbitraryPrecisionValue()).toBe('1000');
|
|
56
|
+
expect(parsed.getIssueDate().getYear()).toBe(2020);
|
|
57
|
+
expect(parsed.getDatedDate().getMonth()).toBe(1);
|
|
58
|
+
expect(parsed.getMaturityDate().getYear()).toBe(2030);
|
|
59
|
+
expect(parsed.getMaturityDate().getMonth()).toBe(1);
|
|
60
|
+
expect(parsed.getMaturityDate().getDay()).toBe(15);
|
|
61
|
+
expect(parsed.getIdentifier().getIdentifierValue()).toBe('912828ZT0');
|
|
62
|
+
expect(parsed.getIdentifier().getIdentifierType()).toBe(identifier_type_pb_1.IdentifierTypeProto.CUSIP);
|
|
63
|
+
});
|
|
64
|
+
test('TIPS: bond fields + base_cpi + inflation_index_type survive round-trip', () => {
|
|
65
|
+
const original = new security_pb_1.SecurityProto();
|
|
66
|
+
original.setObjectClass('Security');
|
|
67
|
+
original.setVersion('0.0.1');
|
|
68
|
+
original.setSecurityType(security_type_pb_1.SecurityTypeProto.TIPS);
|
|
69
|
+
original.setAssetClass('Fixed Income');
|
|
70
|
+
original.setIssuerName('US Treasury');
|
|
71
|
+
original.setCouponRate(makeDecimal('0.625'));
|
|
72
|
+
original.setCouponType(coupon_type_pb_1.CouponTypeProto.FIXED);
|
|
73
|
+
original.setCouponFrequency(coupon_frequency_pb_1.CouponFrequencyProto.SEMIANNUALLY);
|
|
74
|
+
original.setFaceValue(makeDecimal('1000'));
|
|
75
|
+
original.setMaturityDate(makeDate(2030, 1, 15));
|
|
76
|
+
original.setBaseCpi(makeDecimal('256.394'));
|
|
77
|
+
original.setInflationIndexType(index_type_pb_1.IndexTypeProto.CPI_U);
|
|
78
|
+
const bytes = original.serializeBinary();
|
|
79
|
+
const parsed = security_pb_1.SecurityProto.deserializeBinary(bytes);
|
|
80
|
+
expect(parsed.getSecurityType()).toBe(security_type_pb_1.SecurityTypeProto.TIPS);
|
|
81
|
+
expect(parsed.getCouponRate().getArbitraryPrecisionValue()).toBe('0.625');
|
|
82
|
+
expect(parsed.getCouponType()).toBe(coupon_type_pb_1.CouponTypeProto.FIXED);
|
|
83
|
+
expect(parsed.getCouponFrequency()).toBe(coupon_frequency_pb_1.CouponFrequencyProto.SEMIANNUALLY);
|
|
84
|
+
expect(parsed.getFaceValue().getArbitraryPrecisionValue()).toBe('1000');
|
|
85
|
+
expect(parsed.getMaturityDate().getYear()).toBe(2030);
|
|
86
|
+
expect(parsed.getBaseCpi().getArbitraryPrecisionValue()).toBe('256.394');
|
|
87
|
+
expect(parsed.getInflationIndexType()).toBe(index_type_pb_1.IndexTypeProto.CPI_U);
|
|
88
|
+
});
|
|
89
|
+
test('FRN: spread + reference_rate_index + reset_frequency survive round-trip', () => {
|
|
90
|
+
const original = new security_pb_1.SecurityProto();
|
|
91
|
+
original.setObjectClass('Security');
|
|
92
|
+
original.setVersion('0.0.1');
|
|
93
|
+
original.setSecurityType(security_type_pb_1.SecurityTypeProto.FRN);
|
|
94
|
+
original.setAssetClass('Fixed Income');
|
|
95
|
+
original.setIssuerName('US Treasury');
|
|
96
|
+
original.setCouponType(coupon_type_pb_1.CouponTypeProto.FLOAT);
|
|
97
|
+
original.setCouponFrequency(coupon_frequency_pb_1.CouponFrequencyProto.QUARTERLY);
|
|
98
|
+
original.setFaceValue(makeDecimal('100'));
|
|
99
|
+
original.setMaturityDate(makeDate(2028, 1, 15));
|
|
100
|
+
original.setSpread(makeDecimal('50'));
|
|
101
|
+
original.setReferenceRateIndex(index_type_pb_1.IndexTypeProto.T_BILL_13_WEEK);
|
|
102
|
+
// Note: setResetFrequency (field 92) not yet in generated JS — codegen needs update
|
|
103
|
+
const bytes = original.serializeBinary();
|
|
104
|
+
const parsed = security_pb_1.SecurityProto.deserializeBinary(bytes);
|
|
105
|
+
expect(parsed.getSecurityType()).toBe(security_type_pb_1.SecurityTypeProto.FRN);
|
|
106
|
+
expect(parsed.getCouponType()).toBe(coupon_type_pb_1.CouponTypeProto.FLOAT);
|
|
107
|
+
expect(parsed.getCouponFrequency()).toBe(coupon_frequency_pb_1.CouponFrequencyProto.QUARTERLY);
|
|
108
|
+
expect(parsed.getFaceValue().getArbitraryPrecisionValue()).toBe('100');
|
|
109
|
+
expect(parsed.getMaturityDate().getYear()).toBe(2028);
|
|
110
|
+
expect(parsed.getSpread().getArbitraryPrecisionValue()).toBe('50');
|
|
111
|
+
expect(parsed.getReferenceRateIndex()).toBe(index_type_pb_1.IndexTypeProto.T_BILL_13_WEEK);
|
|
112
|
+
});
|
|
113
|
+
test('EQUITY_SECURITY: identifier + asset_class survive round-trip', () => {
|
|
114
|
+
const original = new security_pb_1.SecurityProto();
|
|
115
|
+
original.setObjectClass('Security');
|
|
116
|
+
original.setVersion('0.0.1');
|
|
117
|
+
original.setSecurityType(security_type_pb_1.SecurityTypeProto.EQUITY_SECURITY);
|
|
118
|
+
original.setAssetClass('Equity');
|
|
119
|
+
original.setIssuerName('Apple Inc.');
|
|
120
|
+
original.setQuantityType(security_quantity_type_pb_1.SecurityQuantityTypeProto.UNITS);
|
|
121
|
+
original.setIdentifier(makeIdentifier(identifier_type_pb_1.IdentifierTypeProto.EXCH_TICKER, 'AAPL'));
|
|
122
|
+
original.setDescription('Apple Inc. Common Stock');
|
|
123
|
+
const bytes = original.serializeBinary();
|
|
124
|
+
const parsed = security_pb_1.SecurityProto.deserializeBinary(bytes);
|
|
125
|
+
expect(parsed.getSecurityType()).toBe(security_type_pb_1.SecurityTypeProto.EQUITY_SECURITY);
|
|
126
|
+
expect(parsed.getAssetClass()).toBe('Equity');
|
|
127
|
+
expect(parsed.getIssuerName()).toBe('Apple Inc.');
|
|
128
|
+
expect(parsed.getQuantityType()).toBe(security_quantity_type_pb_1.SecurityQuantityTypeProto.UNITS);
|
|
129
|
+
expect(parsed.getDescription()).toBe('Apple Inc. Common Stock');
|
|
130
|
+
expect(parsed.getIdentifier().getIdentifierValue()).toBe('AAPL');
|
|
131
|
+
expect(parsed.getIdentifier().getIdentifierType()).toBe(identifier_type_pb_1.IdentifierTypeProto.EXCH_TICKER);
|
|
132
|
+
});
|
|
133
|
+
test('CASH_SECURITY: cash_id + settlement fields survive round-trip', () => {
|
|
134
|
+
const original = new security_pb_1.SecurityProto();
|
|
135
|
+
original.setObjectClass('Security');
|
|
136
|
+
original.setVersion('0.0.1');
|
|
137
|
+
original.setSecurityType(security_type_pb_1.SecurityTypeProto.CASH_SECURITY);
|
|
138
|
+
original.setAssetClass('Cash');
|
|
139
|
+
original.setIssuerName('Federal Reserve');
|
|
140
|
+
original.setQuantityType(security_quantity_type_pb_1.SecurityQuantityTypeProto.UNITS);
|
|
141
|
+
original.setCashId('USD');
|
|
142
|
+
original.setDescription('US Dollar');
|
|
143
|
+
original.setIdentifier(makeIdentifier(identifier_type_pb_1.IdentifierTypeProto.CASH, 'USD'));
|
|
144
|
+
const bytes = original.serializeBinary();
|
|
145
|
+
const parsed = security_pb_1.SecurityProto.deserializeBinary(bytes);
|
|
146
|
+
expect(parsed.getSecurityType()).toBe(security_type_pb_1.SecurityTypeProto.CASH_SECURITY);
|
|
147
|
+
expect(parsed.getAssetClass()).toBe('Cash');
|
|
148
|
+
expect(parsed.getCashId()).toBe('USD');
|
|
149
|
+
expect(parsed.getDescription()).toBe('US Dollar');
|
|
150
|
+
expect(parsed.getIdentifier().getIdentifierValue()).toBe('USD');
|
|
151
|
+
expect(parsed.getIdentifier().getIdentifierType()).toBe(identifier_type_pb_1.IdentifierTypeProto.CASH);
|
|
152
|
+
});
|
|
153
|
+
test('INDEX_SECURITY: index_type + inflation_index_type survive round-trip', () => {
|
|
154
|
+
const original = new security_pb_1.SecurityProto();
|
|
155
|
+
original.setObjectClass('Security');
|
|
156
|
+
original.setVersion('0.0.1');
|
|
157
|
+
original.setSecurityType(security_type_pb_1.SecurityTypeProto.INDEX_SECURITY);
|
|
158
|
+
original.setAssetClass('Index');
|
|
159
|
+
original.setIssuerName('Bureau of Labor Statistics');
|
|
160
|
+
original.setDescription('US CPI-U All Urban Consumers');
|
|
161
|
+
original.setIndexType(index_type_pb_1.IndexTypeProto.CPI_U);
|
|
162
|
+
original.setIdentifier(makeIdentifier(identifier_type_pb_1.IdentifierTypeProto.CUSIP, 'CPI-U'));
|
|
163
|
+
const bytes = original.serializeBinary();
|
|
164
|
+
const parsed = security_pb_1.SecurityProto.deserializeBinary(bytes);
|
|
165
|
+
expect(parsed.getSecurityType()).toBe(security_type_pb_1.SecurityTypeProto.INDEX_SECURITY);
|
|
166
|
+
expect(parsed.getAssetClass()).toBe('Index');
|
|
167
|
+
expect(parsed.getIssuerName()).toBe('Bureau of Labor Statistics');
|
|
168
|
+
expect(parsed.getDescription()).toBe('US CPI-U All Urban Consumers');
|
|
169
|
+
expect(parsed.getIndexType()).toBe(index_type_pb_1.IndexTypeProto.CPI_U);
|
|
170
|
+
expect(parsed.getIdentifier().getIdentifierValue()).toBe('CPI-U');
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
//# sourceMappingURL=security-roundtrip.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security-roundtrip.test.js","sourceRoot":"","sources":["security-roundtrip.test.ts"],"names":[],"mappings":";;AAAA;;;;GAIG;AACH,iFAAgF;AAChF,2FAAyF;AACzF,iGAA+F;AAC/F,uFAAqF;AACrF,6GAA0G;AAC1G,gGAA+F;AAC/F,0GAAwG;AACxG,2FAAyF;AACzF,uFAAqF;AACrF,iFAA+E;AAE/E,SAAS,WAAW,CAAC,KAAa;IAC9B,OAAO,IAAI,oCAAiB,EAAE,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY,EAAE,KAAa,EAAE,GAAW;IACtD,OAAO,IAAI,8BAAc,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAC1E,CAAC;AAED,SAAS,cAAc,CAAC,IAAY,EAAE,KAAa;IAC/C,OAAO,IAAI,+BAAe,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;AACnF,CAAC;AAED,QAAQ,CAAC,+DAA+D,EAAE,GAAG,EAAE;IAE3E,IAAI,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,QAAQ,GAAG,IAAI,2BAAa,EAAE,CAAC;QACrC,QAAQ,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;QACpC,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAC7B,QAAQ,CAAC,eAAe,CAAC,oCAAiB,CA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