@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,192 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvestmentFilingQuery = exports.InvestmentRequestQuery = exports.InvestmentQuery = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const biz_base_1 = require("@things-factory/biz-base");
6
+ const shell_1 = require("@things-factory/shell");
7
+ const type_graphql_1 = require("type-graphql");
8
+ const investee_1 = require("./investee");
9
+ const investment_board_seat_1 = require("./investment-board-seat");
10
+ const investment_filing_1 = require("./investment-filing");
11
+ const investment_holding_1 = require("./investment-holding");
12
+ const investment_report_1 = require("./investment-report");
13
+ const investment_request_1 = require("./investment-request");
14
+ const investment_service_1 = require("./investment-service");
15
+ const investment_type_1 = require("./investment-type");
16
+ const QUERY = '@privilege(category: "asset", privilege: "query", domainOwnerGranted: true)';
17
+ const today = () => new Date().toISOString().slice(0, 10);
18
+ const manager = () => (0, shell_1.getRepository)(investee_1.Investee).manager;
19
+ let InvestmentQuery = class InvestmentQuery {
20
+ async investees(params, context) {
21
+ const { domain } = context.state;
22
+ const query = (0, shell_1.getQueryBuilderFromListParams)({ domain, params, repository: (0, shell_1.getRepository)(investee_1.Investee), searchables: ['name', 'registrationNo', 'representative', 'description'] });
23
+ const [items, total] = await query.getManyAndCount();
24
+ return { items: await (0, investment_service_1.withHoldings)(manager(), domain, items, today()), total };
25
+ }
26
+ async investee(id, context) {
27
+ const { domain } = context.state;
28
+ const one = await (0, shell_1.getRepository)(investee_1.Investee).findOne({ where: { id, domain: { id: domain.id } } });
29
+ return one ? (await (0, investment_service_1.withHoldings)(manager(), domain, [one], today()))[0] : null;
30
+ }
31
+ investmentHoldings(investeeId, context) {
32
+ return (0, investment_service_1.holdingsOf)(manager(), context.state.domain, investeeId);
33
+ }
34
+ investmentBoardSeats(investeeId, context) {
35
+ return (0, investment_service_1.boardSeatsOf)(manager(), context.state.domain, investeeId);
36
+ }
37
+ investmentReports(investeeId, context) {
38
+ return (0, investment_service_1.reportsOf)(manager(), context.state.domain, investeeId);
39
+ }
40
+ investmentRequests(investeeId, context) {
41
+ return (0, investment_service_1.requestsOf)(manager(), context.state.domain, investeeId);
42
+ }
43
+ investmentFilings(investeeId, context) {
44
+ return (0, investment_service_1.filingsOf)(manager(), context.state.domain, investeeId);
45
+ }
46
+ lateInvestmentReports(context) {
47
+ return (0, investment_service_1.lateInvestmentReports)(manager(), context.state.domain, today());
48
+ }
49
+ dueInvestmentRequests(context) {
50
+ return (0, investment_service_1.dueInvestmentRequests)(manager(), context.state.domain, today());
51
+ }
52
+ dueInvestmentFilings(context) {
53
+ return (0, investment_service_1.dueInvestmentFilings)(manager(), context.state.domain, today());
54
+ }
55
+ counterparty(row) {
56
+ return row.counterparty ?? (row.counterpartyId ? (0, shell_1.getRepository)(biz_base_1.Counterparty).findOneBy({ id: row.counterpartyId }) : undefined);
57
+ }
58
+ };
59
+ exports.InvestmentQuery = InvestmentQuery;
60
+ tslib_1.__decorate([
61
+ (0, type_graphql_1.Directive)(QUERY),
62
+ (0, type_graphql_1.Query)(type => investment_type_1.InvesteeList, { description: 'To fetch a page of the companies the domain holds shares in, with where each holding stands now' }),
63
+ tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
64
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
65
+ tslib_1.__metadata("design:type", Function),
66
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
67
+ tslib_1.__metadata("design:returntype", Promise)
68
+ ], InvestmentQuery.prototype, "investees", null);
69
+ tslib_1.__decorate([
70
+ (0, type_graphql_1.Directive)(QUERY),
71
+ (0, type_graphql_1.Query)(type => investee_1.Investee, { nullable: true, description: 'To fetch a company the domain holds shares in' }),
72
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
73
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
74
+ tslib_1.__metadata("design:type", Function),
75
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
76
+ tslib_1.__metadata("design:returntype", Promise)
77
+ ], InvestmentQuery.prototype, "investee", null);
78
+ tslib_1.__decorate([
79
+ (0, type_graphql_1.Directive)(QUERY),
80
+ (0, type_graphql_1.Query)(type => [investment_holding_1.InvestmentHolding], { description: "An investee's holding, day by day, the earliest first" }),
81
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('investeeId')),
82
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
83
+ tslib_1.__metadata("design:type", Function),
84
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
85
+ tslib_1.__metadata("design:returntype", void 0)
86
+ ], InvestmentQuery.prototype, "investmentHoldings", null);
87
+ tslib_1.__decorate([
88
+ (0, type_graphql_1.Directive)(QUERY),
89
+ (0, type_graphql_1.Query)(type => [investment_board_seat_1.InvestmentBoardSeat], { description: "Who of ours sat on an investee's board, and when" }),
90
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('investeeId')),
91
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
92
+ tslib_1.__metadata("design:type", Function),
93
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
94
+ tslib_1.__metadata("design:returntype", void 0)
95
+ ], InvestmentQuery.prototype, "investmentBoardSeats", null);
96
+ tslib_1.__decorate([
97
+ (0, type_graphql_1.Directive)(QUERY),
98
+ (0, type_graphql_1.Query)(type => [investment_report_1.InvestmentReport], { description: "An investee's reports, the latest first, with our part of each one's equity" }),
99
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('investeeId')),
100
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
101
+ tslib_1.__metadata("design:type", Function),
102
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
103
+ tslib_1.__metadata("design:returntype", void 0)
104
+ ], InvestmentQuery.prototype, "investmentReports", null);
105
+ tslib_1.__decorate([
106
+ (0, type_graphql_1.Directive)(QUERY),
107
+ (0, type_graphql_1.Query)(type => [investment_request_1.InvestmentRequest], { description: "What an investee asked its shareholders, the latest first" }),
108
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('investeeId')),
109
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
110
+ tslib_1.__metadata("design:type", Function),
111
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
112
+ tslib_1.__metadata("design:returntype", void 0)
113
+ ], InvestmentQuery.prototype, "investmentRequests", null);
114
+ tslib_1.__decorate([
115
+ (0, type_graphql_1.Directive)(QUERY),
116
+ (0, type_graphql_1.Query)(type => [investment_filing_1.InvestmentFiling], { description: 'The filings asked of us for holding an investee, the latest due first' }),
117
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('investeeId')),
118
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
119
+ tslib_1.__metadata("design:type", Function),
120
+ tslib_1.__metadata("design:paramtypes", [String, Object]),
121
+ tslib_1.__metadata("design:returntype", void 0)
122
+ ], InvestmentQuery.prototype, "investmentFilings", null);
123
+ tslib_1.__decorate([
124
+ (0, type_graphql_1.Directive)(QUERY),
125
+ (0, type_graphql_1.Query)(type => [investment_type_1.LateInvestmentReport], { description: "The investees' reports that are late" }),
126
+ tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
127
+ tslib_1.__metadata("design:type", Function),
128
+ tslib_1.__metadata("design:paramtypes", [Object]),
129
+ tslib_1.__metadata("design:returntype", void 0)
130
+ ], InvestmentQuery.prototype, "lateInvestmentReports", null);
131
+ tslib_1.__decorate([
132
+ (0, type_graphql_1.Directive)(QUERY),
133
+ (0, type_graphql_1.Query)(type => [investment_request_1.InvestmentRequest], { description: 'Requests not answered whose due day has passed or is near' }),
134
+ tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
135
+ tslib_1.__metadata("design:type", Function),
136
+ tslib_1.__metadata("design:paramtypes", [Object]),
137
+ tslib_1.__metadata("design:returntype", void 0)
138
+ ], InvestmentQuery.prototype, "dueInvestmentRequests", null);
139
+ tslib_1.__decorate([
140
+ (0, type_graphql_1.Directive)(QUERY),
141
+ (0, type_graphql_1.Query)(type => [investment_filing_1.InvestmentFiling], { description: 'Filings not made whose due day has passed or is near' }),
142
+ tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
143
+ tslib_1.__metadata("design:type", Function),
144
+ tslib_1.__metadata("design:paramtypes", [Object]),
145
+ tslib_1.__metadata("design:returntype", void 0)
146
+ ], InvestmentQuery.prototype, "dueInvestmentFilings", null);
147
+ tslib_1.__decorate([
148
+ (0, type_graphql_1.FieldResolver)(type => biz_base_1.Counterparty, { nullable: true }),
149
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
150
+ tslib_1.__metadata("design:type", Function),
151
+ tslib_1.__metadata("design:paramtypes", [investee_1.Investee]),
152
+ tslib_1.__metadata("design:returntype", void 0)
153
+ ], InvestmentQuery.prototype, "counterparty", null);
154
+ exports.InvestmentQuery = InvestmentQuery = tslib_1.__decorate([
155
+ (0, type_graphql_1.UseMiddleware)(shell_1.SpeakRefusals),
156
+ (0, type_graphql_1.Resolver)(investee_1.Investee)
157
+ ], InvestmentQuery);
158
+ /* The investee a request or a filing is about - for the rows read across investees. */
159
+ const investeeOf = (row) => row.investee ?? (row.investeeId ? (0, shell_1.getRepository)(investee_1.Investee).findOneBy({ id: row.investeeId }) : undefined);
160
+ let InvestmentRequestQuery = class InvestmentRequestQuery {
161
+ investee(row) {
162
+ return investeeOf(row);
163
+ }
164
+ };
165
+ exports.InvestmentRequestQuery = InvestmentRequestQuery;
166
+ tslib_1.__decorate([
167
+ (0, type_graphql_1.FieldResolver)(type => investee_1.Investee, { nullable: true }),
168
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
169
+ tslib_1.__metadata("design:type", Function),
170
+ tslib_1.__metadata("design:paramtypes", [investment_request_1.InvestmentRequest]),
171
+ tslib_1.__metadata("design:returntype", void 0)
172
+ ], InvestmentRequestQuery.prototype, "investee", null);
173
+ exports.InvestmentRequestQuery = InvestmentRequestQuery = tslib_1.__decorate([
174
+ (0, type_graphql_1.Resolver)(investment_request_1.InvestmentRequest)
175
+ ], InvestmentRequestQuery);
176
+ let InvestmentFilingQuery = class InvestmentFilingQuery {
177
+ investee(row) {
178
+ return investeeOf(row);
179
+ }
180
+ };
181
+ exports.InvestmentFilingQuery = InvestmentFilingQuery;
182
+ tslib_1.__decorate([
183
+ (0, type_graphql_1.FieldResolver)(type => investee_1.Investee, { nullable: true }),
184
+ tslib_1.__param(0, (0, type_graphql_1.Root)()),
185
+ tslib_1.__metadata("design:type", Function),
186
+ tslib_1.__metadata("design:paramtypes", [investment_filing_1.InvestmentFiling]),
187
+ tslib_1.__metadata("design:returntype", void 0)
188
+ ], InvestmentFilingQuery.prototype, "investee", null);
189
+ exports.InvestmentFilingQuery = InvestmentFilingQuery = tslib_1.__decorate([
190
+ (0, type_graphql_1.Resolver)(investment_filing_1.InvestmentFiling)
191
+ ], InvestmentFilingQuery);
192
+ //# sourceMappingURL=investment-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"investment-query.js","sourceRoot":"","sources":["../../../server/service/investment/investment-query.ts"],"names":[],"mappings":";;;;AAAA,uDAAuD;AACvD,iDAA8G;AAC9G,+CAA6G;AAE7G,yCAAqC;AACrC,mEAA6D;AAC7D,2DAAsD;AACtD,6DAAwD;AACxD,2DAAsD;AACtD,6DAAwD;AACxD,6DAU6B;AAC7B,uDAAsE;AAEtE,MAAM,KAAK,GAAG,6EAA6E,CAAA;AAC3F,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EA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iB,CAAC;GACf,sBAAsB,CAKlC;AAGM,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAEhC,QAAQ,CAAS,GAAqB;QACpC,OAAO,UAAU,CAAC,GAAG,CAAC,CAAA;IACxB,CAAC;CACF,CAAA;AALY,sDAAqB;AAEhC;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1C,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAM,oCAAgB;;qDAErC;gCAJU,qBAAqB;IADjC,IAAA,uBAAQ,EAAC,oCAAgB,CAAC;GACd,qBAAqB,CAKjC","sourcesContent":["import { Counterparty } from '@things-factory/biz-base'\nimport { getQueryBuilderFromListParams, getRepository, ListParam, SpeakRefusals } from '@things-factory/shell'\nimport { Arg, Args, Ctx, Directive, FieldResolver, Query, Resolver, Root, 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 {\n boardSeatsOf,\n dueInvestmentFilings,\n dueInvestmentRequests,\n filingsOf,\n holdingsOf,\n lateInvestmentReports,\n reportsOf,\n requestsOf,\n withHoldings\n} from './investment-service'\nimport { InvesteeList, LateInvestmentReport } from './investment-type'\n\nconst QUERY = '@privilege(category: \"asset\", privilege: \"query\", domainOwnerGranted: true)'\nconst today = () => new Date().toISOString().slice(0, 10)\nconst manager = () => getRepository(Investee).manager\n\n@UseMiddleware(SpeakRefusals)\n@Resolver(Investee)\nexport class InvestmentQuery {\n @Directive(QUERY)\n @Query(type => InvesteeList, { description: 'To fetch a page of the companies the domain holds shares in, with where each holding stands now' })\n async investees(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<InvesteeList> {\n const { domain } = context.state\n const query = getQueryBuilderFromListParams({ domain, params, repository: getRepository(Investee), searchables: ['name', 'registrationNo', 'representative', 'description'] })\n const [items, total] = await query.getManyAndCount()\n return { items: await withHoldings(manager(), domain, items, today()), total }\n }\n\n @Directive(QUERY)\n @Query(type => Investee, { nullable: true, description: 'To fetch a company the domain holds shares in' })\n async investee(@Arg('id') id: string, @Ctx() context: ResolverContext) {\n const { domain } = context.state\n const one = await getRepository(Investee).findOne({ where: { id, domain: { id: domain.id } } })\n return one ? (await withHoldings(manager(), domain, [one], today()))[0] : null\n }\n\n @Directive(QUERY)\n @Query(type => [InvestmentHolding], { description: \"An investee's holding, day by day, the earliest first\" })\n investmentHoldings(@Arg('investeeId') investeeId: string, @Ctx() context: ResolverContext) {\n return holdingsOf(manager(), context.state.domain, investeeId)\n }\n\n @Directive(QUERY)\n @Query(type => [InvestmentBoardSeat], { description: \"Who of ours sat on an investee's board, and when\" })\n investmentBoardSeats(@Arg('investeeId') investeeId: string, @Ctx() context: ResolverContext) {\n return boardSeatsOf(manager(), context.state.domain, investeeId)\n }\n\n @Directive(QUERY)\n @Query(type => [InvestmentReport], { description: \"An investee's reports, the latest first, with our part of each one's equity\" })\n investmentReports(@Arg('investeeId') investeeId: string, @Ctx() context: ResolverContext) {\n return reportsOf(manager(), context.state.domain, investeeId)\n }\n\n @Directive(QUERY)\n @Query(type => [InvestmentRequest], { description: \"What an investee asked its shareholders, the latest first\" })\n investmentRequests(@Arg('investeeId') investeeId: string, @Ctx() context: ResolverContext) {\n return requestsOf(manager(), context.state.domain, investeeId)\n }\n\n @Directive(QUERY)\n @Query(type => [InvestmentFiling], { description: 'The filings asked of us for holding an investee, the latest due first' })\n investmentFilings(@Arg('investeeId') investeeId: string, @Ctx() context: ResolverContext) {\n return filingsOf(manager(), context.state.domain, investeeId)\n }\n\n @Directive(QUERY)\n @Query(type => [LateInvestmentReport], { description: \"The investees' reports that are late\" })\n lateInvestmentReports(@Ctx() context: ResolverContext) {\n return lateInvestmentReports(manager(), context.state.domain, today())\n }\n\n @Directive(QUERY)\n @Query(type => [InvestmentRequest], { description: 'Requests not answered whose due day has passed or is near' })\n dueInvestmentRequests(@Ctx() context: ResolverContext) {\n return dueInvestmentRequests(manager(), context.state.domain, today())\n }\n\n @Directive(QUERY)\n @Query(type => [InvestmentFiling], { description: 'Filings not made whose due day has passed or is near' })\n dueInvestmentFilings(@Ctx() context: ResolverContext) {\n return dueInvestmentFilings(manager(), context.state.domain, today())\n }\n\n @FieldResolver(type => Counterparty, { nullable: true })\n counterparty(@Root() row: Investee) {\n return row.counterparty ?? (row.counterpartyId ? getRepository(Counterparty).findOneBy({ id: row.counterpartyId }) : undefined)\n }\n}\n\n/* The investee a request or a filing is about - for the rows read across investees. */\nconst investeeOf = (row: { investee?: Investee; investeeId?: string }) => row.investee ?? (row.investeeId ? getRepository(Investee).findOneBy({ id: row.investeeId }) : undefined)\n\n@Resolver(InvestmentRequest)\nexport class InvestmentRequestQuery {\n @FieldResolver(type => Investee, { nullable: true })\n investee(@Root() row: InvestmentRequest) {\n return investeeOf(row)\n }\n}\n\n@Resolver(InvestmentFiling)\nexport class InvestmentFilingQuery {\n @FieldResolver(type => Investee, { nullable: true })\n investee(@Root() row: InvestmentFiling) {\n return investeeOf(row)\n }\n}\n"]}
@@ -0,0 +1,37 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { Domain } from '@things-factory/shell';
3
+ import { Investee } from './investee';
4
+ import { InvestmentReportKind } from './investment-rules';
5
+ /**
6
+ * A report the company sent its shareholders (decision 8): the period it covers - any length, a year end can move - when
7
+ * it was signed and received, and the figures we keep of it in its currency. The original is its document.
8
+ */
9
+ export declare class InvestmentReport {
10
+ readonly id: string;
11
+ domain?: Domain;
12
+ domainId?: string;
13
+ investee?: Investee;
14
+ investeeId?: string;
15
+ periodFrom?: string;
16
+ periodTo: string;
17
+ kind: InvestmentReportKind;
18
+ standard?: string;
19
+ auditor?: string;
20
+ signedOn?: string;
21
+ receivedOn?: string;
22
+ revenue?: number;
23
+ netIncome?: number;
24
+ shareCapital?: number;
25
+ totalEquity?: number;
26
+ totalAssets?: number;
27
+ description?: string;
28
+ ourShare?: number;
29
+ documents?: number;
30
+ createdAt?: Date;
31
+ updatedAt?: Date;
32
+ deletedAt?: Date;
33
+ creator?: User;
34
+ creatorId?: string;
35
+ updater?: User;
36
+ updaterId?: string;
37
+ }
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvestmentReport = 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
+ * A report the company sent its shareholders (decision 8): the period it covers - any length, a year end can move - when
13
+ * it was signed and received, and the figures we keep of it in its currency. The original is its document.
14
+ */
15
+ let InvestmentReport = class InvestmentReport {
16
+ };
17
+ exports.InvestmentReport = InvestmentReport;
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
+ ], InvestmentReport.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
+ ], InvestmentReport.prototype, "domain", void 0);
28
+ tslib_1.__decorate([
29
+ (0, typeorm_1.RelationId)((report) => report.domain),
30
+ tslib_1.__metadata("design:type", String)
31
+ ], InvestmentReport.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
+ ], InvestmentReport.prototype, "investee", void 0);
37
+ tslib_1.__decorate([
38
+ (0, typeorm_1.RelationId)((report) => report.investee),
39
+ tslib_1.__metadata("design:type", String)
40
+ ], InvestmentReport.prototype, "investeeId", void 0);
41
+ tslib_1.__decorate([
42
+ (0, typeorm_1.Column)({ nullable: true }),
43
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The first day it covers - YYYY-MM-DD' }),
44
+ tslib_1.__metadata("design:type", String)
45
+ ], InvestmentReport.prototype, "periodFrom", void 0);
46
+ tslib_1.__decorate([
47
+ (0, typeorm_1.Column)(),
48
+ (0, type_graphql_1.Field)({ description: 'The last day it covers - YYYY-MM-DD' }),
49
+ tslib_1.__metadata("design:type", String)
50
+ ], InvestmentReport.prototype, "periodTo", void 0);
51
+ tslib_1.__decorate([
52
+ (0, typeorm_1.Column)({ default: investment_rules_1.InvestmentReportKind.AUDITED }),
53
+ (0, type_graphql_1.Field)(type => investment_rules_1.InvestmentReportKind, { description: 'Audited, interim or management' }),
54
+ tslib_1.__metadata("design:type", String)
55
+ ], InvestmentReport.prototype, "kind", void 0);
56
+ tslib_1.__decorate([
57
+ (0, typeorm_1.Column)({ nullable: true }),
58
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The accounting standard it is drawn up by' }),
59
+ tslib_1.__metadata("design:type", String)
60
+ ], InvestmentReport.prototype, "standard", void 0);
61
+ tslib_1.__decorate([
62
+ (0, typeorm_1.Column)({ nullable: true }),
63
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Who audited it' }),
64
+ tslib_1.__metadata("design:type", String)
65
+ ], InvestmentReport.prototype, "auditor", void 0);
66
+ tslib_1.__decorate([
67
+ (0, typeorm_1.Column)({ nullable: true }),
68
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The day it was signed - YYYY-MM-DD' }),
69
+ tslib_1.__metadata("design:type", String)
70
+ ], InvestmentReport.prototype, "signedOn", void 0);
71
+ tslib_1.__decorate([
72
+ (0, typeorm_1.Column)({ nullable: true }),
73
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The day we received it - YYYY-MM-DD' }),
74
+ tslib_1.__metadata("design:type", String)
75
+ ], InvestmentReport.prototype, "receivedOn", void 0);
76
+ tslib_1.__decorate([
77
+ (0, typeorm_1.Column)({ nullable: true, ...(0, shell_1.moneyColumn)() }),
78
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'Revenue of the period' }),
79
+ tslib_1.__metadata("design:type", Number)
80
+ ], InvestmentReport.prototype, "revenue", void 0);
81
+ tslib_1.__decorate([
82
+ (0, typeorm_1.Column)({ nullable: true, ...(0, shell_1.moneyColumn)() }),
83
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'Net income of the period' }),
84
+ tslib_1.__metadata("design:type", Number)
85
+ ], InvestmentReport.prototype, "netIncome", void 0);
86
+ tslib_1.__decorate([
87
+ (0, typeorm_1.Column)({ nullable: true, ...(0, shell_1.moneyColumn)() }),
88
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'Share capital at its end' }),
89
+ tslib_1.__metadata("design:type", Number)
90
+ ], InvestmentReport.prototype, "shareCapital", void 0);
91
+ tslib_1.__decorate([
92
+ (0, typeorm_1.Column)({ nullable: true, ...(0, shell_1.moneyColumn)() }),
93
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'Total equity at its end' }),
94
+ tslib_1.__metadata("design:type", Number)
95
+ ], InvestmentReport.prototype, "totalEquity", void 0);
96
+ tslib_1.__decorate([
97
+ (0, typeorm_1.Column)({ nullable: true, ...(0, shell_1.moneyColumn)() }),
98
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'Total assets at its end' }),
99
+ tslib_1.__metadata("design:type", Number)
100
+ ], InvestmentReport.prototype, "totalAssets", void 0);
101
+ tslib_1.__decorate([
102
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
103
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Notes' }),
104
+ tslib_1.__metadata("design:type", String)
105
+ ], InvestmentReport.prototype, "description", void 0);
106
+ tslib_1.__decorate([
107
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'Our part of its equity - filled by the list query' }),
108
+ tslib_1.__metadata("design:type", Number)
109
+ ], InvestmentReport.prototype, "ourShare", void 0);
110
+ tslib_1.__decorate([
111
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'How many documents are attached - filled by the list query' }),
112
+ tslib_1.__metadata("design:type", Number)
113
+ ], InvestmentReport.prototype, "documents", void 0);
114
+ tslib_1.__decorate([
115
+ (0, typeorm_1.CreateDateColumn)(),
116
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When the row was written' }),
117
+ tslib_1.__metadata("design:type", Date)
118
+ ], InvestmentReport.prototype, "createdAt", void 0);
119
+ tslib_1.__decorate([
120
+ (0, typeorm_1.UpdateDateColumn)(),
121
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When the row last changed' }),
122
+ tslib_1.__metadata("design:type", Date)
123
+ ], InvestmentReport.prototype, "updatedAt", void 0);
124
+ tslib_1.__decorate([
125
+ (0, typeorm_1.DeleteDateColumn)(),
126
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When the row was deleted' }),
127
+ tslib_1.__metadata("design:type", Date)
128
+ ], InvestmentReport.prototype, "deletedAt", void 0);
129
+ tslib_1.__decorate([
130
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
131
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who wrote it' }),
132
+ tslib_1.__metadata("design:type", auth_base_1.User)
133
+ ], InvestmentReport.prototype, "creator", void 0);
134
+ tslib_1.__decorate([
135
+ (0, typeorm_1.RelationId)((report) => report.creator),
136
+ tslib_1.__metadata("design:type", String)
137
+ ], InvestmentReport.prototype, "creatorId", void 0);
138
+ tslib_1.__decorate([
139
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
140
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who last changed it' }),
141
+ tslib_1.__metadata("design:type", auth_base_1.User)
142
+ ], InvestmentReport.prototype, "updater", void 0);
143
+ tslib_1.__decorate([
144
+ (0, typeorm_1.RelationId)((report) => report.updater),
145
+ tslib_1.__metadata("design:type", String)
146
+ ], InvestmentReport.prototype, "updaterId", void 0);
147
+ exports.InvestmentReport = InvestmentReport = tslib_1.__decorate([
148
+ (0, typeorm_1.Entity)(),
149
+ (0, typeorm_1.Index)('ix_investment_report_0', (report) => [report.domain, report.investee, report.periodTo]),
150
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for InvestmentReport — a report the company sent its shareholders' })
151
+ ], InvestmentReport);
152
+ //# sourceMappingURL=investment-report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"investment-report.js","sourceRoot":"","sources":["../../../server/service/investment/investment-report.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,iDAA2D;AAC3D,+CAAgE;AAChE,qCAAoJ;AAEpJ,yCAAqC;AACrC,yDAAyD;AAGzD;;;GAGG;AAII,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAsG5B,CAAA;AAtGY,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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AAS,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;iDAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,MAAwB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC;;mDACvC;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;iDAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,MAAwB,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC;;mDACvC;2BArGP,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,QAAQ,CAAC,CAAC;IAChH,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,0EAA0E,EAAE,CAAC;GAC3F,gBAAgB,CAsG5B","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Domain, moneyColumn } 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 { InvestmentReportKind } from './investment-rules'\n\n\n/**\n * A report the company sent its shareholders (decision 8): the period it covers - any length, a year end can move - when\n * it was signed and received, and the figures we keep of it in its currency. The original is its document.\n */\n@Entity()\n@Index('ix_investment_report_0', (report: InvestmentReport) => [report.domain, report.investee, report.periodTo])\n@ObjectType({ description: 'Entity for InvestmentReport — a report the company sent its shareholders' })\nexport class InvestmentReport {\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((report: InvestmentReport) => report.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((report: InvestmentReport) => report.investee)\n investeeId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The first day it covers - YYYY-MM-DD' })\n periodFrom?: string\n\n @Column()\n @Field({ description: 'The last day it covers - YYYY-MM-DD' })\n periodTo: string\n\n @Column({ default: InvestmentReportKind.AUDITED })\n @Field(type => InvestmentReportKind, { description: 'Audited, interim or management' })\n kind: InvestmentReportKind\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The accounting standard it is drawn up by' })\n standard?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Who audited it' })\n auditor?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The day it was signed - YYYY-MM-DD' })\n signedOn?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The day we received it - YYYY-MM-DD' })\n receivedOn?: string\n\n @Column({ nullable: true, ...moneyColumn() })\n @Field(type => Float, { nullable: true, description: 'Revenue of the period' })\n revenue?: number\n\n @Column({ nullable: true, ...moneyColumn() })\n @Field(type => Float, { nullable: true, description: 'Net income of the period' })\n netIncome?: number\n\n @Column({ nullable: true, ...moneyColumn() })\n @Field(type => Float, { nullable: true, description: 'Share capital at its end' })\n shareCapital?: number\n\n @Column({ nullable: true, ...moneyColumn() })\n @Field(type => Float, { nullable: true, description: 'Total equity at its end' })\n totalEquity?: number\n\n @Column({ nullable: true, ...moneyColumn() })\n @Field(type => Float, { nullable: true, description: 'Total assets at its end' })\n totalAssets?: number\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 of its equity - filled by the list query' })\n ourShare?: number\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((report: InvestmentReport) => report.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((report: InvestmentReport) => report.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 { InvestmentRequestKind } from './investment-rules';
5
+ /**
6
+ * What the company asked its shareholders to sign or vote on (decision 9) - a written resolution, an acknowledgement, a
7
+ * meeting's notice - with its items and our answer to each. The request and our signed copy are its documents.
8
+ */
9
+ export declare class InvestmentRequest {
10
+ readonly id: string;
11
+ domain?: Domain;
12
+ domainId?: string;
13
+ investee?: Investee;
14
+ investeeId?: string;
15
+ kind: InvestmentRequestKind;
16
+ title: string;
17
+ receivedOn?: string;
18
+ dueOn?: string;
19
+ sentOn?: string;
20
+ signer?: string;
21
+ items?: string;
22
+ description?: string;
23
+ documents?: 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,123 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvestmentRequest = 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
+ * What the company asked its shareholders to sign or vote on (decision 9) - a written resolution, an acknowledgement, a
13
+ * meeting's notice - with its items and our answer to each. The request and our signed copy are its documents.
14
+ */
15
+ let InvestmentRequest = class InvestmentRequest {
16
+ };
17
+ exports.InvestmentRequest = InvestmentRequest;
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
+ ], InvestmentRequest.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
+ ], InvestmentRequest.prototype, "domain", void 0);
28
+ tslib_1.__decorate([
29
+ (0, typeorm_1.RelationId)((request) => request.domain),
30
+ tslib_1.__metadata("design:type", String)
31
+ ], InvestmentRequest.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
+ ], InvestmentRequest.prototype, "investee", void 0);
37
+ tslib_1.__decorate([
38
+ (0, typeorm_1.RelationId)((request) => request.investee),
39
+ tslib_1.__metadata("design:type", String)
40
+ ], InvestmentRequest.prototype, "investeeId", void 0);
41
+ tslib_1.__decorate([
42
+ (0, typeorm_1.Column)({ default: investment_rules_1.InvestmentRequestKind.WRITTEN_RESOLUTION }),
43
+ (0, type_graphql_1.Field)(type => investment_rules_1.InvestmentRequestKind, { description: 'What is asked' }),
44
+ tslib_1.__metadata("design:type", String)
45
+ ], InvestmentRequest.prototype, "kind", void 0);
46
+ tslib_1.__decorate([
47
+ (0, typeorm_1.Column)(),
48
+ (0, type_graphql_1.Field)({ description: 'What it is about' }),
49
+ tslib_1.__metadata("design:type", String)
50
+ ], InvestmentRequest.prototype, "title", void 0);
51
+ tslib_1.__decorate([
52
+ (0, typeorm_1.Column)({ nullable: true }),
53
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The day we received it - YYYY-MM-DD' }),
54
+ tslib_1.__metadata("design:type", String)
55
+ ], InvestmentRequest.prototype, "receivedOn", 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 must be answered by - YYYY-MM-DD' }),
59
+ tslib_1.__metadata("design:type", String)
60
+ ], InvestmentRequest.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 we sent our answer - YYYY-MM-DD' }),
64
+ tslib_1.__metadata("design:type", String)
65
+ ], InvestmentRequest.prototype, "sentOn", void 0);
66
+ tslib_1.__decorate([
67
+ (0, typeorm_1.Column)({ nullable: true }),
68
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Who signed for us' }),
69
+ tslib_1.__metadata("design:type", String)
70
+ ], InvestmentRequest.prototype, "signer", void 0);
71
+ tslib_1.__decorate([
72
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
73
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Its items and our answers, one per line: the item, then our answer' }),
74
+ tslib_1.__metadata("design:type", String)
75
+ ], InvestmentRequest.prototype, "items", void 0);
76
+ tslib_1.__decorate([
77
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
78
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Notes' }),
79
+ tslib_1.__metadata("design:type", String)
80
+ ], InvestmentRequest.prototype, "description", void 0);
81
+ tslib_1.__decorate([
82
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'How many documents are attached - filled by the list query' }),
83
+ tslib_1.__metadata("design:type", Number)
84
+ ], InvestmentRequest.prototype, "documents", void 0);
85
+ tslib_1.__decorate([
86
+ (0, typeorm_1.CreateDateColumn)(),
87
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When the row was written' }),
88
+ tslib_1.__metadata("design:type", Date)
89
+ ], InvestmentRequest.prototype, "createdAt", void 0);
90
+ tslib_1.__decorate([
91
+ (0, typeorm_1.UpdateDateColumn)(),
92
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When the row last changed' }),
93
+ tslib_1.__metadata("design:type", Date)
94
+ ], InvestmentRequest.prototype, "updatedAt", void 0);
95
+ tslib_1.__decorate([
96
+ (0, typeorm_1.DeleteDateColumn)(),
97
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When the row was deleted' }),
98
+ tslib_1.__metadata("design:type", Date)
99
+ ], InvestmentRequest.prototype, "deletedAt", void 0);
100
+ tslib_1.__decorate([
101
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
102
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who wrote it' }),
103
+ tslib_1.__metadata("design:type", auth_base_1.User)
104
+ ], InvestmentRequest.prototype, "creator", void 0);
105
+ tslib_1.__decorate([
106
+ (0, typeorm_1.RelationId)((request) => request.creator),
107
+ tslib_1.__metadata("design:type", String)
108
+ ], InvestmentRequest.prototype, "creatorId", void 0);
109
+ tslib_1.__decorate([
110
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
111
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who last changed it' }),
112
+ tslib_1.__metadata("design:type", auth_base_1.User)
113
+ ], InvestmentRequest.prototype, "updater", void 0);
114
+ tslib_1.__decorate([
115
+ (0, typeorm_1.RelationId)((request) => request.updater),
116
+ tslib_1.__metadata("design:type", String)
117
+ ], InvestmentRequest.prototype, "updaterId", void 0);
118
+ exports.InvestmentRequest = InvestmentRequest = tslib_1.__decorate([
119
+ (0, typeorm_1.Entity)(),
120
+ (0, typeorm_1.Index)('ix_investment_request_0', (request) => [request.domain, request.investee, request.receivedOn]),
121
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for InvestmentRequest — what the company asked its shareholders to sign or vote on' })
122
+ ], InvestmentRequest);
123
+ //# sourceMappingURL=investment-request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"investment-request.js","sourceRoot":"","sources":["../../../server/service/investment/investment-request.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,iDAA8C;AAC9C,+CAAyD;AACzD,qCAAoJ;AAEpJ,yCAAqC;AACrC,yDAA0D;AAG1D;;;GAGG;AAII,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CA+E7B,CAAA;AA/EY,8CAAiB;AAGnB;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;;6CACrC;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;iDAAA;AAGf;IADC,IAAA,oB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C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC;sCAC3D,gBAAI;kDAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,OAA0B,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;oDAC1C;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;kDAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,OAA0B,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;oDAC1C;4BA9EP,iBAAiB;IAH7B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,yBAAyB,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,2FAA2F,EAAE,CAAC;GAC5G,iBAAiB,CA+E7B","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'\nimport { InvestmentRequestKind } from './investment-rules'\n\n\n/**\n * What the company asked its shareholders to sign or vote on (decision 9) - a written resolution, an acknowledgement, a\n * meeting's notice - with its items and our answer to each. The request and our signed copy are its documents.\n */\n@Entity()\n@Index('ix_investment_request_0', (request: InvestmentRequest) => [request.domain, request.investee, request.receivedOn])\n@ObjectType({ description: 'Entity for InvestmentRequest — what the company asked its shareholders to sign or vote on' })\nexport class InvestmentRequest {\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((request: InvestmentRequest) => request.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((request: InvestmentRequest) => request.investee)\n investeeId?: string\n\n @Column({ default: InvestmentRequestKind.WRITTEN_RESOLUTION })\n @Field(type => InvestmentRequestKind, { description: 'What is asked' })\n kind: InvestmentRequestKind\n\n @Column()\n @Field({ description: 'What it is about' })\n title: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The day we received it - YYYY-MM-DD' })\n receivedOn?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The day it must be answered by - YYYY-MM-DD' })\n dueOn?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The day we sent our answer - YYYY-MM-DD' })\n sentOn?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Who signed for us' })\n signer?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Its items and our answers, one per line: the item, then our answer' })\n items?: string\n\n @Column({ type: 'text', nullable: true })\n @Field({ nullable: true, description: 'Notes' })\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((request: InvestmentRequest) => request.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((request: InvestmentRequest) => request.updater)\n updaterId?: string\n}\n"]}