@react-pakistan/util-functions 1.22.76 → 1.22.78
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.
|
@@ -72,11 +72,14 @@ const postQuoteInvoice = (_d) => __awaiter(void 0, [_d], void 0, function* ({ ca
|
|
|
72
72
|
products, createdAt, phone, lastName, firstName, email, country, city, address, prisma, }) {
|
|
73
73
|
let quoteInvoice;
|
|
74
74
|
if (mode === 'Create') {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
let mappedServices;
|
|
76
|
+
if (services.length) {
|
|
77
|
+
mappedServices = services.map((item) => {
|
|
78
|
+
const itemToReturn = Object.assign({}, item);
|
|
79
|
+
delete itemToReturn.mode;
|
|
80
|
+
return itemToReturn;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
80
83
|
if (customerId || companyId) {
|
|
81
84
|
quoteInvoice = yield prisma.quoteInvoice.create({
|
|
82
85
|
data: {
|
|
@@ -108,6 +111,19 @@ products, createdAt, phone, lastName, firstName, email, country, city, address,
|
|
|
108
111
|
products: true,
|
|
109
112
|
},
|
|
110
113
|
});
|
|
114
|
+
products.forEach((_e) => __awaiter(void 0, [_e], void 0, function* ({ id: _id, productQuantity }) {
|
|
115
|
+
yield prisma.quotesInvoicesOnStellarProducts.create({
|
|
116
|
+
data: {
|
|
117
|
+
quoteInvoiceId: quoteInvoice === null || quoteInvoice === void 0 ? void 0 : quoteInvoice.id,
|
|
118
|
+
productId: _id,
|
|
119
|
+
productQuantity,
|
|
120
|
+
},
|
|
121
|
+
include: {
|
|
122
|
+
product: true,
|
|
123
|
+
quoteInvoice: true,
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
}));
|
|
111
127
|
// await prisma.quotesInvoicesOnStellarProducts.create({
|
|
112
128
|
// data: {
|
|
113
129
|
// quoteInvoiceId: quoteInvoice.id,
|
|
@@ -236,7 +252,7 @@ products, createdAt, phone, lastName, firstName, email, country, city, address,
|
|
|
236
252
|
return quoteInvoice;
|
|
237
253
|
});
|
|
238
254
|
exports.postQuoteInvoice = postQuoteInvoice;
|
|
239
|
-
const deleteQuoteInvoice = (
|
|
255
|
+
const deleteQuoteInvoice = (_f) => __awaiter(void 0, [_f], void 0, function* ({ prisma, id, }) {
|
|
240
256
|
const quoteInvoice = yield prisma.quoteInvoice.delete({
|
|
241
257
|
where: {
|
|
242
258
|
id,
|