@react-pakistan/util-functions 1.24.57 → 1.24.59
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/bank/index.d.ts +30 -0
- package/api/stellar-solutions/{banking-detail → bank}/index.js +25 -25
- package/api/stellar-solutions/product/index.d.ts +1 -1
- package/api/stellar-solutions/product/index.js +43 -34
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/api/stellar-solutions/banking-detail/index.d.ts +0 -30
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BankingDetailBE } from '../type';
|
|
2
|
+
interface GetBanksArgs {
|
|
3
|
+
prisma: any;
|
|
4
|
+
}
|
|
5
|
+
interface GetBankByIdArgs {
|
|
6
|
+
id: string;
|
|
7
|
+
prisma: any;
|
|
8
|
+
}
|
|
9
|
+
interface PostBankArgs {
|
|
10
|
+
accountNumber: string;
|
|
11
|
+
accountTitle: string;
|
|
12
|
+
bankAddress: string;
|
|
13
|
+
bankName: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
iban: string;
|
|
17
|
+
id: string;
|
|
18
|
+
preferenceId: string;
|
|
19
|
+
prisma: any;
|
|
20
|
+
swiftCode: string;
|
|
21
|
+
}
|
|
22
|
+
interface DeleteBankArgs {
|
|
23
|
+
id: string;
|
|
24
|
+
prisma: any;
|
|
25
|
+
}
|
|
26
|
+
export declare const getBanks: ({ prisma, }: GetBanksArgs) => Promise<Array<BankingDetailBE>>;
|
|
27
|
+
export declare const getBankById: ({ prisma, id, }: GetBankByIdArgs) => Promise<BankingDetailBE>;
|
|
28
|
+
export declare const postBank: ({ prisma, accountNumber, accountTitle, bankAddress, bankName, enabled, iban, id, preferenceId, swiftCode, }: PostBankArgs) => Promise<Array<BankingDetailBE>>;
|
|
29
|
+
export declare const deleteBank: ({ prisma, id, }: DeleteBankArgs) => Promise<BankingDetailBE>;
|
|
30
|
+
export {};
|
|
@@ -37,47 +37,47 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.
|
|
41
|
-
var
|
|
42
|
-
var
|
|
40
|
+
exports.deleteBank = exports.postBank = exports.getBankById = exports.getBanks = void 0;
|
|
41
|
+
var getBanks = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
42
|
+
var banks;
|
|
43
43
|
var prisma = _b.prisma;
|
|
44
44
|
return __generator(this, function (_c) {
|
|
45
45
|
switch (_c.label) {
|
|
46
|
-
case 0: return [4 /*yield*/, prisma.
|
|
46
|
+
case 0: return [4 /*yield*/, prisma.bank.findMany({
|
|
47
47
|
orderBy: {
|
|
48
48
|
createdAt: 'desc',
|
|
49
49
|
},
|
|
50
50
|
})];
|
|
51
51
|
case 1:
|
|
52
|
-
|
|
53
|
-
return [2 /*return*/,
|
|
52
|
+
banks = _c.sent();
|
|
53
|
+
return [2 /*return*/, banks];
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
}); };
|
|
57
|
-
exports.
|
|
58
|
-
var
|
|
59
|
-
var
|
|
57
|
+
exports.getBanks = getBanks;
|
|
58
|
+
var getBankById = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
59
|
+
var bank;
|
|
60
60
|
var prisma = _b.prisma, id = _b.id;
|
|
61
61
|
return __generator(this, function (_c) {
|
|
62
62
|
switch (_c.label) {
|
|
63
|
-
case 0: return [4 /*yield*/, prisma.
|
|
63
|
+
case 0: return [4 /*yield*/, prisma.bank.findUnique({
|
|
64
64
|
where: {
|
|
65
65
|
id: id,
|
|
66
66
|
},
|
|
67
67
|
})];
|
|
68
68
|
case 1:
|
|
69
|
-
|
|
70
|
-
return [2 /*return*/,
|
|
69
|
+
bank = _c.sent();
|
|
70
|
+
return [2 /*return*/, bank];
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
}); };
|
|
74
|
-
exports.
|
|
75
|
-
var
|
|
76
|
-
var
|
|
74
|
+
exports.getBankById = getBankById;
|
|
75
|
+
var postBank = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
76
|
+
var bank;
|
|
77
77
|
var prisma = _b.prisma, accountNumber = _b.accountNumber, accountTitle = _b.accountTitle, bankAddress = _b.bankAddress, bankName = _b.bankName, enabled = _b.enabled, iban = _b.iban, id = _b.id, preferenceId = _b.preferenceId, swiftCode = _b.swiftCode;
|
|
78
78
|
return __generator(this, function (_c) {
|
|
79
79
|
switch (_c.label) {
|
|
80
|
-
case 0: return [4 /*yield*/, prisma.
|
|
80
|
+
case 0: return [4 /*yield*/, prisma.bank.upsert({
|
|
81
81
|
where: {
|
|
82
82
|
id: id,
|
|
83
83
|
},
|
|
@@ -103,26 +103,26 @@ var postBankingDetail = function (_a) { return __awaiter(void 0, [_a], void 0, f
|
|
|
103
103
|
},
|
|
104
104
|
})];
|
|
105
105
|
case 1:
|
|
106
|
-
|
|
107
|
-
return [2 /*return*/,
|
|
106
|
+
bank = _c.sent();
|
|
107
|
+
return [2 /*return*/, bank];
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
110
|
}); };
|
|
111
|
-
exports.
|
|
112
|
-
var
|
|
113
|
-
var
|
|
111
|
+
exports.postBank = postBank;
|
|
112
|
+
var deleteBank = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
113
|
+
var bank;
|
|
114
114
|
var prisma = _b.prisma, id = _b.id;
|
|
115
115
|
return __generator(this, function (_c) {
|
|
116
116
|
switch (_c.label) {
|
|
117
|
-
case 0: return [4 /*yield*/, prisma.
|
|
117
|
+
case 0: return [4 /*yield*/, prisma.bank.delete({
|
|
118
118
|
where: {
|
|
119
119
|
id: id,
|
|
120
120
|
},
|
|
121
121
|
})];
|
|
122
122
|
case 1:
|
|
123
|
-
|
|
124
|
-
return [2 /*return*/,
|
|
123
|
+
bank = _c.sent();
|
|
124
|
+
return [2 /*return*/, bank];
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
127
|
}); };
|
|
128
|
-
exports.
|
|
128
|
+
exports.deleteBank = deleteBank;
|
|
@@ -42,6 +42,6 @@ interface DeleteProductArgs {
|
|
|
42
42
|
export declare const getProducts: ({ prisma, }: GetProductsArgs) => Promise<Array<ProductBE>>;
|
|
43
43
|
export declare const getProductById: ({ prisma, id, }: GetProductByIdArgs) => Promise<ProductBE>;
|
|
44
44
|
export declare const postProducts: ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }: PostProductsArgs) => Promise<Array<ProductBE>>;
|
|
45
|
-
export declare const postProduct: ({
|
|
45
|
+
export declare const postProduct: ({ authorName, buyPrice, currency, description, id, image, isbn, name, prisma, productCategoryId, quantity, ref, salePrice, }: PostProductArgs) => Promise<Array<ProductBE> | Error>;
|
|
46
46
|
export declare const deleteProduct: ({ prisma, id, }: DeleteProductArgs) => Promise<ProductBE>;
|
|
47
47
|
export {};
|
|
@@ -105,44 +105,53 @@ var postProducts = function (_a) { return __awaiter(void 0, [_a], void 0, functi
|
|
|
105
105
|
}); };
|
|
106
106
|
exports.postProducts = postProducts;
|
|
107
107
|
var postProduct = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
108
|
-
var product;
|
|
109
|
-
var
|
|
108
|
+
var product, error_1;
|
|
109
|
+
var authorName = _b.authorName, buyPrice = _b.buyPrice, currency = _b.currency, description = _b.description, id = _b.id, image = _b.image, isbn = _b.isbn, name = _b.name, prisma = _b.prisma, productCategoryId = _b.productCategoryId, quantity = _b.quantity, ref = _b.ref, salePrice = _b.salePrice;
|
|
110
110
|
return __generator(this, function (_c) {
|
|
111
111
|
switch (_c.label) {
|
|
112
|
-
case 0:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
update: {
|
|
117
|
-
authorName: authorName,
|
|
118
|
-
buyPrice: buyPrice,
|
|
119
|
-
currency: currency,
|
|
120
|
-
description: description,
|
|
121
|
-
image: image,
|
|
122
|
-
isbn: isbn,
|
|
123
|
-
name: name,
|
|
124
|
-
productCategoryId: productCategoryId,
|
|
125
|
-
quantity: quantity,
|
|
126
|
-
ref: ref,
|
|
127
|
-
salePrice: salePrice,
|
|
128
|
-
},
|
|
129
|
-
create: {
|
|
130
|
-
authorName: authorName,
|
|
131
|
-
buyPrice: buyPrice,
|
|
132
|
-
currency: currency,
|
|
133
|
-
description: description,
|
|
134
|
-
image: image,
|
|
135
|
-
isbn: isbn,
|
|
136
|
-
name: name,
|
|
137
|
-
productCategoryId: productCategoryId,
|
|
138
|
-
quantity: quantity,
|
|
139
|
-
ref: ref,
|
|
140
|
-
salePrice: salePrice,
|
|
141
|
-
},
|
|
142
|
-
})];
|
|
112
|
+
case 0:
|
|
113
|
+
product = [];
|
|
114
|
+
_c.label = 1;
|
|
143
115
|
case 1:
|
|
116
|
+
_c.trys.push([1, 3, , 4]);
|
|
117
|
+
return [4 /*yield*/, prisma.product.upsert({
|
|
118
|
+
where: {
|
|
119
|
+
id: id,
|
|
120
|
+
},
|
|
121
|
+
update: {
|
|
122
|
+
authorName: authorName,
|
|
123
|
+
buyPrice: buyPrice,
|
|
124
|
+
currency: currency,
|
|
125
|
+
description: description,
|
|
126
|
+
image: image,
|
|
127
|
+
isbn: isbn,
|
|
128
|
+
name: name,
|
|
129
|
+
productCategoryId: productCategoryId,
|
|
130
|
+
quantity: quantity,
|
|
131
|
+
ref: ref,
|
|
132
|
+
salePrice: salePrice,
|
|
133
|
+
},
|
|
134
|
+
create: {
|
|
135
|
+
authorName: authorName,
|
|
136
|
+
buyPrice: buyPrice,
|
|
137
|
+
currency: currency,
|
|
138
|
+
description: description,
|
|
139
|
+
image: image,
|
|
140
|
+
isbn: isbn,
|
|
141
|
+
name: name,
|
|
142
|
+
productCategoryId: productCategoryId,
|
|
143
|
+
quantity: quantity,
|
|
144
|
+
ref: ref,
|
|
145
|
+
salePrice: salePrice,
|
|
146
|
+
},
|
|
147
|
+
})];
|
|
148
|
+
case 2:
|
|
144
149
|
product = _c.sent();
|
|
145
|
-
return [
|
|
150
|
+
return [3 /*break*/, 4];
|
|
151
|
+
case 3:
|
|
152
|
+
error_1 = _c.sent();
|
|
153
|
+
return [2 /*return*/, error_1];
|
|
154
|
+
case 4: return [2 /*return*/, product];
|
|
146
155
|
}
|
|
147
156
|
});
|
|
148
157
|
}); };
|
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './api/cors';
|
|
2
2
|
export * from './api/stellar-solutions/app-user';
|
|
3
|
-
export * from './api/stellar-solutions/
|
|
3
|
+
export * from './api/stellar-solutions/bank';
|
|
4
4
|
export * from './api/stellar-solutions/branch';
|
|
5
5
|
export * from './api/stellar-solutions/company';
|
|
6
6
|
export * from './api/stellar-solutions/company-report';
|
package/index.js
CHANGED
|
@@ -16,7 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./api/cors"), exports);
|
|
18
18
|
__exportStar(require("./api/stellar-solutions/app-user"), exports);
|
|
19
|
-
__exportStar(require("./api/stellar-solutions/
|
|
19
|
+
__exportStar(require("./api/stellar-solutions/bank"), exports);
|
|
20
20
|
__exportStar(require("./api/stellar-solutions/branch"), exports);
|
|
21
21
|
__exportStar(require("./api/stellar-solutions/company"), exports);
|
|
22
22
|
__exportStar(require("./api/stellar-solutions/company-report"), exports);
|
package/package.json
CHANGED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { BankingDetailBE } from '../type';
|
|
2
|
-
interface GetBankingDetailsArgs {
|
|
3
|
-
prisma: any;
|
|
4
|
-
}
|
|
5
|
-
interface GetBankingDetailByIdArgs {
|
|
6
|
-
id: string;
|
|
7
|
-
prisma: any;
|
|
8
|
-
}
|
|
9
|
-
interface PostBankingDetailArgs {
|
|
10
|
-
accountNumber: string;
|
|
11
|
-
accountTitle: string;
|
|
12
|
-
bankAddress: string;
|
|
13
|
-
bankName: string;
|
|
14
|
-
createdAt: string;
|
|
15
|
-
enabled: boolean;
|
|
16
|
-
iban: string;
|
|
17
|
-
id: string;
|
|
18
|
-
preferenceId: string;
|
|
19
|
-
prisma: any;
|
|
20
|
-
swiftCode: string;
|
|
21
|
-
}
|
|
22
|
-
interface DeleteBankingDetailArgs {
|
|
23
|
-
id: string;
|
|
24
|
-
prisma: any;
|
|
25
|
-
}
|
|
26
|
-
export declare const getBankingDetails: ({ prisma, }: GetBankingDetailsArgs) => Promise<Array<BankingDetailBE>>;
|
|
27
|
-
export declare const getBankingDetailById: ({ prisma, id }: GetBankingDetailByIdArgs) => Promise<BankingDetailBE>;
|
|
28
|
-
export declare const postBankingDetail: ({ prisma, accountNumber, accountTitle, bankAddress, bankName, enabled, iban, id, preferenceId, swiftCode, }: PostBankingDetailArgs) => Promise<Array<BankingDetailBE>>;
|
|
29
|
-
export declare const deleteBankingDetail: ({ prisma, id, }: DeleteBankingDetailArgs) => Promise<BankingDetailBE>;
|
|
30
|
-
export {};
|