@react-pakistan/util-functions 1.24.25 → 1.24.27
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.
- package/api/stellar-solutions/expense-category/index.d.ts +1 -4
- package/api/stellar-solutions/expense-category/index.js +15 -22
- package/api/stellar-solutions/tax/index.d.ts +2 -2
- package/api/stellar-solutions/tax/index.js +3 -3
- package/api/stellar-solutions/type.d.ts +1 -1
- package/package.json +1 -1
|
@@ -33,10 +33,7 @@ interface DeleteExpenseCategoryArgs {
|
|
|
33
33
|
}
|
|
34
34
|
export declare const getExpenseCategories: ({ prisma, }: GetExpenseCategoriesArgs) => Promise<Array<ExpenseCategoryBE>>;
|
|
35
35
|
export declare const getExpenseCategoryById: ({ id, prisma, }: GetExpenseCategoryByIdArgs) => Promise<ExpenseCategoryBE>;
|
|
36
|
-
export declare const postExpenseCategories: ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }: PostExpenseCategoriesArgs) => Promise<
|
|
37
|
-
data: Array<ExpenseCategoryBE>;
|
|
38
|
-
error: Error | undefined;
|
|
39
|
-
}>;
|
|
36
|
+
export declare const postExpenseCategories: ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }: PostExpenseCategoriesArgs) => Promise<Array<ExpenseCategoryBE>>;
|
|
40
37
|
export declare const postExpenseCategory: ({ color, description, id, name, prisma, }: PostExpenseCategoryArgs) => Promise<Array<ExpenseCategoryBE>>;
|
|
41
38
|
export declare const deleteExpenseCategory: ({ id, prisma, }: DeleteExpenseCategoryArgs) => Promise<ExpenseCategoryBE>;
|
|
42
39
|
export {};
|
|
@@ -79,32 +79,25 @@ var getExpenseCategoryById = function (_a) { return __awaiter(void 0, [_a], void
|
|
|
79
79
|
}); };
|
|
80
80
|
exports.getExpenseCategoryById = getExpenseCategoryById;
|
|
81
81
|
var postExpenseCategories = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
82
|
-
var
|
|
82
|
+
var expenseCategories;
|
|
83
83
|
var currentPage = _b.currentPage, include = _b.include, orderBy = _b.orderBy, pageLimit = _b.pageLimit, prisma = _b.prisma, queryWhere = _b.queryWhere;
|
|
84
84
|
return __generator(this, function (_c) {
|
|
85
85
|
switch (_c.label) {
|
|
86
|
-
case 0:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}),
|
|
99
|
-
])];
|
|
86
|
+
case 0: return [4 /*yield*/, prisma.$transaction([
|
|
87
|
+
prisma.expenseCategory.count({
|
|
88
|
+
where: queryWhere,
|
|
89
|
+
}),
|
|
90
|
+
prisma.expenseCategory.findMany({
|
|
91
|
+
orderBy: orderBy,
|
|
92
|
+
include: include,
|
|
93
|
+
where: queryWhere,
|
|
94
|
+
take: pageLimit,
|
|
95
|
+
skip: (currentPage - 1) * pageLimit,
|
|
96
|
+
}),
|
|
97
|
+
])];
|
|
100
98
|
case 1:
|
|
101
|
-
|
|
102
|
-
return [
|
|
103
|
-
case 2:
|
|
104
|
-
err_1 = _c.sent();
|
|
105
|
-
error = err_1;
|
|
106
|
-
return [3 /*break*/, 3];
|
|
107
|
-
case 3: return [2 /*return*/, { data: data, error: error }];
|
|
99
|
+
expenseCategories = _c.sent();
|
|
100
|
+
return [2 /*return*/, expenseCategories];
|
|
108
101
|
}
|
|
109
102
|
});
|
|
110
103
|
}); };
|
|
@@ -13,7 +13,7 @@ interface PostTaxArgs {
|
|
|
13
13
|
isDefault: string;
|
|
14
14
|
preferenceId: string;
|
|
15
15
|
taxName: string;
|
|
16
|
-
|
|
16
|
+
taxRate: string;
|
|
17
17
|
prisma: any;
|
|
18
18
|
}
|
|
19
19
|
interface DeleteTaxArgs {
|
|
@@ -22,6 +22,6 @@ interface DeleteTaxArgs {
|
|
|
22
22
|
}
|
|
23
23
|
export declare const getTaxes: ({ prisma, }: GetTaxesArgs) => Promise<Array<TaxBE>>;
|
|
24
24
|
export declare const getTaxById: ({ prisma, id, }: GetTaxByIdArgs) => Promise<TaxBE>;
|
|
25
|
-
export declare const postTax: ({ description, enabled, id, isDefault, preferenceId, prisma, taxName,
|
|
25
|
+
export declare const postTax: ({ description, enabled, id, isDefault, preferenceId, prisma, taxName, taxRate, }: PostTaxArgs) => Promise<Array<TaxBE>>;
|
|
26
26
|
export declare const deleteTax: ({ prisma, id, }: DeleteTaxArgs) => Promise<TaxBE>;
|
|
27
27
|
export {};
|
|
@@ -74,7 +74,7 @@ var getTaxById = function (_a) { return __awaiter(void 0, [_a], void 0, function
|
|
|
74
74
|
exports.getTaxById = getTaxById;
|
|
75
75
|
var postTax = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
76
76
|
var tax;
|
|
77
|
-
var description = _b.description, enabled = _b.enabled, id = _b.id, isDefault = _b.isDefault, preferenceId = _b.preferenceId, prisma = _b.prisma, taxName = _b.taxName,
|
|
77
|
+
var description = _b.description, enabled = _b.enabled, id = _b.id, isDefault = _b.isDefault, preferenceId = _b.preferenceId, prisma = _b.prisma, taxName = _b.taxName, taxRate = _b.taxRate;
|
|
78
78
|
return __generator(this, function (_c) {
|
|
79
79
|
switch (_c.label) {
|
|
80
80
|
case 0: return [4 /*yield*/, prisma.tax.upsert({
|
|
@@ -87,7 +87,7 @@ var postTax = function (_a) { return __awaiter(void 0, [_a], void 0, function (_
|
|
|
87
87
|
isDefault: isDefault,
|
|
88
88
|
preferenceId: preferenceId,
|
|
89
89
|
taxName: taxName,
|
|
90
|
-
|
|
90
|
+
taxRate: taxRate,
|
|
91
91
|
},
|
|
92
92
|
create: {
|
|
93
93
|
description: description,
|
|
@@ -95,7 +95,7 @@ var postTax = function (_a) { return __awaiter(void 0, [_a], void 0, function (_
|
|
|
95
95
|
isDefault: isDefault,
|
|
96
96
|
preferenceId: preferenceId,
|
|
97
97
|
taxName: taxName,
|
|
98
|
-
|
|
98
|
+
taxRate: taxRate,
|
|
99
99
|
},
|
|
100
100
|
})];
|
|
101
101
|
case 1:
|