@things-factory/asset 0.0.0-stage → 10.1.230

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist-client/components/asset-documents.d.ts +22 -0
  2. package/dist-client/components/asset-documents.js +190 -0
  3. package/dist-client/components/asset-documents.js.map +1 -0
  4. package/dist-client/grid.d.ts +13 -0
  5. package/dist-client/grid.js +56 -0
  6. package/dist-client/grid.js.map +1 -0
  7. package/dist-client/index.d.ts +1 -0
  8. package/dist-client/index.js +2 -0
  9. package/dist-client/index.js.map +1 -0
  10. package/dist-client/pages/asset-list.d.ts +53 -0
  11. package/dist-client/pages/asset-list.js +171 -0
  12. package/dist-client/pages/asset-list.js.map +1 -0
  13. package/dist-client/pages/asset-reconciliation.d.ts +25 -0
  14. package/dist-client/pages/asset-reconciliation.js +165 -0
  15. package/dist-client/pages/asset-reconciliation.js.map +1 -0
  16. package/dist-client/pages/investee-page.d.ts +47 -0
  17. package/dist-client/pages/investee-page.js +322 -0
  18. package/dist-client/pages/investee-page.js.map +1 -0
  19. package/dist-client/pages/investment-list.d.ts +51 -0
  20. package/dist-client/pages/investment-list.js +134 -0
  21. package/dist-client/pages/investment-list.js.map +1 -0
  22. package/dist-client/route.d.ts +1 -0
  23. package/dist-client/route.js +18 -0
  24. package/dist-client/route.js.map +1 -0
  25. package/dist-client/tsconfig.tsbuildinfo +1 -0
  26. package/dist-client/words.d.ts +25 -0
  27. package/dist-client/words.js +23 -0
  28. package/dist-client/words.js.map +1 -0
  29. package/dist-server/attachment-reader.d.ts +3 -0
  30. package/dist-server/attachment-reader.js +20 -0
  31. package/dist-server/attachment-reader.js.map +1 -0
  32. package/dist-server/index.d.ts +1 -0
  33. package/dist-server/index.js +11 -0
  34. package/dist-server/index.js.map +1 -0
  35. package/dist-server/role-tasks.d.ts +2 -0
  36. package/dist-server/role-tasks.js +13 -0
  37. package/dist-server/role-tasks.js.map +1 -0
  38. package/dist-server/service/asset/asset-mutation.d.ts +5 -0
  39. package/dist-server/service/asset/asset-mutation.js +31 -0
  40. package/dist-server/service/asset/asset-mutation.js.map +1 -0
  41. package/dist-server/service/asset/asset-query.d.ts +19 -0
  42. package/dist-server/service/asset/asset-query.js +108 -0
  43. package/dist-server/service/asset/asset-query.js.map +1 -0
  44. package/dist-server/service/asset/asset-rules.d.ts +87 -0
  45. package/dist-server/service/asset/asset-rules.js +148 -0
  46. package/dist-server/service/asset/asset-rules.js.map +1 -0
  47. package/dist-server/service/asset/asset-service.d.ts +23 -0
  48. package/dist-server/service/asset/asset-service.js +84 -0
  49. package/dist-server/service/asset/asset-service.js.map +1 -0
  50. package/dist-server/service/asset/asset-type.d.ts +48 -0
  51. package/dist-server/service/asset/asset-type.js +182 -0
  52. package/dist-server/service/asset/asset-type.js.map +1 -0
  53. package/dist-server/service/asset/asset.d.ts +38 -0
  54. package/dist-server/service/asset/asset.js +159 -0
  55. package/dist-server/service/asset/asset.js.map +1 -0
  56. package/dist-server/service/asset/index.d.ts +6 -0
  57. package/dist-server/service/asset/index.js +10 -0
  58. package/dist-server/service/asset/index.js.map +1 -0
  59. package/dist-server/service/asset-document/asset-document-resolver.d.ts +32 -0
  60. package/dist-server/service/asset-document/asset-document-resolver.js +94 -0
  61. package/dist-server/service/asset-document/asset-document-resolver.js.map +1 -0
  62. package/dist-server/service/asset-document/asset-document-service.d.ts +34 -0
  63. package/dist-server/service/asset-document/asset-document-service.js +79 -0
  64. package/dist-server/service/asset-document/asset-document-service.js.map +1 -0
  65. package/dist-server/service/asset-document/index.d.ts +4 -0
  66. package/dist-server/service/asset-document/index.js +8 -0
  67. package/dist-server/service/asset-document/index.js.map +1 -0
  68. package/dist-server/service/checks.d.ts +12 -0
  69. package/dist-server/service/checks.js +27 -0
  70. package/dist-server/service/checks.js.map +1 -0
  71. package/dist-server/service/index.d.ts +18 -0
  72. package/dist-server/service/index.js +40 -0
  73. package/dist-server/service/index.js.map +1 -0
  74. package/dist-server/service/investment/index.d.ts +11 -0
  75. package/dist-server/service/investment/index.js +15 -0
  76. package/dist-server/service/investment/index.js.map +1 -0
  77. package/dist-server/service/investment/investee.d.ts +33 -0
  78. package/dist-server/service/investment/investee.js +135 -0
  79. package/dist-server/service/investment/investee.js.map +1 -0
  80. package/dist-server/service/investment/investment-board-seat.d.ts +25 -0
  81. package/dist-server/service/investment/investment-board-seat.js +98 -0
  82. package/dist-server/service/investment/investment-board-seat.js.map +1 -0
  83. package/dist-server/service/investment/investment-filing.d.ts +29 -0
  84. package/dist-server/service/investment/investment-filing.js +113 -0
  85. package/dist-server/service/investment/investment-filing.js.map +1 -0
  86. package/dist-server/service/investment/investment-holding.d.ts +31 -0
  87. package/dist-server/service/investment/investment-holding.js +127 -0
  88. package/dist-server/service/investment/investment-holding.js.map +1 -0
  89. package/dist-server/service/investment/investment-mutation.d.ts +15 -0
  90. package/dist-server/service/investment/investment-mutation.js +112 -0
  91. package/dist-server/service/investment/investment-mutation.js.map +1 -0
  92. package/dist-server/service/investment/investment-query.d.ts +33 -0
  93. package/dist-server/service/investment/investment-query.js +192 -0
  94. package/dist-server/service/investment/investment-query.js.map +1 -0
  95. package/dist-server/service/investment/investment-report.d.ts +37 -0
  96. package/dist-server/service/investment/investment-report.js +152 -0
  97. package/dist-server/service/investment/investment-report.js.map +1 -0
  98. package/dist-server/service/investment/investment-request.d.ts +31 -0
  99. package/dist-server/service/investment/investment-request.js +123 -0
  100. package/dist-server/service/investment/investment-request.js.map +1 -0
  101. package/dist-server/service/investment/investment-rules.d.ts +81 -0
  102. package/dist-server/service/investment/investment-rules.js +121 -0
  103. package/dist-server/service/investment/investment-rules.js.map +1 -0
  104. package/dist-server/service/investment/investment-service.d.ts +34 -0
  105. package/dist-server/service/investment/investment-service.js +280 -0
  106. package/dist-server/service/investment/investment-service.js.map +1 -0
  107. package/dist-server/service/investment/investment-type.d.ts +85 -0
  108. package/dist-server/service/investment/investment-type.js +324 -0
  109. package/dist-server/service/investment/investment-type.js.map +1 -0
  110. package/dist-server/service/patches.d.ts +24 -0
  111. package/dist-server/service/patches.js +63 -0
  112. package/dist-server/service/patches.js.map +1 -0
  113. package/dist-server/tsconfig.tsbuildinfo +1 -0
  114. package/package.json +49 -4
  115. package/things-factory.config.js +11 -0
  116. package/translations/en.json +188 -0
  117. package/translations/es.json +188 -0
  118. package/translations/ja.json +188 -0
  119. package/translations/ko.json +188 -0
  120. package/translations/ms.json +188 -0
  121. package/translations/zh.json +188 -0
  122. package/README.md +0 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"investment-board-seat.js","sourceRoot":"","sources":["../../../server/service/investment/investment-board-seat.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,iDAA8C;AAC9C,+CAAoD;AACpD,qCAAoJ;AAEpJ,yCAAqC;AAGrC;;;GAGG;AAII,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CA4D/B,CAAA;AA5DY,kDAAmB;AAGrB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;;+CACrC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;sCAC5D,cAAM;mDAAA;AAGf;IADC,IAAA,oBAAU,EAAC,CAAC,IAAyB,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC;;qDACtC;AAIjB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAQ,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACpD,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI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IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;sCAC3D,gBAAI;oDAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,IAAyB,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;;sDACtC;AAIlB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;sCAClE,gBAAI;oDAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,IAAyB,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;;sDACtC;8BA3DP,mBAAmB;IAH/B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,4BAA4B,EAAE,CAAC,IAAyB,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChG,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,mFAAmF,EAAE,CAAC;GACpG,mBAAmB,CA4D/B","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\nimport { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, CreateDateColumn, DeleteDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'\n\nimport { Investee } from './investee'\n\n\n/**\n * Someone of ours on the company's board and for how long (decision 7). Our part and whether we sit on its board, day by\n * day, are what the accountant classifies the shares by; the register does not classify them.\n */\n@Entity()\n@Index('ix_investment_board_seat_0', (seat: InvestmentBoardSeat) => [seat.domain, seat.investee])\n@ObjectType({ description: \"Entity for InvestmentBoardSeat — someone of ours on the company's board, and when\" })\nexport class InvestmentBoardSeat {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain' })\n domain?: Domain\n\n @RelationId((seat: InvestmentBoardSeat) => seat.domain)\n domainId?: string\n\n @ManyToOne(type => Investee, { onDelete: 'CASCADE' })\n @Field(type => Investee, { nullable: true, description: 'The company the row is about' })\n investee?: Investee\n\n @RelationId((seat: InvestmentBoardSeat) => seat.investee)\n investeeId?: string\n\n @Column()\n @Field({ description: 'Who sits on the board' })\n director: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The day they were appointed - YYYY-MM-DD' })\n appointedOn?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The day they left - YYYY-MM-DD' })\n resignedOn?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Notes' })\n description?: string\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'When the row was written' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'When the row last changed' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'When the row was deleted' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who wrote it' })\n creator?: User\n\n @RelationId((seat: InvestmentBoardSeat) => seat.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who last changed it' })\n updater?: User\n\n @RelationId((seat: InvestmentBoardSeat) => seat.updater)\n updaterId?: string\n}\n"]}
@@ -0,0 +1,29 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { Domain } from '@things-factory/shell';
3
+ import { Investee } from './investee';
4
+ /**
5
+ * A filing the law asks of us for holding the shares, one due day at a time (decision 10) - the foreign direct investment
6
+ * report, the statement of an overseas subsidiary. The law, the authority and the day are written as the accountant or the
7
+ * bank says; the register names none of them. A yearly one is added again when it is filed.
8
+ */
9
+ export declare class InvestmentFiling {
10
+ readonly id: string;
11
+ domain?: Domain;
12
+ domainId?: string;
13
+ investee?: Investee;
14
+ investeeId?: string;
15
+ name: string;
16
+ law?: string;
17
+ authority?: string;
18
+ dueOn?: string;
19
+ filedOn?: string;
20
+ description?: string;
21
+ documents?: number;
22
+ createdAt?: Date;
23
+ updatedAt?: Date;
24
+ deletedAt?: Date;
25
+ creator?: User;
26
+ creatorId?: string;
27
+ updater?: User;
28
+ updaterId?: string;
29
+ }
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvestmentFiling = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const auth_base_1 = require("@things-factory/auth-base");
6
+ const shell_1 = require("@things-factory/shell");
7
+ const type_graphql_1 = require("type-graphql");
8
+ const typeorm_1 = require("typeorm");
9
+ const investee_1 = require("./investee");
10
+ /**
11
+ * A filing the law asks of us for holding the shares, one due day at a time (decision 10) - the foreign direct investment
12
+ * report, the statement of an overseas subsidiary. The law, the authority and the day are written as the accountant or the
13
+ * bank says; the register names none of them. A yearly one is added again when it is filed.
14
+ */
15
+ let InvestmentFiling = class InvestmentFiling {
16
+ };
17
+ exports.InvestmentFiling = InvestmentFiling;
18
+ tslib_1.__decorate([
19
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
20
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier' }),
21
+ tslib_1.__metadata("design:type", String)
22
+ ], InvestmentFiling.prototype, "id", void 0);
23
+ tslib_1.__decorate([
24
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
25
+ (0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain' }),
26
+ tslib_1.__metadata("design:type", shell_1.Domain)
27
+ ], InvestmentFiling.prototype, "domain", void 0);
28
+ tslib_1.__decorate([
29
+ (0, typeorm_1.RelationId)((filing) => filing.domain),
30
+ tslib_1.__metadata("design:type", String)
31
+ ], InvestmentFiling.prototype, "domainId", void 0);
32
+ tslib_1.__decorate([
33
+ (0, typeorm_1.ManyToOne)(type => investee_1.Investee, { onDelete: 'CASCADE' }),
34
+ (0, type_graphql_1.Field)(type => investee_1.Investee, { nullable: true, description: 'The company the row is about' }),
35
+ tslib_1.__metadata("design:type", investee_1.Investee)
36
+ ], InvestmentFiling.prototype, "investee", void 0);
37
+ tslib_1.__decorate([
38
+ (0, typeorm_1.RelationId)((filing) => filing.investee),
39
+ tslib_1.__metadata("design:type", String)
40
+ ], InvestmentFiling.prototype, "investeeId", void 0);
41
+ tslib_1.__decorate([
42
+ (0, typeorm_1.Column)(),
43
+ (0, type_graphql_1.Field)({ description: 'What is to be filed' }),
44
+ tslib_1.__metadata("design:type", String)
45
+ ], InvestmentFiling.prototype, "name", void 0);
46
+ tslib_1.__decorate([
47
+ (0, typeorm_1.Column)({ nullable: true }),
48
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The law that asks for it' }),
49
+ tslib_1.__metadata("design:type", String)
50
+ ], InvestmentFiling.prototype, "law", void 0);
51
+ tslib_1.__decorate([
52
+ (0, typeorm_1.Column)({ nullable: true }),
53
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Where it is filed' }),
54
+ tslib_1.__metadata("design:type", String)
55
+ ], InvestmentFiling.prototype, "authority", void 0);
56
+ tslib_1.__decorate([
57
+ (0, typeorm_1.Column)({ nullable: true }),
58
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The day it is due - YYYY-MM-DD' }),
59
+ tslib_1.__metadata("design:type", String)
60
+ ], InvestmentFiling.prototype, "dueOn", void 0);
61
+ tslib_1.__decorate([
62
+ (0, typeorm_1.Column)({ nullable: true }),
63
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The day it was filed - YYYY-MM-DD' }),
64
+ tslib_1.__metadata("design:type", String)
65
+ ], InvestmentFiling.prototype, "filedOn", void 0);
66
+ tslib_1.__decorate([
67
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
68
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Notes - a late filing, a warning' }),
69
+ tslib_1.__metadata("design:type", String)
70
+ ], InvestmentFiling.prototype, "description", void 0);
71
+ tslib_1.__decorate([
72
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'How many documents are attached - filled by the list query' }),
73
+ tslib_1.__metadata("design:type", Number)
74
+ ], InvestmentFiling.prototype, "documents", void 0);
75
+ tslib_1.__decorate([
76
+ (0, typeorm_1.CreateDateColumn)(),
77
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When the row was written' }),
78
+ tslib_1.__metadata("design:type", Date)
79
+ ], InvestmentFiling.prototype, "createdAt", void 0);
80
+ tslib_1.__decorate([
81
+ (0, typeorm_1.UpdateDateColumn)(),
82
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When the row last changed' }),
83
+ tslib_1.__metadata("design:type", Date)
84
+ ], InvestmentFiling.prototype, "updatedAt", void 0);
85
+ tslib_1.__decorate([
86
+ (0, typeorm_1.DeleteDateColumn)(),
87
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When the row was deleted' }),
88
+ tslib_1.__metadata("design:type", Date)
89
+ ], InvestmentFiling.prototype, "deletedAt", void 0);
90
+ tslib_1.__decorate([
91
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
92
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who wrote it' }),
93
+ tslib_1.__metadata("design:type", auth_base_1.User)
94
+ ], InvestmentFiling.prototype, "creator", void 0);
95
+ tslib_1.__decorate([
96
+ (0, typeorm_1.RelationId)((filing) => filing.creator),
97
+ tslib_1.__metadata("design:type", String)
98
+ ], InvestmentFiling.prototype, "creatorId", void 0);
99
+ tslib_1.__decorate([
100
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
101
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who last changed it' }),
102
+ tslib_1.__metadata("design:type", auth_base_1.User)
103
+ ], InvestmentFiling.prototype, "updater", void 0);
104
+ tslib_1.__decorate([
105
+ (0, typeorm_1.RelationId)((filing) => filing.updater),
106
+ tslib_1.__metadata("design:type", String)
107
+ ], InvestmentFiling.prototype, "updaterId", void 0);
108
+ exports.InvestmentFiling = InvestmentFiling = tslib_1.__decorate([
109
+ (0, typeorm_1.Entity)(),
110
+ (0, typeorm_1.Index)('ix_investment_filing_0', (filing) => [filing.domain, filing.investee, filing.dueOn]),
111
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for InvestmentFiling — a filing the law asks of us for the shares, one due day at a time' })
112
+ ], InvestmentFiling);
113
+ //# sourceMappingURL=investment-filing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"investment-filing.js","sourceRoot":"","sources":["../../../server/service/investment/investment-filing.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,iDAA8C;AAC9C,+CAAyD;AACzD,qCAAoJ;AAEpJ,yCAAqC;AAGrC;;;;GAIG;AAII,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAuE5B,CAAA;AAvEY,4CAAgB;AAGlB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;;4CACrC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;sCAC5D,cAAM;gDAAA;AAGf;IADC,IAAA,oBAA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AE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;sCAClE,gBAAI;iDAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,MAAwB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC;;mDACvC;2BAtEP,gBAAgB;IAH5B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,wBAAwB,EAAE,CAAC,MAAwB,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7G,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,iGAAiG,EAAE,CAAC;GAClH,gBAAgB,CAuE5B","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\nimport { Field, ID, Int, ObjectType } from 'type-graphql'\nimport { Column, CreateDateColumn, DeleteDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'\n\nimport { Investee } from './investee'\n\n\n/**\n * A filing the law asks of us for holding the shares, one due day at a time (decision 10) - the foreign direct investment\n * report, the statement of an overseas subsidiary. The law, the authority and the day are written as the accountant or the\n * bank says; the register names none of them. A yearly one is added again when it is filed.\n */\n@Entity()\n@Index('ix_investment_filing_0', (filing: InvestmentFiling) => [filing.domain, filing.investee, filing.dueOn])\n@ObjectType({ description: 'Entity for InvestmentFiling — a filing the law asks of us for the shares, one due day at a time' })\nexport class InvestmentFiling {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain' })\n domain?: Domain\n\n @RelationId((filing: InvestmentFiling) => filing.domain)\n domainId?: string\n\n @ManyToOne(type => Investee, { onDelete: 'CASCADE' })\n @Field(type => Investee, { nullable: true, description: 'The company the row is about' })\n investee?: Investee\n\n @RelationId((filing: InvestmentFiling) => filing.investee)\n investeeId?: string\n\n @Column()\n @Field({ description: 'What is to be filed' })\n name: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The law that asks for it' })\n law?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Where it is filed' })\n authority?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The day it is due - YYYY-MM-DD' })\n dueOn?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The day it was filed - YYYY-MM-DD' })\n filedOn?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Notes - a late filing, a warning' })\n description?: string\n\n @Field(type => Int, { nullable: true, description: 'How many documents are attached - filled by the list query' })\n documents?: number\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'When the row was written' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'When the row last changed' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'When the row was deleted' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who wrote it' })\n creator?: User\n\n @RelationId((filing: InvestmentFiling) => filing.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who last changed it' })\n updater?: User\n\n @RelationId((filing: InvestmentFiling) => filing.updater)\n updaterId?: string\n}\n"]}
@@ -0,0 +1,31 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { Domain } from '@things-factory/shell';
3
+ import { Investee } from './investee';
4
+ import { Contribution, HoldingReason } from './investment-rules';
5
+ /**
6
+ * The holding as it stood on a day (ADR-0175 decision 7): our shares and all the company's shares, and why it changed.
7
+ * Our part is computed. Shares issued to others are a row too - our shares stay, our part falls.
8
+ */
9
+ export declare class InvestmentHolding {
10
+ readonly id: string;
11
+ domain?: Domain;
12
+ domainId?: string;
13
+ investee?: Investee;
14
+ investeeId?: string;
15
+ recordDate: string;
16
+ ourShares: number;
17
+ totalShares: number;
18
+ reason: HoldingReason;
19
+ contribution: Contribution;
20
+ amount?: number;
21
+ currency?: string;
22
+ description?: string;
23
+ get ratio(): number;
24
+ createdAt?: Date;
25
+ updatedAt?: Date;
26
+ deletedAt?: Date;
27
+ creator?: User;
28
+ creatorId?: string;
29
+ updater?: User;
30
+ updaterId?: string;
31
+ }
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvestmentHolding = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const auth_base_1 = require("@things-factory/auth-base");
6
+ const shell_1 = require("@things-factory/shell");
7
+ const type_graphql_1 = require("type-graphql");
8
+ const typeorm_1 = require("typeorm");
9
+ const investee_1 = require("./investee");
10
+ const investment_rules_1 = require("./investment-rules");
11
+ /**
12
+ * The holding as it stood on a day (ADR-0175 decision 7): our shares and all the company's shares, and why it changed.
13
+ * Our part is computed. Shares issued to others are a row too - our shares stay, our part falls.
14
+ */
15
+ let InvestmentHolding = class InvestmentHolding {
16
+ get ratio() {
17
+ return (0, investment_rules_1.ratioOf)(this);
18
+ }
19
+ };
20
+ exports.InvestmentHolding = InvestmentHolding;
21
+ tslib_1.__decorate([
22
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
23
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier' }),
24
+ tslib_1.__metadata("design:type", String)
25
+ ], InvestmentHolding.prototype, "id", void 0);
26
+ tslib_1.__decorate([
27
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
28
+ (0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain' }),
29
+ tslib_1.__metadata("design:type", shell_1.Domain)
30
+ ], InvestmentHolding.prototype, "domain", void 0);
31
+ tslib_1.__decorate([
32
+ (0, typeorm_1.RelationId)((holding) => holding.domain),
33
+ tslib_1.__metadata("design:type", String)
34
+ ], InvestmentHolding.prototype, "domainId", void 0);
35
+ tslib_1.__decorate([
36
+ (0, typeorm_1.ManyToOne)(type => investee_1.Investee, { onDelete: 'CASCADE' }),
37
+ (0, type_graphql_1.Field)(type => investee_1.Investee, { nullable: true, description: 'The company the row is about' }),
38
+ tslib_1.__metadata("design:type", investee_1.Investee)
39
+ ], InvestmentHolding.prototype, "investee", void 0);
40
+ tslib_1.__decorate([
41
+ (0, typeorm_1.RelationId)((holding) => holding.investee),
42
+ tslib_1.__metadata("design:type", String)
43
+ ], InvestmentHolding.prototype, "investeeId", void 0);
44
+ tslib_1.__decorate([
45
+ (0, typeorm_1.Column)(),
46
+ (0, type_graphql_1.Field)({ description: 'The day the holding stood so - YYYY-MM-DD' }),
47
+ tslib_1.__metadata("design:type", String)
48
+ ], InvestmentHolding.prototype, "recordDate", void 0);
49
+ tslib_1.__decorate([
50
+ (0, typeorm_1.Column)({ ...(0, shell_1.quantityColumn)(), default: 0 }),
51
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { description: 'Our shares' }),
52
+ tslib_1.__metadata("design:type", Number)
53
+ ], InvestmentHolding.prototype, "ourShares", void 0);
54
+ tslib_1.__decorate([
55
+ (0, typeorm_1.Column)({ ...(0, shell_1.quantityColumn)(), default: 0 }),
56
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { description: "All the company's shares" }),
57
+ tslib_1.__metadata("design:type", Number)
58
+ ], InvestmentHolding.prototype, "totalShares", void 0);
59
+ tslib_1.__decorate([
60
+ (0, typeorm_1.Column)({ default: investment_rules_1.HoldingReason.OTHER }),
61
+ (0, type_graphql_1.Field)(type => investment_rules_1.HoldingReason, { description: 'Why it changed' }),
62
+ tslib_1.__metadata("design:type", String)
63
+ ], InvestmentHolding.prototype, "reason", void 0);
64
+ tslib_1.__decorate([
65
+ (0, typeorm_1.Column)({ default: investment_rules_1.Contribution.NONE }),
66
+ (0, type_graphql_1.Field)(type => investment_rules_1.Contribution, { description: 'What we gave for shares taken' }),
67
+ tslib_1.__metadata("design:type", String)
68
+ ], InvestmentHolding.prototype, "contribution", void 0);
69
+ tslib_1.__decorate([
70
+ (0, typeorm_1.Column)({ nullable: true, ...(0, shell_1.moneyColumn)() }),
71
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'What the shares taken were valued at' }),
72
+ tslib_1.__metadata("design:type", Number)
73
+ ], InvestmentHolding.prototype, "amount", void 0);
74
+ tslib_1.__decorate([
75
+ (0, typeorm_1.Column)({ nullable: true }),
76
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The currency of the amount - ISO 4217' }),
77
+ tslib_1.__metadata("design:type", String)
78
+ ], InvestmentHolding.prototype, "currency", void 0);
79
+ tslib_1.__decorate([
80
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
81
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Notes' }),
82
+ tslib_1.__metadata("design:type", String)
83
+ ], InvestmentHolding.prototype, "description", void 0);
84
+ tslib_1.__decorate([
85
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'Our part, 0 to 1' }),
86
+ tslib_1.__metadata("design:type", Number),
87
+ tslib_1.__metadata("design:paramtypes", [])
88
+ ], InvestmentHolding.prototype, "ratio", null);
89
+ tslib_1.__decorate([
90
+ (0, typeorm_1.CreateDateColumn)(),
91
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When the row was written' }),
92
+ tslib_1.__metadata("design:type", Date)
93
+ ], InvestmentHolding.prototype, "createdAt", void 0);
94
+ tslib_1.__decorate([
95
+ (0, typeorm_1.UpdateDateColumn)(),
96
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When the row last changed' }),
97
+ tslib_1.__metadata("design:type", Date)
98
+ ], InvestmentHolding.prototype, "updatedAt", void 0);
99
+ tslib_1.__decorate([
100
+ (0, typeorm_1.DeleteDateColumn)(),
101
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When the row was deleted' }),
102
+ tslib_1.__metadata("design:type", Date)
103
+ ], InvestmentHolding.prototype, "deletedAt", void 0);
104
+ tslib_1.__decorate([
105
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
106
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who wrote it' }),
107
+ tslib_1.__metadata("design:type", auth_base_1.User)
108
+ ], InvestmentHolding.prototype, "creator", void 0);
109
+ tslib_1.__decorate([
110
+ (0, typeorm_1.RelationId)((holding) => holding.creator),
111
+ tslib_1.__metadata("design:type", String)
112
+ ], InvestmentHolding.prototype, "creatorId", void 0);
113
+ tslib_1.__decorate([
114
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
115
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who last changed it' }),
116
+ tslib_1.__metadata("design:type", auth_base_1.User)
117
+ ], InvestmentHolding.prototype, "updater", void 0);
118
+ tslib_1.__decorate([
119
+ (0, typeorm_1.RelationId)((holding) => holding.updater),
120
+ tslib_1.__metadata("design:type", String)
121
+ ], InvestmentHolding.prototype, "updaterId", void 0);
122
+ exports.InvestmentHolding = InvestmentHolding = tslib_1.__decorate([
123
+ (0, typeorm_1.Entity)(),
124
+ (0, typeorm_1.Index)('ix_investment_holding_0', (holding) => [holding.domain, holding.investee, holding.recordDate]),
125
+ (0, type_graphql_1.ObjectType)({ description: "Entity for InvestmentHolding — our shares and the company's shares on a day" })
126
+ ], InvestmentHolding);
127
+ //# sourceMappingURL=investment-holding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"investment-holding.js","sourceRoot":"","sources":["../../../server/service/investment/investment-holding.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,iDAA2E;AAC3E,+CAAgE;AAChE,qCAAoJ;AAEpJ,yCAAqC;AACrC,yDAAyE;AAGzE;;;GAGG;AAII,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAmD5B,IACI,KAAK;QACP,OAAO,IAAA,0BAAO,EAAC,IAAI,CAAC,CAAA;IACtB,CAA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AyB,EAAE,CAAC,OAA0B,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACxH,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,6EAA6E,EAAE,CAAC;GAC9F,iBAAiB,CAiF7B","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Domain, moneyColumn, quantityColumn } from '@things-factory/shell'\nimport { Field, Float, ID, Int, ObjectType } from 'type-graphql'\nimport { Column, CreateDateColumn, DeleteDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'\n\nimport { Investee } from './investee'\nimport { Contribution, HoldingReason, ratioOf } from './investment-rules'\n\n\n/**\n * The holding as it stood on a day (ADR-0175 decision 7): our shares and all the company's shares, and why it changed.\n * Our part is computed. Shares issued to others are a row too - our shares stay, our part falls.\n */\n@Entity()\n@Index('ix_investment_holding_0', (holding: InvestmentHolding) => [holding.domain, holding.investee, holding.recordDate])\n@ObjectType({ description: \"Entity for InvestmentHolding — our shares and the company's shares on a day\" })\nexport class InvestmentHolding {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier' })\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain' })\n domain?: Domain\n\n @RelationId((holding: InvestmentHolding) => holding.domain)\n domainId?: string\n\n @ManyToOne(type => Investee, { onDelete: 'CASCADE' })\n @Field(type => Investee, { nullable: true, description: 'The company the row is about' })\n investee?: Investee\n\n @RelationId((holding: InvestmentHolding) => holding.investee)\n investeeId?: string\n\n @Column()\n @Field({ description: 'The day the holding stood so - YYYY-MM-DD' })\n recordDate: string\n\n @Column({ ...quantityColumn(), default: 0 })\n @Field(type => Float, { description: 'Our shares' })\n ourShares: number\n\n @Column({ ...quantityColumn(), default: 0 })\n @Field(type => Float, { description: \"All the company's shares\" })\n totalShares: number\n\n @Column({ default: HoldingReason.OTHER })\n @Field(type => HoldingReason, { description: 'Why it changed' })\n reason: HoldingReason\n\n @Column({ default: Contribution.NONE })\n @Field(type => Contribution, { description: 'What we gave for shares taken' })\n contribution: Contribution\n\n @Column({ nullable: true, ...moneyColumn() })\n @Field(type => Float, { nullable: true, description: 'What the shares taken were valued at' })\n amount?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The currency of the amount - ISO 4217' })\n currency?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Notes' })\n description?: string\n\n @Field(type => Float, { nullable: true, description: 'Our part, 0 to 1' })\n get ratio(): number {\n return ratioOf(this)\n }\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'When the row was written' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'When the row last changed' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'When the row was deleted' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who wrote it' })\n creator?: User\n\n @RelationId((holding: InvestmentHolding) => holding.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'Who last changed it' })\n updater?: User\n\n @RelationId((holding: InvestmentHolding) => holding.updater)\n updaterId?: string\n}\n"]}
@@ -0,0 +1,15 @@
1
+ import { Investee } from './investee';
2
+ import { InvestmentBoardSeat } from './investment-board-seat';
3
+ import { InvestmentFiling } from './investment-filing';
4
+ import { InvestmentHolding } from './investment-holding';
5
+ import { InvestmentReport } from './investment-report';
6
+ import { InvestmentRequest } from './investment-request';
7
+ import { InvesteePatch, InvestmentBoardSeatPatch, InvestmentFilingPatch, InvestmentHoldingPatch, InvestmentReportPatch, InvestmentRequestPatch } from './investment-type';
8
+ export declare class InvestmentMutation {
9
+ updateMultipleInvestee(patches: InvesteePatch[], context: ResolverContext): Promise<Investee[]>;
10
+ updateMultipleInvestmentHolding(investeeId: string, patches: InvestmentHoldingPatch[], context: ResolverContext): Promise<InvestmentHolding[]>;
11
+ updateMultipleInvestmentBoardSeat(investeeId: string, patches: InvestmentBoardSeatPatch[], context: ResolverContext): Promise<InvestmentBoardSeat[]>;
12
+ updateMultipleInvestmentReport(investeeId: string, patches: InvestmentReportPatch[], context: ResolverContext): Promise<InvestmentReport[]>;
13
+ updateMultipleInvestmentRequest(investeeId: string, patches: InvestmentRequestPatch[], context: ResolverContext): Promise<InvestmentRequest[]>;
14
+ updateMultipleInvestmentFiling(investeeId: string, patches: InvestmentFilingPatch[], context: ResolverContext): Promise<InvestmentFiling[]>;
15
+ }
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvestmentMutation = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const shell_1 = require("@things-factory/shell");
6
+ const type_graphql_1 = require("type-graphql");
7
+ const investee_1 = require("./investee");
8
+ const investment_board_seat_1 = require("./investment-board-seat");
9
+ const investment_filing_1 = require("./investment-filing");
10
+ const investment_holding_1 = require("./investment-holding");
11
+ const investment_report_1 = require("./investment-report");
12
+ const investment_request_1 = require("./investment-request");
13
+ const investment_service_1 = require("./investment-service");
14
+ const investment_type_1 = require("./investment-type");
15
+ const MUTATION = '@privilege(category: "asset", privilege: "mutation", domainOwnerGranted: true)';
16
+ let InvestmentMutation = class InvestmentMutation {
17
+ updateMultipleInvestee(patches, context) {
18
+ const { tx, domain, user } = context.state;
19
+ return (0, investment_service_1.saveInvestees)(tx, domain, user, patches);
20
+ }
21
+ updateMultipleInvestmentHolding(investeeId, patches, context) {
22
+ const { tx, domain, user } = context.state;
23
+ return (0, investment_service_1.saveHoldings)(tx, domain, user, investeeId, patches);
24
+ }
25
+ updateMultipleInvestmentBoardSeat(investeeId, patches, context) {
26
+ const { tx, domain, user } = context.state;
27
+ return (0, investment_service_1.saveBoardSeats)(tx, domain, user, investeeId, patches);
28
+ }
29
+ updateMultipleInvestmentReport(investeeId, patches, context) {
30
+ const { tx, domain, user } = context.state;
31
+ return (0, investment_service_1.saveReports)(tx, domain, user, investeeId, patches);
32
+ }
33
+ updateMultipleInvestmentRequest(investeeId, patches, context) {
34
+ const { tx, domain, user } = context.state;
35
+ return (0, investment_service_1.saveRequests)(tx, domain, user, investeeId, patches);
36
+ }
37
+ updateMultipleInvestmentFiling(investeeId, patches, context) {
38
+ const { tx, domain, user } = context.state;
39
+ return (0, investment_service_1.saveFilings)(tx, domain, user, investeeId, patches);
40
+ }
41
+ };
42
+ exports.InvestmentMutation = InvestmentMutation;
43
+ tslib_1.__decorate([
44
+ (0, type_graphql_1.Directive)('@transaction'),
45
+ (0, type_graphql_1.Directive)(MUTATION),
46
+ (0, type_graphql_1.Mutation)(type => [investee_1.Investee], { description: 'To save the investee grid - new, changed and deleted rows together' }),
47
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('patches', type => [investment_type_1.InvesteePatch])),
48
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
49
+ tslib_1.__metadata("design:type", Function),
50
+ tslib_1.__metadata("design:paramtypes", [Array, Object]),
51
+ tslib_1.__metadata("design:returntype", void 0)
52
+ ], InvestmentMutation.prototype, "updateMultipleInvestee", null);
53
+ tslib_1.__decorate([
54
+ (0, type_graphql_1.Directive)('@transaction'),
55
+ (0, type_graphql_1.Directive)(MUTATION),
56
+ (0, type_graphql_1.Mutation)(type => [investment_holding_1.InvestmentHolding], { description: "To save an investee's holding grid" }),
57
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('investeeId')),
58
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patches', type => [investment_type_1.InvestmentHoldingPatch])),
59
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
60
+ tslib_1.__metadata("design:type", Function),
61
+ tslib_1.__metadata("design:paramtypes", [String, Array, Object]),
62
+ tslib_1.__metadata("design:returntype", void 0)
63
+ ], InvestmentMutation.prototype, "updateMultipleInvestmentHolding", null);
64
+ tslib_1.__decorate([
65
+ (0, type_graphql_1.Directive)('@transaction'),
66
+ (0, type_graphql_1.Directive)(MUTATION),
67
+ (0, type_graphql_1.Mutation)(type => [investment_board_seat_1.InvestmentBoardSeat], { description: "To save an investee's board seat grid" }),
68
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('investeeId')),
69
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patches', type => [investment_type_1.InvestmentBoardSeatPatch])),
70
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
71
+ tslib_1.__metadata("design:type", Function),
72
+ tslib_1.__metadata("design:paramtypes", [String, Array, Object]),
73
+ tslib_1.__metadata("design:returntype", void 0)
74
+ ], InvestmentMutation.prototype, "updateMultipleInvestmentBoardSeat", null);
75
+ tslib_1.__decorate([
76
+ (0, type_graphql_1.Directive)('@transaction'),
77
+ (0, type_graphql_1.Directive)(MUTATION),
78
+ (0, type_graphql_1.Mutation)(type => [investment_report_1.InvestmentReport], { description: "To save an investee's report grid" }),
79
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('investeeId')),
80
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patches', type => [investment_type_1.InvestmentReportPatch])),
81
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
82
+ tslib_1.__metadata("design:type", Function),
83
+ tslib_1.__metadata("design:paramtypes", [String, Array, Object]),
84
+ tslib_1.__metadata("design:returntype", void 0)
85
+ ], InvestmentMutation.prototype, "updateMultipleInvestmentReport", null);
86
+ tslib_1.__decorate([
87
+ (0, type_graphql_1.Directive)('@transaction'),
88
+ (0, type_graphql_1.Directive)(MUTATION),
89
+ (0, type_graphql_1.Mutation)(type => [investment_request_1.InvestmentRequest], { description: "To save an investee's request grid" }),
90
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('investeeId')),
91
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patches', type => [investment_type_1.InvestmentRequestPatch])),
92
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
93
+ tslib_1.__metadata("design:type", Function),
94
+ tslib_1.__metadata("design:paramtypes", [String, Array, Object]),
95
+ tslib_1.__metadata("design:returntype", void 0)
96
+ ], InvestmentMutation.prototype, "updateMultipleInvestmentRequest", null);
97
+ tslib_1.__decorate([
98
+ (0, type_graphql_1.Directive)('@transaction'),
99
+ (0, type_graphql_1.Directive)(MUTATION),
100
+ (0, type_graphql_1.Mutation)(type => [investment_filing_1.InvestmentFiling], { description: "To save an investee's filing grid" }),
101
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('investeeId')),
102
+ tslib_1.__param(1, (0, type_graphql_1.Arg)('patches', type => [investment_type_1.InvestmentFilingPatch])),
103
+ tslib_1.__param(2, (0, type_graphql_1.Ctx)()),
104
+ tslib_1.__metadata("design:type", Function),
105
+ tslib_1.__metadata("design:paramtypes", [String, Array, Object]),
106
+ tslib_1.__metadata("design:returntype", void 0)
107
+ ], InvestmentMutation.prototype, "updateMultipleInvestmentFiling", null);
108
+ exports.InvestmentMutation = InvestmentMutation = tslib_1.__decorate([
109
+ (0, type_graphql_1.UseMiddleware)(shell_1.SpeakRefusals),
110
+ (0, type_graphql_1.Resolver)(investee_1.Investee)
111
+ ], InvestmentMutation);
112
+ //# sourceMappingURL=investment-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"investment-mutation.js","sourceRoot":"","sources":["../../../server/service/investment/investment-mutation.ts"],"names":[],"mappings":";;;;AAAA,iDAAqD;AACrD,+CAAqF;AAErF,yCAAqC;AACrC,mEAA6D;AAC7D,2DAAsD;AACtD,6DAAwD;AACxD,2DAAsD;AACtD,6DAAwD;AACxD,6DAA0H;AAC1H,uDAO0B;AAE1B,MAAM,QAAQ,GAAG,gFAAgF,CAAA;AAI1F,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAI7B,sBAAsB,CAA0C,OAAwB,EAAS,OAAwB;QACvH,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAC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AAA;IAAoC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;wEAG9J;6BA/CU,kBAAkB;IAF9B,IAAA,4BAAa,EAAC,qBAAa,CAAC;IAC5B,IAAA,uBAAQ,EAAC,mBAAQ,CAAC;GACN,kBAAkB,CAgD9B","sourcesContent":["import { SpeakRefusals } from '@things-factory/shell'\nimport { Arg, Ctx, Directive, Mutation, Resolver, UseMiddleware } from 'type-graphql'\n\nimport { Investee } from './investee'\nimport { InvestmentBoardSeat } from './investment-board-seat'\nimport { InvestmentFiling } from './investment-filing'\nimport { InvestmentHolding } from './investment-holding'\nimport { InvestmentReport } from './investment-report'\nimport { InvestmentRequest } from './investment-request'\nimport { saveBoardSeats, saveFilings, saveHoldings, saveInvestees, saveReports, saveRequests } from './investment-service'\nimport {\n InvesteePatch,\n InvestmentBoardSeatPatch,\n InvestmentFilingPatch,\n InvestmentHoldingPatch,\n InvestmentReportPatch,\n InvestmentRequestPatch\n} from './investment-type'\n\nconst MUTATION = '@privilege(category: \"asset\", privilege: \"mutation\", domainOwnerGranted: true)'\n\n@UseMiddleware(SpeakRefusals)\n@Resolver(Investee)\nexport class InvestmentMutation {\n @Directive('@transaction')\n @Directive(MUTATION)\n @Mutation(type => [Investee], { description: 'To save the investee grid - new, changed and deleted rows together' })\n updateMultipleInvestee(@Arg('patches', type => [InvesteePatch]) patches: InvesteePatch[], @Ctx() context: ResolverContext) {\n const { tx, domain, user } = context.state\n return saveInvestees(tx, domain, user, patches)\n }\n\n @Directive('@transaction')\n @Directive(MUTATION)\n @Mutation(type => [InvestmentHolding], { description: \"To save an investee's holding grid\" })\n updateMultipleInvestmentHolding(@Arg('investeeId') investeeId: string, @Arg('patches', type => [InvestmentHoldingPatch]) patches: InvestmentHoldingPatch[], @Ctx() context: ResolverContext) {\n const { tx, domain, user } = context.state\n return saveHoldings(tx, domain, user, investeeId, patches)\n }\n\n @Directive('@transaction')\n @Directive(MUTATION)\n @Mutation(type => [InvestmentBoardSeat], { description: \"To save an investee's board seat grid\" })\n updateMultipleInvestmentBoardSeat(@Arg('investeeId') investeeId: string, @Arg('patches', type => [InvestmentBoardSeatPatch]) patches: InvestmentBoardSeatPatch[], @Ctx() context: ResolverContext) {\n const { tx, domain, user } = context.state\n return saveBoardSeats(tx, domain, user, investeeId, patches)\n }\n\n @Directive('@transaction')\n @Directive(MUTATION)\n @Mutation(type => [InvestmentReport], { description: \"To save an investee's report grid\" })\n updateMultipleInvestmentReport(@Arg('investeeId') investeeId: string, @Arg('patches', type => [InvestmentReportPatch]) patches: InvestmentReportPatch[], @Ctx() context: ResolverContext) {\n const { tx, domain, user } = context.state\n return saveReports(tx, domain, user, investeeId, patches)\n }\n\n @Directive('@transaction')\n @Directive(MUTATION)\n @Mutation(type => [InvestmentRequest], { description: \"To save an investee's request grid\" })\n updateMultipleInvestmentRequest(@Arg('investeeId') investeeId: string, @Arg('patches', type => [InvestmentRequestPatch]) patches: InvestmentRequestPatch[], @Ctx() context: ResolverContext) {\n const { tx, domain, user } = context.state\n return saveRequests(tx, domain, user, investeeId, patches)\n }\n\n @Directive('@transaction')\n @Directive(MUTATION)\n @Mutation(type => [InvestmentFiling], { description: \"To save an investee's filing grid\" })\n updateMultipleInvestmentFiling(@Arg('investeeId') investeeId: string, @Arg('patches', type => [InvestmentFilingPatch]) patches: InvestmentFilingPatch[], @Ctx() context: ResolverContext) {\n const { tx, domain, user } = context.state\n return saveFilings(tx, domain, user, investeeId, patches)\n }\n}\n"]}
@@ -0,0 +1,33 @@
1
+ import { Counterparty } from '@things-factory/biz-base';
2
+ import { ListParam } from '@things-factory/shell';
3
+ import { Investee } from './investee';
4
+ import { InvestmentBoardSeat } from './investment-board-seat';
5
+ import { InvestmentFiling } from './investment-filing';
6
+ import { InvestmentHolding } from './investment-holding';
7
+ import { InvestmentReport } from './investment-report';
8
+ import { InvestmentRequest } from './investment-request';
9
+ import { InvesteeList } from './investment-type';
10
+ export declare class InvestmentQuery {
11
+ investees(params: ListParam, context: ResolverContext): Promise<InvesteeList>;
12
+ investee(id: string, context: ResolverContext): Promise<Investee>;
13
+ investmentHoldings(investeeId: string, context: ResolverContext): Promise<InvestmentHolding[]>;
14
+ investmentBoardSeats(investeeId: string, context: ResolverContext): Promise<InvestmentBoardSeat[]>;
15
+ investmentReports(investeeId: string, context: ResolverContext): Promise<InvestmentReport[]>;
16
+ investmentRequests(investeeId: string, context: ResolverContext): Promise<InvestmentRequest[]>;
17
+ investmentFilings(investeeId: string, context: ResolverContext): Promise<InvestmentFiling[]>;
18
+ lateInvestmentReports(context: ResolverContext): Promise<{
19
+ periodTo: string;
20
+ dueOn: string;
21
+ investeeId: string;
22
+ investeeName: string;
23
+ }[]>;
24
+ dueInvestmentRequests(context: ResolverContext): Promise<InvestmentRequest[]>;
25
+ dueInvestmentFilings(context: ResolverContext): Promise<InvestmentFiling[]>;
26
+ counterparty(row: Investee): Counterparty | Promise<Counterparty>;
27
+ }
28
+ export declare class InvestmentRequestQuery {
29
+ investee(row: InvestmentRequest): Investee | Promise<Investee>;
30
+ }
31
+ export declare class InvestmentFilingQuery {
32
+ investee(row: InvestmentFiling): Investee | Promise<Investee>;
33
+ }