@fintekkers/ledger-models 1.1.18 → 1.1.20
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/catalog/measures.json +1 -1
- package/hierarchy.json +1 -0
- package/node/fintekkers/models/price/price_type_pb.d.ts +1 -0
- package/node/fintekkers/models/price/price_type_pb.js +2 -1
- package/node/fintekkers/models/security/product_type_pb.d.ts +1 -0
- package/node/fintekkers/models/security/product_type_pb.js +1 -0
- package/node/fintekkers/requests/valuation/product_inputs.test.js +80 -6
- package/node/fintekkers/requests/valuation/product_inputs.test.js.map +1 -1
- package/node/fintekkers/requests/valuation/product_inputs.test.ts +93 -7
- package/node/fintekkers/requests/valuation/product_inputs_pb.d.ts +114 -0
- package/node/fintekkers/requests/valuation/product_inputs_pb.js +882 -3
- package/node/wrappers/models/price/lm412EnumValues.test.d.ts +1 -0
- package/node/wrappers/models/price/lm412EnumValues.test.js +66 -0
- package/node/wrappers/models/price/lm412EnumValues.test.js.map +1 -0
- package/node/wrappers/models/price/lm412EnumValues.test.ts +55 -0
- package/node/wrappers/models/security/product_hierarchy.test.d.ts +1 -0
- package/node/wrappers/models/security/product_hierarchy.test.js +16 -0
- package/node/wrappers/models/security/product_hierarchy.test.js.map +1 -0
- package/node/wrappers/models/security/product_hierarchy.test.ts +14 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
/**
|
|
27
|
+
* LM-412 is additive: PriceTypeProto gains RATE = 5 and ProductTypeProto gains
|
|
28
|
+
* T_BILL_13_WEEK_SERIES = 36. Every existing value keeps its number and name.
|
|
29
|
+
*
|
|
30
|
+
* The values come from test-fixtures/field-changes/lm-412.json, which wire-diff
|
|
31
|
+
* rule lm412 and the Java, Python and Rust tests also read. google-protobuf has
|
|
32
|
+
* no runtime descriptors, so this checks the generated enum objects.
|
|
33
|
+
*/
|
|
34
|
+
const fs = __importStar(require("fs"));
|
|
35
|
+
const path = __importStar(require("path"));
|
|
36
|
+
const price_type_pb_1 = require("../../../fintekkers/models/price/price_type_pb");
|
|
37
|
+
const product_type_pb_1 = require("../../../fintekkers/models/security/product_type_pb");
|
|
38
|
+
const fixturePath = path.resolve(__dirname, '../../../../../test-fixtures/field-changes/lm-412.json');
|
|
39
|
+
const spec = JSON.parse(fs.readFileSync(fixturePath, 'utf8'));
|
|
40
|
+
const ENUMS = {
|
|
41
|
+
'.fintekkers.models.price.PriceTypeProto': price_type_pb_1.PriceTypeProto,
|
|
42
|
+
'.fintekkers.models.security.ProductTypeProto': product_type_pb_1.ProductTypeProto,
|
|
43
|
+
};
|
|
44
|
+
test('the added values are RATE and T_BILL_13_WEEK_SERIES', () => {
|
|
45
|
+
expect(spec.added_values.map((v) => [v.enum, v.number, v.name])).toEqual([
|
|
46
|
+
['.fintekkers.models.price.PriceTypeProto', 5, 'RATE'],
|
|
47
|
+
['.fintekkers.models.security.ProductTypeProto', 36, 'T_BILL_13_WEEK_SERIES'],
|
|
48
|
+
]);
|
|
49
|
+
expect(price_type_pb_1.PriceTypeProto.RATE).toBe(5);
|
|
50
|
+
expect(product_type_pb_1.ProductTypeProto.T_BILL_13_WEEK_SERIES).toBe(36);
|
|
51
|
+
});
|
|
52
|
+
test.each([...spec.added_values, ...spec.kept].map((v) => [`${v.enum} ${v.name}`, v]))('%s has its number', (_label, v) => {
|
|
53
|
+
expect(ENUMS[v.enum][v.name]).toBe(v.number);
|
|
54
|
+
});
|
|
55
|
+
test.each(Object.keys(ENUMS))('kept plus added is the whole of %s', (name) => {
|
|
56
|
+
const listed = [...spec.kept, ...spec.added_values]
|
|
57
|
+
.filter((v) => v.enum === name)
|
|
58
|
+
.map((v) => `${v.number} ${v.name}`)
|
|
59
|
+
.sort();
|
|
60
|
+
const actual = Object.entries(ENUMS[name])
|
|
61
|
+
.map(([n, number]) => `${number} ${n}`)
|
|
62
|
+
.sort();
|
|
63
|
+
expect(actual.length).toBe(listed.length);
|
|
64
|
+
expect(actual).toEqual(listed);
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=lm412EnumValues.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lm412EnumValues.test.js","sourceRoot":"","sources":["lm412EnumValues.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;GAOG;AACH,uCAAyB;AACzB,2CAA6B;AAE7B,kFAAgF;AAChF,yFAAuF;AAQvF,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,wD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AI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,oCAAoC,EAAE,CAAC,IAAI,EAAE,EAAE;IACzE,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC;SAC9C,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC;SAC9B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;SACnC,IAAI,EAAE,CAAC;IACZ,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SACrC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC;SACtC,IAAI,EAAE,CAAC;IACZ,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LM-412 is additive: PriceTypeProto gains RATE = 5 and ProductTypeProto gains
|
|
3
|
+
* T_BILL_13_WEEK_SERIES = 36. Every existing value keeps its number and name.
|
|
4
|
+
*
|
|
5
|
+
* The values come from test-fixtures/field-changes/lm-412.json, which wire-diff
|
|
6
|
+
* rule lm412 and the Java, Python and Rust tests also read. google-protobuf has
|
|
7
|
+
* no runtime descriptors, so this checks the generated enum objects.
|
|
8
|
+
*/
|
|
9
|
+
import * as fs from 'fs';
|
|
10
|
+
import * as path from 'path';
|
|
11
|
+
|
|
12
|
+
import { PriceTypeProto } from '../../../fintekkers/models/price/price_type_pb';
|
|
13
|
+
import { ProductTypeProto } from '../../../fintekkers/models/security/product_type_pb';
|
|
14
|
+
|
|
15
|
+
interface EnumValue {
|
|
16
|
+
enum: string;
|
|
17
|
+
number: number;
|
|
18
|
+
name: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const fixturePath = path.resolve(__dirname, '../../../../../test-fixtures/field-changes/lm-412.json');
|
|
22
|
+
const spec = JSON.parse(fs.readFileSync(fixturePath, 'utf8')) as { added_values: EnumValue[]; kept: EnumValue[] };
|
|
23
|
+
|
|
24
|
+
const ENUMS: Record<string, Record<string, number>> = {
|
|
25
|
+
'.fintekkers.models.price.PriceTypeProto': PriceTypeProto as unknown as Record<string, number>,
|
|
26
|
+
'.fintekkers.models.security.ProductTypeProto': ProductTypeProto as unknown as Record<string, number>,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
test('the added values are RATE and T_BILL_13_WEEK_SERIES', () => {
|
|
30
|
+
expect(spec.added_values.map((v) => [v.enum, v.number, v.name])).toEqual([
|
|
31
|
+
['.fintekkers.models.price.PriceTypeProto', 5, 'RATE'],
|
|
32
|
+
['.fintekkers.models.security.ProductTypeProto', 36, 'T_BILL_13_WEEK_SERIES'],
|
|
33
|
+
]);
|
|
34
|
+
expect(PriceTypeProto.RATE).toBe(5);
|
|
35
|
+
expect(ProductTypeProto.T_BILL_13_WEEK_SERIES).toBe(36);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test.each([...spec.added_values, ...spec.kept].map((v) => [`${v.enum} ${v.name}`, v] as [string, EnumValue]))(
|
|
39
|
+
'%s has its number',
|
|
40
|
+
(_label, v) => {
|
|
41
|
+
expect(ENUMS[v.enum][v.name]).toBe(v.number);
|
|
42
|
+
},
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
test.each(Object.keys(ENUMS))('kept plus added is the whole of %s', (name) => {
|
|
46
|
+
const listed = [...spec.kept, ...spec.added_values]
|
|
47
|
+
.filter((v) => v.enum === name)
|
|
48
|
+
.map((v) => `${v.number} ${v.name}`)
|
|
49
|
+
.sort();
|
|
50
|
+
const actual = Object.entries(ENUMS[name])
|
|
51
|
+
.map(([n, number]) => `${number} ${n}`)
|
|
52
|
+
.sort();
|
|
53
|
+
expect(actual.length).toBe(listed.length);
|
|
54
|
+
expect(actual).toEqual(listed);
|
|
55
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* LM-412: T_BILL_13_WEEK_SERIES sits beside SOFR_SERIES in hierarchy.json,
|
|
5
|
+
* with the same parent, asset class and instrument type.
|
|
6
|
+
*/
|
|
7
|
+
const product_hierarchy_1 = require("./product_hierarchy");
|
|
8
|
+
test('T_BILL_13_WEEK_SERIES is classified like SOFR_SERIES', () => {
|
|
9
|
+
expect((0, product_hierarchy_1.parentOf)('T_BILL_13_WEEK_SERIES')).toBe('INDEX');
|
|
10
|
+
expect((0, product_hierarchy_1.parentOf)('T_BILL_13_WEEK_SERIES')).toBe((0, product_hierarchy_1.parentOf)('SOFR_SERIES'));
|
|
11
|
+
expect((0, product_hierarchy_1.assetClassOf)('T_BILL_13_WEEK_SERIES')).toBe('RATES');
|
|
12
|
+
expect((0, product_hierarchy_1.assetClassOf)('T_BILL_13_WEEK_SERIES')).toBe((0, product_hierarchy_1.assetClassOf)('SOFR_SERIES'));
|
|
13
|
+
expect((0, product_hierarchy_1.instrumentTypeOf)('T_BILL_13_WEEK_SERIES')).toBe('REFERENCE_INDEX');
|
|
14
|
+
expect((0, product_hierarchy_1.instrumentTypeOf)('T_BILL_13_WEEK_SERIES')).toBe((0, product_hierarchy_1.instrumentTypeOf)('SOFR_SERIES'));
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=product_hierarchy.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product_hierarchy.test.js","sourceRoot":"","sources":["product_hierarchy.test.ts"],"names":[],"mappings":";;AAAA;;;GAGG;AACH,2DAA+E;AAE/E,IAAI,CAAC,sDAAsD,EAAE,GAAG,EAAE;IAC9D,MAAM,CAAC,IAAA,4BAAQ,EAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxD,MAAM,CAAC,IAAA,4BAAQ,EAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAA,4BAAQ,EAAC,aAAa,CAAC,CAAC,CAAC;IACxE,MAAM,CAAC,IAAA,gCAAY,EAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5D,MAAM,CAAC,IAAA,gCAAY,EAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAA,gCAAY,EAAC,aAAa,CAAC,CAAC,CAAC;IAChF,MAAM,CAAC,IAAA,oCAAgB,EAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC1E,MAAM,CAAC,IAAA,oCAAgB,EAAC,uBAAuB,CAAC,CAAC,CAAC,IAAI,CAAC,IAAA,oCAAgB,EAAC,aAAa,CAAC,CAAC,CAAC;AAC5F,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LM-412: T_BILL_13_WEEK_SERIES sits beside SOFR_SERIES in hierarchy.json,
|
|
3
|
+
* with the same parent, asset class and instrument type.
|
|
4
|
+
*/
|
|
5
|
+
import { assetClassOf, instrumentTypeOf, parentOf } from './product_hierarchy';
|
|
6
|
+
|
|
7
|
+
test('T_BILL_13_WEEK_SERIES is classified like SOFR_SERIES', () => {
|
|
8
|
+
expect(parentOf('T_BILL_13_WEEK_SERIES')).toBe('INDEX');
|
|
9
|
+
expect(parentOf('T_BILL_13_WEEK_SERIES')).toBe(parentOf('SOFR_SERIES'));
|
|
10
|
+
expect(assetClassOf('T_BILL_13_WEEK_SERIES')).toBe('RATES');
|
|
11
|
+
expect(assetClassOf('T_BILL_13_WEEK_SERIES')).toBe(assetClassOf('SOFR_SERIES'));
|
|
12
|
+
expect(instrumentTypeOf('T_BILL_13_WEEK_SERIES')).toBe('REFERENCE_INDEX');
|
|
13
|
+
expect(instrumentTypeOf('T_BILL_13_WEEK_SERIES')).toBe(instrumentTypeOf('SOFR_SERIES'));
|
|
14
|
+
});
|