@fintekkers/ledger-models 0.1.72 → 0.1.75
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/.env +1 -1
- package/node/wrappers/models/position/field.js +27 -0
- package/node/wrappers/models/position/field.js.map +1 -0
- package/node/wrappers/models/position/field.test.js +63 -0
- package/node/wrappers/models/position/field.test.js.map +1 -0
- package/node/wrappers/models/position/field.test.ts +13 -0
- package/node/wrappers/models/position/field.ts +25 -0
- package/node/wrappers/models/position/position.js +7 -19
- package/node/wrappers/models/position/position.js.map +1 -1
- package/node/wrappers/models/position/position.test copy.js +107 -0
- package/node/wrappers/models/position/position.test copy.js.map +1 -0
- package/node/wrappers/models/position/position.test.js +32 -4
- package/node/wrappers/models/position/position.test.js.map +1 -1
- package/node/wrappers/models/position/position.test.ts +34 -19
- package/node/wrappers/models/position/position.ts +11 -38
- package/node/wrappers/models/utils/date.js +2 -2
- package/node/wrappers/models/utils/date.js.map +1 -1
- package/node/wrappers/models/utils/date.ts +2 -4
- package/node/wrappers/models/utils/datetime.js +0 -19
- package/node/wrappers/models/utils/datetime.js.map +1 -1
- package/node/wrappers/models/utils/datetime.test.js +48 -0
- package/node/wrappers/models/utils/datetime.test.js.map +1 -0
- package/node/wrappers/models/utils/datetime.test.ts +8 -0
- package/node/wrappers/models/utils/datetime.ts +0 -24
- package/node/wrappers/models/utils/protoEnum.js +54 -0
- package/node/wrappers/models/utils/protoEnum.js.map +1 -0
- package/node/wrappers/models/utils/protoEnum.test.js +25 -0
- package/node/wrappers/models/utils/protoEnum.test.js.map +1 -0
- package/node/wrappers/models/utils/protoEnum.test.ts +28 -0
- package/node/wrappers/models/utils/protoEnum.ts +59 -0
- package/node/wrappers/models/utils/serialization.js +9 -2
- package/node/wrappers/models/utils/serialization.js.map +1 -1
- package/node/wrappers/models/utils/serialization.ts +11 -9
- package/node/wrappers/services/portfolio-service/portfolio.test.js +0 -1
- package/node/wrappers/services/portfolio-service/portfolio.test.js.map +1 -1
- package/node/wrappers/services/portfolio-service/portfolio.test.ts +0 -1
- package/node/wrappers/services/position-service/PositionService.js +2 -2
- package/node/wrappers/services/position-service/PositionService.js.map +1 -1
- package/node/wrappers/services/position-service/PositionService.ts +1 -1
- package/node/wrappers/services/position-service/position.test.js +18 -63
- package/node/wrappers/services/position-service/position.test.js.map +1 -1
- package/node/wrappers/services/position-service/position.test.ts +8 -73
- package/node/wrappers/services/security-service/security.maturityLadder.test.js +0 -1
- package/node/wrappers/services/security-service/security.maturityLadder.test.js.map +1 -1
- package/node/wrappers/services/security-service/security.maturityLadder.test.ts +0 -2
- package/node/wrappers/services/transaction-service/transaction.search.test.js +0 -1
- package/node/wrappers/services/transaction-service/transaction.search.test.js.map +1 -1
- package/node/wrappers/services/transaction-service/transaction.search.test.ts +0 -2
- package/package.json +1 -1
package/.env
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Field = void 0;
|
|
4
|
+
var field_pb_1 = require("../../../fintekkers/models/position/field_pb");
|
|
5
|
+
var Field = /** @class */ (function () {
|
|
6
|
+
function Field(field) {
|
|
7
|
+
this.field = field;
|
|
8
|
+
}
|
|
9
|
+
Field.prototype.getName = function () {
|
|
10
|
+
function getEnumNameByValue(enumObj, value) {
|
|
11
|
+
// Find the enum key that matches the value
|
|
12
|
+
var entry = Object.entries(enumObj).find(function (_a) {
|
|
13
|
+
var val = _a[1];
|
|
14
|
+
return val === value;
|
|
15
|
+
});
|
|
16
|
+
// Return the key name if found, otherwise undefined or a placeholder
|
|
17
|
+
return entry ? entry[0] : 'undefined';
|
|
18
|
+
}
|
|
19
|
+
return getEnumNameByValue(field_pb_1.FieldProto, this.field);
|
|
20
|
+
};
|
|
21
|
+
Field.prototype.toString = function () {
|
|
22
|
+
return null; //this.getEnumValueName();
|
|
23
|
+
};
|
|
24
|
+
return Field;
|
|
25
|
+
}());
|
|
26
|
+
exports.Field = Field;
|
|
27
|
+
//# sourceMappingURL=field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.js","sourceRoot":"","sources":["field.ts"],"names":[],"mappings":";;;AACA,yEAA0E;AAE1E;IAGI,eAAY,KAAiB;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,uBAAO,GAAP;QACI,SAAS,kBAAkB,CAAC,OAAY,EAAE,KAAa;YACnD,2CAA2C;YAC3C,IAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,UAAC,EAAO;oBAAJ,GAAG,QAAA;gBAAM,OAAA,GAAG,KAAK,KAAK;YAAb,CAAa,CAAC,CAAC;YACvE,qEAAqE;YACrE,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;QAC1C,CAAC;QAED,OAAO,kBAAkB,CAAC,qBAAU,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IACtD,CAAC;IAED,wBAAQ,GAAR;QACI,OAAO,IAAI,CAAC,CAAA,0BAA0B;IAC1C,CAAC;IACL,YAAC;AAAD,CAAC,AArBD,IAqBC;AArBY,sBAAK"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var field_pb_1 = require("../../../fintekkers/models/position/field_pb");
|
|
40
|
+
var field_1 = require("./field");
|
|
41
|
+
test('test the field wrapper', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
42
|
+
var isTrue;
|
|
43
|
+
return __generator(this, function (_a) {
|
|
44
|
+
switch (_a.label) {
|
|
45
|
+
case 0: return [4 /*yield*/, testSerialization()];
|
|
46
|
+
case 1:
|
|
47
|
+
isTrue = _a.sent();
|
|
48
|
+
expect(isTrue).toBe(true);
|
|
49
|
+
return [2 /*return*/];
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}); });
|
|
53
|
+
function testSerialization() {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
55
|
+
var field;
|
|
56
|
+
return __generator(this, function (_a) {
|
|
57
|
+
field = new field_1.Field(field_pb_1.FieldProto.TRADE_DATE);
|
|
58
|
+
expect(field.getName()).toBe("TRADE_DATE");
|
|
59
|
+
return [2 /*return*/, true];
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=field.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.test.js","sourceRoot":"","sources":["field.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAA0E;AAC1E,iCAAgC;AAEhC,IAAI,CAAC,wBAAwB,EAAE;;;;oBACZ,qBAAM,iBAAiB,EAAE,EAAA;;gBAAlC,MAAM,GAAG,SAAyB;gBACxC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;;;KAC7B,CAAC,CAAC;AAEH,SAAe,iBAAiB;;;;YACxB,KAAK,GAAU,IAAI,aAAK,CAAC,qBAAU,CAAC,UAAU,CAAC,CAAC;YACpD,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAC3C,sBAAO,IAAI,EAAC;;;CACf"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FieldProto } from '../../../fintekkers/models/position/field_pb';
|
|
2
|
+
import { Field } from './field';
|
|
3
|
+
|
|
4
|
+
test('test the field wrapper', async () => {
|
|
5
|
+
const isTrue = await testSerialization();
|
|
6
|
+
expect(isTrue).toBe(true);
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
async function testSerialization(): Promise<boolean> {
|
|
10
|
+
let field: Field = new Field(FieldProto.TRADE_DATE);
|
|
11
|
+
expect(field.getName()).toBe("TRADE_DATE");
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
import { FieldProto } from '../../../fintekkers/models/position/field_pb';
|
|
3
|
+
|
|
4
|
+
export class Field {
|
|
5
|
+
private field: FieldProto;
|
|
6
|
+
|
|
7
|
+
constructor(field: FieldProto) {
|
|
8
|
+
this.field = field;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
getName() {
|
|
12
|
+
function getEnumNameByValue(enumObj: any, value: number): string {
|
|
13
|
+
// Find the enum key that matches the value
|
|
14
|
+
const entry = Object.entries(enumObj).find(([, val]) => val === value);
|
|
15
|
+
// Return the key name if found, otherwise undefined or a placeholder
|
|
16
|
+
return entry ? entry[0] : 'undefined';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return getEnumNameByValue(FieldProto, this.field);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
toString(): string {
|
|
23
|
+
return null;//this.getEnumValueName();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Note: Some classes and functions have been omitted or simplified due to lack of context.
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
3
|
exports.Position = void 0;
|
|
4
|
+
//Models
|
|
5
5
|
var field_pb_1 = require("../../../fintekkers/models/position/field_pb");
|
|
6
6
|
var position_util_pb_1 = require("../../../fintekkers/models/position/position_util_pb");
|
|
7
7
|
var portfolio_1 = require("../portfolio/portfolio");
|
|
@@ -13,13 +13,11 @@ var identifier_pb_1 = require("../../../fintekkers/models/security/identifier/id
|
|
|
13
13
|
var measure_pb_1 = require("../../../fintekkers/models/position/measure_pb");
|
|
14
14
|
var serialization_1 = require("../utils/serialization");
|
|
15
15
|
var wrappers_pb_1 = require("google-protobuf/google/protobuf/wrappers_pb");
|
|
16
|
+
var protoEnum_1 = require("../utils/protoEnum");
|
|
17
|
+
var field_1 = require("./field");
|
|
16
18
|
var Position = /** @class */ (function () {
|
|
17
19
|
function Position(positionProto) {
|
|
18
20
|
this.proto = positionProto;
|
|
19
|
-
// //For each field, put into a map
|
|
20
|
-
// this.proto.getFieldsList().forEach(field => {
|
|
21
|
-
// console.log(field);
|
|
22
|
-
// });
|
|
23
21
|
}
|
|
24
22
|
Position.prototype.getFieldValue = function (field) {
|
|
25
23
|
return this.getField(new position_util_pb_1.FieldMapEntry().setField(field));
|
|
@@ -28,13 +26,13 @@ var Position = /** @class */ (function () {
|
|
|
28
26
|
for (var _i = 0, _a = this.proto.getFieldsList(); _i < _a.length; _i++) {
|
|
29
27
|
var tmpField = _a[_i];
|
|
30
28
|
if (tmpField.getField() === fieldToGet.getField()) {
|
|
31
|
-
if (tmpField.getStringValue()) {
|
|
29
|
+
if (tmpField.getStringValue() !== undefined && tmpField.getStringValue().length > 0) {
|
|
32
30
|
return tmpField.getStringValue();
|
|
33
31
|
}
|
|
34
32
|
if (tmpField.getEnumValue() > 0) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
var fieldName = new field_1.Field(fieldToGet.getField()).getName();
|
|
34
|
+
var proto = protoEnum_1.ProtoEnum.fromEnumName(fieldName, tmpField.getEnumValue());
|
|
35
|
+
return proto;
|
|
38
36
|
}
|
|
39
37
|
var unpackedValue = Position.unpackField(tmpField);
|
|
40
38
|
if (field_pb_1.FieldProto.SECURITY == fieldToGet.getField()) {
|
|
@@ -85,16 +83,6 @@ var Position = /** @class */ (function () {
|
|
|
85
83
|
}
|
|
86
84
|
return output;
|
|
87
85
|
};
|
|
88
|
-
// private static wrapStringToAny(myString: string): Any {
|
|
89
|
-
// const myAny = new Any();
|
|
90
|
-
// myAny.pack(wrappers.StringValue.create({ value: myString }));
|
|
91
|
-
// return myAny;
|
|
92
|
-
// }
|
|
93
|
-
// private static packField(fieldToPack: any): Any {
|
|
94
|
-
// const myAny = new Any();
|
|
95
|
-
// myAny.pack(fieldToPack);
|
|
96
|
-
// return myAny;
|
|
97
|
-
// }
|
|
98
86
|
Position.unpackField = function (fieldToUnpack) {
|
|
99
87
|
switch (fieldToUnpack.getField()) {
|
|
100
88
|
case field_pb_1.FieldProto.PORTFOLIO_ID:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.js","sourceRoot":"","sources":["position.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"position.js","sourceRoot":"","sources":["position.ts"],"names":[],"mappings":";;;AAAA,QAAQ;AACR,yEAA0E;AAE1E,yFAAsG;AACtG,oDAA+C;AAC/C,iDAA4C;AAC5C,mEAAoE;AACpE,yFAAyF;AACzF,+EAA+E;AAC/E,8FAA+F;AAC/F,6EAA8E;AAE9E,wDAAgE;AAChE,2EAA0E;AAC1E,gDAA+C;AAC/C,iCAAgC;AAIhC;IAGE,kBAAY,aAA4B;QACtC,IAAI,CAAC,KAAK,GAAG,aAAa,CAAC;IAC7B,CAAC;IAEM,gCAAa,GAApB,UAAqB,KAAiB;QACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,gCAAa,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5D,CAAC;IAEM,2BAAQ,GAAf,UAAgB,UAAyB;QACvC,KAAuB,UAA0B,EAA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;YACjC,KAAK,qBAAU,CAAC,eAAe;gBAC7B,mDAAmD;gBACnD,gFAAgF;gBAChF,OAAO,IAAI,CAAC,CAAC,qDAAqD;YACpE,KAAK,qBAAU,CAAC,cAAc,CAAC;YAC/B,KAAK,qBAAU,CAAC,oBAAoB,CAAC;YACrC,KAAK,qBAAU,CAAC,YAAY,CAAC;YAC7B,KAAK,qBAAU,CAAC,WAAW;gBACzB,OAAO,yBAAW,CAAC,iBAAiB,CAAC,aAAa,CAAC,mBAAmB,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;YACvF,KAAK,qBAAU,CAAC,SAAS;gBACvB,OAAO,aAAa,CAAC,mBAAmB,EAAE,CAAC;YAC7C,KAAK,qBAAU,CAAC,QAAQ;gBACtB,OAAO,aAAa,CAAC,mBAAmB,EAAE,CAAC;YAC7C;gBACE,MAAM,IAAI,KAAK,CAAC,4CAAqC,qBAAU,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAE,CAAC,CAAC;QACjG,CAAC;IACH,CAAC;IACH,eAAC;AAAD,CAAC,AAzHD,IAyHC;AAzHY,4BAAQ"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var uuid_1 = require("../utils/uuid");
|
|
40
|
+
var any_pb_1 = require("google-protobuf/google/protobuf/any_pb");
|
|
41
|
+
var decimal_value_pb_1 = require("../../../fintekkers/models/util/decimal_value_pb");
|
|
42
|
+
var position_pb_1 = require("../../../fintekkers/models/position/position_pb");
|
|
43
|
+
var position_util_pb_1 = require("../../../fintekkers/models/position/position_util_pb");
|
|
44
|
+
var field_pb_1 = require("../../../fintekkers/models/position/field_pb");
|
|
45
|
+
var measure_pb_1 = require("../../../fintekkers/models/position/measure_pb");
|
|
46
|
+
var security_pb_1 = require("../../../fintekkers/models/security/security_pb");
|
|
47
|
+
var portfolio_pb_1 = require("../../../fintekkers/models/portfolio/portfolio_pb");
|
|
48
|
+
var position_1 = require("./position");
|
|
49
|
+
var date_1 = require("../utils/date");
|
|
50
|
+
var position_status_pb_1 = require("../../../fintekkers/models/position/position_status_pb");
|
|
51
|
+
test('test the position wrapper', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
52
|
+
var isTrue;
|
|
53
|
+
return __generator(this, function (_a) {
|
|
54
|
+
switch (_a.label) {
|
|
55
|
+
case 0: return [4 /*yield*/, testSerialization()];
|
|
56
|
+
case 1:
|
|
57
|
+
isTrue = _a.sent();
|
|
58
|
+
expect(isTrue).toBe(true);
|
|
59
|
+
return [2 /*return*/];
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}); });
|
|
63
|
+
function testSerialization() {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
+
var fields, security, portfolio, tradeDate, productType, id, measure, measureValue, tradeDatePacked, idPacked, positionProto, position, tradeDatePosition, securityPosition, portfolioPosition, positionID;
|
|
66
|
+
return __generator(this, function (_a) {
|
|
67
|
+
fields = [field_pb_1.FieldProto.ID, field_pb_1.FieldProto.TRADE_DATE, field_pb_1.FieldProto.PRODUCT_TYPE, field_pb_1.FieldProto.PORTFOLIO, field_pb_1.FieldProto.SECURITY];
|
|
68
|
+
security = new security_pb_1.SecurityProto().setAssetClass("Test");
|
|
69
|
+
portfolio = new portfolio_pb_1.PortfolioProto().setPortfolioName("Test portfolio");
|
|
70
|
+
tradeDate = date_1.LocalDate.today().toDate();
|
|
71
|
+
productType = "Test product type";
|
|
72
|
+
id = new uuid_1.UUID(uuid_1.UUID.random().toBytes());
|
|
73
|
+
measure = measure_pb_1.MeasureProto.DIRECTED_QUANTITY;
|
|
74
|
+
measureValue = new decimal_value_pb_1.DecimalValueProto().setArbitraryPrecisionValue("1.0");
|
|
75
|
+
tradeDatePacked = new any_pb_1.Any();
|
|
76
|
+
tradeDatePacked.setTypeUrl("Doesn't matter");
|
|
77
|
+
tradeDatePacked.setValue(date_1.LocalDate.from(tradeDate).toProto().serializeBinary());
|
|
78
|
+
idPacked = new any_pb_1.Any();
|
|
79
|
+
idPacked.setTypeUrl("Doesn't matter");
|
|
80
|
+
idPacked.setValue(id.toUUIDProto().serializeBinary());
|
|
81
|
+
positionProto = new position_pb_1.PositionProto();
|
|
82
|
+
positionProto.setFieldsList([
|
|
83
|
+
new position_util_pb_1.FieldMapEntry().setField(field_pb_1.FieldProto.TRADE_DATE).setFieldValuePacked(tradeDatePacked),
|
|
84
|
+
new position_util_pb_1.FieldMapEntry().setField(field_pb_1.FieldProto.SECURITY).setFieldValuePacked(security),
|
|
85
|
+
new position_util_pb_1.FieldMapEntry().setField(field_pb_1.FieldProto.PORTFOLIO).setFieldValuePacked(portfolio),
|
|
86
|
+
new position_util_pb_1.FieldMapEntry().setField(field_pb_1.FieldProto.POSITION_STATUS).setEnumValue(position_status_pb_1.PositionStatusProto.EXECUTED),
|
|
87
|
+
new position_util_pb_1.FieldMapEntry().setField(field_pb_1.FieldProto.PRODUCT_TYPE).setStringValue(productType),
|
|
88
|
+
new position_util_pb_1.FieldMapEntry().setField(field_pb_1.FieldProto.ID).setFieldValuePacked(idPacked),
|
|
89
|
+
]);
|
|
90
|
+
position = new position_1.Position(positionProto);
|
|
91
|
+
tradeDatePosition = position.getFieldValue(field_pb_1.FieldProto.TRADE_DATE);
|
|
92
|
+
expect(tradeDate.getFullYear()).toBe(tradeDatePosition.getFullYear());
|
|
93
|
+
expect(tradeDate.getMonth()).toBe(tradeDatePosition.getMonth());
|
|
94
|
+
expect(tradeDate.getDay()).toBe(tradeDatePosition.getDay());
|
|
95
|
+
securityPosition = position.getFieldValue(field_pb_1.FieldProto.SECURITY);
|
|
96
|
+
expect(securityPosition.getAssetClass()).toBe(security.getAssetClass());
|
|
97
|
+
portfolioPosition = position.getFieldValue(field_pb_1.FieldProto.PORTFOLIO);
|
|
98
|
+
expect(portfolioPosition.getPortfolioName()).toBe(portfolio.getPortfolioName());
|
|
99
|
+
expect(position.getFieldValue(field_pb_1.FieldProto.PRODUCT_TYPE)).toBe(productType);
|
|
100
|
+
positionID = position.getFieldValue(field_pb_1.FieldProto.ID);
|
|
101
|
+
expect(positionID.toString()).toBe(id.toString());
|
|
102
|
+
expect(position.getFieldValue(field_pb_1.FieldProto.POSITION_STATUS)).toBe(position_status_pb_1.PositionStatusProto.EXECUTED);
|
|
103
|
+
return [2 /*return*/, true];
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=position.test%20copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.test copy.js","sourceRoot":"","sources":["position.test copy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,sCAAqC;AACrC,iEAA6D;AAS7D,qFAAqF;AAErF,+EAAsH;AACtH,yFAAqF;AACrF,yEAA0E;AAK1E,6EAA8E;AAC9E,+EAAgF;AAChF,kFAAmF;AACnF,uCAAsC;AACtC,sCAA0C;AAC1C,6FAA6F;AAE7F,IAAI,CAAC,2BAA2B,EAAE;;;;oBACf,qBAAM,iBAAiB,EAAE,EAAA;;gBAAlC,MAAM,GAAG,SAAyB;gBACxC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;;;KAC7B,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,CAAC,qBAAU,CAAC,SAAS,CAAC,CAAC;YACrF,MAAM,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,CAAC;YAEhF,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,qBAAU,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAEtE,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,qBAAU,CAAC,EAAE,CAAC,CAAC;YACvD,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;YAElD,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,qBAAU,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,wCAAmB,CAAC,QAAQ,CAAC,CAAC;YAE9F,sBAAO,IAAI,EAAC;;;CACf"}
|
|
@@ -52,19 +52,47 @@ test('test the position wrapper', function () { return __awaiter(void 0, void 0,
|
|
|
52
52
|
var isTrue;
|
|
53
53
|
return __generator(this, function (_a) {
|
|
54
54
|
switch (_a.label) {
|
|
55
|
-
case 0: return [4 /*yield*/,
|
|
55
|
+
case 0: return [4 /*yield*/, testEnumSerialization()];
|
|
56
56
|
case 1:
|
|
57
|
+
isTrue = _a.sent();
|
|
58
|
+
expect(isTrue).toBe(true);
|
|
59
|
+
return [4 /*yield*/, testSerialization()];
|
|
60
|
+
case 2:
|
|
57
61
|
isTrue = _a.sent();
|
|
58
62
|
expect(isTrue).toBe(true);
|
|
59
63
|
return [2 /*return*/];
|
|
60
64
|
}
|
|
61
65
|
});
|
|
62
66
|
}); });
|
|
67
|
+
function testEnumSerialization() {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
69
|
+
var positionProto, measureValue, position, status;
|
|
70
|
+
return __generator(this, function (_a) {
|
|
71
|
+
positionProto = new position_pb_1.PositionProto();
|
|
72
|
+
positionProto.setFieldsList([
|
|
73
|
+
new position_util_pb_1.FieldMapEntry().setField(field_pb_1.FieldProto.POSITION_STATUS).setEnumValue(position_status_pb_1.PositionStatusProto.EXECUTED)
|
|
74
|
+
]);
|
|
75
|
+
measureValue = new decimal_value_pb_1.DecimalValueProto().setArbitraryPrecisionValue("1.55");
|
|
76
|
+
positionProto.setMeasuresList([
|
|
77
|
+
new position_util_pb_1.MeasureMapEntry().setMeasure(measure_pb_1.MeasureProto.DIRECTED_QUANTITY).setMeasureDecimalValue(measureValue)
|
|
78
|
+
]);
|
|
79
|
+
position = new position_1.Position(positionProto);
|
|
80
|
+
status = position.getFieldValue(field_pb_1.FieldProto.POSITION_STATUS);
|
|
81
|
+
expect(status.getEnumValueName()).toBe("EXECUTED");
|
|
82
|
+
expect(status.getEnumValue()).toBe(position_status_pb_1.PositionStatusProto.EXECUTED);
|
|
83
|
+
expect(status.getEnumDescriptor()).toBe(position_status_pb_1.PositionStatusProto);
|
|
84
|
+
position.getMeasures().forEach(function (measureMapEntry) {
|
|
85
|
+
measureMapEntry.getMeasure().toString();
|
|
86
|
+
});
|
|
87
|
+
expect(position.getMeasureValue(measure_pb_1.MeasureProto.DIRECTED_QUANTITY)).toBe(1.55);
|
|
88
|
+
return [2 /*return*/, true];
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
}
|
|
63
92
|
function testSerialization() {
|
|
64
93
|
return __awaiter(this, void 0, void 0, function () {
|
|
65
|
-
var
|
|
94
|
+
var security, portfolio, tradeDate, productType, id, measure, measureValue, tradeDatePacked, idPacked, positionProto, position, tradeDatePosition, securityPosition, portfolioPosition, positionID;
|
|
66
95
|
return __generator(this, function (_a) {
|
|
67
|
-
fields = [field_pb_1.FieldProto.ID, field_pb_1.FieldProto.TRADE_DATE, field_pb_1.FieldProto.PRODUCT_TYPE, field_pb_1.FieldProto.PORTFOLIO, field_pb_1.FieldProto.SECURITY];
|
|
68
96
|
security = new security_pb_1.SecurityProto().setAssetClass("Test");
|
|
69
97
|
portfolio = new portfolio_pb_1.PortfolioProto().setPortfolioName("Test portfolio");
|
|
70
98
|
tradeDate = date_1.LocalDate.today().toDate();
|
|
@@ -99,7 +127,7 @@ function testSerialization() {
|
|
|
99
127
|
expect(position.getFieldValue(field_pb_1.FieldProto.PRODUCT_TYPE)).toBe(productType);
|
|
100
128
|
positionID = position.getFieldValue(field_pb_1.FieldProto.ID);
|
|
101
129
|
expect(positionID.toString()).toBe(id.toString());
|
|
102
|
-
expect(position.getFieldValue(field_pb_1.FieldProto.POSITION_STATUS)).toBe(
|
|
130
|
+
expect(position.getFieldValue(field_pb_1.FieldProto.POSITION_STATUS).toString()).toBe("EXECUTED");
|
|
103
131
|
return [2 /*return*/, true];
|
|
104
132
|
});
|
|
105
133
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.test.js","sourceRoot":"","sources":["position.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"position.test.js","sourceRoot":"","sources":["position.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAAqC;AACrC,iEAA6D;AAI7D,qFAAqF;AACrF,+EAAgF;AAChF,yFAAsG;AACtG,yEAA0E;AAC1E,6EAA8E;AAC9E,+EAAgF;AAChF,kFAAmF;AACnF,uCAAsC;AACtC,sCAA0C;AAC1C,6FAA6F;AAG7F,IAAI,CAAC,2BAA2B,EAAE;;;;oBACjB,qBAAM,qBAAqB,EAAE,EAAA;;gBAAtC,MAAM,GAAG,SAA6B;gBAC1C,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAEjB,qBAAM,iBAAiB,EAAE,EAAA;;gBAAlC,MAAM,GAAG,SAAyB,CAAC;gBACnC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;;;KAC7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,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAEtE,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,qBAAU,CAAC,EAAE,CAAC,CAAC;YACvD,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;YAElD,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,qBAAU,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAEvF,sBAAO,IAAI,EAAC;;;CACf"}
|
|
@@ -1,40 +1,55 @@
|
|
|
1
|
-
import { LocalDateProto } from '../../../fintekkers/models/util/local_date_pb';
|
|
2
|
-
import { UUIDProto } from '../../../fintekkers/models/util/uuid_pb';
|
|
3
|
-
import { ProtoSerializationUtil } from '../utils/serialization';
|
|
4
1
|
import { UUID } from '../utils/uuid';
|
|
5
2
|
import { Any } from 'google-protobuf/google/protobuf/any_pb';
|
|
6
3
|
|
|
7
4
|
import assert = require('assert');
|
|
8
|
-
import Transaction from '../transaction/transaction';
|
|
9
|
-
import { TransactionProto } from '../../../fintekkers/models/transaction/transaction_pb';
|
|
10
|
-
import { TransactionTypeProto } from '../../../fintekkers/models/transaction/transaction_type_pb';
|
|
11
|
-
import { LocalTimestampProto } from '../../../fintekkers/models/util/local_timestamp_pb';
|
|
12
5
|
|
|
13
|
-
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
|
|
14
6
|
import { DecimalValueProto } from '../../../fintekkers/models/util/decimal_value_pb';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { FieldMapEntry } from '../../../fintekkers/models/position/position_util_pb';
|
|
7
|
+
import { PositionProto } from '../../../fintekkers/models/position/position_pb';
|
|
8
|
+
import { FieldMapEntry, MeasureMapEntry } from '../../../fintekkers/models/position/position_util_pb';
|
|
18
9
|
import { FieldProto } from '../../../fintekkers/models/position/field_pb';
|
|
19
|
-
import { PositionService } from '../../services/position-service/PositionService';
|
|
20
|
-
import { PositionFilter } from './positionfilter';
|
|
21
|
-
import { QueryPositionRequestProto } from '../../../fintekkers/requests/position/query_position_request_pb';
|
|
22
|
-
import { ZonedDateTime } from '../utils/datetime';
|
|
23
10
|
import { MeasureProto } from '../../../fintekkers/models/position/measure_pb';
|
|
24
11
|
import { SecurityProto } from '../../../fintekkers/models/security/security_pb';
|
|
25
12
|
import { PortfolioProto } from '../../../fintekkers/models/portfolio/portfolio_pb';
|
|
26
13
|
import { Position } from './position';
|
|
27
14
|
import { LocalDate } from '../utils/date';
|
|
28
15
|
import { PositionStatusProto } from '../../../fintekkers/models/position/position_status_pb';
|
|
16
|
+
import { ProtoEnum } from '../utils/protoEnum';
|
|
29
17
|
|
|
30
18
|
test('test the position wrapper', async () => {
|
|
31
|
-
|
|
19
|
+
let isTrue = await testEnumSerialization();
|
|
20
|
+
expect(isTrue).toBe(true);
|
|
21
|
+
|
|
22
|
+
isTrue = await testSerialization();
|
|
32
23
|
expect(isTrue).toBe(true);
|
|
33
24
|
});
|
|
34
25
|
|
|
35
|
-
async function
|
|
36
|
-
let
|
|
26
|
+
async function testEnumSerialization(): Promise<boolean> {
|
|
27
|
+
let positionProto = new PositionProto();
|
|
28
|
+
positionProto.setFieldsList([
|
|
29
|
+
new FieldMapEntry().setField(FieldProto.POSITION_STATUS).setEnumValue(PositionStatusProto.EXECUTED)
|
|
30
|
+
]);
|
|
31
|
+
|
|
32
|
+
let measureValue = new DecimalValueProto().setArbitraryPrecisionValue("1.55");
|
|
33
|
+
positionProto.setMeasuresList([
|
|
34
|
+
new MeasureMapEntry().setMeasure(MeasureProto.DIRECTED_QUANTITY).setMeasureDecimalValue(measureValue)
|
|
35
|
+
]);
|
|
37
36
|
|
|
37
|
+
let position = new Position(positionProto);
|
|
38
|
+
|
|
39
|
+
let status: ProtoEnum = position.getFieldValue(FieldProto.POSITION_STATUS);
|
|
40
|
+
expect(status.getEnumValueName()).toBe("EXECUTED");
|
|
41
|
+
expect(status.getEnumValue()).toBe(PositionStatusProto.EXECUTED);
|
|
42
|
+
expect(status.getEnumDescriptor()).toBe(PositionStatusProto);
|
|
43
|
+
|
|
44
|
+
position.getMeasures().forEach(measureMapEntry => {
|
|
45
|
+
measureMapEntry.getMeasure().toString();
|
|
46
|
+
});
|
|
47
|
+
expect(position.getMeasureValue(MeasureProto.DIRECTED_QUANTITY)).toBe(1.55);
|
|
48
|
+
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function testSerialization(): Promise<boolean> {
|
|
38
53
|
let security = new SecurityProto().setAssetClass("Test");
|
|
39
54
|
let portfolio = new PortfolioProto().setPortfolioName("Test portfolio");
|
|
40
55
|
let tradeDate = LocalDate.today().toDate();
|
|
@@ -79,7 +94,7 @@ async function testSerialization(): Promise<boolean> {
|
|
|
79
94
|
let positionID = position.getFieldValue(FieldProto.ID);
|
|
80
95
|
expect(positionID.toString()).toBe(id.toString());
|
|
81
96
|
|
|
82
|
-
expect(position.getFieldValue(FieldProto.POSITION_STATUS)).toBe(
|
|
97
|
+
expect(position.getFieldValue(FieldProto.POSITION_STATUS).toString()).toBe("EXECUTED");
|
|
83
98
|
|
|
84
99
|
return true;
|
|
85
100
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
import { Any } from "@grpc/grpc-js/build/src/generated/google/protobuf/Any";
|
|
1
|
+
//Models
|
|
4
2
|
import { FieldProto } from "../../../fintekkers/models/position/field_pb";
|
|
5
3
|
import { PositionProto } from "../../../fintekkers/models/position/position_pb";
|
|
6
4
|
import { FieldMapEntry, MeasureMapEntry } from "../../../fintekkers/models/position/position_util_pb";
|
|
@@ -10,43 +8,38 @@ import { UUIDProto } from "../../../fintekkers/models/util/uuid_pb";
|
|
|
10
8
|
import { LocalTimestampProto } from "../../../fintekkers/models/util/local_timestamp_pb";
|
|
11
9
|
import { LocalDateProto } from "../../../fintekkers/models/util/local_date_pb";
|
|
12
10
|
import { IdentifierProto } from "../../../fintekkers/models/security/identifier/identifier_pb";
|
|
13
|
-
import { UUID } from "../utils/uuid";
|
|
14
11
|
import { MeasureProto } from "../../../fintekkers/models/position/measure_pb";
|
|
15
12
|
import Decimal from "decimal.js";
|
|
16
13
|
import { ProtoSerializationUtil } from "../utils/serialization";
|
|
17
|
-
import { SecurityProto } from "../../../fintekkers/models/security/security_pb";
|
|
18
|
-
import { PortfolioProto } from "../../../fintekkers/models/portfolio/portfolio_pb";
|
|
19
14
|
import { StringValue } from 'google-protobuf/google/protobuf/wrappers_pb';
|
|
15
|
+
import { ProtoEnum } from "../utils/protoEnum";
|
|
16
|
+
import { Field } from "./field";
|
|
17
|
+
import { UUID } from "../utils/uuid";
|
|
18
|
+
import { ZonedDateTime } from "../utils/datetime";
|
|
20
19
|
|
|
21
20
|
export class Position {
|
|
22
21
|
proto: PositionProto;
|
|
23
22
|
|
|
24
23
|
constructor(positionProto: PositionProto) {
|
|
25
24
|
this.proto = positionProto;
|
|
26
|
-
|
|
27
|
-
// //For each field, put into a map
|
|
28
|
-
// this.proto.getFieldsList().forEach(field => {
|
|
29
|
-
// console.log(field);
|
|
30
|
-
// });
|
|
31
|
-
|
|
32
25
|
}
|
|
33
26
|
|
|
34
27
|
public getFieldValue(field: FieldProto): any {
|
|
35
28
|
return this.getField(new FieldMapEntry().setField(field));
|
|
36
29
|
}
|
|
37
30
|
|
|
38
|
-
public getField(fieldToGet: FieldMapEntry):
|
|
31
|
+
public getField(fieldToGet: FieldMapEntry): string | ProtoEnum | Security | Portfolio | UUID | Date | ZonedDateTime | number {
|
|
39
32
|
for (const tmpField of this.proto.getFieldsList()) {
|
|
40
33
|
if (tmpField.getField() === fieldToGet.getField()) {
|
|
41
34
|
|
|
42
|
-
if (tmpField.getStringValue()) {
|
|
35
|
+
if (tmpField.getStringValue() !== undefined && tmpField.getStringValue().length > 0) {
|
|
43
36
|
return tmpField.getStringValue();
|
|
44
37
|
}
|
|
45
38
|
|
|
46
39
|
if (tmpField.getEnumValue() > 0) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
let fieldName: string = new Field(fieldToGet.getField()).getName();
|
|
41
|
+
let proto: ProtoEnum = ProtoEnum.fromEnumName(fieldName, tmpField.getEnumValue());
|
|
42
|
+
return proto;
|
|
50
43
|
}
|
|
51
44
|
|
|
52
45
|
const unpackedValue = Position.unpackField(tmpField);
|
|
@@ -73,7 +66,7 @@ export class Position {
|
|
|
73
66
|
private getMeasure(measureToGet: MeasureMapEntry): Decimal {
|
|
74
67
|
for (const tmpMeasure of this.proto.getMeasuresList()) {
|
|
75
68
|
if (tmpMeasure.getMeasure() === measureToGet.getMeasure()) {
|
|
76
|
-
return ProtoSerializationUtil.deserialize(tmpMeasure.getMeasureDecimalValue());
|
|
69
|
+
return ProtoSerializationUtil.deserialize(tmpMeasure.getMeasureDecimalValue()) as unknown as Decimal;
|
|
77
70
|
}
|
|
78
71
|
}
|
|
79
72
|
|
|
@@ -110,18 +103,6 @@ export class Position {
|
|
|
110
103
|
return output;
|
|
111
104
|
}
|
|
112
105
|
|
|
113
|
-
// private static wrapStringToAny(myString: string): Any {
|
|
114
|
-
// const myAny = new Any();
|
|
115
|
-
// myAny.pack(wrappers.StringValue.create({ value: myString }));
|
|
116
|
-
// return myAny;
|
|
117
|
-
// }
|
|
118
|
-
|
|
119
|
-
// private static packField(fieldToPack: any): Any {
|
|
120
|
-
// const myAny = new Any();
|
|
121
|
-
// myAny.pack(fieldToPack);
|
|
122
|
-
// return myAny;
|
|
123
|
-
// }
|
|
124
|
-
|
|
125
106
|
public static unpackField(fieldToUnpack: FieldMapEntry): any {
|
|
126
107
|
switch (fieldToUnpack.getField()) {
|
|
127
108
|
case FieldProto.PORTFOLIO_ID:
|
|
@@ -157,12 +138,4 @@ export class Position {
|
|
|
157
138
|
throw new Error(`Field not found. Could not unpack ${FieldProto[fieldToUnpack.getField()]}`);
|
|
158
139
|
}
|
|
159
140
|
}
|
|
160
|
-
|
|
161
|
-
// public static unpackMeasure(measureToUnpack: MeasureProto): DecimalValueProto {
|
|
162
|
-
// if (measureToUnpack === MeasureProto.DIRECTED_QUANTITY) {
|
|
163
|
-
// return measureToUnpack.g;
|
|
164
|
-
// } else {
|
|
165
|
-
// throw new Error(`Field not found. Could not unpack ${MeasureProto.Name[measureToUnpack.measure]}`);
|
|
166
|
-
// }
|
|
167
|
-
// }
|
|
168
141
|
}
|
|
@@ -21,10 +21,10 @@ var LocalDate = /** @class */ (function () {
|
|
|
21
21
|
};
|
|
22
22
|
LocalDate.today = function () {
|
|
23
23
|
var today = new Date();
|
|
24
|
-
return
|
|
24
|
+
return this.from(today);
|
|
25
25
|
};
|
|
26
26
|
LocalDate.from = function (date) {
|
|
27
|
-
return new LocalDate(new local_date_pb_1.LocalDateProto().setYear(date.getFullYear()).setMonth(date.getMonth()).setDay(date.getDate()));
|
|
27
|
+
return new LocalDate(new local_date_pb_1.LocalDateProto().setYear(date.getFullYear()).setMonth(date.getMonth() + 1).setDay(date.getDate()));
|
|
28
28
|
};
|
|
29
29
|
return LocalDate;
|
|
30
30
|
}());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date.js","sourceRoot":"","sources":["date.ts"],"names":[],"mappings":";;;AACA,+EAA+E;AAC/E,iDAAyD;AAEzD;IAGE,mBAAY,KAAqB;QAC/B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,0BAAM,GAAN;QACE,sEAAsE;QACtE,gFAAgF;QAChF,4EAA4E;QAC5E,OAAO,sCAAsB,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC;IAED,4BAAQ,GAAR;QACE,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM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