@react-pakistan/util-functions 1.22.39 → 1.22.41

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.
Files changed (38) hide show
  1. package/api/stellar-solutions/app-user/index.d.ts +1 -8
  2. package/api/stellar-solutions/banking-detail/index.d.ts +1 -12
  3. package/api/stellar-solutions/branch/index.d.ts +2 -13
  4. package/api/stellar-solutions/company/index.d.ts +1 -9
  5. package/api/stellar-solutions/company/index.js +1 -1
  6. package/api/stellar-solutions/contact/index.d.ts +1 -11
  7. package/api/stellar-solutions/currency/index.d.ts +1 -10
  8. package/api/stellar-solutions/customer/index.d.ts +10 -12
  9. package/api/stellar-solutions/customer/index.js +21 -4
  10. package/api/stellar-solutions/expense/index.d.ts +36 -0
  11. package/api/stellar-solutions/expense/index.js +91 -0
  12. package/api/stellar-solutions/expense-category/index.d.ts +33 -0
  13. package/api/stellar-solutions/expense-category/index.js +85 -0
  14. package/api/stellar-solutions/lead/index.d.ts +34 -0
  15. package/api/stellar-solutions/lead/index.js +87 -0
  16. package/api/stellar-solutions/menu-order/index.d.ts +24 -0
  17. package/api/stellar-solutions/menu-order/index.js +59 -0
  18. package/api/stellar-solutions/payment/index.d.ts +30 -0
  19. package/api/stellar-solutions/payment/index.js +71 -0
  20. package/api/stellar-solutions/payment-mode/index.d.ts +22 -0
  21. package/api/stellar-solutions/payment-mode/index.js +52 -0
  22. package/api/stellar-solutions/preference/index.d.ts +5 -0
  23. package/api/stellar-solutions/preference/index.js +30 -0
  24. package/api/stellar-solutions/product/index.d.ts +41 -0
  25. package/api/stellar-solutions/product/index.js +100 -0
  26. package/api/stellar-solutions/product-category/index.d.ts +32 -0
  27. package/api/stellar-solutions/product-category/index.js +80 -0
  28. package/api/stellar-solutions/profile/index.d.ts +46 -0
  29. package/api/stellar-solutions/profile/index.js +101 -0
  30. package/api/stellar-solutions/quote-invoice/index.d.ts +54 -0
  31. package/api/stellar-solutions/quote-invoice/index.js +214 -0
  32. package/api/stellar-solutions/tax/index.d.ts +27 -0
  33. package/api/stellar-solutions/tax/index.js +65 -0
  34. package/api/stellar-solutions/type.d.ts +226 -0
  35. package/api/stellar-solutions/type.js +3 -0
  36. package/index.d.ts +13 -1
  37. package/index.js +13 -1
  38. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ import { PaymentBE } from '../type';
2
+ interface GetPaymentsArgs {
3
+ prisma: any;
4
+ }
5
+ interface GetPaymentByIdArgs {
6
+ id: string;
7
+ prisma: any;
8
+ }
9
+ interface PostPaymentArgs {
10
+ id: string;
11
+ amount: string;
12
+ attachment: string;
13
+ currency: string;
14
+ date: string;
15
+ description: string;
16
+ mode: string;
17
+ paymentType: string;
18
+ ref: string;
19
+ quoteInvoiceId: string;
20
+ prisma: any;
21
+ }
22
+ interface DeletePaymentArgs {
23
+ prisma: any;
24
+ id: string;
25
+ }
26
+ export declare const getPayments: ({ prisma, }: GetPaymentsArgs) => Promise<Array<PaymentBE>>;
27
+ export declare const getPaymentById: ({ id, prisma, }: GetPaymentByIdArgs) => Promise<PaymentBE>;
28
+ export declare const postPayment: ({ id, amount, attachment, currency, date, description, mode, paymentType, ref, quoteInvoiceId, prisma, }: PostPaymentArgs) => Promise<Array<PaymentBE>>;
29
+ export declare const deletePayment: ({ id, prisma, }: DeletePaymentArgs) => Promise<PaymentBE>;
30
+ export {};
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-explicit-any, no-restricted-globals */
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.deletePayment = exports.postPayment = exports.getPaymentById = exports.getPayments = void 0;
14
+ const getPayments = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
15
+ const payments = yield prisma.stellarPayment.findMany({
16
+ orderBy: {
17
+ createdAt: 'desc',
18
+ },
19
+ });
20
+ return payments;
21
+ });
22
+ exports.getPayments = getPayments;
23
+ const getPaymentById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ id, prisma, }) {
24
+ const payment = yield prisma.stellarPayment.findUnique({
25
+ where: {
26
+ id,
27
+ },
28
+ });
29
+ return payment;
30
+ });
31
+ exports.getPaymentById = getPaymentById;
32
+ const postPayment = (_c) => __awaiter(void 0, [_c], void 0, function* ({ id, amount, attachment, currency, date, description, mode, paymentType, ref, quoteInvoiceId, prisma, }) {
33
+ const payment = yield prisma.stellarPayment.upsert({
34
+ where: {
35
+ id,
36
+ },
37
+ update: {
38
+ amount,
39
+ attachment,
40
+ currency,
41
+ date,
42
+ description,
43
+ mode,
44
+ paymentType,
45
+ quoteInvoiceId,
46
+ ref,
47
+ },
48
+ create: {
49
+ amount,
50
+ attachment,
51
+ currency,
52
+ date,
53
+ description,
54
+ mode,
55
+ paymentType,
56
+ quoteInvoiceId,
57
+ ref,
58
+ },
59
+ });
60
+ return payment;
61
+ });
62
+ exports.postPayment = postPayment;
63
+ const deletePayment = (_d) => __awaiter(void 0, [_d], void 0, function* ({ id, prisma, }) {
64
+ const payment = yield prisma.stellarPayment.delete({
65
+ where: {
66
+ id,
67
+ },
68
+ });
69
+ return payment;
70
+ });
71
+ exports.deletePayment = deletePayment;
@@ -0,0 +1,22 @@
1
+ import { PaymentModeBE } from '../type';
2
+ interface GetPaymentModesArgs {
3
+ prisma: any;
4
+ }
5
+ interface GetPaymentModeByIdArgs {
6
+ id: string;
7
+ prisma: any;
8
+ }
9
+ interface PostPaymentModeArgs {
10
+ enabled: string;
11
+ id: string;
12
+ prisma: any;
13
+ }
14
+ interface DeletePaymentModeArgs {
15
+ id: string;
16
+ prisma: any;
17
+ }
18
+ export declare const getPaymentModes: ({ prisma, }: GetPaymentModesArgs) => Promise<Array<PaymentModeBE>>;
19
+ export declare const getPaymentModeById: ({ id, prisma, }: GetPaymentModeByIdArgs) => Promise<PaymentModeBE>;
20
+ export declare const postPaymentMode: ({ enabled, id, prisma, }: PostPaymentModeArgs) => Promise<Array<PaymentModeBE>>;
21
+ export declare const deletePaymentMode: ({ id, prisma, }: DeletePaymentModeArgs) => Promise<PaymentModeBE>;
22
+ export {};
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-explicit-any, no-restricted-globals */
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.deletePaymentMode = exports.postPaymentMode = exports.getPaymentModeById = exports.getPaymentModes = void 0;
14
+ const getPaymentModes = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
15
+ const paymentModes = yield prisma.stellarPaymentMode.findMany({
16
+ orderBy: {
17
+ createdAt: 'desc',
18
+ },
19
+ });
20
+ return paymentModes;
21
+ });
22
+ exports.getPaymentModes = getPaymentModes;
23
+ const getPaymentModeById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ id, prisma, }) {
24
+ const paymentMode = yield prisma.stellarPaymentMode.findUnique({
25
+ where: {
26
+ id,
27
+ },
28
+ });
29
+ return paymentMode;
30
+ });
31
+ exports.getPaymentModeById = getPaymentModeById;
32
+ const postPaymentMode = (_c) => __awaiter(void 0, [_c], void 0, function* ({ enabled, id, prisma, }) {
33
+ const paymentMode = yield prisma.stellarPaymentMode.update({
34
+ where: {
35
+ id,
36
+ },
37
+ data: {
38
+ enabled,
39
+ },
40
+ });
41
+ return paymentMode;
42
+ });
43
+ exports.postPaymentMode = postPaymentMode;
44
+ const deletePaymentMode = (_d) => __awaiter(void 0, [_d], void 0, function* ({ id, prisma, }) {
45
+ const paymentMode = yield prisma.stellarPaymentMode.delete({
46
+ where: {
47
+ id,
48
+ },
49
+ });
50
+ return paymentMode;
51
+ });
52
+ exports.deletePaymentMode = deletePaymentMode;
@@ -0,0 +1,5 @@
1
+ import { PreferenceBE } from '../type';
2
+ export interface GetPreferencesArgs {
3
+ prisma: any;
4
+ }
5
+ export declare const getPreferences: ({ prisma, }: GetPreferencesArgs) => Promise<Array<PreferenceBE>>;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-explicit-any, no-restricted-globals, @typescript-eslint/array-type */
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.getPreferences = void 0;
14
+ const getPreferences = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
15
+ const preferences = yield prisma.stellarPreference.findMany({
16
+ orderBy: {
17
+ createdAt: 'desc',
18
+ },
19
+ include: {
20
+ bankingDetails: true,
21
+ branches: true,
22
+ currencies: true,
23
+ menuOrder: true,
24
+ paymentModes: true,
25
+ taxes: true,
26
+ },
27
+ });
28
+ return preferences;
29
+ });
30
+ exports.getPreferences = getPreferences;
@@ -0,0 +1,41 @@
1
+ import { ProductBE } from '../type';
2
+ interface GetProductsArgs {
3
+ prisma: any;
4
+ }
5
+ interface GetProductByIdArgs {
6
+ id: string;
7
+ prisma: any;
8
+ }
9
+ interface PostProductsArgs {
10
+ currentPage: number;
11
+ pageLimit: number;
12
+ prisma: any;
13
+ queryWhere: {
14
+ [key: string]: any;
15
+ };
16
+ }
17
+ interface PostProductArgs {
18
+ authorName: string;
19
+ buyPrice: string;
20
+ currency: string;
21
+ description: string;
22
+ id: string;
23
+ image: string;
24
+ isbn: string;
25
+ name: string;
26
+ prisma: any;
27
+ productCategoryId: string;
28
+ quantity: string;
29
+ ref: string;
30
+ salePrice: string;
31
+ }
32
+ interface DeleteProductArgs {
33
+ prisma: any;
34
+ id: string;
35
+ }
36
+ export declare const getProducts: ({ prisma, }: GetProductsArgs) => Promise<Array<ProductBE>>;
37
+ export declare const getProductById: ({ prisma, id, }: GetProductByIdArgs) => Promise<ProductBE>;
38
+ export declare const postProducts: ({ currentPage, pageLimit, prisma, queryWhere, }: PostProductsArgs) => Promise<Array<ProductBE>>;
39
+ export declare const postProduct: ({ prisma, id, authorName, buyPrice, currency, description, image, isbn, name, productCategoryId, quantity, ref, salePrice, }: PostProductArgs) => Promise<Array<ProductBE>>;
40
+ export declare const deleteProduct: ({ prisma, id, }: DeleteProductArgs) => Promise<ProductBE>;
41
+ export {};
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-explicit-any, no-restricted-globals */
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.deleteProduct = exports.postProduct = exports.postProducts = exports.getProductById = exports.getProducts = void 0;
14
+ const getProducts = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
15
+ const products = yield prisma.stellarProduct.findMany({
16
+ orderBy: {
17
+ createdAt: 'desc',
18
+ },
19
+ include: {
20
+ productCategory: true,
21
+ quotesInvoices: true,
22
+ },
23
+ });
24
+ return products;
25
+ });
26
+ exports.getProducts = getProducts;
27
+ const getProductById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id, }) {
28
+ const product = yield prisma.stellarProduct.findUnique({
29
+ where: {
30
+ id,
31
+ },
32
+ include: {
33
+ productCategory: true,
34
+ quotesInvoices: true,
35
+ },
36
+ });
37
+ return product;
38
+ });
39
+ exports.getProductById = getProductById;
40
+ const postProducts = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
41
+ const products = yield prisma.$transaction([
42
+ prisma.stellarProduct.count({
43
+ where: queryWhere,
44
+ }),
45
+ prisma.stellarProduct.findMany({
46
+ orderBy: {
47
+ createdAt: 'desc',
48
+ },
49
+ where: queryWhere,
50
+ take: pageLimit,
51
+ skip: currentPage === 1 ? 0 : currentPage - 1 * pageLimit,
52
+ }),
53
+ ]);
54
+ return products;
55
+ });
56
+ exports.postProducts = postProducts;
57
+ const postProduct = (_d) => __awaiter(void 0, [_d], void 0, function* ({ prisma, id, authorName, buyPrice, currency, description, image, isbn, name, productCategoryId, quantity, ref, salePrice, }) {
58
+ const product = yield prisma.stellarProduct.upsert({
59
+ where: {
60
+ id,
61
+ },
62
+ update: {
63
+ authorName,
64
+ buyPrice,
65
+ currency,
66
+ description,
67
+ image,
68
+ isbn,
69
+ name,
70
+ productCategoryId,
71
+ quantity,
72
+ ref,
73
+ salePrice,
74
+ },
75
+ create: {
76
+ authorName,
77
+ buyPrice,
78
+ currency,
79
+ description,
80
+ image,
81
+ isbn,
82
+ name,
83
+ productCategoryId,
84
+ quantity,
85
+ ref,
86
+ salePrice,
87
+ },
88
+ });
89
+ return product;
90
+ });
91
+ exports.postProduct = postProduct;
92
+ const deleteProduct = (_e) => __awaiter(void 0, [_e], void 0, function* ({ prisma, id, }) {
93
+ const product = yield prisma.stellarProduct.delete({
94
+ where: {
95
+ id,
96
+ },
97
+ });
98
+ return product;
99
+ });
100
+ exports.deleteProduct = deleteProduct;
@@ -0,0 +1,32 @@
1
+ import { ProductCategoryBE } from '../type';
2
+ interface GetProductCategoriesArgs {
3
+ prisma: any;
4
+ }
5
+ interface GetProductCategoryByIdArgs {
6
+ id: string;
7
+ prisma: any;
8
+ }
9
+ interface PostProductCategoriesArgs {
10
+ currentPage: number;
11
+ pageLimit: number;
12
+ prisma: any;
13
+ queryWhere: {
14
+ [key: string]: any;
15
+ };
16
+ }
17
+ interface PostProductCategoryArgs {
18
+ description: string;
19
+ id: string;
20
+ name: string;
21
+ prisma: any;
22
+ }
23
+ interface DeleteProductCategoryArgs {
24
+ prisma: any;
25
+ id: string;
26
+ }
27
+ export declare const getProductCategories: ({ prisma, }: GetProductCategoriesArgs) => Promise<Array<ProductCategoryBE>>;
28
+ export declare const getProductCategoryById: ({ prisma, id, }: GetProductCategoryByIdArgs) => Promise<ProductCategoryBE>;
29
+ export declare const postProductCategories: ({ currentPage, pageLimit, prisma, queryWhere, }: PostProductCategoriesArgs) => Promise<Array<ProductCategoryBE>>;
30
+ export declare const postProductCategory: ({ description, id, name, prisma, }: PostProductCategoryArgs) => Promise<Array<ProductCategoryBE>>;
31
+ export declare const deleteProductCategory: ({ prisma, id, }: DeleteProductCategoryArgs) => Promise<ProductCategoryBE>;
32
+ export {};
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-explicit-any, no-restricted-globals, @typescript-eslint/array-type */
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.deleteProductCategory = exports.postProductCategory = exports.postProductCategories = exports.getProductCategoryById = exports.getProductCategories = void 0;
14
+ const getProductCategories = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
15
+ const productCategories = yield prisma.stellarProductCategory.findMany({
16
+ orderBy: {
17
+ createdAt: 'desc',
18
+ },
19
+ include: {
20
+ products: true,
21
+ },
22
+ });
23
+ return productCategories;
24
+ });
25
+ exports.getProductCategories = getProductCategories;
26
+ const getProductCategoryById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id, }) {
27
+ const productCategory = yield prisma.stellarProductCategory.findUnique({
28
+ where: {
29
+ id,
30
+ },
31
+ include: {
32
+ products: true,
33
+ },
34
+ });
35
+ return productCategory;
36
+ });
37
+ exports.getProductCategoryById = getProductCategoryById;
38
+ const postProductCategories = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
39
+ const productCategories = yield prisma.$transaction([
40
+ prisma.stellarProductCategory.count({
41
+ where: queryWhere,
42
+ }),
43
+ prisma.stellarProductCategory.findMany({
44
+ orderBy: {
45
+ createdAt: 'desc',
46
+ },
47
+ where: queryWhere,
48
+ take: pageLimit,
49
+ skip: currentPage === 1 ? 0 : currentPage - 1 * pageLimit,
50
+ }),
51
+ ]);
52
+ return productCategories;
53
+ });
54
+ exports.postProductCategories = postProductCategories;
55
+ const postProductCategory = (_d) => __awaiter(void 0, [_d], void 0, function* ({ description, id, name, prisma, }) {
56
+ const productCategory = yield prisma.stellarProductCategory.upsert({
57
+ where: {
58
+ id,
59
+ },
60
+ update: {
61
+ description,
62
+ name,
63
+ },
64
+ create: {
65
+ description,
66
+ name,
67
+ },
68
+ });
69
+ return productCategory;
70
+ });
71
+ exports.postProductCategory = postProductCategory;
72
+ const deleteProductCategory = (_e) => __awaiter(void 0, [_e], void 0, function* ({ prisma, id, }) {
73
+ const productCategory = yield prisma.stellarProductCategory.delete({
74
+ where: {
75
+ id,
76
+ },
77
+ });
78
+ return productCategory;
79
+ });
80
+ exports.deleteProductCategory = deleteProductCategory;
@@ -0,0 +1,46 @@
1
+ import { ProfileBE } from '../type';
2
+ interface GetProfilesArgs {
3
+ prisma: any;
4
+ }
5
+ interface GetProfileByIdArgs {
6
+ id: string;
7
+ prisma: any;
8
+ }
9
+ interface GetProfileByUserIdArgs {
10
+ prisma: any;
11
+ userId: string;
12
+ }
13
+ interface PostProfilesArgs {
14
+ currentPage: number;
15
+ pageLimit: number;
16
+ prisma: any;
17
+ queryWhere: {
18
+ [key: string]: any;
19
+ };
20
+ }
21
+ interface PostProfileArgs {
22
+ avatar: string;
23
+ dob: string;
24
+ email: string;
25
+ firstName: string;
26
+ gender: string;
27
+ id: string;
28
+ language: string;
29
+ lastName: string;
30
+ location: string;
31
+ phone: string;
32
+ prisma: any;
33
+ skill: string;
34
+ userId: string;
35
+ }
36
+ interface DeleteProfileArgs {
37
+ prisma: any;
38
+ id: string;
39
+ }
40
+ export declare const getProfiles: ({ prisma, }: GetProfilesArgs) => Promise<Array<ProfileBE>>;
41
+ export declare const getProfileById: ({ prisma, id, }: GetProfileByIdArgs) => Promise<ProfileBE>;
42
+ export declare const getProfileByUserId: ({ prisma, userId, }: GetProfileByUserIdArgs) => Promise<ProfileBE>;
43
+ export declare const postProfiles: ({ currentPage, pageLimit, prisma, queryWhere, }: PostProfilesArgs) => Promise<Array<ProfileBE>>;
44
+ export declare const postProfile: ({ avatar, dob, email, firstName, gender, id, language, lastName, location, phone, prisma, skill, userId, }: PostProfileArgs) => Promise<Array<ProfileBE>>;
45
+ export declare const DeleteProfile: ({ prisma, id, }: DeleteProfileArgs) => Promise<ProfileBE>;
46
+ export {};
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-explicit-any, no-restricted-globals */
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.DeleteProfile = exports.postProfile = exports.postProfiles = exports.getProfileByUserId = exports.getProfileById = exports.getProfiles = void 0;
14
+ const getProfiles = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
15
+ const profiles = yield prisma.stellarProfile.findMany({
16
+ orderBy: {
17
+ createdAt: 'desc',
18
+ },
19
+ });
20
+ return profiles;
21
+ });
22
+ exports.getProfiles = getProfiles;
23
+ const getProfileById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id, }) {
24
+ const profile = yield prisma.stellarProfile.findUnique({
25
+ where: {
26
+ id,
27
+ },
28
+ });
29
+ return profile;
30
+ });
31
+ exports.getProfileById = getProfileById;
32
+ const getProfileByUserId = (_c) => __awaiter(void 0, [_c], void 0, function* ({ prisma, userId, }) {
33
+ const profile = yield prisma.stellarProfile.findFirst({
34
+ where: {
35
+ userId,
36
+ },
37
+ });
38
+ return profile;
39
+ });
40
+ exports.getProfileByUserId = getProfileByUserId;
41
+ const postProfiles = (_d) => __awaiter(void 0, [_d], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
42
+ const profiles = yield prisma.$transaction([
43
+ prisma.stellarProfile.count({
44
+ where: queryWhere,
45
+ }),
46
+ prisma.stellarProfile.findMany({
47
+ orderBy: {
48
+ createdAt: 'desc',
49
+ },
50
+ where: queryWhere,
51
+ take: pageLimit,
52
+ skip: currentPage === 1 ? 0 : currentPage - 1 * pageLimit,
53
+ }),
54
+ ]);
55
+ return profiles;
56
+ });
57
+ exports.postProfiles = postProfiles;
58
+ const postProfile = (_e) => __awaiter(void 0, [_e], void 0, function* ({ avatar, dob, email, firstName, gender, id, language, lastName, location, phone, prisma, skill, userId, }) {
59
+ const profile = yield prisma.stellarProfile.upsert({
60
+ where: {
61
+ id,
62
+ },
63
+ update: {
64
+ avatar,
65
+ dob,
66
+ email,
67
+ firstName,
68
+ gender,
69
+ language,
70
+ lastName,
71
+ location,
72
+ phone,
73
+ skill,
74
+ userId,
75
+ },
76
+ create: {
77
+ avatar,
78
+ dob,
79
+ email,
80
+ firstName,
81
+ gender,
82
+ language,
83
+ lastName,
84
+ location,
85
+ phone,
86
+ skill,
87
+ userId,
88
+ },
89
+ });
90
+ return profile;
91
+ });
92
+ exports.postProfile = postProfile;
93
+ const DeleteProfile = (_f) => __awaiter(void 0, [_f], void 0, function* ({ prisma, id, }) {
94
+ const profile = yield prisma.stellarProfile.delete({
95
+ where: {
96
+ id,
97
+ },
98
+ });
99
+ return profile;
100
+ });
101
+ exports.DeleteProfile = DeleteProfile;
@@ -0,0 +1,54 @@
1
+ import { QuoteInvoiceBE } from '../type';
2
+ interface GetQuotesInvoicesArgs {
3
+ prisma: any;
4
+ }
5
+ interface GetQuoteInvoiceByIdArgs {
6
+ id: string;
7
+ prisma: any;
8
+ }
9
+ interface PostQuotesInvoicesArgs {
10
+ currentPage: number;
11
+ pageLimit: number;
12
+ prisma: any;
13
+ queryWhere: {
14
+ [key: string]: any;
15
+ };
16
+ }
17
+ interface PostQuoteInvoiceArgs {
18
+ category: string;
19
+ companyId: string;
20
+ currency: string;
21
+ customerId: string;
22
+ date: string;
23
+ discount: string;
24
+ discountUnit: string;
25
+ expiryDate: string;
26
+ id: string;
27
+ mode: string;
28
+ note: string;
29
+ ref: string;
30
+ services: any[];
31
+ status: string;
32
+ subTotal: string;
33
+ taxValue: string;
34
+ total: string;
35
+ productIds: any[];
36
+ phone: string;
37
+ lastName: string;
38
+ firstName: string;
39
+ email: string;
40
+ country: string;
41
+ city: string;
42
+ address: string;
43
+ prisma: any;
44
+ }
45
+ interface DeleteQuoteInvoiceArgs {
46
+ prisma: any;
47
+ id: string;
48
+ }
49
+ export declare const getQuotesInvoices: ({ prisma, }: GetQuotesInvoicesArgs) => Promise<Array<QuoteInvoiceBE>>;
50
+ export declare const getQuoteInvoiceById: ({ prisma, id, }: GetQuoteInvoiceByIdArgs) => Promise<QuoteInvoiceBE>;
51
+ export declare const postQuotesInvoices: ({ currentPage, pageLimit, prisma, queryWhere, }: PostQuotesInvoicesArgs) => Promise<Array<QuoteInvoiceBE>>;
52
+ export declare const postQuoteInvoice: ({ category, companyId, currency, customerId, date, discount, discountUnit, expiryDate, id, mode, note, ref, services, status, subTotal, taxValue, total, productIds, phone, lastName, firstName, email, country, city, address, prisma, }: PostQuoteInvoiceArgs) => Promise<Array<QuoteInvoiceBE>>;
53
+ export declare const DeleteQuoteInvoice: ({ prisma, id, }: DeleteQuoteInvoiceArgs) => Promise<QuoteInvoiceBE>;
54
+ export {};