@things-factory/invoice 10.1.213 → 10.1.215

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.
@@ -5,6 +5,8 @@ require("./routes");
5
5
  tslib_1.__exportStar(require("./service"), exports);
6
6
  const auth_base_1 = require("@things-factory/auth-base");
7
7
  const role_tasks_1 = require("./role-tasks");
8
+ const invoice_read_1 = require("./service/invoice/invoice-read");
8
9
  for (const task of role_tasks_1.ROLE_TASKS)
9
10
  (0, auth_base_1.registerRoleTask)(task);
11
+ (0, invoice_read_1.registerInvoiceReads)();
10
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;AAAA,oBAAiB;AACjB,oDAAyB;AAEzB,yDAA4D;AAC5D,6CAAyC;AAEzC,KAAK,MAAM,IAAI,IAAI,uBAAU;IAAE,IAAA,4BAAgB,EAAC,IAAI,CAAC,CAAA","sourcesContent":["import './routes'\nexport * from './service'\n\nimport { registerRoleTask } from '@things-factory/auth-base'\nimport { ROLE_TASKS } from './role-tasks'\n\nfor (const task of ROLE_TASKS) registerRoleTask(task)\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../server/index.ts"],"names":[],"mappings":";;;AAAA,oBAAiB;AACjB,oDAAyB;AAEzB,yDAA4D;AAC5D,6CAAyC;AACzC,iEAAqE;AAErE,KAAK,MAAM,IAAI,IAAI,uBAAU;IAAE,IAAA,4BAAgB,EAAC,IAAI,CAAC,CAAA;AACrD,IAAA,mCAAoB,GAAE,CAAA","sourcesContent":["import './routes'\nexport * from './service'\n\nimport { registerRoleTask } from '@things-factory/auth-base'\nimport { ROLE_TASKS } from './role-tasks'\nimport { registerInvoiceReads } from './service/invoice/invoice-read'\n\nfor (const task of ROLE_TASKS) registerRoleTask(task)\nregisterInvoiceReads()\n"]}
@@ -6,6 +6,7 @@ export * from './invoice/invoice-rules';
6
6
  export * from './invoice/invoice-service';
7
7
  export * from './invoice/invoice-files';
8
8
  export * from './invoice/invoice-type';
9
+ export * from './invoice/invoice-read';
9
10
  export declare const entities: any[];
10
11
  export declare const subscribers: any[];
11
12
  export declare const schema: {
@@ -10,6 +10,7 @@ tslib_1.__exportStar(require("./invoice/invoice-rules"), exports);
10
10
  tslib_1.__exportStar(require("./invoice/invoice-service"), exports);
11
11
  tslib_1.__exportStar(require("./invoice/invoice-files"), exports);
12
12
  tslib_1.__exportStar(require("./invoice/invoice-type"), exports);
13
+ tslib_1.__exportStar(require("./invoice/invoice-read"), exports);
13
14
  const invoice = tslib_1.__importStar(require("./invoice"));
14
15
  const invoiceEvent = tslib_1.__importStar(require("./invoice-event"));
15
16
  const invoiceItem = tslib_1.__importStar(require("./invoice-item"));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,wEAA6C;AAC7C,sEAA2C;AAC3C,4DAAiC;AACjC,wEAA6C;AAC7C,kEAAuC;AACvC,oEAAyC;AACzC,kEAAuC;AACvC,iEAAsC;AACtC,2DAAoC;AACpC,sEAA+C;AAC/C,oEAA6C;AAC7C,MAAM,OAAO,GAAgE,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,CAAC,CAAA;AACpG,QAAA,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAC/C,QAAA,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;AACrD,QAAA,MAAM,GAAG,EAAE,eAAe,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAA","sourcesContent":["export * from './invoice-event/invoice-event'\nexport * from './invoice-item/invoice-item'\nexport * from './invoice/invoice'\nexport * from './invoice/commercial-document'\nexport * from './invoice/invoice-rules'\nexport * from './invoice/invoice-service'\nexport * from './invoice/invoice-files'\nexport * from './invoice/invoice-type'\nimport * as invoice from './invoice'\nimport * as invoiceEvent from './invoice-event'\nimport * as invoiceItem from './invoice-item'\nconst modules: { entities: any[]; subscribers: any[]; resolvers: any[] }[] = [invoice, invoiceItem, invoiceEvent]\nexport const entities = modules.flatMap(one => one.entities)\nexport const subscribers = modules.flatMap(one => one.subscribers)\nexport const schema = { resolverClasses: modules.flatMap(one => one.resolvers) }\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;AAAA,wEAA6C;AAC7C,sEAA2C;AAC3C,4DAAiC;AACjC,wEAA6C;AAC7C,kEAAuC;AACvC,oEAAyC;AACzC,kEAAuC;AACvC,iEAAsC;AACtC,iEAAsC;AACtC,2DAAoC;AACpC,sEAA+C;AAC/C,oEAA6C;AAC7C,MAAM,OAAO,GAAgE,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,CAAC,CAAA;AACpG,QAAA,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AAC/C,QAAA,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;AACrD,QAAA,MAAM,GAAG,EAAE,eAAe,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAA","sourcesContent":["export * from './invoice-event/invoice-event'\nexport * from './invoice-item/invoice-item'\nexport * from './invoice/invoice'\nexport * from './invoice/commercial-document'\nexport * from './invoice/invoice-rules'\nexport * from './invoice/invoice-service'\nexport * from './invoice/invoice-files'\nexport * from './invoice/invoice-type'\nexport * from './invoice/invoice-read'\nimport * as invoice from './invoice'\nimport * as invoiceEvent from './invoice-event'\nimport * as invoiceItem from './invoice-item'\nconst modules: { entities: any[]; subscribers: any[]; resolvers: any[] }[] = [invoice, invoiceItem, invoiceEvent]\nexport const entities = modules.flatMap(one => one.entities)\nexport const subscribers = modules.flatMap(one => one.subscribers)\nexport const schema = { resolverClasses: modules.flatMap(one => one.resolvers) }\n"]}
@@ -0,0 +1,6 @@
1
+ import { type ListRead } from '@things-factory/ai-assistant';
2
+ export declare const INVOICE_LIST_READ: ListRead;
3
+ /** The keys an application's assistant mode names in its `readTargets` to read invoices. */
4
+ export declare const INVOICE_READ_TARGETS: string[];
5
+ /** At boot: the assistant may read the invoice list, in a mode that names it. */
6
+ export declare function registerInvoiceReads(): void;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.INVOICE_READ_TARGETS = exports.INVOICE_LIST_READ = void 0;
4
+ exports.registerInvoiceReads = registerInvoiceReads;
5
+ const ai_assistant_1 = require("@things-factory/ai-assistant");
6
+ const invoice_status_1 = require("./invoice-status");
7
+ /*
8
+ * 청구서 as the assistant reads it (design/ai/read-targets.md §3) - the list screen's own query, as the person: what the
9
+ * invoice door lets them see, they read with the assistant. The rows a person picks on the list (「AI와 작업」) go as
10
+ * `invoice:<uuid>` - this key's last part - and are read here by their ids. The search words are the resolver's
11
+ * searchables (invoice-query.ts), field for field; a test holds the two equal.
12
+ */
13
+ exports.INVOICE_LIST_READ = {
14
+ key: 'invoice.invoice',
15
+ title: 'title.invoice-list',
16
+ name: 'Invoices (청구서)',
17
+ listQuery: 'invoices',
18
+ selection: 'id number status direction currency counterpartyId supplierName buyerName issueDate dueDate purchaseOrder paymentTerms notes supplyAmount taxAmount totalAmount voidReason',
19
+ columns: [
20
+ { name: 'number', type: 'string', labelKey: 'field.invoice-number' },
21
+ { name: 'status', type: 'string', labelKey: 'field.invoice-status' },
22
+ { name: 'direction', type: 'string', labelKey: 'field.invoice-direction' },
23
+ { name: 'supplierName', type: 'string' },
24
+ { name: 'buyerName', type: 'string' },
25
+ { name: 'counterpartyId', type: 'string' },
26
+ { name: 'issueDate', type: 'date', labelKey: 'field.invoice-issue-date' },
27
+ { name: 'dueDate', type: 'date', labelKey: 'field.invoice-due-date' },
28
+ { name: 'purchaseOrder', type: 'string' },
29
+ { name: 'paymentTerms', type: 'string' },
30
+ { name: 'currency', type: 'string' },
31
+ { name: 'supplyAmount', type: 'number', total: true, currency: 'currency' },
32
+ { name: 'taxAmount', type: 'number', total: true, currency: 'currency' },
33
+ { name: 'totalAmount', type: 'number', total: true, currency: 'currency', labelKey: 'field.invoice-total-amount' },
34
+ { name: 'notes', type: 'string' },
35
+ { name: 'voidReason', type: 'string' }
36
+ ],
37
+ dateField: 'issueDate',
38
+ status: { field: 'status', values: Object.values(invoice_status_1.InvoiceStatus) },
39
+ search: 'fields number, supplierName, buyerName, purchaseOrder, notes',
40
+ route: 'invoice-list'
41
+ };
42
+ /** The keys an application's assistant mode names in its `readTargets` to read invoices. */
43
+ exports.INVOICE_READ_TARGETS = [exports.INVOICE_LIST_READ.key];
44
+ /** At boot: the assistant may read the invoice list, in a mode that names it. */
45
+ function registerInvoiceReads() {
46
+ (0, ai_assistant_1.registerReadTarget)((0, ai_assistant_1.listReadTarget)(exports.INVOICE_LIST_READ));
47
+ }
48
+ //# sourceMappingURL=invoice-read.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoice-read.js","sourceRoot":"","sources":["../../../server/service/invoice/invoice-read.ts"],"names":[],"mappings":";;;AA6CA,oDAEC;AA/CD,+DAAgG;AAEhG,qDAAgD;AAEhD;;;;;GAKG;AACU,QAAA,iBAAiB,GAAa;IACzC,GAAG,EAAE,iBAAiB;IACtB,KAAK,EAAE,oBAAoB;IAC3B,IAAI,EAAE,gBAAgB;IACtB,SAAS,EAAE,UAAU;IACrB,SAAS,EACP,4KAA4K;IAC9K,OAAO,EAAE;QACP,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,sBAAsB,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S,EAAE,WAAW;IACtB,MAAM,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,8BAAa,CAAC,EAAE;IACjE,MAAM,EAAE,8DAA8D;IACtE,KAAK,EAAE,cAAc;CACtB,CAAA;AAED,4FAA4F;AAC/E,QAAA,oBAAoB,GAAG,CAAC,yBAAiB,CAAC,GAAG,CAAC,CAAA;AAE3D,iFAAiF;AACjF,SAAgB,oBAAoB;IAClC,IAAA,iCAAkB,EAAC,IAAA,6BAAc,EAAC,yBAAiB,CAAC,CAAC,CAAA;AACvD,CAAC","sourcesContent":["import { listReadTarget, registerReadTarget, type ListRead } from '@things-factory/ai-assistant'\n\nimport { InvoiceStatus } from './invoice-status'\n\n/*\n * 청구서 as the assistant reads it (design/ai/read-targets.md §3) - the list screen's own query, as the person: what the\n * invoice door lets them see, they read with the assistant. The rows a person picks on the list (「AI와 작업」) go as\n * `invoice:<uuid>` - this key's last part - and are read here by their ids. The search words are the resolver's\n * searchables (invoice-query.ts), field for field; a test holds the two equal.\n */\nexport const INVOICE_LIST_READ: ListRead = {\n key: 'invoice.invoice',\n title: 'title.invoice-list',\n name: 'Invoices (청구서)',\n listQuery: 'invoices',\n selection:\n 'id number status direction currency counterpartyId supplierName buyerName issueDate dueDate purchaseOrder paymentTerms notes supplyAmount taxAmount totalAmount voidReason',\n columns: [\n { name: 'number', type: 'string', labelKey: 'field.invoice-number' },\n { name: 'status', type: 'string', labelKey: 'field.invoice-status' },\n { name: 'direction', type: 'string', labelKey: 'field.invoice-direction' },\n { name: 'supplierName', type: 'string' },\n { name: 'buyerName', type: 'string' },\n { name: 'counterpartyId', type: 'string' },\n { name: 'issueDate', type: 'date', labelKey: 'field.invoice-issue-date' },\n { name: 'dueDate', type: 'date', labelKey: 'field.invoice-due-date' },\n { name: 'purchaseOrder', type: 'string' },\n { name: 'paymentTerms', type: 'string' },\n { name: 'currency', type: 'string' },\n { name: 'supplyAmount', type: 'number', total: true, currency: 'currency' },\n { name: 'taxAmount', type: 'number', total: true, currency: 'currency' },\n { name: 'totalAmount', type: 'number', total: true, currency: 'currency', labelKey: 'field.invoice-total-amount' },\n { name: 'notes', type: 'string' },\n { name: 'voidReason', type: 'string' }\n ],\n dateField: 'issueDate',\n status: { field: 'status', values: Object.values(InvoiceStatus) },\n search: 'fields number, supplierName, buyerName, purchaseOrder, notes',\n route: 'invoice-list'\n}\n\n/** The keys an application's assistant mode names in its `readTargets` to read invoices. */\nexport const INVOICE_READ_TARGETS = [INVOICE_LIST_READ.key]\n\n/** At boot: the assistant may read the invoice list, in a mode that names it. */\nexport function registerInvoiceReads(): void {\n registerReadTarget(listReadTarget(INVOICE_LIST_READ))\n}\n"]}
@@ -0,0 +1,5 @@
1
+ export declare enum InvoiceStatus {
2
+ DRAFT = "DRAFT",
3
+ ISSUED = "ISSUED",
4
+ VOID = "VOID"
5
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvoiceStatus = void 0;
4
+ const type_graphql_1 = require("type-graphql");
5
+ /* Apart from the entity, so what reads the statuses (the assistant's list read, its test) needs no type-graphql class. */
6
+ var InvoiceStatus;
7
+ (function (InvoiceStatus) {
8
+ InvoiceStatus["DRAFT"] = "DRAFT";
9
+ InvoiceStatus["ISSUED"] = "ISSUED";
10
+ InvoiceStatus["VOID"] = "VOID";
11
+ })(InvoiceStatus || (exports.InvoiceStatus = InvoiceStatus = {}));
12
+ (0, type_graphql_1.registerEnumType)(InvoiceStatus, { name: 'InvoiceStatus', description: 'state of an invoice — draft, issued or void' });
13
+ //# sourceMappingURL=invoice-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoice-status.js","sourceRoot":"","sources":["../../../server/service/invoice/invoice-status.ts"],"names":[],"mappings":";;;AAAA,+CAA+C;AAE/C,0HAA0H;AAC1H,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,gCAAe,CAAA;IACf,kCAAiB,CAAA;IACjB,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AACD,IAAA,+BAAgB,EAAC,aAAa,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,6CAA6C,EAAE,CAAC,CAAA","sourcesContent":["import { registerEnumType } from 'type-graphql'\n\n/* Apart from the entity, so what reads the statuses (the assistant's list read, its test) needs no type-graphql class. */\nexport enum InvoiceStatus {\n DRAFT = 'DRAFT',\n ISSUED = 'ISSUED',\n VOID = 'VOID'\n}\nregisterEnumType(InvoiceStatus, { name: 'InvoiceStatus', description: 'state of an invoice — draft, issued or void' })\n"]}
@@ -3,11 +3,8 @@ import { Counterparty } from '@things-factory/biz-base';
3
3
  import { Domain } from '@things-factory/shell';
4
4
  import { InvoiceItem } from '../invoice-item/invoice-item';
5
5
  import { CommercialDocument } from './commercial-document';
6
- export declare enum InvoiceStatus {
7
- DRAFT = "DRAFT",
8
- ISSUED = "ISSUED",
9
- VOID = "VOID"
10
- }
6
+ import { InvoiceStatus } from './invoice-status';
7
+ export { InvoiceStatus };
11
8
  export declare enum InvoiceTaxBasis {
12
9
  CALCULATED = "CALCULATED",
13
10
  RECEIVED = "RECEIVED"
@@ -9,13 +9,8 @@ const type_graphql_1 = require("type-graphql");
9
9
  const typeorm_1 = require("typeorm");
10
10
  const invoice_item_1 = require("../invoice-item/invoice-item");
11
11
  const commercial_document_1 = require("./commercial-document");
12
- var InvoiceStatus;
13
- (function (InvoiceStatus) {
14
- InvoiceStatus["DRAFT"] = "DRAFT";
15
- InvoiceStatus["ISSUED"] = "ISSUED";
16
- InvoiceStatus["VOID"] = "VOID";
17
- })(InvoiceStatus || (exports.InvoiceStatus = InvoiceStatus = {}));
18
- (0, type_graphql_1.registerEnumType)(InvoiceStatus, { name: 'InvoiceStatus', description: 'state of an invoice — draft, issued or void' });
12
+ const invoice_status_1 = require("./invoice-status");
13
+ Object.defineProperty(exports, "InvoiceStatus", { enumerable: true, get: function () { return invoice_status_1.InvoiceStatus; } });
19
14
  var InvoiceTaxBasis;
20
15
  (function (InvoiceTaxBasis) {
21
16
  InvoiceTaxBasis["CALCULATED"] = "CALCULATED";
@@ -53,8 +48,8 @@ tslib_1.__decorate([
53
48
  tslib_1.__metadata("design:type", String)
54
49
  ], Invoice.prototype, "counterpartyId", void 0);
55
50
  tslib_1.__decorate([
56
- (0, typeorm_1.Column)({ default: InvoiceStatus.DRAFT }),
57
- (0, type_graphql_1.Field)(type => InvoiceStatus, { description: 'Draft, issued or void' }),
51
+ (0, typeorm_1.Column)({ default: invoice_status_1.InvoiceStatus.DRAFT }),
52
+ (0, type_graphql_1.Field)(type => invoice_status_1.InvoiceStatus, { description: 'Draft, issued or void' }),
58
53
  tslib_1.__metadata("design:type", String)
59
54
  ], Invoice.prototype, "status", void 0);
60
55
  tslib_1.__decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"invoice.js","sourceRoot":"","sources":["../../../server/service/invoice/invoice.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,uDAAuD;AACvD,iDAA8C;AAC9C,+CAAsE;AACtE,qCAA+J;AAE/J,+DAA0D;AAC1D,+DAA0D;AAE1D,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,gCAAe,CAAA;IACf,kCAAiB,CAAA;IACjB,8BAAa,CAAA;AACf,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AACD,IAAA,+BAAgB,EAAC,aAAa,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,6CAA6C,EAAE,CAAC,CAAA;AAEtH,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,4CAAyB,CAAA;IACzB,wCAAqB,CAAA;AACvB,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B;AACD,IAAA,+BAAgB,EAAC,eAAe,EAAE;IAChC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,kGAAkG;CAChH,CAAC,CAAA;AAMK,IAAM,OAAO,GAAb,MAAM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AAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;wCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;0CAChC;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,CAAC;sCAC9B,gBAAI;wCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;0CAChC;kBAjEP,OAAO;IAJnB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,cAAc,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAC9H,IAAA,eAAK,EAAC,cAAc,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9F,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,sEAAsE,EAAE,CAAC;GACvF,OAAO,CAkEnB","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Counterparty } from '@things-factory/biz-base'\nimport { Domain } from '@things-factory/shell'\nimport { Field, ID, ObjectType, registerEnumType } from 'type-graphql'\nimport { Column, CreateDateColumn, DeleteDateColumn, Entity, Index, ManyToOne, OneToMany, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'\n\nimport { InvoiceItem } from '../invoice-item/invoice-item'\nimport { CommercialDocument } from './commercial-document'\n\nexport enum InvoiceStatus {\n DRAFT = 'DRAFT',\n ISSUED = 'ISSUED',\n VOID = 'VOID'\n}\nregisterEnumType(InvoiceStatus, { name: 'InvoiceStatus', description: 'state of an invoice — draft, issued or void' })\n\nexport enum InvoiceTaxBasis {\n CALCULATED = 'CALCULATED',\n RECEIVED = 'RECEIVED'\n}\nregisterEnumType(InvoiceTaxBasis, {\n name: 'InvoiceTaxBasis',\n description: 'whether the tax is reckoned from the supply groups or kept as the sender printed it on each line'\n})\n\n@Entity()\n@Index('ix_invoice_0', (invoice: Invoice) => [invoice.domain, invoice.number], { unique: true, where: '\"deleted_at\" IS NULL' })\n@Index('ix_invoice_1', (invoice: Invoice) => [invoice.domain, invoice.status, invoice.dueDate])\n@ObjectType({ description: 'Entity for Invoice — a commercial invoice, domestic or international' })\nexport class Invoice extends CommercialDocument {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true })\n domain?: Domain\n\n @RelationId((invoice: Invoice) => invoice.domain)\n domainId?: string\n\n /* The printed buyer or supplier stays as printed; this is who it is among the domain's counterparties (ADR-0122). */\n @ManyToOne(type => Counterparty, { nullable: true })\n @Field(type => Counterparty, { nullable: true, description: 'The other party among the domain counterparties: the buyer of a sale, the supplier of a purchase' })\n counterparty?: Counterparty\n\n @RelationId((invoice: Invoice) => invoice.counterparty)\n @Field({ nullable: true, description: 'Id of the other party among the domain counterparties' })\n counterpartyId?: string\n\n @Column({ default: InvoiceStatus.DRAFT })\n @Field(type => InvoiceStatus, { description: 'Draft, issued or void' })\n status: InvoiceStatus\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Payment due date, YYYY-MM-DD' })\n dueDate?: string\n\n @Column({ default: InvoiceTaxBasis.CALCULATED })\n @Field(type => InvoiceTaxBasis, { description: 'Reckoned tax, or the tax a received invoice printed' })\n taxBasis: InvoiceTaxBasis\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Why the invoice was voided' })\n voidReason?: string\n\n @OneToMany(type => InvoiceItem, item => item.invoice)\n @Field(type => [InvoiceItem], { description: 'Lines in printed order' })\n items: InvoiceItem[]\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'When the invoice was created' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'When the invoice last changed' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'When the invoice was deleted' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((invoice: Invoice) => invoice.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((invoice: Invoice) => invoice.updater)\n updaterId?: string\n}\n"]}
1
+ {"version":3,"file":"invoice.js","sourceRoot":"","sources":["../../../server/service/invoice/invoice.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,uDAAuD;AACvD,iDAA8C;AAC9C,+CAAsE;AACtE,qCAA+J;AAE/J,+DAA0D;AAC1D,+DAA0D;AAC1D,qDAAgD;AAEvC,8FAFA,8BAAa,OAEA;AAEtB,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,4CAAyB,CAAA;IACzB,wCAAqB,CAAA;AACvB,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B;AACD,IAAA,+BAAgB,EAAC,eAAe,EAAE;IAChC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,kGAAkG;CAChH,CAAC,CAAA;AAMK,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,wCAAkB;CAkE9C,CAAA;AAlEY,0BAAO;AAGT;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;mCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAA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AC;IAC3C,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC9B,gBAAI;wCAAA;AAGd;IADC,IAAA,oBAAU,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;0CAChC;kBAjEP,OAAO;IAJnB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,cAAc,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAC9H,IAAA,eAAK,EAAC,cAAc,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9F,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,sEAAsE,EAAE,CAAC;GACvF,OAAO,CAkEnB","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Counterparty } from '@things-factory/biz-base'\nimport { Domain } from '@things-factory/shell'\nimport { Field, ID, ObjectType, registerEnumType } from 'type-graphql'\nimport { Column, CreateDateColumn, DeleteDateColumn, Entity, Index, ManyToOne, OneToMany, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'\n\nimport { InvoiceItem } from '../invoice-item/invoice-item'\nimport { CommercialDocument } from './commercial-document'\nimport { InvoiceStatus } from './invoice-status'\n\nexport { InvoiceStatus }\n\nexport enum InvoiceTaxBasis {\n CALCULATED = 'CALCULATED',\n RECEIVED = 'RECEIVED'\n}\nregisterEnumType(InvoiceTaxBasis, {\n name: 'InvoiceTaxBasis',\n description: 'whether the tax is reckoned from the supply groups or kept as the sender printed it on each line'\n})\n\n@Entity()\n@Index('ix_invoice_0', (invoice: Invoice) => [invoice.domain, invoice.number], { unique: true, where: '\"deleted_at\" IS NULL' })\n@Index('ix_invoice_1', (invoice: Invoice) => [invoice.domain, invoice.status, invoice.dueDate])\n@ObjectType({ description: 'Entity for Invoice — a commercial invoice, domestic or international' })\nexport class Invoice extends CommercialDocument {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true })\n domain?: Domain\n\n @RelationId((invoice: Invoice) => invoice.domain)\n domainId?: string\n\n /* The printed buyer or supplier stays as printed; this is who it is among the domain's counterparties (ADR-0122). */\n @ManyToOne(type => Counterparty, { nullable: true })\n @Field(type => Counterparty, { nullable: true, description: 'The other party among the domain counterparties: the buyer of a sale, the supplier of a purchase' })\n counterparty?: Counterparty\n\n @RelationId((invoice: Invoice) => invoice.counterparty)\n @Field({ nullable: true, description: 'Id of the other party among the domain counterparties' })\n counterpartyId?: string\n\n @Column({ default: InvoiceStatus.DRAFT })\n @Field(type => InvoiceStatus, { description: 'Draft, issued or void' })\n status: InvoiceStatus\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Payment due date, YYYY-MM-DD' })\n dueDate?: string\n\n @Column({ default: InvoiceTaxBasis.CALCULATED })\n @Field(type => InvoiceTaxBasis, { description: 'Reckoned tax, or the tax a received invoice printed' })\n taxBasis: InvoiceTaxBasis\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Why the invoice was voided' })\n voidReason?: string\n\n @OneToMany(type => InvoiceItem, item => item.invoice)\n @Field(type => [InvoiceItem], { description: 'Lines in printed order' })\n items: InvoiceItem[]\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'When the invoice was created' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'When the invoice last changed' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'When the invoice was deleted' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((invoice: Invoice) => invoice.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((invoice: Invoice) => invoice.updater)\n updaterId?: string\n}\n"]}