@fintekkers/ledger-models 0.1.61 → 0.1.63
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 +3 -0
- package/node/fintekkers/models/position/field_pb.d.ts +1 -0
- package/node/fintekkers/models/position/field_pb.js +1 -0
- package/node/fintekkers/models/security/bond/auction_type_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/bond/auction_type_pb.d.ts +12 -0
- package/node/fintekkers/models/security/bond/auction_type_pb.js +33 -0
- package/node/fintekkers/models/security/bond/issuance_grpc_pb.js +1 -0
- package/node/fintekkers/models/security/bond/issuance_pb.d.ts +85 -0
- package/node/fintekkers/models/security/bond/issuance_pb.js +652 -0
- package/node/fintekkers/models/security/security_pb.d.ts +6 -0
- package/node/fintekkers/models/security/security_pb.js +64 -2
- package/node/fintekkers/requests/transaction/query_transaction_request_pb.d.ts +3 -0
- package/node/fintekkers/requests/transaction/query_transaction_request_pb.js +31 -1
- package/node/fintekkers/requests/transaction/query_transaction_response_pb.d.ts +7 -0
- package/node/fintekkers/requests/transaction/query_transaction_response_pb.js +54 -1
- package/node/wrappers/models/portfolio/portfolio.js +41 -0
- package/node/wrappers/models/portfolio/portfolio.js.map +1 -0
- package/node/wrappers/models/portfolio/portfolio.ts +49 -0
- package/node/wrappers/models/position/position.js +14 -9
- package/node/wrappers/models/position/position.js.map +1 -1
- package/node/wrappers/models/position/position.test.js +43 -0
- package/node/wrappers/models/position/position.test.js.map +1 -0
- package/node/wrappers/models/position/position.test.ts +70 -0
- package/node/wrappers/models/position/position.ts +17 -10
- package/node/wrappers/models/position/positionfilter.js +35 -0
- package/node/wrappers/models/position/positionfilter.js.map +1 -0
- package/node/wrappers/models/position/positionfilter.ts +38 -0
- package/node/wrappers/models/security/security.test.js +33 -0
- package/node/wrappers/models/security/security.test.js.map +1 -0
- package/node/wrappers/models/security/security.test.ts +41 -0
- package/node/wrappers/models/transaction/transaction.js +6 -5
- package/node/wrappers/models/transaction/transaction.js.map +1 -1
- package/node/wrappers/models/transaction/transaction.test.js.map +1 -1
- package/node/wrappers/models/transaction/transaction.test.ts +1 -6
- package/node/wrappers/models/transaction/transaction.ts +31 -31
- package/node/wrappers/models/transaction/transaction_type.js +0 -1
- package/node/wrappers/models/transaction/transaction_type.js.map +1 -1
- package/node/wrappers/models/transaction/transaction_type.ts +1 -1
- package/node/wrappers/models/utils/datetime.js +9 -0
- package/node/wrappers/models/utils/datetime.js.map +1 -1
- package/node/wrappers/models/utils/datetime.ts +16 -4
- package/node/wrappers/models/utils/requestcontext.js +55 -0
- package/node/wrappers/models/utils/requestcontext.js.map +1 -0
- package/node/wrappers/models/utils/requestcontext.ts +44 -0
- package/node/wrappers/models/utils/requestcontext_d.js +1 -0
- package/node/wrappers/models/utils/requestcontext_d.js.map +1 -0
- package/node/wrappers/models/utils/requestcontext_d.ts +7 -0
- package/node/wrappers/models/utils/serialization.js +14 -4
- package/node/wrappers/models/utils/serialization.js.map +1 -1
- package/node/wrappers/models/utils/serialization.test.js +8 -9
- package/node/wrappers/models/utils/serialization.test.js.map +1 -1
- package/node/wrappers/models/utils/serialization.test.ts +8 -10
- package/node/wrappers/models/utils/serialization.ts +46 -38
- package/node/wrappers/models/utils/serialization.util.js +108 -0
- package/node/wrappers/models/utils/serialization.util.js.map +1 -0
- package/node/wrappers/models/utils/serialization.util.test.js +36 -0
- package/node/wrappers/models/utils/serialization.util.test.js.map +1 -0
- package/node/wrappers/models/utils/serialization.util.test.ts +47 -0
- package/node/wrappers/models/utils/serialization.util.ts +121 -0
- package/node/wrappers/services/portfolio-service/PortfolioService.js +8 -16
- package/node/wrappers/services/portfolio-service/PortfolioService.js.map +1 -1
- package/node/wrappers/services/portfolio-service/PortfolioService.ts +14 -24
- package/node/wrappers/services/portfolio-service/portfolio.test.js +30 -34
- package/node/wrappers/services/portfolio-service/portfolio.test.js.map +1 -1
- package/node/wrappers/services/portfolio-service/portfolio.test.ts +9 -13
- package/node/wrappers/services/position-service/PositionService.js +4 -3
- package/node/wrappers/services/position-service/PositionService.js.map +1 -1
- package/node/wrappers/services/position-service/PositionService.ts +4 -19
- package/node/wrappers/services/position-service/position.test.js +24 -9
- package/node/wrappers/services/position-service/position.test.js.map +1 -1
- package/node/wrappers/services/position-service/position.test.ts +57 -51
- package/node/wrappers/services/security-service/SecurityService.js +16 -15
- package/node/wrappers/services/security-service/SecurityService.js.map +1 -1
- package/node/wrappers/services/security-service/SecurityService.ts +15 -18
- package/node/wrappers/services/security-service/security.maturityLadder.test.js +59 -0
- package/node/wrappers/services/security-service/security.maturityLadder.test.js.map +1 -0
- package/node/wrappers/services/security-service/security.maturityLadder.test.ts +39 -0
- package/node/wrappers/services/security-service/security.test.js +19 -7
- package/node/wrappers/services/security-service/security.test.js.map +1 -1
- package/node/wrappers/services/security-service/security.test.ts +11 -7
- package/node/wrappers/services/transaction-service/TransactionService.js +34 -47
- package/node/wrappers/services/transaction-service/TransactionService.js.map +1 -1
- package/node/wrappers/services/transaction-service/TransactionService.ts +16 -23
- package/node/wrappers/services/transaction-service/transaction.test.js +45 -12
- package/node/wrappers/services/transaction-service/transaction.test.js.map +1 -1
- package/node/wrappers/services/transaction-service/transaction.test.ts +48 -21
- package/package.json +2 -1
- package/web/fintekkers/models/position/field_pb.d.ts +1 -0
- package/web/fintekkers/models/position/field_pb.js +1 -0
- package/web/fintekkers/models/security/bond/auction_type_pb.d.ts +8 -0
- package/web/fintekkers/models/security/bond/auction_type_pb.js +27 -0
- package/web/fintekkers/models/security/bond/issuance_pb.d.ts +82 -0
- package/web/fintekkers/models/security/bond/issuance_pb.js +646 -0
- package/web/fintekkers/models/security/security_pb.d.ts +7 -0
- package/web/fintekkers/models/security/security_pb.js +64 -2
- package/web/fintekkers/requests/transaction/query_transaction_request_pb.d.ts +4 -0
- package/web/fintekkers/requests/transaction/query_transaction_request_pb.js +31 -1
- package/web/fintekkers/requests/transaction/query_transaction_response_pb.d.ts +7 -0
- package/web/fintekkers/requests/transaction/query_transaction_response_pb.js +54 -1
- package/node/wrappers/models/utils/util.js +0 -28
- package/node/wrappers/models/utils/util.js.map +0 -1
- package/node/wrappers/models/utils/util.ts +0 -28
|
@@ -31,6 +31,8 @@ var fintekkers_models_util_uuid_pb = require('../../../fintekkers/models/util/uu
|
|
|
31
31
|
goog.object.extend(proto, fintekkers_models_util_uuid_pb);
|
|
32
32
|
var fintekkers_models_security_identifier_identifier_pb = require('../../../fintekkers/models/security/identifier/identifier_pb.js');
|
|
33
33
|
goog.object.extend(proto, fintekkers_models_security_identifier_identifier_pb);
|
|
34
|
+
var fintekkers_models_security_bond_issuance_pb = require('../../../fintekkers/models/security/bond/issuance_pb.js');
|
|
35
|
+
goog.object.extend(proto, fintekkers_models_security_bond_issuance_pb);
|
|
34
36
|
var fintekkers_models_security_security_type_pb = require('../../../fintekkers/models/security/security_type_pb.js');
|
|
35
37
|
goog.object.extend(proto, fintekkers_models_security_security_type_pb);
|
|
36
38
|
var fintekkers_models_security_security_quantity_type_pb = require('../../../fintekkers/models/security/security_quantity_type_pb.js');
|
|
@@ -51,7 +53,7 @@ goog.exportSymbol('proto.fintekkers.models.security.SecurityProto', null, global
|
|
|
51
53
|
* @constructor
|
|
52
54
|
*/
|
|
53
55
|
proto.fintekkers.models.security.SecurityProto = function(opt_data) {
|
|
54
|
-
jspb.Message.initialize(this, opt_data, 0, -1,
|
|
56
|
+
jspb.Message.initialize(this, opt_data, 0, -1, proto.fintekkers.models.security.SecurityProto.repeatedFields_, null);
|
|
55
57
|
};
|
|
56
58
|
goog.inherits(proto.fintekkers.models.security.SecurityProto, jspb.Message);
|
|
57
59
|
if (goog.DEBUG && !COMPILED) {
|
|
@@ -62,6 +64,13 @@ if (goog.DEBUG && !COMPILED) {
|
|
|
62
64
|
proto.fintekkers.models.security.SecurityProto.displayName = 'proto.fintekkers.models.security.SecurityProto';
|
|
63
65
|
}
|
|
64
66
|
|
|
67
|
+
/**
|
|
68
|
+
* List of repeated fields within this message type.
|
|
69
|
+
* @private {!Array<number>}
|
|
70
|
+
* @const
|
|
71
|
+
*/
|
|
72
|
+
proto.fintekkers.models.security.SecurityProto.repeatedFields_ = [67];
|
|
73
|
+
|
|
65
74
|
|
|
66
75
|
|
|
67
76
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
|
@@ -114,7 +123,9 @@ proto.fintekkers.models.security.SecurityProto.toObject = function(includeInstan
|
|
|
114
123
|
datedDate: (f = msg.getDatedDate()) && fintekkers_models_util_local_date_pb.LocalDateProto.toObject(includeInstance, f),
|
|
115
124
|
faceValue: (f = msg.getFaceValue()) && fintekkers_models_util_decimal_value_pb.DecimalValueProto.toObject(includeInstance, f),
|
|
116
125
|
issueDate: (f = msg.getIssueDate()) && fintekkers_models_util_local_date_pb.LocalDateProto.toObject(includeInstance, f),
|
|
117
|
-
maturityDate: (f = msg.getMaturityDate()) && fintekkers_models_util_local_date_pb.LocalDateProto.toObject(includeInstance, f)
|
|
126
|
+
maturityDate: (f = msg.getMaturityDate()) && fintekkers_models_util_local_date_pb.LocalDateProto.toObject(includeInstance, f),
|
|
127
|
+
issuanceInfoList: jspb.Message.toObjectList(msg.getIssuanceInfoList(),
|
|
128
|
+
fintekkers_models_security_bond_issuance_pb.IssuanceProto.toObject, includeInstance)
|
|
118
129
|
};
|
|
119
130
|
|
|
120
131
|
if (includeInstance) {
|
|
@@ -250,6 +261,11 @@ proto.fintekkers.models.security.SecurityProto.deserializeBinaryFromReader = fun
|
|
|
250
261
|
reader.readMessage(value,fintekkers_models_util_local_date_pb.LocalDateProto.deserializeBinaryFromReader);
|
|
251
262
|
msg.setMaturityDate(value);
|
|
252
263
|
break;
|
|
264
|
+
case 67:
|
|
265
|
+
var value = new fintekkers_models_security_bond_issuance_pb.IssuanceProto;
|
|
266
|
+
reader.readMessage(value,fintekkers_models_security_bond_issuance_pb.IssuanceProto.deserializeBinaryFromReader);
|
|
267
|
+
msg.addIssuanceInfo(value);
|
|
268
|
+
break;
|
|
253
269
|
default:
|
|
254
270
|
reader.skipField();
|
|
255
271
|
break;
|
|
@@ -444,6 +460,14 @@ proto.fintekkers.models.security.SecurityProto.serializeBinaryToWriter = functio
|
|
|
444
460
|
fintekkers_models_util_local_date_pb.LocalDateProto.serializeBinaryToWriter
|
|
445
461
|
);
|
|
446
462
|
}
|
|
463
|
+
f = message.getIssuanceInfoList();
|
|
464
|
+
if (f.length > 0) {
|
|
465
|
+
writer.writeRepeatedMessage(
|
|
466
|
+
67,
|
|
467
|
+
f,
|
|
468
|
+
fintekkers_models_security_bond_issuance_pb.IssuanceProto.serializeBinaryToWriter
|
|
469
|
+
);
|
|
470
|
+
}
|
|
447
471
|
};
|
|
448
472
|
|
|
449
473
|
|
|
@@ -1052,4 +1076,42 @@ proto.fintekkers.models.security.SecurityProto.prototype.hasMaturityDate = funct
|
|
|
1052
1076
|
};
|
|
1053
1077
|
|
|
1054
1078
|
|
|
1079
|
+
/**
|
|
1080
|
+
* repeated bond.IssuanceProto issuance_info = 67;
|
|
1081
|
+
* @return {!Array<!proto.fintekkers.models.security.bond.IssuanceProto>}
|
|
1082
|
+
*/
|
|
1083
|
+
proto.fintekkers.models.security.SecurityProto.prototype.getIssuanceInfoList = function() {
|
|
1084
|
+
return /** @type{!Array<!proto.fintekkers.models.security.bond.IssuanceProto>} */ (
|
|
1085
|
+
jspb.Message.getRepeatedWrapperField(this, fintekkers_models_security_bond_issuance_pb.IssuanceProto, 67));
|
|
1086
|
+
};
|
|
1087
|
+
|
|
1088
|
+
|
|
1089
|
+
/**
|
|
1090
|
+
* @param {!Array<!proto.fintekkers.models.security.bond.IssuanceProto>} value
|
|
1091
|
+
* @return {!proto.fintekkers.models.security.SecurityProto} returns this
|
|
1092
|
+
*/
|
|
1093
|
+
proto.fintekkers.models.security.SecurityProto.prototype.setIssuanceInfoList = function(value) {
|
|
1094
|
+
return jspb.Message.setRepeatedWrapperField(this, 67, value);
|
|
1095
|
+
};
|
|
1096
|
+
|
|
1097
|
+
|
|
1098
|
+
/**
|
|
1099
|
+
* @param {!proto.fintekkers.models.security.bond.IssuanceProto=} opt_value
|
|
1100
|
+
* @param {number=} opt_index
|
|
1101
|
+
* @return {!proto.fintekkers.models.security.bond.IssuanceProto}
|
|
1102
|
+
*/
|
|
1103
|
+
proto.fintekkers.models.security.SecurityProto.prototype.addIssuanceInfo = function(opt_value, opt_index) {
|
|
1104
|
+
return jspb.Message.addToRepeatedWrapperField(this, 67, opt_value, proto.fintekkers.models.security.bond.IssuanceProto, opt_index);
|
|
1105
|
+
};
|
|
1106
|
+
|
|
1107
|
+
|
|
1108
|
+
/**
|
|
1109
|
+
* Clears the list making it empty but non-null.
|
|
1110
|
+
* @return {!proto.fintekkers.models.security.SecurityProto} returns this
|
|
1111
|
+
*/
|
|
1112
|
+
proto.fintekkers.models.security.SecurityProto.prototype.clearIssuanceInfoList = function() {
|
|
1113
|
+
return this.setIssuanceInfoList([]);
|
|
1114
|
+
};
|
|
1115
|
+
|
|
1116
|
+
|
|
1055
1117
|
goog.object.extend(exports, proto.fintekkers.models.security);
|
|
@@ -28,6 +28,8 @@ export class QueryTransactionRequestProto extends jspb.Message {
|
|
|
28
28
|
clearAsOf(): void;
|
|
29
29
|
getAsOf(): fintekkers_models_util_local_timestamp_pb.LocalTimestampProto | undefined;
|
|
30
30
|
setAsOf(value?: fintekkers_models_util_local_timestamp_pb.LocalTimestampProto): QueryTransactionRequestProto;
|
|
31
|
+
getLimit(): number;
|
|
32
|
+
setLimit(value: number): QueryTransactionRequestProto;
|
|
31
33
|
|
|
32
34
|
serializeBinary(): Uint8Array;
|
|
33
35
|
toObject(includeInstance?: boolean): QueryTransactionRequestProto.AsObject;
|
|
@@ -46,5 +48,6 @@ export namespace QueryTransactionRequestProto {
|
|
|
46
48
|
uuidsList: Array<fintekkers_models_util_uuid_pb.UUIDProto.AsObject>,
|
|
47
49
|
searchTransactionInput?: fintekkers_models_position_position_filter_pb.PositionFilterProto.AsObject,
|
|
48
50
|
asOf?: fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.AsObject,
|
|
51
|
+
limit: number,
|
|
49
52
|
}
|
|
50
53
|
}
|
|
@@ -93,7 +93,8 @@ proto.fintekkers.requests.transaction.QueryTransactionRequestProto.toObject = fu
|
|
|
93
93
|
uuidsList: jspb.Message.toObjectList(msg.getUuidsList(),
|
|
94
94
|
fintekkers_models_util_uuid_pb.UUIDProto.toObject, includeInstance),
|
|
95
95
|
searchTransactionInput: (f = msg.getSearchTransactionInput()) && fintekkers_models_position_position_filter_pb.PositionFilterProto.toObject(includeInstance, f),
|
|
96
|
-
asOf: (f = msg.getAsOf()) && fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.toObject(includeInstance, f)
|
|
96
|
+
asOf: (f = msg.getAsOf()) && fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.toObject(includeInstance, f),
|
|
97
|
+
limit: jspb.Message.getFieldWithDefault(msg, 24, 0)
|
|
97
98
|
};
|
|
98
99
|
|
|
99
100
|
if (includeInstance) {
|
|
@@ -153,6 +154,10 @@ proto.fintekkers.requests.transaction.QueryTransactionRequestProto.deserializeBi
|
|
|
153
154
|
reader.readMessage(value,fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.deserializeBinaryFromReader);
|
|
154
155
|
msg.setAsOf(value);
|
|
155
156
|
break;
|
|
157
|
+
case 24:
|
|
158
|
+
var value = /** @type {number} */ (reader.readInt32());
|
|
159
|
+
msg.setLimit(value);
|
|
160
|
+
break;
|
|
156
161
|
default:
|
|
157
162
|
reader.skipField();
|
|
158
163
|
break;
|
|
@@ -220,6 +225,13 @@ proto.fintekkers.requests.transaction.QueryTransactionRequestProto.serializeBina
|
|
|
220
225
|
fintekkers_models_util_local_timestamp_pb.LocalTimestampProto.serializeBinaryToWriter
|
|
221
226
|
);
|
|
222
227
|
}
|
|
228
|
+
f = message.getLimit();
|
|
229
|
+
if (f !== 0) {
|
|
230
|
+
writer.writeInt32(
|
|
231
|
+
24,
|
|
232
|
+
f
|
|
233
|
+
);
|
|
234
|
+
}
|
|
223
235
|
};
|
|
224
236
|
|
|
225
237
|
|
|
@@ -371,4 +383,22 @@ proto.fintekkers.requests.transaction.QueryTransactionRequestProto.prototype.has
|
|
|
371
383
|
};
|
|
372
384
|
|
|
373
385
|
|
|
386
|
+
/**
|
|
387
|
+
* optional int32 limit = 24;
|
|
388
|
+
* @return {number}
|
|
389
|
+
*/
|
|
390
|
+
proto.fintekkers.requests.transaction.QueryTransactionRequestProto.prototype.getLimit = function() {
|
|
391
|
+
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 24, 0));
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* @param {number} value
|
|
397
|
+
* @return {!proto.fintekkers.requests.transaction.QueryTransactionRequestProto} returns this
|
|
398
|
+
*/
|
|
399
|
+
proto.fintekkers.requests.transaction.QueryTransactionRequestProto.prototype.setLimit = function(value) {
|
|
400
|
+
return jspb.Message.setProto3IntField(this, 24, value);
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
|
|
374
404
|
goog.object.extend(exports, proto.fintekkers.requests.transaction);
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import * as jspb from "google-protobuf";
|
|
8
8
|
import * as fintekkers_models_transaction_transaction_pb from "../../../fintekkers/models/transaction/transaction_pb";
|
|
9
9
|
import * as fintekkers_requests_transaction_query_transaction_request_pb from "../../../fintekkers/requests/transaction/query_transaction_request_pb";
|
|
10
|
+
import * as fintekkers_requests_util_errors_summary_pb from "../../../fintekkers/requests/util/errors/summary_pb";
|
|
10
11
|
|
|
11
12
|
export class QueryTransactionResponseProto extends jspb.Message {
|
|
12
13
|
getObjectClass(): string;
|
|
@@ -23,6 +24,11 @@ export class QueryTransactionResponseProto extends jspb.Message {
|
|
|
23
24
|
setTransactionResponseList(value: Array<fintekkers_models_transaction_transaction_pb.TransactionProto>): QueryTransactionResponseProto;
|
|
24
25
|
addTransactionResponse(value?: fintekkers_models_transaction_transaction_pb.TransactionProto, index?: number): fintekkers_models_transaction_transaction_pb.TransactionProto;
|
|
25
26
|
|
|
27
|
+
hasErrorsOrWarnings(): boolean;
|
|
28
|
+
clearErrorsOrWarnings(): void;
|
|
29
|
+
getErrorsOrWarnings(): fintekkers_requests_util_errors_summary_pb.SummaryProto | undefined;
|
|
30
|
+
setErrorsOrWarnings(value?: fintekkers_requests_util_errors_summary_pb.SummaryProto): QueryTransactionResponseProto;
|
|
31
|
+
|
|
26
32
|
serializeBinary(): Uint8Array;
|
|
27
33
|
toObject(includeInstance?: boolean): QueryTransactionResponseProto.AsObject;
|
|
28
34
|
static toObject(includeInstance: boolean, msg: QueryTransactionResponseProto): QueryTransactionResponseProto.AsObject;
|
|
@@ -39,5 +45,6 @@ export namespace QueryTransactionResponseProto {
|
|
|
39
45
|
version: string,
|
|
40
46
|
createTransactionRequest?: fintekkers_requests_transaction_query_transaction_request_pb.QueryTransactionRequestProto.AsObject,
|
|
41
47
|
transactionResponseList: Array<fintekkers_models_transaction_transaction_pb.TransactionProto.AsObject>,
|
|
48
|
+
errorsOrWarnings?: fintekkers_requests_util_errors_summary_pb.SummaryProto.AsObject,
|
|
42
49
|
}
|
|
43
50
|
}
|
|
@@ -25,6 +25,8 @@ var fintekkers_models_transaction_transaction_pb = require('../../../fintekkers/
|
|
|
25
25
|
goog.object.extend(proto, fintekkers_models_transaction_transaction_pb);
|
|
26
26
|
var fintekkers_requests_transaction_query_transaction_request_pb = require('../../../fintekkers/requests/transaction/query_transaction_request_pb.js');
|
|
27
27
|
goog.object.extend(proto, fintekkers_requests_transaction_query_transaction_request_pb);
|
|
28
|
+
var fintekkers_requests_util_errors_summary_pb = require('../../../fintekkers/requests/util/errors/summary_pb.js');
|
|
29
|
+
goog.object.extend(proto, fintekkers_requests_util_errors_summary_pb);
|
|
28
30
|
goog.exportSymbol('proto.fintekkers.requests.transaction.QueryTransactionResponseProto', null, global);
|
|
29
31
|
/**
|
|
30
32
|
* Generated by JsPbCodeGenerator.
|
|
@@ -90,7 +92,8 @@ proto.fintekkers.requests.transaction.QueryTransactionResponseProto.toObject = f
|
|
|
90
92
|
version: jspb.Message.getFieldWithDefault(msg, 2, ""),
|
|
91
93
|
createTransactionRequest: (f = msg.getCreateTransactionRequest()) && fintekkers_requests_transaction_query_transaction_request_pb.QueryTransactionRequestProto.toObject(includeInstance, f),
|
|
92
94
|
transactionResponseList: jspb.Message.toObjectList(msg.getTransactionResponseList(),
|
|
93
|
-
fintekkers_models_transaction_transaction_pb.TransactionProto.toObject, includeInstance)
|
|
95
|
+
fintekkers_models_transaction_transaction_pb.TransactionProto.toObject, includeInstance),
|
|
96
|
+
errorsOrWarnings: (f = msg.getErrorsOrWarnings()) && fintekkers_requests_util_errors_summary_pb.SummaryProto.toObject(includeInstance, f)
|
|
94
97
|
};
|
|
95
98
|
|
|
96
99
|
if (includeInstance) {
|
|
@@ -145,6 +148,11 @@ proto.fintekkers.requests.transaction.QueryTransactionResponseProto.deserializeB
|
|
|
145
148
|
reader.readMessage(value,fintekkers_models_transaction_transaction_pb.TransactionProto.deserializeBinaryFromReader);
|
|
146
149
|
msg.addTransactionResponse(value);
|
|
147
150
|
break;
|
|
151
|
+
case 40:
|
|
152
|
+
var value = new fintekkers_requests_util_errors_summary_pb.SummaryProto;
|
|
153
|
+
reader.readMessage(value,fintekkers_requests_util_errors_summary_pb.SummaryProto.deserializeBinaryFromReader);
|
|
154
|
+
msg.setErrorsOrWarnings(value);
|
|
155
|
+
break;
|
|
148
156
|
default:
|
|
149
157
|
reader.skipField();
|
|
150
158
|
break;
|
|
@@ -204,6 +212,14 @@ proto.fintekkers.requests.transaction.QueryTransactionResponseProto.serializeBin
|
|
|
204
212
|
fintekkers_models_transaction_transaction_pb.TransactionProto.serializeBinaryToWriter
|
|
205
213
|
);
|
|
206
214
|
}
|
|
215
|
+
f = message.getErrorsOrWarnings();
|
|
216
|
+
if (f != null) {
|
|
217
|
+
writer.writeMessage(
|
|
218
|
+
40,
|
|
219
|
+
f,
|
|
220
|
+
fintekkers_requests_util_errors_summary_pb.SummaryProto.serializeBinaryToWriter
|
|
221
|
+
);
|
|
222
|
+
}
|
|
207
223
|
};
|
|
208
224
|
|
|
209
225
|
|
|
@@ -318,4 +334,41 @@ proto.fintekkers.requests.transaction.QueryTransactionResponseProto.prototype.cl
|
|
|
318
334
|
};
|
|
319
335
|
|
|
320
336
|
|
|
337
|
+
/**
|
|
338
|
+
* optional fintekkers.requests.util.errors.SummaryProto errors_or_warnings = 40;
|
|
339
|
+
* @return {?proto.fintekkers.requests.util.errors.SummaryProto}
|
|
340
|
+
*/
|
|
341
|
+
proto.fintekkers.requests.transaction.QueryTransactionResponseProto.prototype.getErrorsOrWarnings = function() {
|
|
342
|
+
return /** @type{?proto.fintekkers.requests.util.errors.SummaryProto} */ (
|
|
343
|
+
jspb.Message.getWrapperField(this, fintekkers_requests_util_errors_summary_pb.SummaryProto, 40));
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* @param {?proto.fintekkers.requests.util.errors.SummaryProto|undefined} value
|
|
349
|
+
* @return {!proto.fintekkers.requests.transaction.QueryTransactionResponseProto} returns this
|
|
350
|
+
*/
|
|
351
|
+
proto.fintekkers.requests.transaction.QueryTransactionResponseProto.prototype.setErrorsOrWarnings = function(value) {
|
|
352
|
+
return jspb.Message.setWrapperField(this, 40, value);
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Clears the message field making it undefined.
|
|
358
|
+
* @return {!proto.fintekkers.requests.transaction.QueryTransactionResponseProto} returns this
|
|
359
|
+
*/
|
|
360
|
+
proto.fintekkers.requests.transaction.QueryTransactionResponseProto.prototype.clearErrorsOrWarnings = function() {
|
|
361
|
+
return this.setErrorsOrWarnings(undefined);
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Returns whether this field is set.
|
|
367
|
+
* @return {boolean}
|
|
368
|
+
*/
|
|
369
|
+
proto.fintekkers.requests.transaction.QueryTransactionResponseProto.prototype.hasErrorsOrWarnings = function() {
|
|
370
|
+
return jspb.Message.getField(this, 40) != null;
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
|
|
321
374
|
goog.object.extend(exports, proto.fintekkers.requests.transaction);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var field_pb_1 = require("../../../fintekkers/models/position/field_pb");
|
|
4
|
+
var datetime_1 = require("../utils/datetime");
|
|
5
|
+
var uuid_1 = require("../utils/uuid");
|
|
6
|
+
var Portfolio = /** @class */ (function () {
|
|
7
|
+
function Portfolio(proto) {
|
|
8
|
+
this.proto = proto;
|
|
9
|
+
}
|
|
10
|
+
// getProto(): PortfolioProto {
|
|
11
|
+
// return this.proto;
|
|
12
|
+
// }
|
|
13
|
+
Portfolio.prototype.getID = function () {
|
|
14
|
+
return uuid_1.UUID.fromU8Array(this.proto.getUuid().getRawUuid_asU8());
|
|
15
|
+
};
|
|
16
|
+
Portfolio.prototype.getAsOf = function () {
|
|
17
|
+
return new datetime_1.ZonedDateTime(this.proto.getAsOf());
|
|
18
|
+
};
|
|
19
|
+
Portfolio.prototype.getPortfolioName = function () {
|
|
20
|
+
return this.proto.getPortfolioName();
|
|
21
|
+
};
|
|
22
|
+
Portfolio.prototype.getFields = function () {
|
|
23
|
+
return [field_pb_1.FieldProto.ID, field_pb_1.FieldProto.PORTFOLIO, field_pb_1.FieldProto.PORTFOLIO_ID, field_pb_1.FieldProto.PORTFOLIO_NAME];
|
|
24
|
+
};
|
|
25
|
+
Portfolio.prototype.getField = function (field) {
|
|
26
|
+
switch (field) {
|
|
27
|
+
case field_pb_1.FieldProto.ID:
|
|
28
|
+
case field_pb_1.FieldProto.PORTFOLIO_ID:
|
|
29
|
+
return this.getID();
|
|
30
|
+
case field_pb_1.FieldProto.AS_OF:
|
|
31
|
+
return this.getAsOf();
|
|
32
|
+
case field_pb_1.FieldProto.PORTFOLIO_NAME:
|
|
33
|
+
return this.getPortfolioName();
|
|
34
|
+
default:
|
|
35
|
+
throw new Error("Field not mapped in Portfolio wrapper: ".concat(field));
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
return Portfolio;
|
|
39
|
+
}());
|
|
40
|
+
exports.default = Portfolio;
|
|
41
|
+
//# sourceMappingURL=portfolio.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portfolio.js","sourceRoot":"","sources":["portfolio.ts"],"names":[],"mappings":";;AACA,yEAA0E;AAC1E,8CAAkD;AAClD,sCAAqC;AAErC;IAGI,mBAAY,KAAqB;QAC7B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,+BAA+B;IAC/B,yBAAyB;IACzB,IAAI;IAEJ,yBAAK,GAAL;QACI,OAAO,WAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,eAAe,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,2BAAO,GAAP;QACI,OAAO,IAAI,wBAAa,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACnD,CAAC;IAED,oCAAgB,GAAhB;QACI,OAAO,IAAI,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;IACzC,CAAC;IAED,6BAAS,GAAT;QACI,OAAO,CAAC,qBAAU,CAAC,EAAE,EAAE,qBAAU,CAAC,SAAS,EAAE,qBAAU,CAAC,YAAY,EAAE,qBAAU,CAAC,cAAc,CAAC,CAAC;IACrG,CAAC;IAED,4BAAQ,GAAR,UAAS,KAAiB;QACtB,QAAQ,KAAK,EAAE;YACX,KAAK,qBAAU,CAAC,EAAE,CAAC;YACnB,KAAK,qBAAU,CAAC,YAAY;gBACxB,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC;YACxB,KAAK,qBAAU,CAAC,KAAK;gBACjB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;YAC1B,KAAK,qBAAU,CAAC,cAAc;gBAC1B,OAAO,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACnC;gBACI,MAAM,IAAI,KAAK,CAAC,iDAA0C,KAAK,CAAE,CAAC,CAAC;SAC1E;IACL,CAAC;IACL,gBAAC;AAAD,CAAC,AAxCD,IAwCC;AAGD,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { PortfolioProto } from "../../../fintekkers/models/portfolio/portfolio_pb";
|
|
2
|
+
import { FieldProto } from "../../../fintekkers/models/position/field_pb";
|
|
3
|
+
import { ZonedDateTime } from "../utils/datetime";
|
|
4
|
+
import { UUID } from "../utils/uuid";
|
|
5
|
+
|
|
6
|
+
class Portfolio {
|
|
7
|
+
proto: PortfolioProto;
|
|
8
|
+
|
|
9
|
+
constructor(proto: PortfolioProto) {
|
|
10
|
+
this.proto = proto;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// getProto(): PortfolioProto {
|
|
14
|
+
// return this.proto;
|
|
15
|
+
// }
|
|
16
|
+
|
|
17
|
+
getID(): UUID {
|
|
18
|
+
return UUID.fromU8Array(this.proto.getUuid().getRawUuid_asU8());
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
getAsOf(): ZonedDateTime {
|
|
22
|
+
return new ZonedDateTime(this.proto.getAsOf());
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
getPortfolioName(): string {
|
|
26
|
+
return this.proto.getPortfolioName();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
getFields(): FieldProto[] {
|
|
30
|
+
return [FieldProto.ID, FieldProto.PORTFOLIO, FieldProto.PORTFOLIO_ID, FieldProto.PORTFOLIO_NAME];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
getField(field: FieldProto): any {
|
|
34
|
+
switch (field) {
|
|
35
|
+
case FieldProto.ID:
|
|
36
|
+
case FieldProto.PORTFOLIO_ID:
|
|
37
|
+
return this.getID();
|
|
38
|
+
case FieldProto.AS_OF:
|
|
39
|
+
return this.getAsOf();
|
|
40
|
+
case FieldProto.PORTFOLIO_NAME:
|
|
41
|
+
return this.getPortfolioName();
|
|
42
|
+
default:
|
|
43
|
+
throw new Error(`Field not mapped in Portfolio wrapper: ${field}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
export default Portfolio;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
// Note: Some classes and functions have been omitted or simplified due to lack of context.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
var Position = /** @class */ (function () {
|
|
5
|
+
function Position(positionProto) {
|
|
6
|
+
this.positionProto = positionProto;
|
|
7
|
+
//For each field, put into a map
|
|
8
|
+
this.positionProto.getFieldsList().forEach(function (field) {
|
|
9
|
+
console.log(field);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return Position;
|
|
13
|
+
}());
|
|
10
14
|
// get_field_value(field: FieldProto): any {
|
|
15
|
+
// this.positionProto.getFieldsList()
|
|
11
16
|
// return this.get_field(new FieldMapEntry({ field }));
|
|
12
17
|
// }
|
|
13
18
|
// get_field(field_to_get: FieldMapEntry): any {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.js","sourceRoot":"","sources":["position.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"position.js","sourceRoot":"","sources":["position.ts"],"names":[],"mappings":";AAAA,2FAA2F;;AAM3F;IAGI,kBAAY,aAA4B;QACtC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QAEnC,gCAAgC;QAChC,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC,OAAO,CAAC,UAAA,KAAK;YAC9C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC,CAAC,CAAC;IAEL,CAAC;IACL,eAAC;AAAD,CAAC,AAZD,IAYC;AACD,gDAAgD;AAChD,6CAA6C;AAC7C,6DAA6D;AAC7D,QAAQ;AAER,oDAAoD;AACpD,6DAA6D;AAC7D,wDAAwD;AACxD,+DAA+D;AAC/D,sEAAsE;AACtE,cAAc;AACd,8DAA8D;AAC9D,qEAAqE;AACrE,cAAc;AAEd,qEAAqE;AAErE,uDAAuD;AACvD,2FAA2F;AAC3F,0EAA0E;AAC1E,cAAc;AAEd,iBAAiB;AACjB,oDAAoD;AACpD,oDAAoD;AACpD,kDAAkD;AAClD,gBAAgB;AAChB,qCAAqC;AACrC,cAAc;AAEd,uEAAuE;AACvE,YAAY;AACZ,UAAU;AAEV,6DAA6D;AAC7D,QAAQ;AAER,0DAA0D;AAC1D,mEAAmE;AACnE,QAAQ;AAER,8DAA8D;AAC9D,iEAAiE;AACjE,gEAAgE;AAChE,6FAA6F;AAC7F,YAAY;AACZ,UAAU;AAEV,+DAA+D;AAC/D,QAAQ;AAER,+DAA+D;AAC/D,6EAA6E;AAC7E,uCAAuC;AACvC,QAAQ;AAER,0CAA0C;AAC1C,4CAA4C;AAC5C,QAAQ;AAER,sCAAsC;AACtC,0CAA0C;AAC1C,QAAQ;AAER,2BAA2B;AAC3B,kCAAkC;AAElC,iDAAiD;AACjD,kDAAkD;AAClD,yBAAyB;AACzB,yDAAyD;AACzD,yBAAyB;AACzB,UAAU;AAEV,qDAAqD;AACrD,wDAAwD;AACxD,yBAAyB;AACzB,kEAAkE;AAClE,oCAAoC;AACpC,yBAAyB;AACzB,UAAU;AAEV,6BAA6B;AAC7B,QAAQ;AAER,0DAA0D;AAC1D,kCAAkC;AAClC,qEAAqE;AACrE,uBAAuB;AACvB,QAAQ;AAER,mDAAmD;AACnD,uDAAuD;AACvD,oCAAoC;AACpC,sCAAsC;AACtC,yBAAyB;AACzB,UAAU;AACV,wCAAwC;AACxC,qBAAqB;AACrB,QAAQ;AAER,iEAAiE;AACjE,oGAAoG;AACpG,6EAA6E;AAC7E,gDAAgD;AAChD,QAAQ;AAER,iGAAiG;AACjG,MAAM;AAEN,kFAAkF;AAClF,iGAAiG;AACjG,wFAAwF;AACxF,iFAAiF;AACjF,4DAA4D"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var position_pb_1 = require("../../../fintekkers/models/position/position_pb");
|
|
4
|
+
var position_util_pb_1 = require("../../../fintekkers/models/position/position_util_pb");
|
|
5
|
+
var field_pb_1 = require("../../../fintekkers/models/position/field_pb");
|
|
6
|
+
test('test the position wrapper', function () {
|
|
7
|
+
testSerialization();
|
|
8
|
+
});
|
|
9
|
+
function testSerialization() {
|
|
10
|
+
var transaction = dummyPosition();
|
|
11
|
+
// assert(transaction.getTransactionType().toString() === 'BUY');
|
|
12
|
+
// assert(transaction.getDirectedQuantity().toNumber() > 0);
|
|
13
|
+
}
|
|
14
|
+
function pack() {
|
|
15
|
+
var message = new position_pb_1.PositionProto();
|
|
16
|
+
// Create a value of any type (in this case, a string)
|
|
17
|
+
// const stringValue = "Hello, Any!";
|
|
18
|
+
// const anyValue = new Any();
|
|
19
|
+
// anyValue.pack(stringValue, "type.googleapis.com/google.protobuf.StringValue");
|
|
20
|
+
// message.setValue(anyValue);
|
|
21
|
+
// // Serialize the message to a binary buffer
|
|
22
|
+
// const serialized = message.serializeBinary();
|
|
23
|
+
// // Deserialize the binary buffer
|
|
24
|
+
// const deserializedMessage = PositionProto.deserializeBinary(serialized);
|
|
25
|
+
// const deserializedValue = deserializedMessage.getFieldsList()[0];
|
|
26
|
+
// if (deserializedValue.is(string)) {
|
|
27
|
+
// const unpackedValue = deserializedValue.unpack(StringValue.deserializeBinary);
|
|
28
|
+
// console.log(unpackedValue.getValue()); // Output: Hello, Any!
|
|
29
|
+
// }
|
|
30
|
+
}
|
|
31
|
+
function dummyPosition() {
|
|
32
|
+
var field = new position_util_pb_1.FieldMapEntry()
|
|
33
|
+
.setField(field_pb_1.FieldProto.TRANSACTION_TYPE);
|
|
34
|
+
// .setFieldValuePacked
|
|
35
|
+
return new position_pb_1.PositionProto();
|
|
36
|
+
// new TransactionProto()
|
|
37
|
+
// .setObjectClass('Transaction').setVersion('0.0.1').setUuid(UUID.random().toUUIDProto())
|
|
38
|
+
// .setTradeDate(new LocalDateProto().setYear(2021).setMonth(1).setDay(1))
|
|
39
|
+
// .setTransactionType(TransactionTypeProto.BUY)
|
|
40
|
+
// .setQuantity(new DecimalValueProto().setArbitraryPrecisionValue('1000.00'))
|
|
41
|
+
// .setSettlementDate(new LocalDateProto().setYear(2021).setMonth(1).setDay(1)));
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=position.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.test.js","sourceRoot":"","sources":["position.test.ts"],"names":[],"mappings":";;AAcA,+EAAgF;AAChF,yFAAqF;AACrF,yEAA0E;AAI1E,IAAI,CAAC,2BAA2B,EAAE;IAC9B,iBAAiB,EAAE,CAAC;AACtB,CAAC,CAAC,CAAC;AAEL,SAAS,iBAAiB;IACtB,IAAM,WAAW,GAAG,aAAa,EAAE,CAAC;IAEpC,iEAAiE;IACjE,4DAA4D;AAChE,CAAC;AAED,SAAS,IAAI;IACT,IAAM,OAAO,GAAG,IAAI,2BAAa,EAAE,CAAC;IAEpC,sDAAsD;IACtD,qCAAqC;IACrC,8BAA8B;IAC9B,iFAAiF;IAEjF,8BAA8B;IAE9B,8CAA8C;IAC9C,gDAAgD;IAEhD,mCAAmC;IACnC,2EAA2E;IAC3E,oEAAoE;IAEpE,sCAAsC;IACtC,iFAAiF;IACjF,gEAAgE;IAChE,IAAI;AAER,CAAC;AAED,SAAS,aAAa;IAClB,IAAI,KAAK,GAAG,IAAI,gCAAa,EAAE;SAC1B,QAAQ,CAAC,qBAAU,CAAC,gBAAgB,CAAC,CAAC;IACvC,uBAAuB;IAE3B,OAAO,IAAI,2BAAa,EAAE,CAAC;IAE3B,yBAAyB;IACzB,0FAA0F;IAC1F,0EAA0E;IAC1E,gDAAgD;IAChD,8EAA8E;IAC9E,iFAAiF;AACrF,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
import { UUID } from '../utils/uuid';
|
|
5
|
+
|
|
6
|
+
import assert = require('assert');
|
|
7
|
+
import Transaction from '../transaction/transaction';
|
|
8
|
+
import { TransactionProto } from '../../../fintekkers/models/transaction/transaction_pb';
|
|
9
|
+
import { TransactionTypeProto } from '../../../fintekkers/models/transaction/transaction_type_pb';
|
|
10
|
+
import { LocalTimestampProto } from '../../../fintekkers/models/util/local_timestamp_pb';
|
|
11
|
+
|
|
12
|
+
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
|
|
13
|
+
import { DecimalValueProto } from '../../../fintekkers/models/util/decimal_value_pb';
|
|
14
|
+
import { PriceProto } from '../../../fintekkers/models/price/price_pb';
|
|
15
|
+
import { PositionProto } from '../../../fintekkers/models/position/position_pb';
|
|
16
|
+
import { FieldMapEntry } from '../../../fintekkers/models/position/position_util_pb';
|
|
17
|
+
import { FieldProto } from '../../../fintekkers/models/position/field_pb';
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
test('test the position wrapper', () => {
|
|
22
|
+
testSerialization();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
function testSerialization(): void {
|
|
26
|
+
const transaction = dummyPosition();
|
|
27
|
+
|
|
28
|
+
// assert(transaction.getTransactionType().toString() === 'BUY');
|
|
29
|
+
// assert(transaction.getDirectedQuantity().toNumber() > 0);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function pack() {
|
|
33
|
+
const message = new PositionProto();
|
|
34
|
+
|
|
35
|
+
// Create a value of any type (in this case, a string)
|
|
36
|
+
// const stringValue = "Hello, Any!";
|
|
37
|
+
// const anyValue = new Any();
|
|
38
|
+
// anyValue.pack(stringValue, "type.googleapis.com/google.protobuf.StringValue");
|
|
39
|
+
|
|
40
|
+
// message.setValue(anyValue);
|
|
41
|
+
|
|
42
|
+
// // Serialize the message to a binary buffer
|
|
43
|
+
// const serialized = message.serializeBinary();
|
|
44
|
+
|
|
45
|
+
// // Deserialize the binary buffer
|
|
46
|
+
// const deserializedMessage = PositionProto.deserializeBinary(serialized);
|
|
47
|
+
// const deserializedValue = deserializedMessage.getFieldsList()[0];
|
|
48
|
+
|
|
49
|
+
// if (deserializedValue.is(string)) {
|
|
50
|
+
// const unpackedValue = deserializedValue.unpack(StringValue.deserializeBinary);
|
|
51
|
+
// console.log(unpackedValue.getValue()); // Output: Hello, Any!
|
|
52
|
+
// }
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function dummyPosition() {
|
|
57
|
+
let field = new FieldMapEntry()
|
|
58
|
+
.setField(FieldProto.TRANSACTION_TYPE);
|
|
59
|
+
// .setFieldValuePacked
|
|
60
|
+
|
|
61
|
+
return new PositionProto();
|
|
62
|
+
|
|
63
|
+
// new TransactionProto()
|
|
64
|
+
// .setObjectClass('Transaction').setVersion('0.0.1').setUuid(UUID.random().toUUIDProto())
|
|
65
|
+
// .setTradeDate(new LocalDateProto().setYear(2021).setMonth(1).setDay(1))
|
|
66
|
+
// .setTransactionType(TransactionTypeProto.BUY)
|
|
67
|
+
// .setQuantity(new DecimalValueProto().setArbitraryPrecisionValue('1000.00'))
|
|
68
|
+
// .setSettlementDate(new LocalDateProto().setYear(2021).setMonth(1).setDay(1)));
|
|
69
|
+
}
|
|
70
|
+
|
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Note: Some classes and functions have been omitted or simplified due to lack of context.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { FieldProto } from "../../../fintekkers/models/position/field_pb";
|
|
4
|
+
import { PositionProto } from "../../../fintekkers/models/position/position_pb";
|
|
5
|
+
import { FieldMapEntry } from "../../../fintekkers/models/position/position_util_pb";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// constructor(positionProto: PositionProto) {
|
|
11
|
-
// this.positionProto = positionProto;
|
|
12
|
-
// }
|
|
7
|
+
class Position {
|
|
8
|
+
positionProto: PositionProto;
|
|
13
9
|
|
|
10
|
+
constructor(positionProto: PositionProto) {
|
|
11
|
+
this.positionProto = positionProto;
|
|
12
|
+
|
|
13
|
+
//For each field, put into a map
|
|
14
|
+
this.positionProto.getFieldsList().forEach(field => {
|
|
15
|
+
console.log(field);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
}
|
|
14
20
|
// get_field_value(field: FieldProto): any {
|
|
21
|
+
// this.positionProto.getFieldsList()
|
|
15
22
|
// return this.get_field(new FieldMapEntry({ field }));
|
|
16
23
|
// }
|
|
17
24
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PositionFilter = void 0;
|
|
4
|
+
var position_util_pb_1 = require("../../../fintekkers/models/position/position_util_pb");
|
|
5
|
+
var serialization_util_1 = require("../utils/serialization.util");
|
|
6
|
+
var position_filter_pb_1 = require("../../../fintekkers/models/position/position_filter_pb");
|
|
7
|
+
var PositionFilter = /** @class */ (function () {
|
|
8
|
+
function PositionFilter() {
|
|
9
|
+
this.filters = [];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @param {*} field FieldProto.ASSET_CLASS, as an example
|
|
13
|
+
* @param {*} fieldValue The appropriate value for the FieldProto, e.g. FieldProto.ASSET_CLASS would have a string fieldValue
|
|
14
|
+
*/
|
|
15
|
+
PositionFilter.prototype.addFilter = function (field, fieldValue) {
|
|
16
|
+
var fieldMapEntry = new position_util_pb_1.FieldMapEntry();
|
|
17
|
+
fieldMapEntry.setField(field); //FieldProto.ASSET_CLASS);
|
|
18
|
+
fieldMapEntry.setFieldValuePacked((0, serialization_util_1.pack)(fieldValue));
|
|
19
|
+
this.filters.push(fieldMapEntry);
|
|
20
|
+
return this;
|
|
21
|
+
};
|
|
22
|
+
PositionFilter.prototype.getFilters = function () {
|
|
23
|
+
return this.filters;
|
|
24
|
+
};
|
|
25
|
+
PositionFilter.prototype.toProto = function () {
|
|
26
|
+
var positionFilterProto = new position_filter_pb_1.PositionFilterProto();
|
|
27
|
+
positionFilterProto.setObjectClass('PositionFilter');
|
|
28
|
+
positionFilterProto.setVersion('0.0.1');
|
|
29
|
+
positionFilterProto.setFiltersList(this.filters);
|
|
30
|
+
return positionFilterProto;
|
|
31
|
+
};
|
|
32
|
+
return PositionFilter;
|
|
33
|
+
}());
|
|
34
|
+
exports.PositionFilter = PositionFilter;
|
|
35
|
+
//# sourceMappingURL=positionfilter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"positionfilter.js","sourceRoot":"","sources":["positionfilter.ts"],"names":[],"mappings":";;;AAAA,yFAAqF;AAErF,kEAAmD;AACnD,6FAA6F;AAE7F;IAGI;QACI,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,kCAAS,GAAT,UAAU,KAAiB,EAAE,UAAe;QACxC,IAAM,aAAa,GAAG,IAAI,gCAAa,EAAE,CAAC;QAC1C,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,0BAA0B;QACzD,aAAa,CAAC,mBAAmB,CAAC,IAAA,yBAAI,EAAC,UAAU,CAAC,CAAC,CAAC;QAEpD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,mCAAU,GAAV;QACI,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED,gCAAO,GAAP;QACI,IAAM,mBAAmB,GAAG,IAAI,wCAAmB,EAAE,CAAC;QACtD,mBAAmB,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;QACrD,mBAAmB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QACxC,mBAAmB,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEjD,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IACL,qBAAC;AAAD,CAAC,AAhCD,IAgCC;AAhCY,wCAAc"}
|