@things-factory/asset 0.0.0-stage → 10.1.229

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 +53 -0
  20. package/dist-client/pages/investment-list.js +131 -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 +187 -0
  117. package/translations/es.json +187 -0
  118. package/translations/ja.json +187 -0
  119. package/translations/ko.json +187 -0
  120. package/translations/ms.json +187 -0
  121. package/translations/zh.json +187 -0
  122. package/README.md +0 -3
@@ -0,0 +1,34 @@
1
+ import { Domain } from '@things-factory/shell';
2
+ import { EntityManager } from 'typeorm';
3
+ export declare enum AssetDocumentOwner {
4
+ Asset = "Asset",
5
+ Investee = "Investee",
6
+ InvestmentHolding = "InvestmentHolding",
7
+ InvestmentReport = "InvestmentReport",
8
+ InvestmentRequest = "InvestmentRequest",
9
+ InvestmentFiling = "InvestmentFiling"
10
+ }
11
+ export declare const DOCUMENT_REF_TYPES: string[];
12
+ export declare function assetDocuments(tx: EntityManager, domain: Domain, owner: AssetDocumentOwner, id: string): Promise<{
13
+ id: string;
14
+ name: string;
15
+ mimetype: string;
16
+ size: number;
17
+ fullpath: string;
18
+ createdAt: Date;
19
+ creator: string | undefined;
20
+ }[]>;
21
+ export declare function attachAssetDocuments(tx: EntityManager, domain: Domain, owner: AssetDocumentOwner, id: string, files: any[], context: any): Promise<{
22
+ id: string;
23
+ name: string;
24
+ mimetype: string;
25
+ size: number;
26
+ fullpath: string;
27
+ createdAt: Date;
28
+ creator: string | undefined;
29
+ }[]>;
30
+ export declare function removeAssetDocument(tx: EntityManager, domain: Domain, user: any, id: string): Promise<boolean>;
31
+ /** How many documents each row has - for the grids' column, in one query. */
32
+ export declare function documentCounts(tx: EntityManager, domain: {
33
+ id: string;
34
+ }, refType: string, ids?: string[]): Promise<Map<string, number>>;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DOCUMENT_REF_TYPES = exports.AssetDocumentOwner = void 0;
4
+ exports.assetDocuments = assetDocuments;
5
+ exports.attachAssetDocuments = attachAssetDocuments;
6
+ exports.removeAssetDocument = removeAssetDocument;
7
+ exports.documentCounts = documentCounts;
8
+ const attachment_base_1 = require("@things-factory/attachment-base");
9
+ const shell_1 = require("@things-factory/shell");
10
+ const type_graphql_1 = require("type-graphql");
11
+ const typeorm_1 = require("typeorm");
12
+ /*
13
+ * The papers of the register - an asset's contract, deed or registration; a holding's share certificate; an investee's
14
+ * report, a request and its signed copy, a filing as submitted (ADR-0175). Attachments of their row, one refType per
15
+ * kind of row. Taking one off does not delete it: the papers are records, so it moves to `<refType>Removed` and the file
16
+ * stays (as Office's contract documents do).
17
+ */
18
+ var AssetDocumentOwner;
19
+ (function (AssetDocumentOwner) {
20
+ AssetDocumentOwner["Asset"] = "Asset";
21
+ AssetDocumentOwner["Investee"] = "Investee";
22
+ AssetDocumentOwner["InvestmentHolding"] = "InvestmentHolding";
23
+ AssetDocumentOwner["InvestmentReport"] = "InvestmentReport";
24
+ AssetDocumentOwner["InvestmentRequest"] = "InvestmentRequest";
25
+ AssetDocumentOwner["InvestmentFiling"] = "InvestmentFiling";
26
+ })(AssetDocumentOwner || (exports.AssetDocumentOwner = AssetDocumentOwner = {}));
27
+ (0, type_graphql_1.registerEnumType)(AssetDocumentOwner, { name: 'AssetDocumentOwner', description: 'The kind of row a document of the asset register is attached to' });
28
+ exports.DOCUMENT_REF_TYPES = Object.values(AssetDocumentOwner);
29
+ const removed = (refType) => `${refType}Removed`;
30
+ async function ownerOf(tx, domain, owner, id) {
31
+ if (!exports.DOCUMENT_REF_TYPES.includes(owner))
32
+ throw new shell_1.Refusal('asset-document-owner-unknown', { owner }, `'${owner}' takes no documents`);
33
+ const found = await tx.getRepository(owner).findOne({ where: { domain: { id: domain.id }, id } });
34
+ if (!found)
35
+ throw new shell_1.Refusal('asset-document-owner-not-found', {}, 'The row was not found - reload and try again');
36
+ return found;
37
+ }
38
+ async function assetDocuments(tx, domain, owner, id) {
39
+ await ownerOf(tx, domain, owner, id);
40
+ const rows = await tx.getRepository(attachment_base_1.Attachment).find({ where: { domain: { id: domain.id }, refType: owner, refBy: id }, relations: ['creator'], order: { createdAt: 'DESC' } });
41
+ return rows.map(one => ({
42
+ id: one.id,
43
+ name: one.name,
44
+ mimetype: one.mimetype,
45
+ size: one.size ? Number(one.size) : undefined,
46
+ fullpath: one.fullpath,
47
+ createdAt: one.createdAt,
48
+ creator: one.creator?.name
49
+ }));
50
+ }
51
+ async function attachAssetDocuments(tx, domain, owner, id, files, context) {
52
+ await ownerOf(tx, domain, owner, id);
53
+ for (const file of files)
54
+ await (0, attachment_base_1.createAttachment)(null, { attachment: { file, refType: owner, refBy: id, category: 'asset' } }, context);
55
+ return assetDocuments(tx, domain, owner, id);
56
+ }
57
+ async function removeAssetDocument(tx, domain, user, id) {
58
+ const one = await tx.getRepository(attachment_base_1.Attachment).findOne({ where: { domain: { id: domain.id }, id, refType: (0, typeorm_1.In)(exports.DOCUMENT_REF_TYPES) } });
59
+ if (!one)
60
+ return false;
61
+ await tx.getRepository(attachment_base_1.Attachment).update({ id }, { refType: removed(one.refType), updater: { id: user.id } });
62
+ return true;
63
+ }
64
+ /** How many documents each row has - for the grids' column, in one query. */
65
+ async function documentCounts(tx, domain, refType, ids) {
66
+ if (ids && !ids.length)
67
+ return new Map();
68
+ const query = tx
69
+ .getRepository(attachment_base_1.Attachment)
70
+ .createQueryBuilder('attachment')
71
+ .select('attachment.refBy', 'refBy')
72
+ .addSelect('COUNT(*)', 'count')
73
+ .where('attachment.domain = :domain AND attachment.refType = :type', { domain: domain.id, type: refType });
74
+ if (ids)
75
+ query.andWhere('attachment.refBy IN (:...ids)', { ids });
76
+ const rows = await query.groupBy('attachment.refBy').getRawMany();
77
+ return new Map(rows.map(one => [one.refBy, Number(one.count)]));
78
+ }
79
+ //# sourceMappingURL=asset-document-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-document-service.js","sourceRoot":"","sources":["../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IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;IAC5G,IAAI,GAAG;QAAE,KAAK,CAAC,QAAQ,CAAC,+BAA+B,EAAE,EAAE,GAAG,EAAE,CAAC,CAAA;IACjE,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,UAAU,EAAE,CAAA;IACjE,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AACjE,CAAC","sourcesContent":["import { Attachment, createAttachment } from '@things-factory/attachment-base'\nimport { Domain, Refusal } from '@things-factory/shell'\nimport { registerEnumType } from 'type-graphql'\nimport { EntityManager, In } from 'typeorm'\n\n/*\n * The papers of the register - an asset's contract, deed or registration; a holding's share certificate; an investee's\n * report, a request and its signed copy, a filing as submitted (ADR-0175). Attachments of their row, one refType per\n * kind of row. Taking one off does not delete it: the papers are records, so it moves to `<refType>Removed` and the file\n * stays (as Office's contract documents do).\n */\nexport enum AssetDocumentOwner {\n Asset = 'Asset',\n Investee = 'Investee',\n InvestmentHolding = 'InvestmentHolding',\n InvestmentReport = 'InvestmentReport',\n InvestmentRequest = 'InvestmentRequest',\n InvestmentFiling = 'InvestmentFiling'\n}\nregisterEnumType(AssetDocumentOwner, { name: 'AssetDocumentOwner', description: 'The kind of row a document of the asset register is attached to' })\n\nexport const DOCUMENT_REF_TYPES: string[] = Object.values(AssetDocumentOwner)\nconst removed = (refType: string) => `${refType}Removed`\n\nasync function ownerOf(tx: EntityManager, domain: Domain, owner: AssetDocumentOwner, id: string) {\n if (!DOCUMENT_REF_TYPES.includes(owner)) throw new Refusal('asset-document-owner-unknown', { owner }, `'${owner}' takes no documents`)\n const found = await tx.getRepository(owner).findOne({ where: { domain: { id: domain.id }, id } as any })\n if (!found) throw new Refusal('asset-document-owner-not-found', {}, 'The row was not found - reload and try again')\n return found\n}\n\nexport async function assetDocuments(tx: EntityManager, domain: Domain, owner: AssetDocumentOwner, id: string) {\n await ownerOf(tx, domain, owner, id)\n const rows = await tx.getRepository(Attachment).find({ where: { domain: { id: domain.id }, refType: owner, refBy: id } as any, relations: ['creator'], order: { createdAt: 'DESC' } as any })\n return rows.map(one => ({\n id: one.id,\n name: one.name,\n mimetype: one.mimetype,\n size: one.size ? Number(one.size) : undefined,\n fullpath: one.fullpath,\n createdAt: one.createdAt,\n creator: (one as any).creator?.name as string | undefined\n }))\n}\n\nexport async function attachAssetDocuments(tx: EntityManager, domain: Domain, owner: AssetDocumentOwner, id: string, files: any[], context: any) {\n await ownerOf(tx, domain, owner, id)\n for (const file of files) await createAttachment(null, { attachment: { file, refType: owner, refBy: id, category: 'asset' } } as any, context)\n return assetDocuments(tx, domain, owner, id)\n}\n\nexport async function removeAssetDocument(tx: EntityManager, domain: Domain, user: any, id: string): Promise<boolean> {\n const one = await tx.getRepository(Attachment).findOne({ where: { domain: { id: domain.id }, id, refType: In(DOCUMENT_REF_TYPES) } as any })\n if (!one) return false\n await tx.getRepository(Attachment).update({ id } as any, { refType: removed(one.refType), updater: { id: user.id } } as any)\n return true\n}\n\n/** How many documents each row has - for the grids' column, in one query. */\nexport async function documentCounts(tx: EntityManager, domain: { id: string }, refType: string, ids?: string[]): Promise<Map<string, number>> {\n if (ids && !ids.length) return new Map()\n const query = tx\n .getRepository(Attachment)\n .createQueryBuilder('attachment')\n .select('attachment.refBy', 'refBy')\n .addSelect('COUNT(*)', 'count')\n .where('attachment.domain = :domain AND attachment.refType = :type', { domain: domain.id, type: refType })\n if (ids) query.andWhere('attachment.refBy IN (:...ids)', { ids })\n const rows = await query.groupBy('attachment.refBy').getRawMany()\n return new Map(rows.map(one => [one.refBy, Number(one.count)]))\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import { AssetDocumentResolver } from './asset-document-resolver';
2
+ export declare const entities: any[];
3
+ export declare const resolvers: (typeof AssetDocumentResolver)[];
4
+ export declare const subscribers: any[];
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subscribers = exports.resolvers = exports.entities = void 0;
4
+ const asset_document_resolver_1 = require("./asset-document-resolver");
5
+ exports.entities = [];
6
+ exports.resolvers = [asset_document_resolver_1.AssetDocumentResolver];
7
+ exports.subscribers = [];
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/asset-document/index.ts"],"names":[],"mappings":";;;AAAA,uEAAiE;AAEpD,QAAA,QAAQ,GAAG,EAAE,CAAA;AACb,QAAA,SAAS,GAAG,CAAC,+CAAqB,CAAC,CAAA;AACnC,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { AssetDocumentResolver } from './asset-document-resolver'\n\nexport const entities = []\nexport const resolvers = [AssetDocumentResolver]\nexport const subscribers = []\n"]}
@@ -0,0 +1,12 @@
1
+ import { Domain } from '@things-factory/shell';
2
+ import { EntityManager } from 'typeorm';
3
+ import { Asset } from './asset/asset';
4
+ /** Assets in use with neither what they were acquired by nor a document. */
5
+ export declare function assetsWithoutEvidence(tx: EntityManager, domain: Domain): Promise<Asset[]>;
6
+ /** The lines of the last filed balance sheet where the register and the books differ; none when nothing is filed. */
7
+ export declare function assetBooksDiffer(tx: EntityManager, domain: Domain): Promise<{
8
+ fiscalYear: number;
9
+ rows: (import("./asset/asset-rules").ReconciliationRow & {
10
+ differs: boolean;
11
+ })[];
12
+ }>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assetsWithoutEvidence = assetsWithoutEvidence;
4
+ exports.assetBooksDiffer = assetBooksDiffer;
5
+ const accounting_1 = require("@things-factory/accounting");
6
+ const asset_1 = require("./asset/asset");
7
+ const asset_rules_1 = require("./asset/asset-rules");
8
+ const asset_service_1 = require("./asset/asset-service");
9
+ const asset_document_service_1 = require("./asset-document/asset-document-service");
10
+ /*
11
+ * The asset register's part of an application's management check (ADR-0175 decision 11): judged here, counted there.
12
+ */
13
+ /** Assets in use with neither what they were acquired by nor a document. */
14
+ async function assetsWithoutEvidence(tx, domain) {
15
+ const assets = await tx.getRepository(asset_1.Asset).find({ where: { domain: { id: domain.id }, status: asset_rules_1.AssetStatus.IN_USE }, order: { acquiredOn: 'ASC' } });
16
+ const counts = await (0, asset_document_service_1.documentCounts)(tx, domain, 'Asset', assets.map(one => one.id));
17
+ return assets.filter(one => !one.source && !counts.get(one.id));
18
+ }
19
+ /** The lines of the last filed balance sheet where the register and the books differ; none when nothing is filed. */
20
+ async function assetBooksDiffer(tx, domain) {
21
+ const latest = await tx.getRepository(accounting_1.FinancialStatement).findOne({ where: { domain: { id: domain.id }, kind: accounting_1.FinancialStatementKind.BALANCE_SHEET }, order: { fiscalYear: 'DESC' } });
22
+ if (!latest)
23
+ return { fiscalYear: null, rows: [] };
24
+ const reconciliation = await (0, asset_service_1.assetReconciliation)(tx, domain, latest.fiscalYear);
25
+ return { fiscalYear: latest.fiscalYear, rows: reconciliation.rows.filter(row => row.differs) };
26
+ }
27
+ //# sourceMappingURL=checks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checks.js","sourceRoot":"","sources":["../../server/service/checks.ts"],"names":[],"mappings":";;AAcA,sDAIC;AAGD,4CAKC;AA1BD,2DAAuF;AAIvF,yCAAqC;AACrC,qDAAiD;AACjD,yDAA2D;AAC3D,oFAAwE;AAExE;;GAEG;AAEH,4EAA4E;AACrE,KAAK,UAAU,qBAAqB,CAAC,EAAiB,EAAE,MAAc;IAC3E,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,aAAK,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,yBAAW,CAAC,MAAM,EAAS,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAS,EAAE,CAAC,CAAA;IACnK,MAAM,MAAM,GAAG,MAAM,IAAA,uCAAc,EAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;IACnF,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAA;AACjE,CAAC;AAED,qHAAqH;AAC9G,KAAK,UAAU,gBAAgB,CAAC,EAAiB,EAAE,MAAc;IACtE,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,+BAAkB,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,mCAAsB,CAAC,aAAa,EAAS,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAS,EAAE,CAAC,CAAA;IACpM,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,UAAU,EAAE,IAAqB,EAAE,IAAI,EAAE,EAAE,EAAE,CAAA;IACnE,MAAM,cAAc,GAAG,MAAM,IAAA,mCAAmB,EAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;IAC/E,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAA;AAChG,CAAC","sourcesContent":["import { FinancialStatement, FinancialStatementKind } from '@things-factory/accounting'\nimport { Domain } from '@things-factory/shell'\nimport { EntityManager } from 'typeorm'\n\nimport { Asset } from './asset/asset'\nimport { AssetStatus } from './asset/asset-rules'\nimport { assetReconciliation } from './asset/asset-service'\nimport { documentCounts } from './asset-document/asset-document-service'\n\n/*\n * The asset register's part of an application's management check (ADR-0175 decision 11): judged here, counted there.\n */\n\n/** Assets in use with neither what they were acquired by nor a document. */\nexport async function assetsWithoutEvidence(tx: EntityManager, domain: Domain): Promise<Asset[]> {\n const assets = await tx.getRepository(Asset).find({ where: { domain: { id: domain.id }, status: AssetStatus.IN_USE } as any, order: { acquiredOn: 'ASC' } as any })\n const counts = await documentCounts(tx, domain, 'Asset', assets.map(one => one.id))\n return assets.filter(one => !one.source && !counts.get(one.id))\n}\n\n/** The lines of the last filed balance sheet where the register and the books differ; none when nothing is filed. */\nexport async function assetBooksDiffer(tx: EntityManager, domain: Domain) {\n const latest = await tx.getRepository(FinancialStatement).findOne({ where: { domain: { id: domain.id }, kind: FinancialStatementKind.BALANCE_SHEET } as any, order: { fiscalYear: 'DESC' } as any })\n if (!latest) return { fiscalYear: null as number | null, rows: [] }\n const reconciliation = await assetReconciliation(tx, domain, latest.fiscalYear)\n return { fiscalYear: latest.fiscalYear, rows: reconciliation.rows.filter(row => row.differs) }\n}\n"]}
@@ -0,0 +1,18 @@
1
+ export * from './asset/asset';
2
+ export * from './asset/asset-rules';
3
+ export * from './asset/asset-type';
4
+ export { saveAssets, assetReconciliation, balanceSheetLines } from './asset/asset-service';
5
+ export * from './investment/investee';
6
+ export * from './investment/investment-holding';
7
+ export * from './investment/investment-board-seat';
8
+ export * from './investment/investment-report';
9
+ export * from './investment/investment-request';
10
+ export * from './investment/investment-filing';
11
+ export * from './investment/investment-rules';
12
+ export * from './investment/investment-service';
13
+ export * from './asset-document/asset-document-service';
14
+ export * from './checks';
15
+ export declare const entities: (typeof import("./asset/asset").Asset | typeof import("./investment/investee").Investee | typeof import("./investment/investment-holding").InvestmentHolding | typeof import("./investment/investment-board-seat").InvestmentBoardSeat | typeof import("./investment/investment-report").InvestmentReport | typeof import("./investment/investment-request").InvestmentRequest | typeof import("./investment/investment-filing").InvestmentFiling)[];
16
+ export declare const schema: {
17
+ resolverClasses: (typeof import("./asset/asset-mutation").AssetMutation | typeof import("./asset/asset-query").AssetQuery | typeof import("./investment/investment-mutation").InvestmentMutation | typeof import("./investment/investment-query").InvestmentQuery | typeof import("./investment/investment-query").InvestmentRequestQuery | typeof import("./investment/investment-query").InvestmentFilingQuery | typeof import("./asset-document/asset-document-resolver").AssetDocumentResolver)[];
18
+ };
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.schema = exports.entities = exports.balanceSheetLines = exports.assetReconciliation = exports.saveAssets = void 0;
4
+ const tslib_1 = require("tslib");
5
+ /* EXPORT ENTITY TYPES */
6
+ tslib_1.__exportStar(require("./asset/asset"), exports);
7
+ tslib_1.__exportStar(require("./asset/asset-rules"), exports);
8
+ tslib_1.__exportStar(require("./asset/asset-type"), exports);
9
+ var asset_service_1 = require("./asset/asset-service");
10
+ Object.defineProperty(exports, "saveAssets", { enumerable: true, get: function () { return asset_service_1.saveAssets; } });
11
+ Object.defineProperty(exports, "assetReconciliation", { enumerable: true, get: function () { return asset_service_1.assetReconciliation; } });
12
+ Object.defineProperty(exports, "balanceSheetLines", { enumerable: true, get: function () { return asset_service_1.balanceSheetLines; } });
13
+ tslib_1.__exportStar(require("./investment/investee"), exports);
14
+ tslib_1.__exportStar(require("./investment/investment-holding"), exports);
15
+ tslib_1.__exportStar(require("./investment/investment-board-seat"), exports);
16
+ tslib_1.__exportStar(require("./investment/investment-report"), exports);
17
+ tslib_1.__exportStar(require("./investment/investment-request"), exports);
18
+ tslib_1.__exportStar(require("./investment/investment-filing"), exports);
19
+ tslib_1.__exportStar(require("./investment/investment-rules"), exports);
20
+ tslib_1.__exportStar(require("./investment/investment-service"), exports);
21
+ tslib_1.__exportStar(require("./asset-document/asset-document-service"), exports);
22
+ tslib_1.__exportStar(require("./checks"), exports);
23
+ /* IMPORT ENTITIES AND RESOLVERS */
24
+ const asset_1 = require("./asset");
25
+ const investment_1 = require("./investment");
26
+ const asset_document_1 = require("./asset-document");
27
+ exports.entities = [
28
+ /* ENTITIES */
29
+ ...asset_1.entities,
30
+ ...investment_1.entities
31
+ ];
32
+ exports.schema = {
33
+ resolverClasses: [
34
+ /* RESOLVER CLASSES */
35
+ ...asset_1.resolvers,
36
+ ...investment_1.resolvers,
37
+ ...asset_document_1.resolvers
38
+ ]
39
+ };
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,yBAAyB;AACzB,wDAA6B;AAC7B,8DAAmC;AACnC,6DAAkC;AAClC,uDAA0F;AAAjF,2GAAA,UAAU,OAAA;AAAE,oHAAA,mBAAmB,OAAA;AAAE,kHAAA,iBAAiB,OAAA;AAC3D,gEAAqC;AACrC,0EAA+C;AAC/C,6EAAkD;AAClD,yEAA8C;AAC9C,0EAA+C;AAC/C,yEAA8C;AAC9C,wEAA6C;AAC7C,0EAA+C;AAC/C,kFAAuD;AACvD,mDAAwB;AAExB,mCAAmC;AACnC,mCAAgF;AAChF,6CAA+F;AAC/F,qDAAsE;AAEzD,QAAA,QAAQ,GAAG;IACtB,cAAc;IACd,GAAG,gBAAa;IAChB,GAAG,qBAAkB;CACtB,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,eAAe,EAAE;QACf,sBAAsB;QACtB,GAAG,iBAAc;QACjB,GAAG,sBAAmB;QACtB,GAAG,0BAAsB;KAC1B;CACF,CAAA","sourcesContent":["/* EXPORT ENTITY TYPES */\nexport * from './asset/asset'\nexport * from './asset/asset-rules'\nexport * from './asset/asset-type'\nexport { saveAssets, assetReconciliation, balanceSheetLines } from './asset/asset-service'\nexport * from './investment/investee'\nexport * from './investment/investment-holding'\nexport * from './investment/investment-board-seat'\nexport * from './investment/investment-report'\nexport * from './investment/investment-request'\nexport * from './investment/investment-filing'\nexport * from './investment/investment-rules'\nexport * from './investment/investment-service'\nexport * from './asset-document/asset-document-service'\nexport * from './checks'\n\n/* IMPORT ENTITIES AND RESOLVERS */\nimport { entities as AssetEntities, resolvers as AssetResolvers } from './asset'\nimport { entities as InvestmentEntities, resolvers as InvestmentResolvers } from './investment'\nimport { resolvers as AssetDocumentResolvers } from './asset-document'\n\nexport const entities = [\n /* ENTITIES */\n ...AssetEntities,\n ...InvestmentEntities\n]\n\nexport const schema = {\n resolverClasses: [\n /* RESOLVER CLASSES */\n ...AssetResolvers,\n ...InvestmentResolvers,\n ...AssetDocumentResolvers\n ]\n}\n"]}
@@ -0,0 +1,11 @@
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 { InvestmentMutation } from './investment-mutation';
6
+ import { InvestmentFilingQuery, InvestmentQuery, InvestmentRequestQuery } from './investment-query';
7
+ import { InvestmentReport } from './investment-report';
8
+ import { InvestmentRequest } from './investment-request';
9
+ export declare const entities: (typeof Investee | typeof InvestmentHolding | typeof InvestmentBoardSeat | typeof InvestmentReport | typeof InvestmentRequest | typeof InvestmentFiling)[];
10
+ export declare const resolvers: (typeof InvestmentMutation | typeof InvestmentQuery | typeof InvestmentRequestQuery | typeof InvestmentFilingQuery)[];
11
+ export declare const subscribers: any[];
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.subscribers = exports.resolvers = exports.entities = void 0;
4
+ const investee_1 = require("./investee");
5
+ const investment_board_seat_1 = require("./investment-board-seat");
6
+ const investment_filing_1 = require("./investment-filing");
7
+ const investment_holding_1 = require("./investment-holding");
8
+ const investment_mutation_1 = require("./investment-mutation");
9
+ const investment_query_1 = require("./investment-query");
10
+ const investment_report_1 = require("./investment-report");
11
+ const investment_request_1 = require("./investment-request");
12
+ exports.entities = [investee_1.Investee, investment_holding_1.InvestmentHolding, investment_board_seat_1.InvestmentBoardSeat, investment_report_1.InvestmentReport, investment_request_1.InvestmentRequest, investment_filing_1.InvestmentFiling];
13
+ exports.resolvers = [investment_query_1.InvestmentQuery, investment_query_1.InvestmentRequestQuery, investment_query_1.InvestmentFilingQuery, investment_mutation_1.InvestmentMutation];
14
+ exports.subscribers = [];
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/investment/index.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AACrC,mEAA6D;AAC7D,2DAAsD;AACtD,6DAAwD;AACxD,+DAA0D;AAC1D,yDAAmG;AACnG,2DAAsD;AACtD,6DAAwD;AAE3C,QAAA,QAAQ,GAAG,CAAC,mBAAQ,EAAE,sCAAiB,EAAE,2CAAmB,EAAE,oCAAgB,EAAE,sCAAiB,EAAE,oCAAgB,CAAC,CAAA;AACpH,QAAA,SAAS,GAAG,CAAC,kCAAe,EAAE,yCAAsB,EAAE,wCAAqB,EAAE,wCAAkB,CAAC,CAAA;AAChG,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { Investee } from './investee'\nimport { InvestmentBoardSeat } from './investment-board-seat'\nimport { InvestmentFiling } from './investment-filing'\nimport { InvestmentHolding } from './investment-holding'\nimport { InvestmentMutation } from './investment-mutation'\nimport { InvestmentFilingQuery, InvestmentQuery, InvestmentRequestQuery } from './investment-query'\nimport { InvestmentReport } from './investment-report'\nimport { InvestmentRequest } from './investment-request'\n\nexport const entities = [Investee, InvestmentHolding, InvestmentBoardSeat, InvestmentReport, InvestmentRequest, InvestmentFiling]\nexport const resolvers = [InvestmentQuery, InvestmentRequestQuery, InvestmentFilingQuery, InvestmentMutation]\nexport const subscribers = []\n"]}
@@ -0,0 +1,33 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { Domain } from '@things-factory/shell';
3
+ import { Counterparty } from '@things-factory/biz-base';
4
+ /**
5
+ * A company the domain holds shares in (ADR-0175 decision 6): who it is, the currency it reports in, when its year ends
6
+ * and how many months after that its report is due. The counterparty is the company as the books name it.
7
+ */
8
+ export declare class Investee {
9
+ readonly id: string;
10
+ domain?: Domain;
11
+ domainId?: string;
12
+ name: string;
13
+ counterparty?: Counterparty;
14
+ counterpartyId?: string;
15
+ country?: string;
16
+ registrationNo?: string;
17
+ currency: string;
18
+ fiscalYearEndMonth?: number;
19
+ reportDueMonths?: number;
20
+ representative?: string;
21
+ active: boolean;
22
+ description?: string;
23
+ ourShares?: number;
24
+ totalShares?: number;
25
+ ratio?: number;
26
+ createdAt?: Date;
27
+ updatedAt?: Date;
28
+ deletedAt?: Date;
29
+ creator?: User;
30
+ creatorId?: string;
31
+ updater?: User;
32
+ updaterId?: string;
33
+ }
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Investee = 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 biz_base_1 = require("@things-factory/biz-base");
10
+ /**
11
+ * A company the domain holds shares in (ADR-0175 decision 6): who it is, the currency it reports in, when its year ends
12
+ * and how many months after that its report is due. The counterparty is the company as the books name it.
13
+ */
14
+ let Investee = class Investee {
15
+ };
16
+ exports.Investee = Investee;
17
+ tslib_1.__decorate([
18
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
19
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier' }),
20
+ tslib_1.__metadata("design:type", String)
21
+ ], Investee.prototype, "id", void 0);
22
+ tslib_1.__decorate([
23
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
24
+ (0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain' }),
25
+ tslib_1.__metadata("design:type", shell_1.Domain)
26
+ ], Investee.prototype, "domain", void 0);
27
+ tslib_1.__decorate([
28
+ (0, typeorm_1.RelationId)((investee) => investee.domain),
29
+ tslib_1.__metadata("design:type", String)
30
+ ], Investee.prototype, "domainId", void 0);
31
+ tslib_1.__decorate([
32
+ (0, typeorm_1.Column)(),
33
+ (0, type_graphql_1.Field)({ description: 'What the company is called' }),
34
+ tslib_1.__metadata("design:type", String)
35
+ ], Investee.prototype, "name", void 0);
36
+ tslib_1.__decorate([
37
+ (0, typeorm_1.ManyToOne)(type => biz_base_1.Counterparty, { nullable: true }),
38
+ (0, type_graphql_1.Field)(type => biz_base_1.Counterparty, { nullable: true, description: 'The company as a counterparty' }),
39
+ tslib_1.__metadata("design:type", biz_base_1.Counterparty)
40
+ ], Investee.prototype, "counterparty", void 0);
41
+ tslib_1.__decorate([
42
+ (0, typeorm_1.RelationId)((investee) => investee.counterparty),
43
+ tslib_1.__metadata("design:type", String)
44
+ ], Investee.prototype, "counterpartyId", void 0);
45
+ tslib_1.__decorate([
46
+ (0, typeorm_1.Column)({ nullable: true }),
47
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The country it is incorporated in - ISO 3166 alpha-2' }),
48
+ tslib_1.__metadata("design:type", String)
49
+ ], Investee.prototype, "country", void 0);
50
+ tslib_1.__decorate([
51
+ (0, typeorm_1.Column)({ nullable: true }),
52
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Its registration number there' }),
53
+ tslib_1.__metadata("design:type", String)
54
+ ], Investee.prototype, "registrationNo", void 0);
55
+ tslib_1.__decorate([
56
+ (0, typeorm_1.Column)({ default: 'KRW' }),
57
+ (0, type_graphql_1.Field)({ description: 'The currency it reports in - ISO 4217' }),
58
+ tslib_1.__metadata("design:type", String)
59
+ ], Investee.prototype, "currency", void 0);
60
+ tslib_1.__decorate([
61
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
62
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The month its fiscal year ends, 1 to 12' }),
63
+ tslib_1.__metadata("design:type", Number)
64
+ ], Investee.prototype, "fiscalYearEndMonth", void 0);
65
+ tslib_1.__decorate([
66
+ (0, typeorm_1.Column)({ type: 'int', nullable: true }),
67
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: "How many months after the year's end its report is due to the shareholders, as its law says" }),
68
+ tslib_1.__metadata("design:type", Number)
69
+ ], Investee.prototype, "reportDueMonths", void 0);
70
+ tslib_1.__decorate([
71
+ (0, typeorm_1.Column)({ nullable: true }),
72
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Who signs for us as its shareholder' }),
73
+ tslib_1.__metadata("design:type", String)
74
+ ], Investee.prototype, "representative", void 0);
75
+ tslib_1.__decorate([
76
+ (0, typeorm_1.Column)({ default: true }),
77
+ (0, type_graphql_1.Field)({ description: 'Whether we still hold its shares' }),
78
+ tslib_1.__metadata("design:type", Boolean)
79
+ ], Investee.prototype, "active", void 0);
80
+ tslib_1.__decorate([
81
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
82
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Notes' }),
83
+ tslib_1.__metadata("design:type", String)
84
+ ], Investee.prototype, "description", void 0);
85
+ tslib_1.__decorate([
86
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'Our shares now - filled by the list query' }),
87
+ tslib_1.__metadata("design:type", Number)
88
+ ], Investee.prototype, "ourShares", void 0);
89
+ tslib_1.__decorate([
90
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'Its shares now - filled by the list query' }),
91
+ tslib_1.__metadata("design:type", Number)
92
+ ], Investee.prototype, "totalShares", void 0);
93
+ tslib_1.__decorate([
94
+ (0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'Our part now, 0 to 1 - filled by the list query' }),
95
+ tslib_1.__metadata("design:type", Number)
96
+ ], Investee.prototype, "ratio", void 0);
97
+ tslib_1.__decorate([
98
+ (0, typeorm_1.CreateDateColumn)(),
99
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When the row was written' }),
100
+ tslib_1.__metadata("design:type", Date)
101
+ ], Investee.prototype, "createdAt", void 0);
102
+ tslib_1.__decorate([
103
+ (0, typeorm_1.UpdateDateColumn)(),
104
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When the row last changed' }),
105
+ tslib_1.__metadata("design:type", Date)
106
+ ], Investee.prototype, "updatedAt", void 0);
107
+ tslib_1.__decorate([
108
+ (0, typeorm_1.DeleteDateColumn)(),
109
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When the row was deleted' }),
110
+ tslib_1.__metadata("design:type", Date)
111
+ ], Investee.prototype, "deletedAt", void 0);
112
+ tslib_1.__decorate([
113
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
114
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who wrote it' }),
115
+ tslib_1.__metadata("design:type", auth_base_1.User)
116
+ ], Investee.prototype, "creator", void 0);
117
+ tslib_1.__decorate([
118
+ (0, typeorm_1.RelationId)((investee) => investee.creator),
119
+ tslib_1.__metadata("design:type", String)
120
+ ], Investee.prototype, "creatorId", void 0);
121
+ tslib_1.__decorate([
122
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
123
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who last changed it' }),
124
+ tslib_1.__metadata("design:type", auth_base_1.User)
125
+ ], Investee.prototype, "updater", void 0);
126
+ tslib_1.__decorate([
127
+ (0, typeorm_1.RelationId)((investee) => investee.updater),
128
+ tslib_1.__metadata("design:type", String)
129
+ ], Investee.prototype, "updaterId", void 0);
130
+ exports.Investee = Investee = tslib_1.__decorate([
131
+ (0, typeorm_1.Entity)(),
132
+ (0, typeorm_1.Index)('ix_investee_0', (investee) => [investee.domain, investee.name]),
133
+ (0, type_graphql_1.ObjectType)({ description: 'Entity for Investee — a company the domain holds shares in' })
134
+ ], Investee);
135
+ //# sourceMappingURL=investee.js.map
@@ -0,0 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I;yCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;2CACnC;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;yCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,QAAkB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC;;2CACnC;mBAxFP,QAAQ;IAHpB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,eAAe,EAAE,CAAC,QAAkB,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAChF,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,4DAA4D,EAAE,CAAC;GAC7E,QAAQ,CAyFpB","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Domain } 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 { Counterparty } from '@things-factory/biz-base'\n\n\n/**\n * A company the domain holds shares in (ADR-0175 decision 6): who it is, the currency it reports in, when its year ends\n * and how many months after that its report is due. The counterparty is the company as the books name it.\n */\n@Entity()\n@Index('ix_investee_0', (investee: Investee) => [investee.domain, investee.name])\n@ObjectType({ description: 'Entity for Investee — a company the domain holds shares in' })\nexport class Investee {\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((investee: Investee) => investee.domain)\n domainId?: string\n\n @Column()\n @Field({ description: 'What the company is called' })\n name: string\n\n @ManyToOne(type => Counterparty, { nullable: true })\n @Field(type => Counterparty, { nullable: true, description: 'The company as a counterparty' })\n counterparty?: Counterparty\n\n @RelationId((investee: Investee) => investee.counterparty)\n counterpartyId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The country it is incorporated in - ISO 3166 alpha-2' })\n country?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Its registration number there' })\n registrationNo?: string\n\n @Column({ default: 'KRW' })\n @Field({ description: 'The currency it reports in - ISO 4217' })\n currency: string\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: 'The month its fiscal year ends, 1 to 12' })\n fiscalYearEndMonth?: number\n\n @Column({ type: 'int', nullable: true })\n @Field(type => Int, { nullable: true, description: \"How many months after the year's end its report is due to the shareholders, as its law says\" })\n reportDueMonths?: number\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Who signs for us as its shareholder' })\n representative?: string\n\n @Column({ default: true })\n @Field({ description: 'Whether we still hold its shares' })\n active: boolean\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 shares now - filled by the list query' })\n ourShares?: number\n\n @Field(type => Float, { nullable: true, description: 'Its shares now - filled by the list query' })\n totalShares?: number\n\n @Field(type => Float, { nullable: true, description: 'Our part now, 0 to 1 - filled by the list query' })\n ratio?: 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((investee: Investee) => investee.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((investee: Investee) => investee.updater)\n updaterId?: string\n}\n"]}
@@ -0,0 +1,25 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { Domain } from '@things-factory/shell';
3
+ import { Investee } from './investee';
4
+ /**
5
+ * 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
6
+ * day, are what the accountant classifies the shares by; the register does not classify them.
7
+ */
8
+ export declare class InvestmentBoardSeat {
9
+ readonly id: string;
10
+ domain?: Domain;
11
+ domainId?: string;
12
+ investee?: Investee;
13
+ investeeId?: string;
14
+ director: string;
15
+ appointedOn?: string;
16
+ resignedOn?: string;
17
+ description?: string;
18
+ createdAt?: Date;
19
+ updatedAt?: Date;
20
+ deletedAt?: Date;
21
+ creator?: User;
22
+ creatorId?: string;
23
+ updater?: User;
24
+ updaterId?: string;
25
+ }
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvestmentBoardSeat = 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
+ * 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
12
+ * day, are what the accountant classifies the shares by; the register does not classify them.
13
+ */
14
+ let InvestmentBoardSeat = class InvestmentBoardSeat {
15
+ };
16
+ exports.InvestmentBoardSeat = InvestmentBoardSeat;
17
+ tslib_1.__decorate([
18
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
19
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'Unique identifier' }),
20
+ tslib_1.__metadata("design:type", String)
21
+ ], InvestmentBoardSeat.prototype, "id", void 0);
22
+ tslib_1.__decorate([
23
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
24
+ (0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain' }),
25
+ tslib_1.__metadata("design:type", shell_1.Domain)
26
+ ], InvestmentBoardSeat.prototype, "domain", void 0);
27
+ tslib_1.__decorate([
28
+ (0, typeorm_1.RelationId)((seat) => seat.domain),
29
+ tslib_1.__metadata("design:type", String)
30
+ ], InvestmentBoardSeat.prototype, "domainId", void 0);
31
+ tslib_1.__decorate([
32
+ (0, typeorm_1.ManyToOne)(type => investee_1.Investee, { onDelete: 'CASCADE' }),
33
+ (0, type_graphql_1.Field)(type => investee_1.Investee, { nullable: true, description: 'The company the row is about' }),
34
+ tslib_1.__metadata("design:type", investee_1.Investee)
35
+ ], InvestmentBoardSeat.prototype, "investee", void 0);
36
+ tslib_1.__decorate([
37
+ (0, typeorm_1.RelationId)((seat) => seat.investee),
38
+ tslib_1.__metadata("design:type", String)
39
+ ], InvestmentBoardSeat.prototype, "investeeId", void 0);
40
+ tslib_1.__decorate([
41
+ (0, typeorm_1.Column)(),
42
+ (0, type_graphql_1.Field)({ description: 'Who sits on the board' }),
43
+ tslib_1.__metadata("design:type", String)
44
+ ], InvestmentBoardSeat.prototype, "director", void 0);
45
+ tslib_1.__decorate([
46
+ (0, typeorm_1.Column)({ nullable: true }),
47
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The day they were appointed - YYYY-MM-DD' }),
48
+ tslib_1.__metadata("design:type", String)
49
+ ], InvestmentBoardSeat.prototype, "appointedOn", void 0);
50
+ tslib_1.__decorate([
51
+ (0, typeorm_1.Column)({ nullable: true }),
52
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The day they left - YYYY-MM-DD' }),
53
+ tslib_1.__metadata("design:type", String)
54
+ ], InvestmentBoardSeat.prototype, "resignedOn", void 0);
55
+ tslib_1.__decorate([
56
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
57
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Notes' }),
58
+ tslib_1.__metadata("design:type", String)
59
+ ], InvestmentBoardSeat.prototype, "description", void 0);
60
+ tslib_1.__decorate([
61
+ (0, typeorm_1.CreateDateColumn)(),
62
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When the row was written' }),
63
+ tslib_1.__metadata("design:type", Date)
64
+ ], InvestmentBoardSeat.prototype, "createdAt", void 0);
65
+ tslib_1.__decorate([
66
+ (0, typeorm_1.UpdateDateColumn)(),
67
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When the row last changed' }),
68
+ tslib_1.__metadata("design:type", Date)
69
+ ], InvestmentBoardSeat.prototype, "updatedAt", void 0);
70
+ tslib_1.__decorate([
71
+ (0, typeorm_1.DeleteDateColumn)(),
72
+ (0, type_graphql_1.Field)({ nullable: true, description: 'When the row was deleted' }),
73
+ tslib_1.__metadata("design:type", Date)
74
+ ], InvestmentBoardSeat.prototype, "deletedAt", void 0);
75
+ tslib_1.__decorate([
76
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
77
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who wrote it' }),
78
+ tslib_1.__metadata("design:type", auth_base_1.User)
79
+ ], InvestmentBoardSeat.prototype, "creator", void 0);
80
+ tslib_1.__decorate([
81
+ (0, typeorm_1.RelationId)((seat) => seat.creator),
82
+ tslib_1.__metadata("design:type", String)
83
+ ], InvestmentBoardSeat.prototype, "creatorId", void 0);
84
+ tslib_1.__decorate([
85
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
86
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'Who last changed it' }),
87
+ tslib_1.__metadata("design:type", auth_base_1.User)
88
+ ], InvestmentBoardSeat.prototype, "updater", void 0);
89
+ tslib_1.__decorate([
90
+ (0, typeorm_1.RelationId)((seat) => seat.updater),
91
+ tslib_1.__metadata("design:type", String)
92
+ ], InvestmentBoardSeat.prototype, "updaterId", void 0);
93
+ exports.InvestmentBoardSeat = InvestmentBoardSeat = tslib_1.__decorate([
94
+ (0, typeorm_1.Entity)(),
95
+ (0, typeorm_1.Index)('ix_investment_board_seat_0', (seat) => [seat.domain, seat.investee]),
96
+ (0, type_graphql_1.ObjectType)({ description: "Entity for InvestmentBoardSeat — someone of ours on the company's board, and when" })
97
+ ], InvestmentBoardSeat);
98
+ //# sourceMappingURL=investment-board-seat.js.map