@react-pakistan/util-functions 1.22.38 → 1.22.39
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,35 @@
|
|
|
1
|
+
interface CurrencyBE {
|
|
2
|
+
code: string;
|
|
3
|
+
createdAt: string;
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
id: string;
|
|
6
|
+
isDefault: string;
|
|
7
|
+
label: string;
|
|
8
|
+
preferenceId: string;
|
|
9
|
+
updatedAt: string;
|
|
10
|
+
}
|
|
11
|
+
interface GetCurrenciesArgs {
|
|
12
|
+
prisma: any;
|
|
13
|
+
}
|
|
14
|
+
interface GetCurrencyByIdArgs {
|
|
15
|
+
id: string;
|
|
16
|
+
prisma: any;
|
|
17
|
+
}
|
|
18
|
+
interface PostCurrencyArgs {
|
|
19
|
+
code: string;
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
id: string;
|
|
22
|
+
isDefault: boolean;
|
|
23
|
+
label: string;
|
|
24
|
+
preferenceId: string;
|
|
25
|
+
prisma: any;
|
|
26
|
+
}
|
|
27
|
+
interface DeleteCurrencyArgs {
|
|
28
|
+
id: string;
|
|
29
|
+
prisma: any;
|
|
30
|
+
}
|
|
31
|
+
export declare const getCurrencies: ({ prisma, }: GetCurrenciesArgs) => Promise<Array<CurrencyBE>>;
|
|
32
|
+
export declare const getCurrencyById: ({ id, prisma, }: GetCurrencyByIdArgs) => Promise<CurrencyBE>;
|
|
33
|
+
export declare const postCurrency: ({ code, enabled, id, isDefault, label, preferenceId, prisma, }: PostCurrencyArgs) => Promise<Array<CurrencyBE>>;
|
|
34
|
+
export declare const deleteCurrency: ({ id, prisma, }: DeleteCurrencyArgs) => Promise<CurrencyBE>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
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.deleteCurrency = exports.postCurrency = exports.getCurrencyById = exports.getCurrencies = void 0;
|
|
14
|
+
const getCurrencies = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
+
const customers = yield prisma.stellarCustomer.findMany({
|
|
16
|
+
orderBy: {
|
|
17
|
+
createdAt: 'desc',
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
return customers;
|
|
21
|
+
});
|
|
22
|
+
exports.getCurrencies = getCurrencies;
|
|
23
|
+
const getCurrencyById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ id, prisma, }) {
|
|
24
|
+
const currency = yield prisma.stellarCurrency.findUnique({
|
|
25
|
+
where: {
|
|
26
|
+
id,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
return currency;
|
|
30
|
+
});
|
|
31
|
+
exports.getCurrencyById = getCurrencyById;
|
|
32
|
+
const postCurrency = (_c) => __awaiter(void 0, [_c], void 0, function* ({ code, enabled, id, isDefault, label, preferenceId, prisma, }) {
|
|
33
|
+
const currency = yield prisma.stellarCurrency.upsert({
|
|
34
|
+
where: {
|
|
35
|
+
id,
|
|
36
|
+
},
|
|
37
|
+
update: {
|
|
38
|
+
code,
|
|
39
|
+
enabled,
|
|
40
|
+
isDefault,
|
|
41
|
+
label,
|
|
42
|
+
preferenceId,
|
|
43
|
+
},
|
|
44
|
+
create: {
|
|
45
|
+
code,
|
|
46
|
+
enabled,
|
|
47
|
+
isDefault,
|
|
48
|
+
label,
|
|
49
|
+
preferenceId,
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
return currency;
|
|
53
|
+
});
|
|
54
|
+
exports.postCurrency = postCurrency;
|
|
55
|
+
const deleteCurrency = (_d) => __awaiter(void 0, [_d], void 0, function* ({ id, prisma, }) {
|
|
56
|
+
const currency = yield prisma.stellarCurrency.delete({
|
|
57
|
+
where: {
|
|
58
|
+
id,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
return currency;
|
|
62
|
+
});
|
|
63
|
+
exports.deleteCurrency = deleteCurrency;
|
package/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export * from './api/stellar-solutions/app-user';
|
|
|
2
2
|
export * from './api/stellar-solutions/banking-detail';
|
|
3
3
|
export * from './api/stellar-solutions/branch';
|
|
4
4
|
export * from './api/stellar-solutions/company';
|
|
5
|
+
export * from './api/stellar-solutions/contact';
|
|
6
|
+
export * from './api/stellar-solutions/currency';
|
|
5
7
|
export * from './api/stellar-solutions/customer';
|
|
6
8
|
export * from './api/cors';
|
|
7
9
|
export * from './constants';
|
package/index.js
CHANGED
|
@@ -18,6 +18,8 @@ __exportStar(require("./api/stellar-solutions/app-user"), exports);
|
|
|
18
18
|
__exportStar(require("./api/stellar-solutions/banking-detail"), exports);
|
|
19
19
|
__exportStar(require("./api/stellar-solutions/branch"), exports);
|
|
20
20
|
__exportStar(require("./api/stellar-solutions/company"), exports);
|
|
21
|
+
__exportStar(require("./api/stellar-solutions/contact"), exports);
|
|
22
|
+
__exportStar(require("./api/stellar-solutions/currency"), exports);
|
|
21
23
|
__exportStar(require("./api/stellar-solutions/customer"), exports);
|
|
22
24
|
__exportStar(require("./api/cors"), exports);
|
|
23
25
|
__exportStar(require("./constants"), exports);
|