@react-pakistan/util-functions 1.23.0 → 1.23.2

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.
@@ -4,6 +4,12 @@ interface PostCompaniesReportArgs {
4
4
  queryWhere: {
5
5
  [key: string]: any;
6
6
  };
7
+ include: {
8
+ [key: string]: any;
9
+ };
10
+ orderBy: {
11
+ [key: string]: any;
12
+ };
7
13
  }
8
- export declare const postCompaniesReport: ({ prisma, queryWhere, }: PostCompaniesReportArgs) => Promise<Array<CompanyBE>>;
14
+ export declare const postCompaniesReport: ({ prisma, queryWhere, orderBy, include, }: PostCompaniesReportArgs) => Promise<Array<CompanyBE>>;
9
15
  export {};
@@ -11,26 +11,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.postCompaniesReport = void 0;
14
- const postCompaniesReport = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, queryWhere, }) {
14
+ const postCompaniesReport = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, queryWhere, orderBy, include, }) {
15
15
  const companies = yield prisma.$transaction([
16
16
  prisma.company.count({
17
17
  where: queryWhere,
18
18
  }),
19
19
  prisma.company.findMany({
20
- orderBy: {
21
- createdAt: 'desc',
22
- },
23
- include: {
24
- contacts: true,
25
- quotesInvoices: {
26
- where: {
27
- category: 'INVOICE',
28
- },
29
- include: {
30
- payments: true,
31
- },
32
- },
33
- },
20
+ include,
21
+ orderBy,
34
22
  where: queryWhere,
35
23
  }),
36
24
  ]);
@@ -1,9 +1,15 @@
1
1
  import { QuoteInvoiceBE } from '../type';
2
2
  interface PostQuotesInvoicesReportArgs {
3
+ include: {
4
+ [key: string]: any;
5
+ };
6
+ orderBy: {
7
+ [key: string]: any;
8
+ };
3
9
  prisma: any;
4
10
  queryWhere: {
5
11
  [key: string]: any;
6
12
  };
7
13
  }
8
- export declare const postQuotesInvoicesReport: ({ prisma, queryWhere, }: PostQuotesInvoicesReportArgs) => Promise<Array<QuoteInvoiceBE>>;
14
+ export declare const postQuotesInvoicesReport: ({ include, orderBy, prisma, queryWhere, }: PostQuotesInvoicesReportArgs) => Promise<Array<QuoteInvoiceBE>>;
9
15
  export {};
@@ -11,22 +11,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.postQuotesInvoicesReport = void 0;
14
- const postQuotesInvoicesReport = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, queryWhere, }) {
14
+ const postQuotesInvoicesReport = (_a) => __awaiter(void 0, [_a], void 0, function* ({ include, orderBy, prisma, queryWhere, }) {
15
15
  const quotesInvoices = yield prisma.$transaction([
16
16
  prisma.quoteInvoice.count({
17
17
  where: queryWhere,
18
18
  }),
19
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
- },
20
+ include,
21
+ orderBy,
30
22
  where: queryWhere,
31
23
  }),
32
24
  ]);
package/index.d.ts CHANGED
@@ -12,7 +12,6 @@ export * from './api/stellar-solutions/expense-category';
12
12
  export * from './api/stellar-solutions/lead';
13
13
  export * from './api/stellar-solutions/menu-order';
14
14
  export * from './api/stellar-solutions/payment';
15
- export * from './api/stellar-solutions/payment-report';
16
15
  export * from './api/stellar-solutions/payment-mode';
17
16
  export * from './api/stellar-solutions/preference';
18
17
  export * from './api/stellar-solutions/product';
package/index.js CHANGED
@@ -28,7 +28,6 @@ __exportStar(require("./api/stellar-solutions/expense-category"), exports);
28
28
  __exportStar(require("./api/stellar-solutions/lead"), exports);
29
29
  __exportStar(require("./api/stellar-solutions/menu-order"), exports);
30
30
  __exportStar(require("./api/stellar-solutions/payment"), exports);
31
- __exportStar(require("./api/stellar-solutions/payment-report"), exports);
32
31
  __exportStar(require("./api/stellar-solutions/payment-mode"), exports);
33
32
  __exportStar(require("./api/stellar-solutions/preference"), exports);
34
33
  __exportStar(require("./api/stellar-solutions/product"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pakistan/util-functions",
3
- "version": "1.23.0",
3
+ "version": "1.23.2",
4
4
  "description": "A library of all util functions",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,9 +0,0 @@
1
- import { PaymentBE } from '../type';
2
- interface PostPaymentsReportArgs {
3
- prisma: any;
4
- queryWhere: {
5
- [key: string]: any;
6
- };
7
- }
8
- export declare const postPaymentsReport: ({ prisma, queryWhere, }: PostPaymentsReportArgs) => Promise<Array<PaymentBE>>;
9
- export {};
@@ -1,31 +0,0 @@
1
- "use strict";
2
- /* eslint-disable @typescript-eslint/no-explicit-any, no-restricted-globals */
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.postPaymentsReport = void 0;
14
- const postPaymentsReport = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, queryWhere, }) {
15
- const payments = yield prisma.$transaction([
16
- prisma.payment.count({
17
- where: queryWhere,
18
- }),
19
- prisma.payment.findMany({
20
- orderBy: {
21
- createdAt: 'desc',
22
- },
23
- include: {
24
- quoteInvoice: true,
25
- },
26
- where: queryWhere,
27
- }),
28
- ]);
29
- return payments;
30
- });
31
- exports.postPaymentsReport = postPaymentsReport;