@react-pakistan/util-functions 1.22.34 → 1.22.36

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,31 @@
1
+ interface AppUserBE {
2
+ createdAt: string;
3
+ email: string;
4
+ firstName: string;
5
+ id: string;
6
+ lastName: string;
7
+ updatedAt: string;
8
+ }
9
+ interface GetAppUsersArgs {
10
+ prisma: any;
11
+ }
12
+ interface GetAppUserByIdArgs {
13
+ id: string;
14
+ prisma: any;
15
+ }
16
+ interface PostAppUserArgs {
17
+ prisma: any;
18
+ id: string;
19
+ email: string;
20
+ firstName: string;
21
+ lastName: string;
22
+ }
23
+ interface DeleteAppUserArgs {
24
+ prisma: any;
25
+ id: string;
26
+ }
27
+ export declare const getAppUsers: ({ prisma }: GetAppUsersArgs) => Promise<Array<AppUserBE>>;
28
+ export declare const getAppUserById: ({ prisma, id }: GetAppUserByIdArgs) => Promise<AppUserBE>;
29
+ export declare const postAppUser: ({ prisma, id, email, firstName, lastName, }: PostAppUserArgs) => Promise<Array<AppUserBE>>;
30
+ export declare const deleteAppUser: ({ prisma, id }: DeleteAppUserArgs) => Promise<AppUserBE>;
31
+ export {};
@@ -0,0 +1,59 @@
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.deleteAppUser = exports.postAppUser = exports.getAppUserById = exports.getAppUsers = void 0;
14
+ const getAppUsers = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma }) {
15
+ const appUsers = yield prisma.stellarAppUser.findMany({
16
+ orderBy: {
17
+ createdAt: 'desc',
18
+ },
19
+ });
20
+ return appUsers;
21
+ });
22
+ exports.getAppUsers = getAppUsers;
23
+ const getAppUserById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id }) {
24
+ const appUser = yield prisma.stellarAppUser.findUnique({
25
+ where: {
26
+ id,
27
+ },
28
+ });
29
+ return appUser;
30
+ });
31
+ exports.getAppUserById = getAppUserById;
32
+ const postAppUser = (_c) => __awaiter(void 0, [_c], void 0, function* ({ prisma, id, email, firstName, lastName, }) {
33
+ const appUser = yield prisma.stellarAppUser.upsert({
34
+ where: {
35
+ id,
36
+ },
37
+ update: {
38
+ email,
39
+ firstName,
40
+ lastName,
41
+ },
42
+ create: {
43
+ email,
44
+ firstName,
45
+ lastName,
46
+ },
47
+ });
48
+ return appUser;
49
+ });
50
+ exports.postAppUser = postAppUser;
51
+ const deleteAppUser = (_d) => __awaiter(void 0, [_d], void 0, function* ({ prisma, id }) {
52
+ const appUser = yield prisma.stellarAppUser.delete({
53
+ where: {
54
+ id,
55
+ },
56
+ });
57
+ return appUser;
58
+ });
59
+ exports.deleteAppUser = deleteAppUser;
@@ -0,0 +1,41 @@
1
+ interface BankingDetailBE {
2
+ accountNumber: string;
3
+ accountTitle: string;
4
+ bankAddress: string;
5
+ bankName: string;
6
+ createdAt: string;
7
+ enabled: boolean;
8
+ iban: string;
9
+ id: string;
10
+ swiftCode: string;
11
+ updatedAt: string;
12
+ }
13
+ interface GetBankingDetailsArgs {
14
+ prisma: any;
15
+ }
16
+ interface GetBankingDetailByIdArgs {
17
+ id: string;
18
+ prisma: any;
19
+ }
20
+ interface PostBankingDetailArgs {
21
+ accountNumber: string;
22
+ accountTitle: string;
23
+ bankAddress: string;
24
+ bankName: string;
25
+ createdAt: string;
26
+ enabled: boolean;
27
+ iban: string;
28
+ id: string;
29
+ preferenceId: string;
30
+ prisma: any;
31
+ swiftCode: string;
32
+ }
33
+ interface DeleteBankingDetailArgs {
34
+ id: string;
35
+ prisma: any;
36
+ }
37
+ export declare const getBankingDetails: ({ prisma }: GetBankingDetailsArgs) => Promise<Array<BankingDetailBE>>;
38
+ export declare const getBankingDetailById: ({ prisma, id }: GetBankingDetailByIdArgs) => Promise<BankingDetailBE>;
39
+ export declare const postBankingDetail: ({ prisma, accountNumber, accountTitle, bankAddress, bankName, enabled, iban, id, preferenceId, swiftCode, }: PostBankingDetailArgs) => Promise<Array<BankingDetailBE>>;
40
+ export declare const deleteBankingDetail: ({ prisma, id, }: DeleteBankingDetailArgs) => Promise<BankingDetailBE>;
41
+ export {};
@@ -0,0 +1,69 @@
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.deleteBankingDetail = exports.postBankingDetail = exports.getBankingDetailById = exports.getBankingDetails = void 0;
14
+ const getBankingDetails = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma }) {
15
+ const bankingDetails = yield prisma.stellarBankingDetail.findMany({
16
+ orderBy: {
17
+ createdAt: 'desc',
18
+ },
19
+ });
20
+ return bankingDetails;
21
+ });
22
+ exports.getBankingDetails = getBankingDetails;
23
+ const getBankingDetailById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id }) {
24
+ const bankingDetail = yield prisma.stellarBankingDetail.findUnique({
25
+ where: {
26
+ id,
27
+ },
28
+ });
29
+ return bankingDetail;
30
+ });
31
+ exports.getBankingDetailById = getBankingDetailById;
32
+ const postBankingDetail = (_c) => __awaiter(void 0, [_c], void 0, function* ({ prisma, accountNumber, accountTitle, bankAddress, bankName, enabled, iban, id, preferenceId, swiftCode, }) {
33
+ const bankingDetail = yield prisma.stellarBankingDetail.upsert({
34
+ where: {
35
+ id,
36
+ },
37
+ update: {
38
+ accountNumber,
39
+ accountTitle,
40
+ bankAddress,
41
+ bankName,
42
+ enabled,
43
+ iban,
44
+ preferenceId,
45
+ swiftCode,
46
+ },
47
+ create: {
48
+ accountNumber,
49
+ accountTitle,
50
+ bankAddress,
51
+ bankName,
52
+ enabled,
53
+ iban,
54
+ preferenceId,
55
+ swiftCode,
56
+ },
57
+ });
58
+ return bankingDetail;
59
+ });
60
+ exports.postBankingDetail = postBankingDetail;
61
+ const deleteBankingDetail = (_d) => __awaiter(void 0, [_d], void 0, function* ({ prisma, id, }) {
62
+ const bankingDetail = yield prisma.stellarBankingDetail.delete({
63
+ where: {
64
+ id,
65
+ },
66
+ });
67
+ return bankingDetail;
68
+ });
69
+ exports.deleteBankingDetail = deleteBankingDetail;
@@ -10,7 +10,15 @@ interface CustomerBE {
10
10
  phone: string;
11
11
  updatedAt: string;
12
12
  }
13
- interface GetCustomerArgs {
13
+ interface GetCustomersArgs {
14
+ prisma: any;
15
+ }
16
+ interface GetCustomerByIdArgs {
17
+ id: string;
18
+ prisma: any;
19
+ }
20
+ interface GetCustomerByPhoneArgs {
21
+ phone: string;
14
22
  prisma: any;
15
23
  }
16
24
  interface PostCustomerArgs {
@@ -28,7 +36,9 @@ interface DeleteCustomerArgs {
28
36
  prisma: any;
29
37
  id: string;
30
38
  }
31
- export declare const getCustomer: ({ prisma }: GetCustomerArgs) => Promise<Array<CustomerBE>>;
39
+ export declare const getCustomers: ({ prisma }: GetCustomersArgs) => Promise<Array<CustomerBE>>;
40
+ export declare const getCustomerById: ({ prisma, id }: GetCustomerByIdArgs) => Promise<CustomerBE>;
41
+ export declare const getCustomerByPhone: ({ prisma, phone }: GetCustomerByPhoneArgs) => Promise<CustomerBE>;
32
42
  export declare const postCustomer: ({ prisma, id, address, city, country, email, firstName, lastName, phone, }: PostCustomerArgs) => Promise<Array<CustomerBE>>;
33
43
  export declare const deleteCustomer: ({ prisma, id }: DeleteCustomerArgs) => Promise<CustomerBE>;
34
44
  export {};
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  });
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.deleteCustomer = exports.postCustomer = exports.getCustomer = void 0;
14
- const getCustomer = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma }) {
13
+ exports.deleteCustomer = exports.postCustomer = exports.getCustomerByPhone = exports.getCustomerById = exports.getCustomers = void 0;
14
+ const getCustomers = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma }) {
15
15
  const customers = yield prisma.stellarCustomer.findMany({
16
16
  orderBy: {
17
17
  createdAt: 'desc',
@@ -19,8 +19,26 @@ const getCustomer = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma
19
19
  });
20
20
  return customers;
21
21
  });
22
- exports.getCustomer = getCustomer;
23
- const postCustomer = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id, address, city, country, email, firstName, lastName, phone, }) {
22
+ exports.getCustomers = getCustomers;
23
+ const getCustomerById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id }) {
24
+ const customer = yield prisma.stellarCustomer.findUnique({
25
+ where: {
26
+ id,
27
+ },
28
+ });
29
+ return customer;
30
+ });
31
+ exports.getCustomerById = getCustomerById;
32
+ const getCustomerByPhone = (_c) => __awaiter(void 0, [_c], void 0, function* ({ prisma, phone }) {
33
+ const customer = yield prisma.stellarCustomer.findUnique({
34
+ where: {
35
+ phone,
36
+ },
37
+ });
38
+ return customer;
39
+ });
40
+ exports.getCustomerByPhone = getCustomerByPhone;
41
+ const postCustomer = (_d) => __awaiter(void 0, [_d], void 0, function* ({ prisma, id, address, city, country, email, firstName, lastName, phone, }) {
24
42
  const customer = yield prisma.stellarCustomer.upsert({
25
43
  where: {
26
44
  id,
@@ -47,7 +65,7 @@ const postCustomer = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma
47
65
  return customer;
48
66
  });
49
67
  exports.postCustomer = postCustomer;
50
- const deleteCustomer = (_c) => __awaiter(void 0, [_c], void 0, function* ({ prisma, id }) {
68
+ const deleteCustomer = (_e) => __awaiter(void 0, [_e], void 0, function* ({ prisma, id }) {
51
69
  const customer = yield prisma.stellarCustomer.delete({
52
70
  where: {
53
71
  id,
File without changes
File without changes
package/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export * from './api/stellar-solutions/app-user';
2
+ export * from './api/stellar-solutions/banking-detail';
1
3
  export * from './api/stellar-solutions/customer';
2
4
  export * from './api/cors';
3
5
  export * from './constants';
package/index.js CHANGED
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./api/stellar-solutions/app-user"), exports);
18
+ __exportStar(require("./api/stellar-solutions/banking-detail"), exports);
17
19
  __exportStar(require("./api/stellar-solutions/customer"), exports);
18
20
  __exportStar(require("./api/cors"), exports);
19
21
  __exportStar(require("./constants"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pakistan/util-functions",
3
- "version": "1.22.34",
3
+ "version": "1.22.36",
4
4
  "description": "A library of all util functions",
5
5
  "main": "index.js",
6
6
  "scripts": {