@things-factory/invoice 0.0.0-stage → 10.1.130
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -2
- package/dist-client/bootstrap.d.ts +1 -0
- package/dist-client/bootstrap.js +5 -0
- package/dist-client/bootstrap.js.map +1 -0
- package/dist-client/document/document-amount.d.ts +6 -0
- package/dist-client/document/document-amount.js +19 -0
- package/dist-client/document/document-amount.js.map +1 -0
- package/dist-client/document/document-form.d.ts +14 -0
- package/dist-client/document/document-form.js +145 -0
- package/dist-client/document/document-form.js.map +1 -0
- package/dist-client/document/document-lines.d.ts +104 -0
- package/dist-client/document/document-lines.js +61 -0
- package/dist-client/document/document-lines.js.map +1 -0
- package/dist-client/document/document-print.d.ts +15 -0
- package/dist-client/document/document-print.js +60 -0
- package/dist-client/document/document-print.js.map +1 -0
- package/dist-client/entity360/invoice-360.d.ts +19 -0
- package/dist-client/entity360/invoice-360.js +116 -0
- package/dist-client/entity360/invoice-360.js.map +1 -0
- package/dist-client/index.d.ts +6 -0
- package/dist-client/index.js +7 -0
- package/dist-client/index.js.map +1 -0
- package/dist-client/invoice-attach.d.ts +19 -0
- package/dist-client/invoice-attach.js +19 -0
- package/dist-client/invoice-attach.js.map +1 -0
- package/dist-client/pages/invoice-editor.d.ts +48 -0
- package/dist-client/pages/invoice-editor.js +341 -0
- package/dist-client/pages/invoice-editor.js.map +1 -0
- package/dist-client/pages/invoice-list.d.ts +39 -0
- package/dist-client/pages/invoice-list.js +125 -0
- package/dist-client/pages/invoice-list.js.map +1 -0
- package/dist-client/route.d.ts +1 -0
- package/dist-client/route.js +11 -0
- package/dist-client/route.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -0
- package/dist-server/index.d.ts +2 -0
- package/dist-server/index.js +6 -0
- package/dist-server/index.js.map +1 -0
- package/dist-server/routes.d.ts +1 -0
- package/dist-server/routes.js +3 -0
- package/dist-server/routes.js.map +1 -0
- package/dist-server/service/index.d.ts +12 -0
- package/dist-server/service/index.js +19 -0
- package/dist-server/service/index.js.map +1 -0
- package/dist-server/service/invoice/commercial-document.d.ts +44 -0
- package/dist-server/service/invoice/commercial-document.js +200 -0
- package/dist-server/service/invoice/commercial-document.js.map +1 -0
- package/dist-server/service/invoice/index.d.ts +6 -0
- package/dist-server/service/invoice/index.js +10 -0
- package/dist-server/service/invoice/index.js.map +1 -0
- package/dist-server/service/invoice/invoice-mutation.d.ts +8 -0
- package/dist-server/service/invoice/invoice-mutation.js +75 -0
- package/dist-server/service/invoice/invoice-mutation.js.map +1 -0
- package/dist-server/service/invoice/invoice-query.d.ts +16 -0
- package/dist-server/service/invoice/invoice-query.js +117 -0
- package/dist-server/service/invoice/invoice-query.js.map +1 -0
- package/dist-server/service/invoice/invoice-rules.d.ts +83 -0
- package/dist-server/service/invoice/invoice-rules.js +202 -0
- package/dist-server/service/invoice/invoice-rules.js.map +1 -0
- package/dist-server/service/invoice/invoice-service.d.ts +26 -0
- package/dist-server/service/invoice/invoice-service.js +133 -0
- package/dist-server/service/invoice/invoice-service.js.map +1 -0
- package/dist-server/service/invoice/invoice-type.d.ts +40 -0
- package/dist-server/service/invoice/invoice-type.js +146 -0
- package/dist-server/service/invoice/invoice-type.js.map +1 -0
- package/dist-server/service/invoice/invoice.d.ts +30 -0
- package/dist-server/service/invoice/invoice.js +108 -0
- package/dist-server/service/invoice/invoice.js.map +1 -0
- package/dist-server/service/invoice-event/index.d.ts +5 -0
- package/dist-server/service/invoice-event/index.js +9 -0
- package/dist-server/service/invoice-event/index.js.map +1 -0
- package/dist-server/service/invoice-event/invoice-event-query.d.ts +9 -0
- package/dist-server/service/invoice-event/invoice-event-query.js +57 -0
- package/dist-server/service/invoice-event/invoice-event-query.js.map +1 -0
- package/dist-server/service/invoice-event/invoice-event.d.ts +22 -0
- package/dist-server/service/invoice-event/invoice-event.js +98 -0
- package/dist-server/service/invoice-event/invoice-event.js.map +1 -0
- package/dist-server/service/invoice-item/index.d.ts +5 -0
- package/dist-server/service/invoice-item/index.js +9 -0
- package/dist-server/service/invoice-item/index.js.map +1 -0
- package/dist-server/service/invoice-item/invoice-item-query.d.ts +8 -0
- package/dist-server/service/invoice-item/invoice-item-query.js +47 -0
- package/dist-server/service/invoice-item/invoice-item-query.js.map +1 -0
- package/dist-server/service/invoice-item/invoice-item.d.ts +19 -0
- package/dist-server/service/invoice-item/invoice-item.js +80 -0
- package/dist-server/service/invoice-item/invoice-item.js.map +1 -0
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +44 -4
- package/things-factory.config.js +11 -0
- package/translations/en.json +81 -0
- package/translations/ko.json +81 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { User } from '@things-factory/auth-base';
|
|
2
|
+
import { Domain } from '@things-factory/shell';
|
|
3
|
+
import { InvoiceItem } from '../invoice-item/invoice-item';
|
|
4
|
+
import { CommercialDocument } from './commercial-document';
|
|
5
|
+
export declare enum InvoiceStatus {
|
|
6
|
+
DRAFT = "DRAFT",
|
|
7
|
+
ISSUED = "ISSUED",
|
|
8
|
+
VOID = "VOID"
|
|
9
|
+
}
|
|
10
|
+
export declare enum InvoiceTaxBasis {
|
|
11
|
+
CALCULATED = "CALCULATED",
|
|
12
|
+
RECEIVED = "RECEIVED"
|
|
13
|
+
}
|
|
14
|
+
export declare class Invoice extends CommercialDocument {
|
|
15
|
+
readonly id: string;
|
|
16
|
+
domain?: Domain;
|
|
17
|
+
domainId?: string;
|
|
18
|
+
status: InvoiceStatus;
|
|
19
|
+
dueDate?: string;
|
|
20
|
+
taxBasis: InvoiceTaxBasis;
|
|
21
|
+
voidReason?: string;
|
|
22
|
+
items: InvoiceItem[];
|
|
23
|
+
createdAt?: Date;
|
|
24
|
+
updatedAt?: Date;
|
|
25
|
+
deletedAt?: Date;
|
|
26
|
+
creator?: User;
|
|
27
|
+
creatorId?: string;
|
|
28
|
+
updater?: User;
|
|
29
|
+
updaterId?: string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Invoice = exports.InvoiceTaxBasis = exports.InvoiceStatus = 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 invoice_item_1 = require("../invoice-item/invoice-item");
|
|
10
|
+
const commercial_document_1 = require("./commercial-document");
|
|
11
|
+
var InvoiceStatus;
|
|
12
|
+
(function (InvoiceStatus) {
|
|
13
|
+
InvoiceStatus["DRAFT"] = "DRAFT";
|
|
14
|
+
InvoiceStatus["ISSUED"] = "ISSUED";
|
|
15
|
+
InvoiceStatus["VOID"] = "VOID";
|
|
16
|
+
})(InvoiceStatus || (exports.InvoiceStatus = InvoiceStatus = {}));
|
|
17
|
+
(0, type_graphql_1.registerEnumType)(InvoiceStatus, { name: 'InvoiceStatus', description: 'state of an invoice — draft, issued or void' });
|
|
18
|
+
var InvoiceTaxBasis;
|
|
19
|
+
(function (InvoiceTaxBasis) {
|
|
20
|
+
InvoiceTaxBasis["CALCULATED"] = "CALCULATED";
|
|
21
|
+
InvoiceTaxBasis["RECEIVED"] = "RECEIVED";
|
|
22
|
+
})(InvoiceTaxBasis || (exports.InvoiceTaxBasis = InvoiceTaxBasis = {}));
|
|
23
|
+
(0, type_graphql_1.registerEnumType)(InvoiceTaxBasis, {
|
|
24
|
+
name: 'InvoiceTaxBasis',
|
|
25
|
+
description: 'whether the tax is reckoned from the supply groups or kept as the sender printed it on each line'
|
|
26
|
+
});
|
|
27
|
+
let Invoice = class Invoice extends commercial_document_1.CommercialDocument {
|
|
28
|
+
};
|
|
29
|
+
exports.Invoice = Invoice;
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
32
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
33
|
+
tslib_1.__metadata("design:type", String)
|
|
34
|
+
], Invoice.prototype, "id", void 0);
|
|
35
|
+
tslib_1.__decorate([
|
|
36
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
37
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true }),
|
|
38
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
39
|
+
], Invoice.prototype, "domain", void 0);
|
|
40
|
+
tslib_1.__decorate([
|
|
41
|
+
(0, typeorm_1.RelationId)((invoice) => invoice.domain),
|
|
42
|
+
tslib_1.__metadata("design:type", String)
|
|
43
|
+
], Invoice.prototype, "domainId", void 0);
|
|
44
|
+
tslib_1.__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ default: InvoiceStatus.DRAFT }),
|
|
46
|
+
(0, type_graphql_1.Field)(type => InvoiceStatus, { description: 'Draft, issued or void' }),
|
|
47
|
+
tslib_1.__metadata("design:type", String)
|
|
48
|
+
], Invoice.prototype, "status", void 0);
|
|
49
|
+
tslib_1.__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
51
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Payment due date, YYYY-MM-DD' }),
|
|
52
|
+
tslib_1.__metadata("design:type", String)
|
|
53
|
+
], Invoice.prototype, "dueDate", void 0);
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ default: InvoiceTaxBasis.CALCULATED }),
|
|
56
|
+
(0, type_graphql_1.Field)(type => InvoiceTaxBasis, { description: 'Reckoned tax, or the tax a received invoice printed' }),
|
|
57
|
+
tslib_1.__metadata("design:type", String)
|
|
58
|
+
], Invoice.prototype, "taxBasis", void 0);
|
|
59
|
+
tslib_1.__decorate([
|
|
60
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
61
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Why the invoice was voided' }),
|
|
62
|
+
tslib_1.__metadata("design:type", String)
|
|
63
|
+
], Invoice.prototype, "voidReason", void 0);
|
|
64
|
+
tslib_1.__decorate([
|
|
65
|
+
(0, typeorm_1.OneToMany)(type => invoice_item_1.InvoiceItem, item => item.invoice),
|
|
66
|
+
(0, type_graphql_1.Field)(type => [invoice_item_1.InvoiceItem], { description: 'Lines in printed order' }),
|
|
67
|
+
tslib_1.__metadata("design:type", Array)
|
|
68
|
+
], Invoice.prototype, "items", void 0);
|
|
69
|
+
tslib_1.__decorate([
|
|
70
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
71
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When the invoice was created' }),
|
|
72
|
+
tslib_1.__metadata("design:type", Date)
|
|
73
|
+
], Invoice.prototype, "createdAt", void 0);
|
|
74
|
+
tslib_1.__decorate([
|
|
75
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
76
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When the invoice last changed' }),
|
|
77
|
+
tslib_1.__metadata("design:type", Date)
|
|
78
|
+
], Invoice.prototype, "updatedAt", void 0);
|
|
79
|
+
tslib_1.__decorate([
|
|
80
|
+
(0, typeorm_1.DeleteDateColumn)(),
|
|
81
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When the invoice was deleted' }),
|
|
82
|
+
tslib_1.__metadata("design:type", Date)
|
|
83
|
+
], Invoice.prototype, "deletedAt", 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 }),
|
|
87
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
88
|
+
], Invoice.prototype, "creator", void 0);
|
|
89
|
+
tslib_1.__decorate([
|
|
90
|
+
(0, typeorm_1.RelationId)((invoice) => invoice.creator),
|
|
91
|
+
tslib_1.__metadata("design:type", String)
|
|
92
|
+
], Invoice.prototype, "creatorId", void 0);
|
|
93
|
+
tslib_1.__decorate([
|
|
94
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
95
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
96
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
97
|
+
], Invoice.prototype, "updater", void 0);
|
|
98
|
+
tslib_1.__decorate([
|
|
99
|
+
(0, typeorm_1.RelationId)((invoice) => invoice.updater),
|
|
100
|
+
tslib_1.__metadata("design:type", String)
|
|
101
|
+
], Invoice.prototype, "updaterId", void 0);
|
|
102
|
+
exports.Invoice = Invoice = tslib_1.__decorate([
|
|
103
|
+
(0, typeorm_1.Entity)(),
|
|
104
|
+
(0, typeorm_1.Index)('ix_invoice_0', (invoice) => [invoice.domain, invoice.number], { unique: true, where: '"deleted_at" IS NULL' }),
|
|
105
|
+
(0, typeorm_1.Index)('ix_invoice_1', (invoice) => [invoice.domain, invoice.status, invoice.dueDate]),
|
|
106
|
+
(0, type_graphql_1.ObjectType)({ description: 'Entity for Invoice — a commercial invoice, domestic or international' })
|
|
107
|
+
], Invoice);
|
|
108
|
+
//# sourceMappingURL=invoice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice.js","sourceRoot":"","sources":["../../../server/service/invoice/invoice.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,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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E,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;kBAxDP,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,CAyDnB","sourcesContent":["import { User } from '@things-factory/auth-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 @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"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { InvoiceEvent } from './invoice-event';
|
|
2
|
+
import { InvoiceEventQuery } from './invoice-event-query';
|
|
3
|
+
export declare const entities: (typeof InvoiceEvent)[];
|
|
4
|
+
export declare const resolvers: (typeof InvoiceEventQuery)[];
|
|
5
|
+
export declare const subscribers: any[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.subscribers = exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const invoice_event_1 = require("./invoice-event");
|
|
5
|
+
const invoice_event_query_1 = require("./invoice-event-query");
|
|
6
|
+
exports.entities = [invoice_event_1.InvoiceEvent];
|
|
7
|
+
exports.resolvers = [invoice_event_query_1.InvoiceEventQuery];
|
|
8
|
+
exports.subscribers = [];
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/invoice-event/index.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAC9C,+DAAyD;AAC5C,QAAA,QAAQ,GAAG,CAAC,4BAAY,CAAC,CAAA;AACzB,QAAA,SAAS,GAAG,CAAC,uCAAiB,CAAC,CAAA;AAC/B,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { InvoiceEvent } from './invoice-event'\nimport { InvoiceEventQuery } from './invoice-event-query'\nexport const entities = [InvoiceEvent]\nexport const resolvers = [InvoiceEventQuery]\nexport const subscribers = []\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { User } from '@things-factory/auth-base';
|
|
2
|
+
import { Domain } from '@things-factory/shell';
|
|
3
|
+
import { InvoiceEvent } from './invoice-event';
|
|
4
|
+
export declare class InvoiceEventQuery {
|
|
5
|
+
actor(row: InvoiceEvent): Promise<User>;
|
|
6
|
+
domain(row: InvoiceEvent): Promise<Domain>;
|
|
7
|
+
creator(row: InvoiceEvent): Promise<User>;
|
|
8
|
+
updater(row: InvoiceEvent): Promise<User>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvoiceEventQuery = 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 shell_2 = require("@things-factory/shell");
|
|
8
|
+
const type_graphql_1 = require("type-graphql");
|
|
9
|
+
const invoice_event_1 = require("./invoice-event");
|
|
10
|
+
let InvoiceEventQuery = class InvoiceEventQuery {
|
|
11
|
+
async actor(row) {
|
|
12
|
+
return row.actor ?? (row.actorId ? (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: row.actorId }) : undefined);
|
|
13
|
+
}
|
|
14
|
+
async domain(row) {
|
|
15
|
+
return row.domain ?? (row.domainId ? (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: row.domainId }) : undefined);
|
|
16
|
+
}
|
|
17
|
+
async creator(row) {
|
|
18
|
+
return row.creator ?? (row.creatorId ? (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: row.creatorId }) : undefined);
|
|
19
|
+
}
|
|
20
|
+
async updater(row) {
|
|
21
|
+
return row.updater ?? (row.updaterId ? (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: row.updaterId }) : undefined);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.InvoiceEventQuery = InvoiceEventQuery;
|
|
25
|
+
tslib_1.__decorate([
|
|
26
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { nullable: true }),
|
|
27
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
28
|
+
tslib_1.__metadata("design:type", Function),
|
|
29
|
+
tslib_1.__metadata("design:paramtypes", [invoice_event_1.InvoiceEvent]),
|
|
30
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
31
|
+
], InvoiceEventQuery.prototype, "actor", null);
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain, { nullable: true }),
|
|
34
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
35
|
+
tslib_1.__metadata("design:type", Function),
|
|
36
|
+
tslib_1.__metadata("design:paramtypes", [invoice_event_1.InvoiceEvent]),
|
|
37
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
38
|
+
], InvoiceEventQuery.prototype, "domain", null);
|
|
39
|
+
tslib_1.__decorate([
|
|
40
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { nullable: true }),
|
|
41
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
42
|
+
tslib_1.__metadata("design:type", Function),
|
|
43
|
+
tslib_1.__metadata("design:paramtypes", [invoice_event_1.InvoiceEvent]),
|
|
44
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
45
|
+
], InvoiceEventQuery.prototype, "creator", null);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { nullable: true }),
|
|
48
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
49
|
+
tslib_1.__metadata("design:type", Function),
|
|
50
|
+
tslib_1.__metadata("design:paramtypes", [invoice_event_1.InvoiceEvent]),
|
|
51
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
52
|
+
], InvoiceEventQuery.prototype, "updater", null);
|
|
53
|
+
exports.InvoiceEventQuery = InvoiceEventQuery = tslib_1.__decorate([
|
|
54
|
+
(0, type_graphql_1.UseMiddleware)(shell_2.SpeakRefusals),
|
|
55
|
+
(0, type_graphql_1.Resolver)(invoice_event_1.InvoiceEvent)
|
|
56
|
+
], InvoiceEventQuery);
|
|
57
|
+
//# sourceMappingURL=invoice-event-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice-event-query.js","sourceRoot":"","sources":["../../../server/service/invoice-event/invoice-event-query.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,iDAA6D;AAC7D,iDAAqD;AACrD,+CAA2E;AAC3E,mDAA8C;AAGvC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEtB,AAAN,KAAK,CAAC,KAAK,CAAS,GAAiB;QACnC,OAAO,GAAG,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAA,qBAAa,EAAC,gBAAI,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IACpG,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAS,GAAiB;QACpC,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAA,qBAAa,EAAC,cAAM,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IACzG,CAAC;IAEK,AAAN,KAAK,CAAC,OAAO,CAAS,GAAiB;QACrC,OAAO,GAAG,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAA,qBAAa,EAAC,gBAAI,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IAC1G,CAAC;IAEK,AAAN,KAAK,CAAC,OAAO,CAAS,GAAiB;QACrC,OAAO,GAAG,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAA,qBAAa,EAAC,gBAAI,CAAC,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;IAC1G,CAAC;CACF,CAAA;AAlBY,8CAAiB;AAEtB;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACnC,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAM,4BAAY;;8CAEpC;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACpC,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAM,4BAAY;;+CAErC;AAEK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjC,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAM,4BAAY;;gDAEtC;AAEK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjC,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAM,4BAAY;;gDAEtC;4BAjBU,iBAAiB;IAF7B,IAAA,4BAAa,EAAC,qBAAa,CAAC;IAC5B,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,iBAAiB,CAkB7B","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Domain, getRepository } from '@things-factory/shell'\nimport { SpeakRefusals } from '@things-factory/shell'\nimport { FieldResolver, Resolver, Root, UseMiddleware } from 'type-graphql'\nimport { InvoiceEvent } from './invoice-event'\n@UseMiddleware(SpeakRefusals)\n@Resolver(InvoiceEvent)\nexport class InvoiceEventQuery {\n @FieldResolver(type => User, { nullable: true })\n async actor(@Root() row: InvoiceEvent) {\n return row.actor ?? (row.actorId ? getRepository(User).findOneBy({ id: row.actorId }) : undefined)\n }\n\n @FieldResolver(type => Domain, { nullable: true })\n async domain(@Root() row: InvoiceEvent) {\n return row.domain ?? (row.domainId ? getRepository(Domain).findOneBy({ id: row.domainId }) : undefined)\n }\n @FieldResolver(type => User, { nullable: true })\n async creator(@Root() row: InvoiceEvent) {\n return row.creator ?? (row.creatorId ? getRepository(User).findOneBy({ id: row.creatorId }) : undefined)\n }\n @FieldResolver(type => User, { nullable: true })\n async updater(@Root() row: InvoiceEvent) {\n return row.updater ?? (row.updaterId ? getRepository(User).findOneBy({ id: row.updaterId }) : undefined)\n }\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { User } from '@things-factory/auth-base';
|
|
2
|
+
import { Domain } from '@things-factory/shell';
|
|
3
|
+
import { Invoice } from '../invoice/invoice';
|
|
4
|
+
export declare class InvoiceEvent {
|
|
5
|
+
snapshot: any;
|
|
6
|
+
readonly id: string;
|
|
7
|
+
domain?: Domain;
|
|
8
|
+
domainId?: string;
|
|
9
|
+
invoice: Invoice;
|
|
10
|
+
invoiceId: string;
|
|
11
|
+
action: string;
|
|
12
|
+
reason?: string;
|
|
13
|
+
createdAt?: Date;
|
|
14
|
+
actor?: User;
|
|
15
|
+
actorId?: string;
|
|
16
|
+
updatedAt?: Date;
|
|
17
|
+
updater?: User;
|
|
18
|
+
updaterId?: string;
|
|
19
|
+
creator?: User;
|
|
20
|
+
creatorId?: string;
|
|
21
|
+
deletedAt?: Date;
|
|
22
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvoiceEvent = 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 invoice_1 = require("../invoice/invoice");
|
|
10
|
+
let InvoiceEvent = class InvoiceEvent {
|
|
11
|
+
};
|
|
12
|
+
exports.InvoiceEvent = InvoiceEvent;
|
|
13
|
+
tslib_1.__decorate([
|
|
14
|
+
(0, typeorm_1.Column)({ type: 'simple-json' }),
|
|
15
|
+
(0, type_graphql_1.Field)(type => shell_1.ScalarObject, { description: 'The document as it stood after the action' }),
|
|
16
|
+
tslib_1.__metadata("design:type", Object)
|
|
17
|
+
], InvoiceEvent.prototype, "snapshot", void 0);
|
|
18
|
+
tslib_1.__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
20
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
21
|
+
tslib_1.__metadata("design:type", String)
|
|
22
|
+
], InvoiceEvent.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 }),
|
|
26
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
27
|
+
], InvoiceEvent.prototype, "domain", void 0);
|
|
28
|
+
tslib_1.__decorate([
|
|
29
|
+
(0, typeorm_1.RelationId)((row) => row.domain),
|
|
30
|
+
tslib_1.__metadata("design:type", String)
|
|
31
|
+
], InvoiceEvent.prototype, "domainId", void 0);
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
(0, typeorm_1.ManyToOne)(type => invoice_1.Invoice, { nullable: false }),
|
|
34
|
+
tslib_1.__metadata("design:type", invoice_1.Invoice)
|
|
35
|
+
], InvoiceEvent.prototype, "invoice", void 0);
|
|
36
|
+
tslib_1.__decorate([
|
|
37
|
+
(0, typeorm_1.RelationId)((row) => row.invoice),
|
|
38
|
+
(0, type_graphql_1.Field)({ description: 'The invoice the event happened to' }),
|
|
39
|
+
tslib_1.__metadata("design:type", String)
|
|
40
|
+
], InvoiceEvent.prototype, "invoiceId", void 0);
|
|
41
|
+
tslib_1.__decorate([
|
|
42
|
+
(0, typeorm_1.Column)(),
|
|
43
|
+
(0, type_graphql_1.Field)({ description: 'What happened: CREATED, UPDATED, ISSUED or VOID' }),
|
|
44
|
+
tslib_1.__metadata("design:type", String)
|
|
45
|
+
], InvoiceEvent.prototype, "action", void 0);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
48
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'Why, for a void' }),
|
|
49
|
+
tslib_1.__metadata("design:type", String)
|
|
50
|
+
], InvoiceEvent.prototype, "reason", void 0);
|
|
51
|
+
tslib_1.__decorate([
|
|
52
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
53
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When the row was created' }),
|
|
54
|
+
tslib_1.__metadata("design:type", Date)
|
|
55
|
+
], InvoiceEvent.prototype, "createdAt", void 0);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
58
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
59
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
60
|
+
], InvoiceEvent.prototype, "actor", void 0);
|
|
61
|
+
tslib_1.__decorate([
|
|
62
|
+
(0, typeorm_1.RelationId)((row) => row.actor),
|
|
63
|
+
tslib_1.__metadata("design:type", String)
|
|
64
|
+
], InvoiceEvent.prototype, "actorId", 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
|
+
], InvoiceEvent.prototype, "updatedAt", void 0);
|
|
70
|
+
tslib_1.__decorate([
|
|
71
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
72
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
73
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
74
|
+
], InvoiceEvent.prototype, "updater", void 0);
|
|
75
|
+
tslib_1.__decorate([
|
|
76
|
+
(0, typeorm_1.RelationId)((row) => row.updater),
|
|
77
|
+
tslib_1.__metadata("design:type", String)
|
|
78
|
+
], InvoiceEvent.prototype, "updaterId", void 0);
|
|
79
|
+
tslib_1.__decorate([
|
|
80
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
81
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
82
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
83
|
+
], InvoiceEvent.prototype, "creator", void 0);
|
|
84
|
+
tslib_1.__decorate([
|
|
85
|
+
(0, typeorm_1.RelationId)((row) => row.creator),
|
|
86
|
+
tslib_1.__metadata("design:type", String)
|
|
87
|
+
], InvoiceEvent.prototype, "creatorId", void 0);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
(0, typeorm_1.DeleteDateColumn)(),
|
|
90
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When the row was deleted' }),
|
|
91
|
+
tslib_1.__metadata("design:type", Date)
|
|
92
|
+
], InvoiceEvent.prototype, "deletedAt", void 0);
|
|
93
|
+
exports.InvoiceEvent = InvoiceEvent = tslib_1.__decorate([
|
|
94
|
+
(0, typeorm_1.Entity)(),
|
|
95
|
+
(0, typeorm_1.Index)('ix_invoice_event_0', (event) => [event.invoice, event.createdAt]),
|
|
96
|
+
(0, type_graphql_1.ObjectType)({ description: 'Entity for InvoiceEvent — what happened to an invoice, with the document as it then stood' })
|
|
97
|
+
], InvoiceEvent);
|
|
98
|
+
//# sourceMappingURL=invoice-event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice-event.js","sourceRoot":"","sources":["../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E,CAAC;sCAC9B,gBAAI;6CAAA;AAEd;IADC,IAAA,oBAAU,EAAC,CAAC,GAAiB,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC;;+CAC7B;AAGlB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;sCACvD,IAAI;+CAAA;uBA/CL,YAAY;IAHxB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,oBAAoB,EAAE,CAAC,KAAmB,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACtF,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,2FAA2F,EAAE,CAAC;GAC5G,YAAY,CAgDxB","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Domain, ScalarObject } from '@things-factory/shell'\nimport { Field, ID, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\nimport { Invoice } from '../invoice/invoice'\n@Entity()\n@Index('ix_invoice_event_0', (event: InvoiceEvent) => [event.invoice, event.createdAt])\n@ObjectType({ description: 'Entity for InvoiceEvent — what happened to an invoice, with the document as it then stood' })\nexport class InvoiceEvent {\n @Column({ type: 'simple-json' })\n @Field(type => ScalarObject, { description: 'The document as it stood after the action' })\n snapshot: any\n\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true })\n domain?: Domain\n @RelationId((row: InvoiceEvent) => row.domain)\n domainId?: string\n @ManyToOne(type => Invoice, { nullable: false })\n invoice: Invoice\n @RelationId((row: InvoiceEvent) => row.invoice)\n @Field({ description: 'The invoice the event happened to' })\n invoiceId: string\n @Column()\n @Field({ description: 'What happened: CREATED, UPDATED, ISSUED or VOID' })\n action: string\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Why, for a void' })\n reason?: string\n @CreateDateColumn()\n @Field({ nullable: true, description: 'When the row was created' })\n createdAt?: Date\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n actor?: User\n @RelationId((row: InvoiceEvent) => row.actor)\n actorId?: string\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'When the row last changed' })\n updatedAt?: Date\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n @RelationId((row: InvoiceEvent) => row.updater)\n updaterId?: string\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n @RelationId((row: InvoiceEvent) => row.creator)\n creatorId?: string\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'When the row was deleted' })\n deletedAt?: Date\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.subscribers = exports.resolvers = exports.entities = void 0;
|
|
4
|
+
const invoice_item_1 = require("./invoice-item");
|
|
5
|
+
const invoice_item_query_1 = require("./invoice-item-query");
|
|
6
|
+
exports.entities = [invoice_item_1.InvoiceItem];
|
|
7
|
+
exports.resolvers = [invoice_item_query_1.InvoiceItemQuery];
|
|
8
|
+
exports.subscribers = [];
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/invoice-item/index.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAC5C,6DAAuD;AAC1C,QAAA,QAAQ,GAAG,CAAC,0BAAW,CAAC,CAAA;AACxB,QAAA,SAAS,GAAG,CAAC,qCAAgB,CAAC,CAAA;AAC9B,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { InvoiceItem } from './invoice-item'\nimport { InvoiceItemQuery } from './invoice-item-query'\nexport const entities = [InvoiceItem]\nexport const resolvers = [InvoiceItemQuery]\nexport const subscribers = []\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { User } from '@things-factory/auth-base';
|
|
2
|
+
import { Domain } from '@things-factory/shell';
|
|
3
|
+
import { InvoiceItem } from './invoice-item';
|
|
4
|
+
export declare class InvoiceItemQuery {
|
|
5
|
+
domain(row: InvoiceItem): Promise<Domain>;
|
|
6
|
+
creator(row: InvoiceItem): Promise<User>;
|
|
7
|
+
updater(row: InvoiceItem): Promise<User>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvoiceItemQuery = 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 shell_2 = require("@things-factory/shell");
|
|
8
|
+
const type_graphql_1 = require("type-graphql");
|
|
9
|
+
const invoice_item_1 = require("./invoice-item");
|
|
10
|
+
let InvoiceItemQuery = class InvoiceItemQuery {
|
|
11
|
+
async domain(row) {
|
|
12
|
+
return row.domain ?? (row.domainId ? (0, shell_1.getRepository)(shell_1.Domain).findOneBy({ id: row.domainId }) : undefined);
|
|
13
|
+
}
|
|
14
|
+
async creator(row) {
|
|
15
|
+
return row.creator ?? (row.creatorId ? (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: row.creatorId }) : undefined);
|
|
16
|
+
}
|
|
17
|
+
async updater(row) {
|
|
18
|
+
return row.updater ?? (row.updaterId ? (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: row.updaterId }) : undefined);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.InvoiceItemQuery = InvoiceItemQuery;
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain, { nullable: true }),
|
|
24
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
25
|
+
tslib_1.__metadata("design:type", Function),
|
|
26
|
+
tslib_1.__metadata("design:paramtypes", [invoice_item_1.InvoiceItem]),
|
|
27
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
28
|
+
], InvoiceItemQuery.prototype, "domain", null);
|
|
29
|
+
tslib_1.__decorate([
|
|
30
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { nullable: true }),
|
|
31
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
32
|
+
tslib_1.__metadata("design:type", Function),
|
|
33
|
+
tslib_1.__metadata("design:paramtypes", [invoice_item_1.InvoiceItem]),
|
|
34
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
35
|
+
], InvoiceItemQuery.prototype, "creator", null);
|
|
36
|
+
tslib_1.__decorate([
|
|
37
|
+
(0, type_graphql_1.FieldResolver)(type => auth_base_1.User, { nullable: true }),
|
|
38
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
39
|
+
tslib_1.__metadata("design:type", Function),
|
|
40
|
+
tslib_1.__metadata("design:paramtypes", [invoice_item_1.InvoiceItem]),
|
|
41
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
42
|
+
], InvoiceItemQuery.prototype, "updater", null);
|
|
43
|
+
exports.InvoiceItemQuery = InvoiceItemQuery = tslib_1.__decorate([
|
|
44
|
+
(0, type_graphql_1.UseMiddleware)(shell_2.SpeakRefusals),
|
|
45
|
+
(0, type_graphql_1.Resolver)(invoice_item_1.InvoiceItem)
|
|
46
|
+
], InvoiceItemQuery);
|
|
47
|
+
//# sourceMappingURL=invoice-item-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice-item-query.js","sourceRoot":"","sources":["../../../server/service/invoice-item/invoice-item-query.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD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AAE,CAAA;;6CAAM,0BAAW;;+CAErC;AAEK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjC,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAM,0BAAW;;+CAErC;2BAZU,gBAAgB;IAF5B,IAAA,4BAAa,EAAC,qBAAa,CAAC;IAC5B,IAAA,uBAAQ,EAAC,0BAAW,CAAC;GACT,gBAAgB,CAa5B","sourcesContent":["import { User } from '@things-factory/auth-base'\nimport { Domain, getRepository } from '@things-factory/shell'\nimport { SpeakRefusals } from '@things-factory/shell'\nimport { FieldResolver, Resolver, Root, UseMiddleware } from 'type-graphql'\nimport { InvoiceItem } from './invoice-item'\n@UseMiddleware(SpeakRefusals)\n@Resolver(InvoiceItem)\nexport class InvoiceItemQuery {\n @FieldResolver(type => Domain, { nullable: true })\n async domain(@Root() row: InvoiceItem) {\n return row.domain ?? (row.domainId ? getRepository(Domain).findOneBy({ id: row.domainId }) : undefined)\n }\n @FieldResolver(type => User, { nullable: true })\n async creator(@Root() row: InvoiceItem) {\n return row.creator ?? (row.creatorId ? getRepository(User).findOneBy({ id: row.creatorId }) : undefined)\n }\n @FieldResolver(type => User, { nullable: true })\n async updater(@Root() row: InvoiceItem) {\n return row.updater ?? (row.updaterId ? getRepository(User).findOneBy({ id: row.updaterId }) : undefined)\n }\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { User } from '@things-factory/auth-base';
|
|
2
|
+
import { Domain } from '@things-factory/shell';
|
|
3
|
+
import { CommercialLine } from '../invoice/commercial-document';
|
|
4
|
+
import { Invoice } from '../invoice/invoice';
|
|
5
|
+
export declare class InvoiceItem extends CommercialLine {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
domain?: Domain;
|
|
8
|
+
domainId?: string;
|
|
9
|
+
invoice: Invoice;
|
|
10
|
+
invoiceId: string;
|
|
11
|
+
receivedTaxAmount?: number;
|
|
12
|
+
createdAt?: Date;
|
|
13
|
+
updatedAt?: Date;
|
|
14
|
+
deletedAt?: Date;
|
|
15
|
+
creator?: User;
|
|
16
|
+
creatorId?: string;
|
|
17
|
+
updater?: User;
|
|
18
|
+
updaterId?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvoiceItem = 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 commercial_document_1 = require("../invoice/commercial-document");
|
|
10
|
+
const invoice_1 = require("../invoice/invoice");
|
|
11
|
+
let InvoiceItem = class InvoiceItem extends commercial_document_1.CommercialLine {
|
|
12
|
+
};
|
|
13
|
+
exports.InvoiceItem = InvoiceItem;
|
|
14
|
+
tslib_1.__decorate([
|
|
15
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
16
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
17
|
+
tslib_1.__metadata("design:type", String)
|
|
18
|
+
], InvoiceItem.prototype, "id", void 0);
|
|
19
|
+
tslib_1.__decorate([
|
|
20
|
+
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
21
|
+
(0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true }),
|
|
22
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
23
|
+
], InvoiceItem.prototype, "domain", void 0);
|
|
24
|
+
tslib_1.__decorate([
|
|
25
|
+
(0, typeorm_1.RelationId)((item) => item.domain),
|
|
26
|
+
tslib_1.__metadata("design:type", String)
|
|
27
|
+
], InvoiceItem.prototype, "domainId", void 0);
|
|
28
|
+
tslib_1.__decorate([
|
|
29
|
+
(0, typeorm_1.ManyToOne)(type => invoice_1.Invoice, invoice => invoice.items, { nullable: false, onDelete: 'CASCADE' }),
|
|
30
|
+
tslib_1.__metadata("design:type", invoice_1.Invoice)
|
|
31
|
+
], InvoiceItem.prototype, "invoice", void 0);
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
(0, typeorm_1.RelationId)((item) => item.invoice),
|
|
34
|
+
(0, type_graphql_1.Field)({ description: 'The invoice the line belongs to' }),
|
|
35
|
+
tslib_1.__metadata("design:type", String)
|
|
36
|
+
], InvoiceItem.prototype, "invoiceId", void 0);
|
|
37
|
+
tslib_1.__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ ...(0, shell_1.moneyColumn)({ scale: 4 }), nullable: true }),
|
|
39
|
+
(0, type_graphql_1.Field)(type => type_graphql_1.Float, { nullable: true, description: 'Tax the sender printed on the line, kept as received; empty on invoices the domain writes' }),
|
|
40
|
+
tslib_1.__metadata("design:type", Number)
|
|
41
|
+
], InvoiceItem.prototype, "receivedTaxAmount", void 0);
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
44
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When the line was written' }),
|
|
45
|
+
tslib_1.__metadata("design:type", Date)
|
|
46
|
+
], InvoiceItem.prototype, "createdAt", void 0);
|
|
47
|
+
tslib_1.__decorate([
|
|
48
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
49
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When the line last changed' }),
|
|
50
|
+
tslib_1.__metadata("design:type", Date)
|
|
51
|
+
], InvoiceItem.prototype, "updatedAt", void 0);
|
|
52
|
+
tslib_1.__decorate([
|
|
53
|
+
(0, typeorm_1.DeleteDateColumn)(),
|
|
54
|
+
(0, type_graphql_1.Field)({ nullable: true, description: 'When the line was removed' }),
|
|
55
|
+
tslib_1.__metadata("design:type", Date)
|
|
56
|
+
], InvoiceItem.prototype, "deletedAt", void 0);
|
|
57
|
+
tslib_1.__decorate([
|
|
58
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
59
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
60
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
61
|
+
], InvoiceItem.prototype, "creator", void 0);
|
|
62
|
+
tslib_1.__decorate([
|
|
63
|
+
(0, typeorm_1.RelationId)((item) => item.creator),
|
|
64
|
+
tslib_1.__metadata("design:type", String)
|
|
65
|
+
], InvoiceItem.prototype, "creatorId", void 0);
|
|
66
|
+
tslib_1.__decorate([
|
|
67
|
+
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
68
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
69
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
70
|
+
], InvoiceItem.prototype, "updater", void 0);
|
|
71
|
+
tslib_1.__decorate([
|
|
72
|
+
(0, typeorm_1.RelationId)((item) => item.updater),
|
|
73
|
+
tslib_1.__metadata("design:type", String)
|
|
74
|
+
], InvoiceItem.prototype, "updaterId", void 0);
|
|
75
|
+
exports.InvoiceItem = InvoiceItem = tslib_1.__decorate([
|
|
76
|
+
(0, typeorm_1.Entity)(),
|
|
77
|
+
(0, typeorm_1.Index)('ix_invoice_item_0', (item) => [item.invoice, item.position]),
|
|
78
|
+
(0, type_graphql_1.ObjectType)({ description: 'Entity for InvoiceItem — one line of an invoice' })
|
|
79
|
+
], InvoiceItem);
|
|
80
|
+
//# sourceMappingURL=invoice-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoice-item.js","sourceRoot":"","sources":["../../../server/service/invoice-item/invoice-item.ts"],"names":[],"mappings":";;;;AAAA,yDAAgD;AAChD,iDAA2D;AAC3D,+CAA2D;AAC3D,qCAAoJ;AAEpJ,wEAA+D;AAC/D,gDAA4C;AAKrC,IAAM,WAAW,GA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Domain, moneyColumn } from '@things-factory/shell'\nimport { Field, Float, ID, ObjectType } from 'type-graphql'\nimport { Column, CreateDateColumn, DeleteDateColumn, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId, UpdateDateColumn } from 'typeorm'\n\nimport { CommercialLine } from '../invoice/commercial-document'\nimport { Invoice } from '../invoice/invoice'\n\n@Entity()\n@Index('ix_invoice_item_0', (item: InvoiceItem) => [item.invoice, item.position])\n@ObjectType({ description: 'Entity for InvoiceItem — one line of an invoice' })\nexport class InvoiceItem extends CommercialLine {\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((item: InvoiceItem) => item.domain)\n domainId?: string\n\n @ManyToOne(type => Invoice, invoice => invoice.items, { nullable: false, onDelete: 'CASCADE' })\n invoice: Invoice\n\n @RelationId((item: InvoiceItem) => item.invoice)\n @Field({ description: 'The invoice the line belongs to' })\n invoiceId: string\n\n @Column({ ...moneyColumn({ scale: 4 }), nullable: true })\n @Field(type => Float, { nullable: true, description: 'Tax the sender printed on the line, kept as received; empty on invoices the domain writes' })\n receivedTaxAmount?: number\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'When the line was written' })\n createdAt?: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'When the line last changed' })\n updatedAt?: Date\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'When the line was removed' })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((item: InvoiceItem) => item.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((item: InvoiceItem) => item.updater)\n updaterId?: string\n}\n"]}
|