@react-pakistan/util-functions 1.22.85 → 1.22.87

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.
@@ -114,10 +114,6 @@ const postQuoteInvoice = (_d) => __awaiter(void 0, [_d], void 0, function* ({ ca
114
114
  productId: _id,
115
115
  productQuantity,
116
116
  },
117
- include: {
118
- quoteInvoice: true,
119
- product: true,
120
- },
121
117
  });
122
118
  })));
123
119
  }
@@ -0,0 +1,9 @@
1
+ import { QuoteInvoiceBE } from '../type';
2
+ interface PostQuotesInvoicesArgs {
3
+ prisma: any;
4
+ queryWhere: {
5
+ [key: string]: any;
6
+ };
7
+ }
8
+ export declare const postQuotesInvoicesReport: ({ prisma, queryWhere, }: PostQuotesInvoicesArgs) => Promise<Array<QuoteInvoiceBE>>;
9
+ export {};
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-explicit-any, no-restricted-globals, @typescript-eslint/array-type */
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.postQuotesInvoicesReport = void 0;
14
+ const postQuotesInvoicesReport = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, queryWhere, }) {
15
+ const quotesInvoices = yield prisma.$transaction([
16
+ prisma.quoteInvoice.count({
17
+ where: queryWhere,
18
+ }),
19
+ prisma.quoteInvoice.findMany({
20
+ orderBy: {
21
+ createdAt: 'desc',
22
+ },
23
+ include: {
24
+ company: true,
25
+ customer: true,
26
+ payments: true,
27
+ products: true,
28
+ services: true,
29
+ },
30
+ where: queryWhere,
31
+ }),
32
+ ]);
33
+ return quotesInvoices;
34
+ });
35
+ exports.postQuotesInvoicesReport = postQuotesInvoicesReport;
package/index.d.ts CHANGED
@@ -17,6 +17,7 @@ export * from './api/stellar-solutions/product';
17
17
  export * from './api/stellar-solutions/product-category';
18
18
  export * from './api/stellar-solutions/profile';
19
19
  export * from './api/stellar-solutions/quote-invoice';
20
+ export * from './api/stellar-solutions/quote-invoice-report';
20
21
  export * from './api/stellar-solutions/tax';
21
22
  export * from './constants';
22
23
  export * from './general';
package/index.js CHANGED
@@ -33,6 +33,7 @@ __exportStar(require("./api/stellar-solutions/product"), exports);
33
33
  __exportStar(require("./api/stellar-solutions/product-category"), exports);
34
34
  __exportStar(require("./api/stellar-solutions/profile"), exports);
35
35
  __exportStar(require("./api/stellar-solutions/quote-invoice"), exports);
36
+ __exportStar(require("./api/stellar-solutions/quote-invoice-report"), exports);
36
37
  __exportStar(require("./api/stellar-solutions/tax"), exports);
37
38
  __exportStar(require("./constants"), exports);
38
39
  __exportStar(require("./general"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pakistan/util-functions",
3
- "version": "1.22.85",
3
+ "version": "1.22.87",
4
4
  "description": "A library of all util functions",
5
5
  "main": "index.js",
6
6
  "scripts": {