@react-pakistan/util-functions 1.22.57 → 1.22.58
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.
|
@@ -32,7 +32,10 @@ interface PostQuoteInvoiceArgs {
|
|
|
32
32
|
subTotal: string;
|
|
33
33
|
taxValue: string;
|
|
34
34
|
total: string;
|
|
35
|
-
|
|
35
|
+
products: [{
|
|
36
|
+
id: string;
|
|
37
|
+
productQuantity: string;
|
|
38
|
+
}];
|
|
36
39
|
phone: string;
|
|
37
40
|
lastName: string;
|
|
38
41
|
firstName: string;
|
|
@@ -49,6 +52,6 @@ interface DeleteQuoteInvoiceArgs {
|
|
|
49
52
|
export declare const getQuotesInvoices: ({ prisma, }: GetQuotesInvoicesArgs) => Promise<Array<QuoteInvoiceBE>>;
|
|
50
53
|
export declare const getQuoteInvoiceById: ({ prisma, id, }: GetQuoteInvoiceByIdArgs) => Promise<QuoteInvoiceBE>;
|
|
51
54
|
export declare const postQuotesInvoices: ({ currentPage, pageLimit, prisma, queryWhere, }: PostQuotesInvoicesArgs) => Promise<Array<QuoteInvoiceBE>>;
|
|
52
|
-
export declare const postQuoteInvoice: ({ category, companyId, currency, customerId, date, discount, discountUnit, expiryDate, id, mode, note, ref, services, status, subTotal, taxValue, total,
|
|
55
|
+
export declare const postQuoteInvoice: ({ category, companyId, currency, customerId, date, discount, discountUnit, expiryDate, id, mode, note, ref, services, status, subTotal, taxValue, total, products, phone, lastName, firstName, email, country, city, address, prisma, }: PostQuoteInvoiceArgs) => Promise<QuoteInvoiceBE>;
|
|
53
56
|
export declare const deleteQuoteInvoice: ({ prisma, id, }: DeleteQuoteInvoiceArgs) => Promise<QuoteInvoiceBE>;
|
|
54
57
|
export {};
|
|
@@ -60,7 +60,9 @@ const postQuotesInvoices = (_c) => __awaiter(void 0, [_c], void 0, function* ({
|
|
|
60
60
|
return quotesInvoices;
|
|
61
61
|
});
|
|
62
62
|
exports.postQuotesInvoices = postQuotesInvoices;
|
|
63
|
-
const postQuoteInvoice = (_d) => __awaiter(void 0, [_d], void 0, function* ({ category, companyId, currency, customerId, date, discount, discountUnit, expiryDate, id, mode, note, ref, services, status, subTotal, taxValue, total,
|
|
63
|
+
const postQuoteInvoice = (_d) => __awaiter(void 0, [_d], void 0, function* ({ category, companyId, currency, customerId, date, discount, discountUnit, expiryDate, id, mode, note, ref, services, status, subTotal, taxValue, total,
|
|
64
|
+
// productIds,
|
|
65
|
+
products, phone, lastName, firstName, email, country, city, address, prisma, }) {
|
|
64
66
|
let quoteInvoice;
|
|
65
67
|
if (mode === 'Create') {
|
|
66
68
|
const mappedServices = services.map((item) => {
|
|
@@ -95,16 +97,29 @@ const postQuoteInvoice = (_d) => __awaiter(void 0, [_d], void 0, function* ({ ca
|
|
|
95
97
|
products: true,
|
|
96
98
|
},
|
|
97
99
|
});
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
100
|
+
products.map((_e) => __awaiter(void 0, [_e], void 0, function* ({ id: __id, productQuantity }) {
|
|
101
|
+
yield prisma.quotesInvoicesOnStellarProducts.create({
|
|
102
|
+
data: {
|
|
103
|
+
quoteInvoiceId: quoteInvoice === null || quoteInvoice === void 0 ? void 0 : quoteInvoice.id,
|
|
104
|
+
productId: __id,
|
|
105
|
+
productQuantity,
|
|
106
|
+
},
|
|
107
|
+
include: {
|
|
108
|
+
product: true,
|
|
109
|
+
quoteInvoice: true,
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
}));
|
|
113
|
+
// await prisma.quotesInvoicesOnStellarProducts.create({
|
|
114
|
+
// data: {
|
|
115
|
+
// quoteInvoiceId: quoteInvoice.id,
|
|
116
|
+
// productId: productIds[0].id,
|
|
117
|
+
// },
|
|
118
|
+
// include: {
|
|
119
|
+
// product: true,
|
|
120
|
+
// quoteInvoice: true,
|
|
121
|
+
// },
|
|
122
|
+
// });
|
|
108
123
|
}
|
|
109
124
|
else {
|
|
110
125
|
quoteInvoice = yield prisma.quoteInvoice.create({
|
|
@@ -191,9 +206,7 @@ const postQuoteInvoice = (_d) => __awaiter(void 0, [_d], void 0, function* ({ ca
|
|
|
191
206
|
status,
|
|
192
207
|
subTotal,
|
|
193
208
|
taxValue,
|
|
194
|
-
total,
|
|
195
|
-
connect: productIds,
|
|
196
|
-
} }),
|
|
209
|
+
total }),
|
|
197
210
|
});
|
|
198
211
|
}
|
|
199
212
|
catch (err) {
|
|
@@ -203,7 +216,7 @@ const postQuoteInvoice = (_d) => __awaiter(void 0, [_d], void 0, function* ({ ca
|
|
|
203
216
|
return quoteInvoice;
|
|
204
217
|
});
|
|
205
218
|
exports.postQuoteInvoice = postQuoteInvoice;
|
|
206
|
-
const deleteQuoteInvoice = (
|
|
219
|
+
const deleteQuoteInvoice = (_f) => __awaiter(void 0, [_f], void 0, function* ({ prisma, id, }) {
|
|
207
220
|
const quoteInvoice = yield prisma.quoteInvoice.delete({
|
|
208
221
|
where: {
|
|
209
222
|
id,
|