@react-pakistan/util-functions 1.22.92 → 1.22.94
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.
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CompanyBE } from '../type';
|
|
2
|
+
interface PostCompaniesReportArgs {
|
|
3
|
+
prisma: any;
|
|
4
|
+
queryWhere: {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export declare const postCompaniesReport: ({ prisma, queryWhere, }: PostCompaniesReportArgs) => Promise<Array<CompanyBE>>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
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.postCompaniesReport = void 0;
|
|
14
|
+
const postCompaniesReport = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, queryWhere, }) {
|
|
15
|
+
const companies = yield prisma.$transaction([
|
|
16
|
+
prisma.company.count({
|
|
17
|
+
where: queryWhere,
|
|
18
|
+
}),
|
|
19
|
+
prisma.company.findMany({
|
|
20
|
+
orderBy: {
|
|
21
|
+
quotesInvoices: {
|
|
22
|
+
payments: {
|
|
23
|
+
createdAt: 'desc',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
include: {
|
|
28
|
+
contacts: true,
|
|
29
|
+
quotesInvoices: true,
|
|
30
|
+
},
|
|
31
|
+
where: queryWhere,
|
|
32
|
+
}),
|
|
33
|
+
]);
|
|
34
|
+
return companies;
|
|
35
|
+
});
|
|
36
|
+
exports.postCompaniesReport = postCompaniesReport;
|
package/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './api/stellar-solutions/app-user';
|
|
|
3
3
|
export * from './api/stellar-solutions/banking-detail';
|
|
4
4
|
export * from './api/stellar-solutions/branch';
|
|
5
5
|
export * from './api/stellar-solutions/company';
|
|
6
|
+
export * from './api/stellar-solutions/company-report';
|
|
6
7
|
export * from './api/stellar-solutions/contact';
|
|
7
8
|
export * from './api/stellar-solutions/currency';
|
|
8
9
|
export * from './api/stellar-solutions/customer';
|
package/index.js
CHANGED
|
@@ -19,6 +19,7 @@ __exportStar(require("./api/stellar-solutions/app-user"), exports);
|
|
|
19
19
|
__exportStar(require("./api/stellar-solutions/banking-detail"), exports);
|
|
20
20
|
__exportStar(require("./api/stellar-solutions/branch"), exports);
|
|
21
21
|
__exportStar(require("./api/stellar-solutions/company"), exports);
|
|
22
|
+
__exportStar(require("./api/stellar-solutions/company-report"), exports);
|
|
22
23
|
__exportStar(require("./api/stellar-solutions/contact"), exports);
|
|
23
24
|
__exportStar(require("./api/stellar-solutions/currency"), exports);
|
|
24
25
|
__exportStar(require("./api/stellar-solutions/customer"), exports);
|