@things-factory/sales-base 3.8.28 → 3.8.32

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 (73) hide show
  1. package/dist-server/entities/index.js +6 -3
  2. package/dist-server/entities/index.js.map +1 -1
  3. package/dist-server/entities/invoice-product.js +94 -0
  4. package/dist-server/entities/invoice-product.js.map +1 -0
  5. package/dist-server/entities/invoice.js +163 -24
  6. package/dist-server/entities/invoice.js.map +1 -1
  7. package/dist-server/graphql/resolvers/index.js +3 -0
  8. package/dist-server/graphql/resolvers/index.js.map +1 -1
  9. package/dist-server/graphql/resolvers/invoice/create-invoice.js +17 -2
  10. package/dist-server/graphql/resolvers/invoice/create-invoice.js.map +1 -1
  11. package/dist-server/graphql/resolvers/invoice-product/create-invoice-product.js +12 -0
  12. package/dist-server/graphql/resolvers/invoice-product/create-invoice-product.js.map +1 -0
  13. package/dist-server/graphql/resolvers/invoice-product/delete-invoice-product.js +13 -0
  14. package/dist-server/graphql/resolvers/invoice-product/delete-invoice-product.js.map +1 -0
  15. package/dist-server/graphql/resolvers/invoice-product/delete-invoice-products.js +16 -0
  16. package/dist-server/graphql/resolvers/invoice-product/delete-invoice-products.js.map +1 -0
  17. package/dist-server/graphql/resolvers/invoice-product/index.js +12 -0
  18. package/dist-server/graphql/resolvers/invoice-product/index.js.map +1 -0
  19. package/dist-server/graphql/resolvers/invoice-product/invoice-product-query.js +33 -0
  20. package/dist-server/graphql/resolvers/invoice-product/invoice-product-query.js.map +1 -0
  21. package/dist-server/graphql/resolvers/invoice-product/update-invoice-product.js +16 -0
  22. package/dist-server/graphql/resolvers/invoice-product/update-invoice-product.js.map +1 -0
  23. package/dist-server/graphql/resolvers/invoice-product/update-multiple-invoice-product.js +31 -0
  24. package/dist-server/graphql/resolvers/invoice-product/update-multiple-invoice-product.js.map +1 -0
  25. package/dist-server/graphql/resolvers/release-good/confirm-release-good.js +14 -20
  26. package/dist-server/graphql/resolvers/release-good/confirm-release-good.js.map +1 -1
  27. package/dist-server/graphql/types/index.js +4 -0
  28. package/dist-server/graphql/types/index.js.map +1 -1
  29. package/dist-server/graphql/types/invoice/invoice-patch.js +38 -5
  30. package/dist-server/graphql/types/invoice/invoice-patch.js.map +1 -1
  31. package/dist-server/graphql/types/invoice/invoice.js +38 -4
  32. package/dist-server/graphql/types/invoice/invoice.js.map +1 -1
  33. package/dist-server/graphql/types/invoice/new-invoice.js +42 -8
  34. package/dist-server/graphql/types/invoice/new-invoice.js.map +1 -1
  35. package/dist-server/graphql/types/invoice-product/index.js +21 -0
  36. package/dist-server/graphql/types/invoice-product/index.js.map +1 -0
  37. package/dist-server/graphql/types/invoice-product/invoice-product-list.js +14 -0
  38. package/dist-server/graphql/types/invoice-product/invoice-product-list.js.map +1 -0
  39. package/dist-server/graphql/types/invoice-product/invoice-product-patch.js +21 -0
  40. package/dist-server/graphql/types/invoice-product/invoice-product-patch.js.map +1 -0
  41. package/dist-server/graphql/types/invoice-product/invoice-product.js +27 -0
  42. package/dist-server/graphql/types/invoice-product/invoice-product.js.map +1 -0
  43. package/dist-server/graphql/types/invoice-product/new-invoice-product.js +21 -0
  44. package/dist-server/graphql/types/invoice-product/new-invoice-product.js.map +1 -0
  45. package/dist-server/graphql/types/invoice-product/product-input.js +13 -0
  46. package/dist-server/graphql/types/invoice-product/product-input.js.map +1 -0
  47. package/dist-server/utils/order-no-generator.js +7 -0
  48. package/dist-server/utils/order-no-generator.js.map +1 -1
  49. package/package.json +6 -6
  50. package/server/entities/index.ts +6 -3
  51. package/server/entities/invoice-product.ts +64 -0
  52. package/server/entities/invoice.ts +127 -19
  53. package/server/graphql/resolvers/index.ts +3 -0
  54. package/server/graphql/resolvers/invoice/create-invoice.ts +43 -6
  55. package/server/graphql/resolvers/invoice-product/create-invoice-product.ts +16 -0
  56. package/server/graphql/resolvers/invoice-product/delete-invoice-product.ts +13 -0
  57. package/server/graphql/resolvers/invoice-product/delete-invoice-products.ts +16 -0
  58. package/server/graphql/resolvers/invoice-product/index.ts +18 -0
  59. package/server/graphql/resolvers/invoice-product/invoice-product-query.ts +38 -0
  60. package/server/graphql/resolvers/invoice-product/update-invoice-product.ts +19 -0
  61. package/server/graphql/resolvers/invoice-product/update-multiple-invoice-product.ts +46 -0
  62. package/server/graphql/resolvers/release-good/confirm-release-good.ts +17 -20
  63. package/server/graphql/types/index.ts +4 -0
  64. package/server/graphql/types/invoice/invoice-patch.ts +38 -5
  65. package/server/graphql/types/invoice/invoice.ts +38 -4
  66. package/server/graphql/types/invoice/new-invoice.ts +42 -8
  67. package/server/graphql/types/invoice-product/index.ts +20 -0
  68. package/server/graphql/types/invoice-product/invoice-product-list.ts +8 -0
  69. package/server/graphql/types/invoice-product/invoice-product-patch.ts +15 -0
  70. package/server/graphql/types/invoice-product/invoice-product.ts +21 -0
  71. package/server/graphql/types/invoice-product/new-invoice-product.ts +15 -0
  72. package/server/graphql/types/invoice-product/product-input.ts +7 -0
  73. package/server/utils/order-no-generator.ts +11 -0
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.VasOrder = exports.Vas = exports.TransferOrder = exports.ShippingOrder = exports.ReverseKittingOrder = exports.ReturnOrder = exports.RetailReplenishmentOrder = exports.ReleaseGood = exports.PurchaseOrderOtherCharge = exports.PurchaseOrder = exports.OrderVas = exports.OrderReverseKitting = exports.OrderProduct = exports.OrderInventory = exports.JobSheet = exports.Invoice = exports.InventoryCheck = exports.GoodsReceivalNote = exports.DeliveryOrder = exports.CollectionOrder = exports.ClaimOrder = exports.ClaimDetail = exports.Claim = exports.ArrivalNotice = exports.Manifest = exports.entities = void 0;
4
- const manifest_1 = require("./manifest");
5
- Object.defineProperty(exports, "Manifest", { enumerable: true, get: function () { return manifest_1.Manifest; } });
3
+ exports.VasOrder = exports.Vas = exports.TransferOrder = exports.ShippingOrder = exports.ReverseKittingOrder = exports.ReturnOrder = exports.RetailReplenishmentOrder = exports.ReleaseGood = exports.PurchaseOrderOtherCharge = exports.PurchaseOrder = exports.OrderVas = exports.OrderReverseKitting = exports.OrderProduct = exports.OrderInventory = exports.Manifest = exports.JobSheet = exports.InvoiceProduct = exports.Invoice = exports.InventoryCheck = exports.GoodsReceivalNote = exports.DeliveryOrder = exports.CollectionOrder = exports.ClaimOrder = exports.ClaimDetail = exports.Claim = exports.ArrivalNotice = exports.entities = void 0;
6
4
  const arrival_notice_1 = require("./arrival-notice");
7
5
  Object.defineProperty(exports, "ArrivalNotice", { enumerable: true, get: function () { return arrival_notice_1.ArrivalNotice; } });
8
6
  const claim_1 = require("./claim");
@@ -21,8 +19,12 @@ const inventory_check_1 = require("./inventory-check");
21
19
  Object.defineProperty(exports, "InventoryCheck", { enumerable: true, get: function () { return inventory_check_1.InventoryCheck; } });
22
20
  const invoice_1 = require("./invoice");
23
21
  Object.defineProperty(exports, "Invoice", { enumerable: true, get: function () { return invoice_1.Invoice; } });
22
+ const invoice_product_1 = require("./invoice-product");
23
+ Object.defineProperty(exports, "InvoiceProduct", { enumerable: true, get: function () { return invoice_product_1.InvoiceProduct; } });
24
24
  const job_sheet_1 = require("./job-sheet");
25
25
  Object.defineProperty(exports, "JobSheet", { enumerable: true, get: function () { return job_sheet_1.JobSheet; } });
26
+ const manifest_1 = require("./manifest");
27
+ Object.defineProperty(exports, "Manifest", { enumerable: true, get: function () { return manifest_1.Manifest; } });
26
28
  const order_inventory_1 = require("./order-inventory");
27
29
  Object.defineProperty(exports, "OrderInventory", { enumerable: true, get: function () { return order_inventory_1.OrderInventory; } });
28
30
  const order_product_1 = require("./order-product");
@@ -52,6 +54,7 @@ Object.defineProperty(exports, "Vas", { enumerable: true, get: function () { ret
52
54
  const vas_order_1 = require("./vas-order");
53
55
  Object.defineProperty(exports, "VasOrder", { enumerable: true, get: function () { return vas_order_1.VasOrder; } });
54
56
  exports.entities = [
57
+ invoice_product_1.InvoiceProduct,
55
58
  manifest_1.Manifest,
56
59
  purchase_order_other_charge_1.PurchaseOrderO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C;AAyDpC,yFAzDO,oBAAQ,OAyDP;AAxDV,qDAAgD;AAyD9C,8FAzDO,8BAAa,OAyDP;AAxDf,+EAAwE;AAyDtE,yGAzDO,sDAAwB,OAyDP;AAxD1B,iDAA4C;AAyD1C,4FAzDO,0BAAW,OAyDP;AAxDb,6EAAuE;AAyDrE,yGAzDO,qDAAwB,OAyDP;AAxD1B,iDAA4C;AAyD1C,4FAzDO,0BAAW,OAyDP;AAxDb,mEAA6D;AAyD3D,oGAzDO,2CAAmB,OAyDP;AAxDrB,qDAAgD;AAyD9C,8FAzDO,8BAAa,OAyDP;AAxDf,qDAAgD;AAyD9C,8FAzDO,8BAAa,OAyDP;AAxDf,+BAA2B;AAyDzB,oFAzDO,SAAG,OAyDP;AAxDL,2CAAsC;AAyDpC,yFAzDO,oBAAQ,OAyDP;AAvDG,QAAA,QAAQ,GAAG;IACtB,gCAAc;IACd,mBAAQ;IACR,sDAAwB;IACxB,8BAAa;IACb,4BAAY;IACZ,oBAAQ;IACR,gCAAc;IACd,iBAAO;IACP,gCAAc;IACd,oBAAQ;IACR,8BAAa;IACb,8BAAa;IACb,kCAAe;IACf,8BAAa;IACb,0BAAW;IACX,SAAG;IACH,aAAK;IACL,0BAAW;IACX,wBAAU;IACV,oBAAQ;IACR,uCAAiB;IACjB,qDAAwB;IACxB,8BAAa;IACb,0BAAW;IACX,2CAAmB;IACnB,2CAAmB;CACpB,CAAA"}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var _a, _b, _c, _d;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.InvoiceProduct = void 0;
14
+ const typeorm_1 = require("typeorm");
15
+ const auth_base_1 = require("@things-factory/auth-base");
16
+ const product_base_1 = require("@things-factory/product-base");
17
+ const shell_1 = require("@things-factory/shell");
18
+ const invoice_1 = require("./invoice");
19
+ let InvoiceProduct = class InvoiceProduct {
20
+ };
21
+ __decorate([
22
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
23
+ __metadata("design:type", String)
24
+ ], InvoiceProduct.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
27
+ __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
28
+ ], InvoiceProduct.prototype, "domain", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.Column)({ nullable: true }),
31
+ __metadata("design:type", String)
32
+ ], InvoiceProduct.prototype, "sku", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.Column)(),
35
+ __metadata("design:type", String)
36
+ ], InvoiceProduct.prototype, "name", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)({
39
+ nullable: true
40
+ }),
41
+ __metadata("design:type", String)
42
+ ], InvoiceProduct.prototype, "description", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.ManyToOne)(type => invoice_1.Invoice),
45
+ __metadata("design:type", invoice_1.Invoice)
46
+ ], InvoiceProduct.prototype, "invoice", void 0);
47
+ __decorate([
48
+ (0, typeorm_1.ManyToOne)(type => product_base_1.Product, { nullable: true }),
49
+ __metadata("design:type", typeof (_b = typeof product_base_1.Product !== "undefined" && product_base_1.Product) === "function" ? _b : Object)
50
+ ], InvoiceProduct.prototype, "product", void 0);
51
+ __decorate([
52
+ (0, typeorm_1.Column)('int', { default: 0 }),
53
+ __metadata("design:type", Number)
54
+ ], InvoiceProduct.prototype, "qty", void 0);
55
+ __decorate([
56
+ (0, typeorm_1.Column)('float', { default: 0 }),
57
+ __metadata("design:type", Number)
58
+ ], InvoiceProduct.prototype, "otherCharges", void 0);
59
+ __decorate([
60
+ (0, typeorm_1.Column)('float', { default: 0 }),
61
+ __metadata("design:type", Number)
62
+ ], InvoiceProduct.prototype, "unitPrice", void 0);
63
+ __decorate([
64
+ (0, typeorm_1.Column)('float', { default: 0 }),
65
+ __metadata("design:type", Number)
66
+ ], InvoiceProduct.prototype, "paidPrice", void 0);
67
+ __decorate([
68
+ (0, typeorm_1.CreateDateColumn)(),
69
+ __metadata("design:type", Date)
70
+ ], InvoiceProduct.prototype, "createdAt", void 0);
71
+ __decorate([
72
+ (0, typeorm_1.UpdateDateColumn)(),
73
+ __metadata("design:type", Date)
74
+ ], InvoiceProduct.prototype, "updatedAt", void 0);
75
+ __decorate([
76
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
77
+ nullable: true
78
+ }),
79
+ __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
80
+ ], InvoiceProduct.prototype, "creator", void 0);
81
+ __decorate([
82
+ (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
83
+ nullable: true
84
+ }),
85
+ __metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
86
+ ], InvoiceProduct.prototype, "updater", void 0);
87
+ InvoiceProduct = __decorate([
88
+ (0, typeorm_1.Entity)(),
89
+ (0, typeorm_1.Index)('ix_invoice_product_0', (invoiceProduct) => [invoiceProduct.id], {
90
+ unique: true
91
+ })
92
+ ], InvoiceProduct);
93
+ exports.InvoiceProduct = InvoiceProduct;
94
+ //# sourceMappingURL=invoice-product.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoice-product.js","sourceRoot":"","sources":["../../server/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CAAC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;kDACO,gBAAI,oBAAJ,gBAAI;+CAAA;AAKb;IAHC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;kDACO,gBAAI,oBAAJ,gBAAI;+CAAA;AAlDF,cAAc;IAJ1B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,sBAAsB,EAAE,CAAC,cAA8B,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE;QACtF,MAAM,EAAE,IAAI;KACb,CAAC;GACW,cAAc,CAmD1B;AAnDY,wCAAc"}
@@ -8,14 +8,14 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
- var _a, _b, _c, _d;
11
+ var _a, _b, _c;
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.Invoice = void 0;
14
+ const typeorm_1 = require("typeorm");
14
15
  const auth_base_1 = require("@things-factory/auth-base");
15
- const biz_base_1 = require("@things-factory/biz-base");
16
16
  const shell_1 = require("@things-factory/shell");
17
- const typeorm_1 = require("typeorm");
18
- const purchase_order_1 = require("./purchase-order");
17
+ const entities_1 = require("../entities");
18
+ const invoice_product_1 = require("./invoice-product");
19
19
  let Invoice = class Invoice {
20
20
  };
21
21
  __decorate([
@@ -31,47 +31,186 @@ __decorate([
31
31
  __metadata("design:type", String)
32
32
  ], Invoice.prototype, "name", void 0);
33
33
  __decorate([
34
- (0, typeorm_1.ManyToOne)(type => biz_base_1.Bizplace),
35
- __metadata("design:type", typeof (_b = typeof biz_base_1.Bizplace !== "undefined" && biz_base_1.Bizplace) === "function" ? _b : Object)
36
- ], Invoice.prototype, "customer", void 0);
34
+ (0, typeorm_1.Column)({
35
+ nullable: true
36
+ }),
37
+ __metadata("design:type", String)
38
+ ], Invoice.prototype, "description", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.OneToMany)(type => invoice_product_1.InvoiceProduct, invoiceProduct => invoiceProduct.invoice),
41
+ __metadata("design:type", Array)
42
+ ], Invoice.prototype, "invoiceProducts", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.OneToOne)(type => entities_1.ReleaseGood, { nullable: true }),
45
+ (0, typeorm_1.JoinColumn)(),
46
+ __metadata("design:type", entities_1.ReleaseGood)
47
+ ], Invoice.prototype, "releaseGood", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.Column)({ default: '' }),
50
+ __metadata("design:type", String)
51
+ ], Invoice.prototype, "refNo1", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)({ default: '' }),
54
+ __metadata("design:type", String)
55
+ ], Invoice.prototype, "refNo2", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.Column)({ default: '' }),
58
+ __metadata("design:type", String)
59
+ ], Invoice.prototype, "refNo3", void 0);
37
60
  __decorate([
38
- (0, typeorm_1.Column)('date'),
61
+ (0, typeorm_1.Column)({ nullable: true }),
39
62
  __metadata("design:type", Date)
40
63
  ], Invoice.prototype, "issuedOn", void 0);
41
64
  __decorate([
42
- (0, typeorm_1.Column)('date'),
43
- __metadata("design:type", Date)
44
- ], Invoice.prototype, "paymentDue", void 0);
65
+ (0, typeorm_1.Column)({
66
+ type: 'uuid',
67
+ nullable: true
68
+ }),
69
+ __metadata("design:type", String)
70
+ ], Invoice.prototype, "contactPointRefId", void 0);
45
71
  __decorate([
46
72
  (0, typeorm_1.Column)(),
47
73
  __metadata("design:type", String)
48
- ], Invoice.prototype, "version", void 0);
74
+ ], Invoice.prototype, "from", void 0);
49
75
  __decorate([
50
- (0, typeorm_1.OneToOne)(type => purchase_order_1.PurchaseOrder),
51
- (0, typeorm_1.JoinColumn)(),
52
- __metadata("design:type", purchase_order_1.PurchaseOrder)
53
- ], Invoice.prototype, "purchaseOrder", void 0);
76
+ (0, typeorm_1.Column)(),
77
+ __metadata("design:type", String)
78
+ ], Invoice.prototype, "fromContactPhone", void 0);
79
+ __decorate([
80
+ (0, typeorm_1.Column)({ nullable: true }),
81
+ __metadata("design:type", String)
82
+ ], Invoice.prototype, "fromAddress1", void 0);
83
+ __decorate([
84
+ (0, typeorm_1.Column)({ nullable: true }),
85
+ __metadata("design:type", String)
86
+ ], Invoice.prototype, "fromAddress2", void 0);
87
+ __decorate([
88
+ (0, typeorm_1.Column)({ nullable: true }),
89
+ __metadata("design:type", String)
90
+ ], Invoice.prototype, "fromAddress3", void 0);
91
+ __decorate([
92
+ (0, typeorm_1.Column)({ nullable: true }),
93
+ __metadata("design:type", String)
94
+ ], Invoice.prototype, "fromAddress4", void 0);
95
+ __decorate([
96
+ (0, typeorm_1.Column)({ nullable: true }),
97
+ __metadata("design:type", String)
98
+ ], Invoice.prototype, "fromAddress5", void 0);
99
+ __decorate([
100
+ (0, typeorm_1.Column)({ nullable: true }),
101
+ __metadata("design:type", String)
102
+ ], Invoice.prototype, "fromPostcode", void 0);
103
+ __decorate([
104
+ (0, typeorm_1.Column)({ nullable: true }),
105
+ __metadata("design:type", String)
106
+ ], Invoice.prototype, "fromCity", void 0);
107
+ __decorate([
108
+ (0, typeorm_1.Column)({ nullable: true }),
109
+ __metadata("design:type", String)
110
+ ], Invoice.prototype, "fromState", void 0);
111
+ __decorate([
112
+ (0, typeorm_1.Column)({ nullable: true }),
113
+ __metadata("design:type", String)
114
+ ], Invoice.prototype, "fromCountry", void 0);
54
115
  __decorate([
55
116
  (0, typeorm_1.Column)(),
56
117
  __metadata("design:type", String)
57
- ], Invoice.prototype, "state", void 0);
118
+ ], Invoice.prototype, "deliverTo", void 0);
58
119
  __decorate([
59
- (0, typeorm_1.Column)({
60
- nullable: true
61
- }),
120
+ (0, typeorm_1.Column)(),
62
121
  __metadata("design:type", String)
63
- ], Invoice.prototype, "description", void 0);
122
+ ], Invoice.prototype, "deliverToPhone", void 0);
123
+ __decorate([
124
+ (0, typeorm_1.Column)(),
125
+ __metadata("design:type", String)
126
+ ], Invoice.prototype, "deliveryAddress1", void 0);
127
+ __decorate([
128
+ (0, typeorm_1.Column)({ nullable: true }),
129
+ __metadata("design:type", String)
130
+ ], Invoice.prototype, "deliveryAddress2", void 0);
131
+ __decorate([
132
+ (0, typeorm_1.Column)({ nullable: true }),
133
+ __metadata("design:type", String)
134
+ ], Invoice.prototype, "deliveryAddress3", void 0);
135
+ __decorate([
136
+ (0, typeorm_1.Column)({ nullable: true }),
137
+ __metadata("design:type", String)
138
+ ], Invoice.prototype, "deliveryAddress4", void 0);
139
+ __decorate([
140
+ (0, typeorm_1.Column)({ nullable: true }),
141
+ __metadata("design:type", String)
142
+ ], Invoice.prototype, "deliveryAddress5", void 0);
143
+ __decorate([
144
+ (0, typeorm_1.Column)(),
145
+ __metadata("design:type", String)
146
+ ], Invoice.prototype, "deliveryPostcode", void 0);
147
+ __decorate([
148
+ (0, typeorm_1.Column)(),
149
+ __metadata("design:type", String)
150
+ ], Invoice.prototype, "deliveryCity", void 0);
151
+ __decorate([
152
+ (0, typeorm_1.Column)(),
153
+ __metadata("design:type", String)
154
+ ], Invoice.prototype, "deliveryState", void 0);
155
+ __decorate([
156
+ (0, typeorm_1.Column)(),
157
+ __metadata("design:type", String)
158
+ ], Invoice.prototype, "deliveryCountry", void 0);
159
+ __decorate([
160
+ (0, typeorm_1.Column)(),
161
+ __metadata("design:type", String)
162
+ ], Invoice.prototype, "billTo", void 0);
163
+ __decorate([
164
+ (0, typeorm_1.Column)(),
165
+ __metadata("design:type", String)
166
+ ], Invoice.prototype, "billToPhone", void 0);
167
+ __decorate([
168
+ (0, typeorm_1.Column)(),
169
+ __metadata("design:type", String)
170
+ ], Invoice.prototype, "billingAddress1", void 0);
171
+ __decorate([
172
+ (0, typeorm_1.Column)({ nullable: true }),
173
+ __metadata("design:type", String)
174
+ ], Invoice.prototype, "billingAddress2", void 0);
175
+ __decorate([
176
+ (0, typeorm_1.Column)({ nullable: true }),
177
+ __metadata("design:type", String)
178
+ ], Invoice.prototype, "billingAddress3", void 0);
179
+ __decorate([
180
+ (0, typeorm_1.Column)({ nullable: true }),
181
+ __metadata("design:type", String)
182
+ ], Invoice.prototype, "billingAddress4", void 0);
183
+ __decorate([
184
+ (0, typeorm_1.Column)({ nullable: true }),
185
+ __metadata("design:type", String)
186
+ ], Invoice.prototype, "billingAddress5", void 0);
187
+ __decorate([
188
+ (0, typeorm_1.Column)(),
189
+ __metadata("design:type", String)
190
+ ], Invoice.prototype, "billingPostcode", void 0);
191
+ __decorate([
192
+ (0, typeorm_1.Column)(),
193
+ __metadata("design:type", String)
194
+ ], Invoice.prototype, "billingCity", void 0);
195
+ __decorate([
196
+ (0, typeorm_1.Column)(),
197
+ __metadata("design:type", String)
198
+ ], Invoice.prototype, "billingState", void 0);
199
+ __decorate([
200
+ (0, typeorm_1.Column)(),
201
+ __metadata("design:type", String)
202
+ ], Invoice.prototype, "billingCountry", void 0);
64
203
  __decorate([
65
204
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
66
205
  nullable: true
67
206
  }),
68
- __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
207
+ __metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
69
208
  ], Invoice.prototype, "creator", void 0);
70
209
  __decorate([
71
210
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
72
211
  nullable: true
73
212
  }),
74
- __metadata("design:type", typeof (_d = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _d : Object)
213
+ __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
75
214
  ], Invoice.prototype, "updater", void 0);
76
215
  __decorate([
77
216
  (0, typeorm_1.CreateDateColumn)(),
@@ -83,7 +222,7 @@ __decorate([
83
222
  ], Invoice.prototype, "updatedAt", void 0);
84
223
  Invoice = __decorate([
85
224
  (0, typeorm_1.Entity)(),
86
- (0, typeorm_1.Index)('ix_invoice_0', (invoice) => [invoice.domain, invoice.name, invoice.customer])
225
+ (0, typeorm_1.Index)('ix_invoice_0', (invoice) => [invoice.id], { unique: true })
87
226
  ], Invoice);
88
227
  exports.Invoice = Invoice;
89
228
  //# sourceMappingURL=invoice.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"invoice.js","sourceRoot":"","sources":["../../server/entities/invoice.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yDAAgD;AAChD,uDAAmD;AACnD,iDAA8C;AAC9C,qCAUgB;AAChB,qDAAgD;AAIhD,IAAa,OAAO,GAApB,MAAa,OAAO;CAiDnB,CAAA;AA/CC;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;mCACrB;AAGV;IADC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;kDAClB,cAAM,oBAAN,cAAM;uCAAA;AAGd;IADC,IAAA,gBAAM,GAAE;;qCACG;AAGZ;IADC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAQ,CAAC;kDAClB,mBAAQ,oBAAR,mBAAQ;yCAAA;AAGlB;IADC,IAAA,gBAAM,EAAC,MAAM,CAAC;8BACL,IAAI;yCAAA;AAGd;IADC,IAAA,gBAAM,EAAC,MAAM,CAAC;8BACH,IAAI;2CAAA;AAGhB;IADC,IAAA,gBAAM,GAAE;;wCACM;AAIf;IAFC,IAAA,kBAAQ,EAAC,IAAI,CAAC,EAAE,CAAC,8BAAa,CAAC;IAC/B,IAAA,oBAAU,GAAE;8BACE,8BAAa;8CAAA;AAG5B;IADC,IAAA,gBAAM,GAAE;;sCACI;AAKb;IAHC,IAAA,gBAAM,EAAC;QACN,QAAQ,EAAE,IAAI;KACf,CAAC;;4CACiB;AAKnB;IAHC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gB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AE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;kDACO,gBAAI,oBAAJ,gBAAI;wCAAA;AAKb;IAHC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;kDACO,gBAAI,oBAAJ,gBAAI;wCAAA;AAGb;IADC,IAAA,0BAAgB,GAAE;8BACR,IAAI;0CAAA;AAGf;IADC,IAAA,0BAAgB,GAAE;8BACR,IAAI;0CAAA;AAzJJ,OAAO;IAFnB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,cAAc,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GAC/D,OAAO,CA0JnB;AA1JY,0BAAO"}
@@ -29,6 +29,7 @@ const DeliveryOrder = __importStar(require("./delivery-order"));
29
29
  const GoodsReceivalNote = __importStar(require("./goods-receival-note"));
30
30
  const InventoryCheck = __importStar(require("./inventory-check"));
31
31
  const Invoice = __importStar(require("./invoice"));
32
+ const InvoiceProduct = __importStar(require("./invoice-product"));
32
33
  const JobSheet = __importStar(require("./job-sheet"));
33
34
  const Manifest = __importStar(require("./manifest"));
34
35
  const OrderInventory = __importStar(require("./order-inventory"));
@@ -48,6 +49,7 @@ const Vas = __importStar(require("./vas"));
48
49
  const VasOrder = __importStar(require("./vas-order"));
49
50
  exports.queries = [
50
51
  Invoice.Query,
52
+ InvoiceProduct.Query,
51
53
  InventoryCheck.Query,
52
54
  JobSheet.Query,
53
55
  PurchaseOrder.Query,
@@ -75,6 +77,7 @@ exports.queries = [
75
77
  ];
76
78
  exports.mutations = [
77
79
  Invoice.Mutation,
80
+ InvoiceProduct.Mutation,
78
81
  JobSheet.Mutation,
79
82
  InventoryCheck.Mutation,
80
83
  PurchaseOrder.Mutation,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../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,QAAQ;CAClB,CAAA"}
@@ -1,11 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createInvoice = void 0;
3
+ exports.addInvoiceProducts = exports.createInvoice = void 0;
4
+ const typeorm_1 = require("typeorm");
5
+ const product_base_1 = require("@things-factory/product-base");
4
6
  const entities_1 = require("../../../entities");
7
+ const utils_1 = require("../../../utils");
5
8
  exports.createInvoice = {
6
9
  async createInvoice(_, { invoice }, context) {
7
10
  const { tx, domain, user } = context.state;
8
- return await tx.getRepository(entities_1.Invoice).save(Object.assign(Object.assign({ domain }, invoice), { creator: user, updater: user }));
11
+ let invoiceProducts = invoice.invoiceProducts;
12
+ let createdInvoice = await tx.getRepository(entities_1.Invoice).save(Object.assign(Object.assign({}, invoice), { domain, name: utils_1.OrderNoGenerator.invoice(), releaseGood: await tx.getRepository(entities_1.ReleaseGood).findOne(invoice === null || invoice === void 0 ? void 0 : invoice.releaseGood.id), creator: user }));
13
+ await addInvoiceProducts(domain, createdInvoice, invoiceProducts, user, tx);
14
+ return createdInvoice;
9
15
  }
10
16
  };
17
+ async function addInvoiceProducts(domain, invoice, invoiceProducts, user, tx) {
18
+ const productRepo = (tx === null || tx === void 0 ? void 0 : tx.getRepository(product_base_1.Product)) || (0, typeorm_1.getRepository)(product_base_1.Product);
19
+ const invoiceProductRepo = (tx === null || tx === void 0 ? void 0 : tx.getRepository(entities_1.InvoiceProduct)) || (0, typeorm_1.getRepository)(entities_1.InvoiceProduct);
20
+ const createdInvoiceProducts = await Promise.all(invoiceProducts.map(async (invoiceProduct) => {
21
+ return Object.assign(Object.assign({ name: utils_1.OrderNoGenerator.invoiceProduct() }, invoiceProduct), { domain, product: await productRepo.findOne(invoiceProduct === null || invoiceProduct === void 0 ? void 0 : invoiceProduct.product.id), invoice, creator: user });
22
+ }));
23
+ await invoiceProductRepo.save(createdInvoiceProducts);
24
+ }
25
+ exports.addInvoiceProducts = addInvoiceProducts;
11
26
  //# sourceMappingURL=create-invoice.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-invoice.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/invoice/create-invoice.ts"],"names":[],"mappings":";;;AAGA,gDAA2C;AAE9B,QAAA,aAAa,GAAG;IAC3B,KAAK,CAAC,aAAa,CAAC,CAAM,EAAE,EAAE,OAAO,EAAE,EAAE,OAAY;QACnD,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;QAE7F,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,kBAAO,CAAC,CAAC,IAAI,+BACzC,MAAM,IACH,OAAO,KACV,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;CACF,CAAA"}
1
+ {"version":3,"file":"create-invoice.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/invoice/create-invoice.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAGlE,+DAAsD;AAGtD,gDAAwE;AACxE,0CAAiD;AAEpC,QAAA,aAAa,GAAG;IAC3B,KAAK,CAAC,aAAa,CAAC,CAAM,EAAE,EAAE,OAAO,EAAE,EAAE,OAAY;QACnD,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAsD,OAAO,CAAC,KAAK,CAAA;QAC7F,IAAI,eAAe,GAAqB,OAAO,CAAC,eAAe,CAAA;QAE/D,IAAI,cAAc,GAAY,MAAM,EAAE,CAAC,aAAa,CAAC,kBAAO,CAAC,CAAC,IAAI,iCAC7D,OAAO,KACV,MAAM,EACN,IAAI,EAAE,wBAAgB,CAAC,OAAO,EAAE,EAChC,WAAW,EAAE,MAAM,EAAE,CAAC,aAAa,CAAC,sBAAW,CAAC,CAAC,OAAO,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,CAAC,EAAE,CAAC,EACjF,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,MAAM,kBAAkB,CAAC,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;QAE3E,OAAO,cAAc,CAAA;IACvB,CAAC;CACF,CAAA;AAEM,KAAK,UAAU,kBAAkB,CACtC,MAAc,EACd,OAAgB,EAChB,eAAsB,EACtB,IAAU,EACV,EAAkB;IAElB,MAAM,WAAW,GAAwB,CAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,aAAa,CAAC,sBAAO,CAAC,KAAI,IAAA,uBAAa,EAAC,sBAAO,CAAC,CAAA;IAC7F,MAAM,kBAAkB,GACtB,CAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,aAAa,CAAC,yBAAc,CAAC,KAAI,IAAA,uBAAa,EAAC,yBAAc,CAAC,CAAA;IAEpE,MAAM,sBAAsB,GAAqB,MAAM,OAAO,CAAC,GAAG,CAChE,eAAe,CAAC,GAAG,CAAC,KAAK,EAAE,cAA8B,EAAE,EAAE;QAC3D,qCACE,IAAI,EAAE,wBAAgB,CAAC,cAAc,EAAE,IACpC,cAAc,KACjB,MAAM,EACN,OAAO,EAAE,MAAM,WAAW,CAAC,OAAO,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,OAAO,CAAC,EAAE,CAAC,EAC9D,OAAO,EACP,OAAO,EAAE,IAAI,IACd;IACH,CAAC,CAAC,CACH,CAAA;IAED,MAAM,kBAAkB,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAA;AACvD,CAAC;AAzBD,gDAyBC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createInvoiceProduct = void 0;
4
+ const typeorm_1 = require("typeorm");
5
+ const entities_1 = require("../../../entities");
6
+ exports.createInvoiceProduct = {
7
+ async createInvoiceProduct(_, { invoiceProduct }, context) {
8
+ const { domain, user } = context.state;
9
+ return await (0, typeorm_1.getRepository)(entities_1.InvoiceProduct).save(Object.assign(Object.assign({}, invoiceProduct), { domain, creator: user, updater: user }));
10
+ }
11
+ };
12
+ //# sourceMappingURL=create-invoice-product.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-invoice-product.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/invoice-product/create-invoice-product.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,gDAAkD;AAErC,QAAA,oBAAoB,GAAG;IAClC,KAAK,CAAC,oBAAoB,CAAC,CAAM,EAAE,EAAE,cAAc,EAAE,EAAE,OAAY;QACjE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEtC,OAAO,MAAM,IAAA,uBAAa,EAAC,yBAAc,CAAC,CAAC,IAAI,iCAC1C,cAAc,KACjB,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;CACF,CAAA"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteInvoiceProduct = void 0;
4
+ const typeorm_1 = require("typeorm");
5
+ const entities_1 = require("../../../entities");
6
+ exports.deleteInvoiceProduct = {
7
+ async deleteInvoiceProduct(_, { name }, context) {
8
+ const { domain, user } = context.state;
9
+ await (0, typeorm_1.getRepository)(entities_1.InvoiceProduct).delete({ domain, name });
10
+ return true;
11
+ }
12
+ };
13
+ //# sourceMappingURL=delete-invoice-product.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-invoice-product.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/invoice-product/delete-invoice-product.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,gDAAkD;AAErC,QAAA,oBAAoB,GAAG;IAClC,KAAK,CAAC,oBAAoB,CAAC,CAAM,EAAE,EAAE,IAAI,EAAE,EAAE,OAAY;QACvD,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEtC,MAAM,IAAA,uBAAa,EAAC,yBAAc,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;QAE5D,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteInvoiceProducts = void 0;
4
+ const typeorm_1 = require("typeorm");
5
+ const entities_1 = require("../../../entities");
6
+ exports.deleteInvoiceProducts = {
7
+ async deleteInvoiceProducts(_, { names }, context) {
8
+ const { domain, user } = context.state;
9
+ await (0, typeorm_1.getRepository)(entities_1.InvoiceProduct).delete({
10
+ domain,
11
+ name: (0, typeorm_1.In)(names)
12
+ });
13
+ return true;
14
+ }
15
+ };
16
+ //# sourceMappingURL=delete-invoice-products.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-invoice-products.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/invoice-product/delete-invoice-products.ts"],"names":[],"mappings":";;;AAAA,qCAA2C;AAC3C,gDAAkD;AAErC,QAAA,qBAAqB,GAAG;IACnC,KAAK,CAAC,qBAAqB,CAAC,CAAM,EAAE,EAAE,KAAK,EAAE,EAAE,OAAY;QACzD,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEtC,MAAM,IAAA,uBAAa,EAAC,yBAAc,CAAC,CAAC,MAAM,CAAC;YACvC,MAAM;YACN,IAAI,EAAE,IAAA,YAAE,EAAC,KAAK,CAAC;SAClB,CAAC,CAAA;QAEF,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Mutation = exports.Query = void 0;
4
+ const create_invoice_product_1 = require("./create-invoice-product");
5
+ const delete_invoice_product_1 = require("./delete-invoice-product");
6
+ const delete_invoice_products_1 = require("./delete-invoice-products");
7
+ const invoice_product_query_1 = require("./invoice-product-query");
8
+ const update_invoice_product_1 = require("./update-invoice-product");
9
+ const update_multiple_invoice_product_1 = require("./update-multiple-invoice-product");
10
+ exports.Query = Object.assign({}, invoice_product_query_1.Query);
11
+ exports.Mutation = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, update_invoice_product_1.updateInvoiceProduct), update_multiple_invoice_product_1.updateMultipleInvoiceProduct), create_invoice_product_1.createInvoiceProduct), delete_invoice_product_1.deleteInvoiceProduct), delete_invoice_products_1.deleteInvoiceProducts);
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/invoice-product/index.ts"],"names":[],"mappings":";;;AAAA,qEAA+D;AAC/D,qEAA+D;AAC/D,uEAAiE;AACjE,mEAAsE;AACtE,qEAA+D;AAC/D,uFAAgF;AAEnE,QAAA,KAAK,qBACb,6BAAmB,EACvB;AAEY,QAAA,QAAQ,6EAChB,6CAAoB,GACpB,8DAA4B,GAC5B,6CAAoB,GACpB,6CAAoB,GACpB,+CAAqB,EACzB"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvoiceProduct = exports.Query = void 0;
4
+ const typeorm_1 = require("typeorm");
5
+ const shell_1 = require("@things-factory/shell");
6
+ const auth_base_1 = require("@things-factory/auth-base");
7
+ const entities_1 = require("../../../entities");
8
+ exports.Query = {
9
+ async invoiceProduct(_, { name }, context) {
10
+ const { domain, user } = context.state;
11
+ const repository = (0, typeorm_1.getRepository)(entities_1.InvoiceProduct);
12
+ return await repository.findOne({
13
+ where: { domain, name }
14
+ });
15
+ },
16
+ async invoiceProducts(_, params, context) {
17
+ const convertedParams = (0, shell_1.convertListParams)(params);
18
+ const [items, total] = await (0, typeorm_1.getRepository)(entities_1.InvoiceProduct).findAndCount(Object.assign({}, convertedParams));
19
+ return { items, total };
20
+ }
21
+ };
22
+ exports.InvoiceProduct = {
23
+ async domain(invoiceProduct) {
24
+ return await (0, typeorm_1.getRepository)(shell_1.Domain).findOne(invoiceProduct.domainId);
25
+ },
26
+ async creator(invoiceProduct) {
27
+ return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(invoiceProduct.creatorId);
28
+ },
29
+ async updater(invoiceProduct) {
30
+ return await (0, typeorm_1.getRepository)(auth_base_1.User).findOne(invoiceProduct.updaterId);
31
+ }
32
+ };
33
+ //# sourceMappingURL=invoice-product-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoice-product-query.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/invoice-product/invoice-product-query.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,iDAA4E;AAC5E,yDAAgD;AAChD,gDAA0E;AAE7D,QAAA,KAAK,GAAG;IACnB,KAAK,CAAC,cAAc,CAAC,CAAM,EAAE,EAAE,IAAI,EAAE,EAAE,OAAY;QACjD,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QACtC,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,yBAAoB,CAAC,CAAA;QAEtD,OAAO,MAAM,UAAU,CAAC,OAAO,CAAC;YAC9B,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;SACxB,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,CAAM,EAAE,MAAiB,EAAE,OAAY;QAC3D,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,CAAC,CAAA;QACjD,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,uBAAa,EAAC,yBAAoB,CAAC,CAAC,YAAY,mBACxE,eAAe,EAClB,CAAA;QAEF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;CACF,CAAA;AAEY,QAAA,cAAc,GAAG;IAC5B,KAAK,CAAC,MAAM,CAAC,cAAc;QACzB,OAAO,MAAM,IAAA,uBAAa,EAAC,cAAM,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAA;IACrE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,cAAc;QAC1B,OAAO,MAAM,IAAA,uBAAa,EAAC,gBAAI,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,CAAA;IACpE,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,cAAc;QAC1B,OAAO,MAAM,IAAA,uBAAa,EAAC,gBAAI,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,SAAS,CAAC,CAAA;IACpE,CAAC;CACF,CAAA"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateInvoiceProduct = void 0;
4
+ const typeorm_1 = require("typeorm");
5
+ const entities_1 = require("../../../entities");
6
+ exports.updateInvoiceProduct = {
7
+ async updateInvoiceProduct(_, { name, patch }, context) {
8
+ const { domain, user } = context.state;
9
+ const repository = (0, typeorm_1.getRepository)(entities_1.InvoiceProduct);
10
+ const invoiceProduct = await repository.findOne({
11
+ where: { domain, name }
12
+ });
13
+ return await repository.save(Object.assign(Object.assign(Object.assign({}, invoiceProduct), patch), { updater: user }));
14
+ }
15
+ };
16
+ //# sourceMappingURL=update-invoice-product.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-invoice-product.js","sourceRoot":"","sources":["../../../../server/graphql/resolvers/invoice-product/update-invoice-product.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AACvC,gDAAkD;AAErC,QAAA,oBAAoB,GAAG;IAClC,KAAK,CAAC,oBAAoB,CAAC,CAAM,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,OAAY;QAC9D,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEtC,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,yBAAc,CAAC,CAAA;QAChD,MAAM,cAAc,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YAC9C,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;SACxB,CAAC,CAAA;QAEF,OAAO,MAAM,UAAU,CAAC,IAAI,+CACvB,cAAc,GACd,KAAK,KACR,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;CACF,CAAA"}