@react-pakistan/util-functions 1.23.12 → 1.23.13
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.
|
@@ -8,6 +8,12 @@ interface GetPaymentByIdArgs {
|
|
|
8
8
|
}
|
|
9
9
|
interface PostPaymentsArgs {
|
|
10
10
|
currentPage: number;
|
|
11
|
+
include: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
14
|
+
orderBy: {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
11
17
|
pageLimit: number;
|
|
12
18
|
prisma: any;
|
|
13
19
|
queryWhere: {
|
|
@@ -34,7 +40,7 @@ interface DeletePaymentArgs {
|
|
|
34
40
|
}
|
|
35
41
|
export declare const getPayments: ({ prisma, }: GetPaymentsArgs) => Promise<Array<PaymentBE>>;
|
|
36
42
|
export declare const getPaymentById: ({ id, prisma, }: GetPaymentByIdArgs) => Promise<PaymentBE>;
|
|
37
|
-
export declare const postPayments: ({ currentPage, pageLimit, prisma, queryWhere, }: PostPaymentsArgs) => Promise<Array<PaymentBE>>;
|
|
43
|
+
export declare const postPayments: ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }: PostPaymentsArgs) => Promise<Array<PaymentBE>>;
|
|
38
44
|
export declare const postPayment: ({ amount, attachment, createdAt, currency, date, description, id, mode, paymentType, prisma, quoteInvoiceId, ref, }: PostPaymentArgs) => Promise<Array<PaymentBE>>;
|
|
39
45
|
export declare const deletePayment: ({ id, prisma, }: DeletePaymentArgs) => Promise<PaymentBE>;
|
|
40
46
|
export {};
|
|
@@ -29,18 +29,14 @@ const getPaymentById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ id,
|
|
|
29
29
|
return payment;
|
|
30
30
|
});
|
|
31
31
|
exports.getPaymentById = getPaymentById;
|
|
32
|
-
const postPayments = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
|
|
32
|
+
const postPayments = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }) {
|
|
33
33
|
const payments = yield prisma.$transaction([
|
|
34
34
|
prisma.payment.count({
|
|
35
35
|
where: queryWhere,
|
|
36
36
|
}),
|
|
37
37
|
prisma.payment.findMany({
|
|
38
|
-
orderBy
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
include: {
|
|
42
|
-
quoteInvoice: true,
|
|
43
|
-
},
|
|
38
|
+
orderBy,
|
|
39
|
+
include,
|
|
44
40
|
where: queryWhere,
|
|
45
41
|
take: pageLimit,
|
|
46
42
|
skip: (currentPage - 1) * pageLimit,
|