@react-pakistan/util-functions 1.22.43 → 1.22.44
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/app-user/index.js +4 -4
- package/api/stellar-solutions/banking-detail/index.d.ts +1 -1
- package/api/stellar-solutions/banking-detail/index.js +5 -5
- package/api/stellar-solutions/branch/index.d.ts +1 -1
- package/api/stellar-solutions/branch/index.js +5 -5
- package/api/stellar-solutions/company/index.d.ts +2 -2
- package/api/stellar-solutions/company/index.js +8 -8
- package/api/stellar-solutions/contact/index.d.ts +1 -1
- package/api/stellar-solutions/contact/index.js +7 -7
- package/api/stellar-solutions/currency/index.js +4 -4
- package/api/stellar-solutions/customer/index.d.ts +2 -2
- package/api/stellar-solutions/customer/index.js +9 -9
- package/api/stellar-solutions/expense/index.js +6 -6
- package/api/stellar-solutions/expense-category/index.js +6 -6
- package/api/stellar-solutions/lead/index.js +6 -6
- package/api/stellar-solutions/menu-order/index.js +4 -4
- package/api/stellar-solutions/payment/index.js +6 -6
- package/api/stellar-solutions/payment-mode/index.js +4 -4
- package/api/stellar-solutions/preference/index.js +1 -1
- package/api/stellar-solutions/product/index.js +6 -6
- package/api/stellar-solutions/product-category/index.js +6 -6
- package/api/stellar-solutions/profile/index.js +7 -7
- package/api/stellar-solutions/quote-invoice/index.js +10 -10
- package/api/stellar-solutions/tax/index.js +4 -4
- package/api/stellar-solutions/type.d.ts +1 -1
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.deleteAppUser = exports.postAppUser = exports.getAppUserById = exports.getAppUsers = void 0;
|
|
14
14
|
const getAppUsers = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma }) {
|
|
15
|
-
const appUsers = yield prisma.
|
|
15
|
+
const appUsers = yield prisma.appUser.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -21,7 +21,7 @@ const getAppUsers = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma
|
|
|
21
21
|
});
|
|
22
22
|
exports.getAppUsers = getAppUsers;
|
|
23
23
|
const getAppUserById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id }) {
|
|
24
|
-
const appUser = yield prisma.
|
|
24
|
+
const appUser = yield prisma.appUser.findUnique({
|
|
25
25
|
where: {
|
|
26
26
|
id,
|
|
27
27
|
},
|
|
@@ -30,7 +30,7 @@ const getAppUserById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ pris
|
|
|
30
30
|
});
|
|
31
31
|
exports.getAppUserById = getAppUserById;
|
|
32
32
|
const postAppUser = (_c) => __awaiter(void 0, [_c], void 0, function* ({ prisma, id, email, firstName, lastName, }) {
|
|
33
|
-
const appUser = yield prisma.
|
|
33
|
+
const appUser = yield prisma.appUser.upsert({
|
|
34
34
|
where: {
|
|
35
35
|
id,
|
|
36
36
|
},
|
|
@@ -49,7 +49,7 @@ const postAppUser = (_c) => __awaiter(void 0, [_c], void 0, function* ({ prisma,
|
|
|
49
49
|
});
|
|
50
50
|
exports.postAppUser = postAppUser;
|
|
51
51
|
const deleteAppUser = (_d) => __awaiter(void 0, [_d], void 0, function* ({ prisma, id }) {
|
|
52
|
-
const appUser = yield prisma.
|
|
52
|
+
const appUser = yield prisma.appUser.delete({
|
|
53
53
|
where: {
|
|
54
54
|
id,
|
|
55
55
|
},
|
|
@@ -23,7 +23,7 @@ interface DeleteBankingDetailArgs {
|
|
|
23
23
|
id: string;
|
|
24
24
|
prisma: any;
|
|
25
25
|
}
|
|
26
|
-
export declare const getBankingDetails: ({ prisma }: GetBankingDetailsArgs) => Promise<Array<BankingDetailBE>>;
|
|
26
|
+
export declare const getBankingDetails: ({ prisma, }: GetBankingDetailsArgs) => Promise<Array<BankingDetailBE>>;
|
|
27
27
|
export declare const getBankingDetailById: ({ prisma, id }: GetBankingDetailByIdArgs) => Promise<BankingDetailBE>;
|
|
28
28
|
export declare const postBankingDetail: ({ prisma, accountNumber, accountTitle, bankAddress, bankName, enabled, iban, id, preferenceId, swiftCode, }: PostBankingDetailArgs) => Promise<Array<BankingDetailBE>>;
|
|
29
29
|
export declare const deleteBankingDetail: ({ prisma, id, }: DeleteBankingDetailArgs) => Promise<BankingDetailBE>;
|
|
@@ -11,8 +11,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
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.
|
|
14
|
+
const getBankingDetails = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
+
const bankingDetails = yield prisma.bankingDetail.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -21,7 +21,7 @@ const getBankingDetails = (_a) => __awaiter(void 0, [_a], void 0, function* ({ p
|
|
|
21
21
|
});
|
|
22
22
|
exports.getBankingDetails = getBankingDetails;
|
|
23
23
|
const getBankingDetailById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id }) {
|
|
24
|
-
const bankingDetail = yield prisma.
|
|
24
|
+
const bankingDetail = yield prisma.bankingDetail.findUnique({
|
|
25
25
|
where: {
|
|
26
26
|
id,
|
|
27
27
|
},
|
|
@@ -30,7 +30,7 @@ const getBankingDetailById = (_b) => __awaiter(void 0, [_b], void 0, function* (
|
|
|
30
30
|
});
|
|
31
31
|
exports.getBankingDetailById = getBankingDetailById;
|
|
32
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.
|
|
33
|
+
const bankingDetail = yield prisma.bankingDetail.upsert({
|
|
34
34
|
where: {
|
|
35
35
|
id,
|
|
36
36
|
},
|
|
@@ -59,7 +59,7 @@ const postBankingDetail = (_c) => __awaiter(void 0, [_c], void 0, function* ({ p
|
|
|
59
59
|
});
|
|
60
60
|
exports.postBankingDetail = postBankingDetail;
|
|
61
61
|
const deleteBankingDetail = (_d) => __awaiter(void 0, [_d], void 0, function* ({ prisma, id, }) {
|
|
62
|
-
const bankingDetail = yield prisma.
|
|
62
|
+
const bankingDetail = yield prisma.bankingDetail.delete({
|
|
63
63
|
where: {
|
|
64
64
|
id,
|
|
65
65
|
},
|
|
@@ -22,7 +22,7 @@ interface DeleteBranchArgs {
|
|
|
22
22
|
id: string;
|
|
23
23
|
prisma: any;
|
|
24
24
|
}
|
|
25
|
-
export declare const getBranches: ({ prisma }: GetBranchesArgs) => Promise<Array<BranchBE>>;
|
|
25
|
+
export declare const getBranches: ({ prisma, }: GetBranchesArgs) => Promise<Array<BranchBE>>;
|
|
26
26
|
export declare const getBranchById: ({ prisma, id }: GetBranchByIdArgs) => Promise<BranchBE>;
|
|
27
27
|
export declare const postBranch: ({ prisma, branchAddress, branchName, enabled, id, isDefault, personEmail, personName, personPhone, preferenceId, }: PostBranchArgs) => Promise<Array<BranchBE>>;
|
|
28
28
|
export declare const deleteBranch: ({ prisma, id, }: DeleteBranchArgs) => Promise<BranchBE>;
|
|
@@ -11,8 +11,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.deleteBranch = exports.postBranch = exports.getBranchById = exports.getBranches = void 0;
|
|
14
|
-
const getBranches = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma }) {
|
|
15
|
-
const branches = yield prisma.
|
|
14
|
+
const getBranches = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
+
const branches = yield prisma.branch.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -21,7 +21,7 @@ const getBranches = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma
|
|
|
21
21
|
});
|
|
22
22
|
exports.getBranches = getBranches;
|
|
23
23
|
const getBranchById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id }) {
|
|
24
|
-
const branch = yield prisma.
|
|
24
|
+
const branch = yield prisma.branch.findUnique({
|
|
25
25
|
where: {
|
|
26
26
|
id,
|
|
27
27
|
},
|
|
@@ -30,7 +30,7 @@ const getBranchById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prism
|
|
|
30
30
|
});
|
|
31
31
|
exports.getBranchById = getBranchById;
|
|
32
32
|
const postBranch = (_c) => __awaiter(void 0, [_c], void 0, function* ({ prisma, branchAddress, branchName, enabled, id, isDefault, personEmail, personName, personPhone, preferenceId, }) {
|
|
33
|
-
const branch = yield prisma.
|
|
33
|
+
const branch = yield prisma.branch.upsert({
|
|
34
34
|
where: {
|
|
35
35
|
id,
|
|
36
36
|
},
|
|
@@ -59,7 +59,7 @@ const postBranch = (_c) => __awaiter(void 0, [_c], void 0, function* ({ prisma,
|
|
|
59
59
|
});
|
|
60
60
|
exports.postBranch = postBranch;
|
|
61
61
|
const deleteBranch = (_d) => __awaiter(void 0, [_d], void 0, function* ({ prisma, id, }) {
|
|
62
|
-
const branch = yield prisma.
|
|
62
|
+
const branch = yield prisma.branch.delete({
|
|
63
63
|
where: {
|
|
64
64
|
id,
|
|
65
65
|
},
|
|
@@ -27,8 +27,8 @@ interface DeleteCompanyArgs {
|
|
|
27
27
|
id: string;
|
|
28
28
|
prisma: any;
|
|
29
29
|
}
|
|
30
|
-
export declare const getCompanies: ({ prisma }: GetCompaniesArgs) => Promise<Array<CompanyBE>>;
|
|
31
|
-
export declare const getCompanyById: ({ prisma, id }: GetCompanyByIdArgs) => Promise<CompanyBE>;
|
|
30
|
+
export declare const getCompanies: ({ prisma, }: GetCompaniesArgs) => Promise<Array<CompanyBE>>;
|
|
31
|
+
export declare const getCompanyById: ({ prisma, id, }: GetCompanyByIdArgs) => Promise<CompanyBE>;
|
|
32
32
|
export declare const postCompanies: ({ prisma, queryWhere, pageLimit, currentPage, }: PostCompaniesArgs) => Promise<Array<CompanyBE>>;
|
|
33
33
|
export declare const postCompany: ({ prisma, country, email, name, id, phone, website, }: PostCompanyArgs) => Promise<Array<CompanyBE>>;
|
|
34
34
|
export declare const deleteCompany: ({ prisma, id, }: DeleteCompanyArgs) => Promise<CompanyBE>;
|
|
@@ -11,8 +11,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.deleteCompany = exports.postCompany = exports.postCompanies = exports.getCompanyById = exports.getCompanies = void 0;
|
|
14
|
-
const getCompanies = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma }) {
|
|
15
|
-
const companies = yield prisma.
|
|
14
|
+
const getCompanies = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
+
const companies = yield prisma.company.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -20,8 +20,8 @@ const getCompanies = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma
|
|
|
20
20
|
return companies;
|
|
21
21
|
});
|
|
22
22
|
exports.getCompanies = getCompanies;
|
|
23
|
-
const getCompanyById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id }) {
|
|
24
|
-
const company = yield prisma.
|
|
23
|
+
const getCompanyById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id, }) {
|
|
24
|
+
const company = yield prisma.company.findUnique({
|
|
25
25
|
where: {
|
|
26
26
|
id,
|
|
27
27
|
},
|
|
@@ -31,10 +31,10 @@ const getCompanyById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ pris
|
|
|
31
31
|
exports.getCompanyById = getCompanyById;
|
|
32
32
|
const postCompanies = (_c) => __awaiter(void 0, [_c], void 0, function* ({ prisma, queryWhere, pageLimit, currentPage, }) {
|
|
33
33
|
const companies = yield prisma.$transaction([
|
|
34
|
-
prisma.
|
|
34
|
+
prisma.company.count({
|
|
35
35
|
where: queryWhere,
|
|
36
36
|
}),
|
|
37
|
-
prisma.
|
|
37
|
+
prisma.company.findMany({
|
|
38
38
|
orderBy: {
|
|
39
39
|
createdAt: 'desc',
|
|
40
40
|
},
|
|
@@ -50,7 +50,7 @@ const postCompanies = (_c) => __awaiter(void 0, [_c], void 0, function* ({ prism
|
|
|
50
50
|
});
|
|
51
51
|
exports.postCompanies = postCompanies;
|
|
52
52
|
const postCompany = (_d) => __awaiter(void 0, [_d], void 0, function* ({ prisma, country, email, name, id, phone, website, }) {
|
|
53
|
-
const company = yield prisma.
|
|
53
|
+
const company = yield prisma.company.upsert({
|
|
54
54
|
where: {
|
|
55
55
|
id,
|
|
56
56
|
},
|
|
@@ -73,7 +73,7 @@ const postCompany = (_d) => __awaiter(void 0, [_d], void 0, function* ({ prisma,
|
|
|
73
73
|
});
|
|
74
74
|
exports.postCompany = postCompany;
|
|
75
75
|
const deleteCompany = (_e) => __awaiter(void 0, [_e], void 0, function* ({ prisma, id, }) {
|
|
76
|
-
const company = yield prisma.
|
|
76
|
+
const company = yield prisma.company.delete({
|
|
77
77
|
where: {
|
|
78
78
|
id,
|
|
79
79
|
},
|
|
@@ -28,7 +28,7 @@ interface DeleteContactArgs {
|
|
|
28
28
|
id: string;
|
|
29
29
|
prisma: any;
|
|
30
30
|
}
|
|
31
|
-
export declare const getContacts: ({ prisma }: GetContactsArgs) => Promise<Array<ContactBE>>;
|
|
31
|
+
export declare const getContacts: ({ prisma, }: GetContactsArgs) => Promise<Array<ContactBE>>;
|
|
32
32
|
export declare const getContactById: ({ prisma, id }: GetContactByIdArgs) => Promise<ContactBE>;
|
|
33
33
|
export declare const postContacts: ({ currentPage, pageLimit, prisma, queryWhere, }: PostContactsArgs) => Promise<Array<ContactBE>>;
|
|
34
34
|
export declare const postContact: ({ prisma, id, companyId, country, email, firstName, lastName, phone, }: PostContactArgs) => Promise<Array<ContactBE>>;
|
|
@@ -11,8 +11,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.deleteContact = exports.postContact = exports.postContacts = exports.getContactById = exports.getContacts = void 0;
|
|
14
|
-
const getContacts = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma }) {
|
|
15
|
-
const contacts = yield prisma.
|
|
14
|
+
const getContacts = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
+
const contacts = yield prisma.contact.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -24,7 +24,7 @@ const getContacts = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma
|
|
|
24
24
|
});
|
|
25
25
|
exports.getContacts = getContacts;
|
|
26
26
|
const getContactById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id }) {
|
|
27
|
-
const contact = yield prisma.
|
|
27
|
+
const contact = yield prisma.contact.findUnique({
|
|
28
28
|
where: {
|
|
29
29
|
id,
|
|
30
30
|
},
|
|
@@ -37,10 +37,10 @@ const getContactById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ pris
|
|
|
37
37
|
exports.getContactById = getContactById;
|
|
38
38
|
const postContacts = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
|
|
39
39
|
const contacts = yield prisma.$transaction([
|
|
40
|
-
prisma.
|
|
40
|
+
prisma.contact.count({
|
|
41
41
|
where: queryWhere,
|
|
42
42
|
}),
|
|
43
|
-
prisma.
|
|
43
|
+
prisma.contact.findMany({
|
|
44
44
|
orderBy: {
|
|
45
45
|
createdAt: 'desc',
|
|
46
46
|
},
|
|
@@ -56,7 +56,7 @@ const postContacts = (_c) => __awaiter(void 0, [_c], void 0, function* ({ curren
|
|
|
56
56
|
});
|
|
57
57
|
exports.postContacts = postContacts;
|
|
58
58
|
const postContact = (_d) => __awaiter(void 0, [_d], void 0, function* ({ prisma, id, companyId, country, email, firstName, lastName, phone, }) {
|
|
59
|
-
const contact = yield prisma.
|
|
59
|
+
const contact = yield prisma.contact.upsert({
|
|
60
60
|
where: {
|
|
61
61
|
id,
|
|
62
62
|
},
|
|
@@ -81,7 +81,7 @@ const postContact = (_d) => __awaiter(void 0, [_d], void 0, function* ({ prisma,
|
|
|
81
81
|
});
|
|
82
82
|
exports.postContact = postContact;
|
|
83
83
|
const deleteContact = (_e) => __awaiter(void 0, [_e], void 0, function* ({ prisma, id }) {
|
|
84
|
-
const contact = yield prisma.
|
|
84
|
+
const contact = yield prisma.contact.delete({
|
|
85
85
|
where: {
|
|
86
86
|
id,
|
|
87
87
|
},
|
|
@@ -12,7 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.deleteCurrency = exports.postCurrency = exports.getCurrencyById = exports.getCurrencies = void 0;
|
|
14
14
|
const getCurrencies = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
-
const customers = yield prisma.
|
|
15
|
+
const customers = yield prisma.currency.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -21,7 +21,7 @@ const getCurrencies = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prism
|
|
|
21
21
|
});
|
|
22
22
|
exports.getCurrencies = getCurrencies;
|
|
23
23
|
const getCurrencyById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ id, prisma, }) {
|
|
24
|
-
const currency = yield prisma.
|
|
24
|
+
const currency = yield prisma.currency.findUnique({
|
|
25
25
|
where: {
|
|
26
26
|
id,
|
|
27
27
|
},
|
|
@@ -30,7 +30,7 @@ const getCurrencyById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ id,
|
|
|
30
30
|
});
|
|
31
31
|
exports.getCurrencyById = getCurrencyById;
|
|
32
32
|
const postCurrency = (_c) => __awaiter(void 0, [_c], void 0, function* ({ code, enabled, id, isDefault, label, preferenceId, prisma, }) {
|
|
33
|
-
const currency = yield prisma.
|
|
33
|
+
const currency = yield prisma.currency.upsert({
|
|
34
34
|
where: {
|
|
35
35
|
id,
|
|
36
36
|
},
|
|
@@ -53,7 +53,7 @@ const postCurrency = (_c) => __awaiter(void 0, [_c], void 0, function* ({ code,
|
|
|
53
53
|
});
|
|
54
54
|
exports.postCurrency = postCurrency;
|
|
55
55
|
const deleteCurrency = (_d) => __awaiter(void 0, [_d], void 0, function* ({ id, prisma, }) {
|
|
56
|
-
const currency = yield prisma.
|
|
56
|
+
const currency = yield prisma.currency.delete({
|
|
57
57
|
where: {
|
|
58
58
|
id,
|
|
59
59
|
},
|
|
@@ -33,8 +33,8 @@ interface DeleteCustomerArgs {
|
|
|
33
33
|
prisma: any;
|
|
34
34
|
id: string;
|
|
35
35
|
}
|
|
36
|
-
export declare const getCustomers: ({ prisma }: GetCustomersArgs) => Promise<Array<CustomerBE>>;
|
|
37
|
-
export declare const getCustomerById: ({ prisma, id }: GetCustomerByIdArgs) => Promise<CustomerBE>;
|
|
36
|
+
export declare const getCustomers: ({ prisma, }: GetCustomersArgs) => Promise<Array<CustomerBE>>;
|
|
37
|
+
export declare const getCustomerById: ({ prisma, id, }: GetCustomerByIdArgs) => Promise<CustomerBE>;
|
|
38
38
|
export declare const getCustomerByPhone: ({ prisma, phone }: GetCustomerByPhoneArgs) => Promise<CustomerBE>;
|
|
39
39
|
export declare const postCustomers: ({ currentPage, pageLimit, prisma, queryWhere, }: PostCustomersArgs) => Promise<Array<CustomerBE>>;
|
|
40
40
|
export declare const postCustomer: ({ prisma, id, address, city, country, email, firstName, lastName, phone, }: PostCustomerArgs) => Promise<Array<CustomerBE>>;
|
|
@@ -11,8 +11,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.deleteCustomer = exports.postCustomer = exports.postCustomers = exports.getCustomerByPhone = exports.getCustomerById = exports.getCustomers = void 0;
|
|
14
|
-
const getCustomers = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma }) {
|
|
15
|
-
const customers = yield prisma.
|
|
14
|
+
const getCustomers = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
+
const customers = yield prisma.customer.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -23,8 +23,8 @@ const getCustomers = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma
|
|
|
23
23
|
return customers;
|
|
24
24
|
});
|
|
25
25
|
exports.getCustomers = getCustomers;
|
|
26
|
-
const getCustomerById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id }) {
|
|
27
|
-
const customer = yield prisma.
|
|
26
|
+
const getCustomerById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id, }) {
|
|
27
|
+
const customer = yield prisma.customer.findUnique({
|
|
28
28
|
where: {
|
|
29
29
|
id,
|
|
30
30
|
},
|
|
@@ -36,7 +36,7 @@ const getCustomerById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ pri
|
|
|
36
36
|
});
|
|
37
37
|
exports.getCustomerById = getCustomerById;
|
|
38
38
|
const getCustomerByPhone = (_c) => __awaiter(void 0, [_c], void 0, function* ({ prisma, phone }) {
|
|
39
|
-
const customer = yield prisma.
|
|
39
|
+
const customer = yield prisma.customer.findUnique({
|
|
40
40
|
where: {
|
|
41
41
|
phone,
|
|
42
42
|
},
|
|
@@ -46,10 +46,10 @@ const getCustomerByPhone = (_c) => __awaiter(void 0, [_c], void 0, function* ({
|
|
|
46
46
|
exports.getCustomerByPhone = getCustomerByPhone;
|
|
47
47
|
const postCustomers = (_d) => __awaiter(void 0, [_d], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
|
|
48
48
|
const customers = yield prisma.$transaction([
|
|
49
|
-
prisma.
|
|
49
|
+
prisma.customer.count({
|
|
50
50
|
where: queryWhere,
|
|
51
51
|
}),
|
|
52
|
-
prisma.
|
|
52
|
+
prisma.customer.findMany({
|
|
53
53
|
orderBy: {
|
|
54
54
|
createdAt: 'desc',
|
|
55
55
|
},
|
|
@@ -62,7 +62,7 @@ const postCustomers = (_d) => __awaiter(void 0, [_d], void 0, function* ({ curre
|
|
|
62
62
|
});
|
|
63
63
|
exports.postCustomers = postCustomers;
|
|
64
64
|
const postCustomer = (_e) => __awaiter(void 0, [_e], void 0, function* ({ prisma, id, address, city, country, email, firstName, lastName, phone, }) {
|
|
65
|
-
const customer = yield prisma.
|
|
65
|
+
const customer = yield prisma.customer.upsert({
|
|
66
66
|
where: {
|
|
67
67
|
id,
|
|
68
68
|
},
|
|
@@ -89,7 +89,7 @@ const postCustomer = (_e) => __awaiter(void 0, [_e], void 0, function* ({ prisma
|
|
|
89
89
|
});
|
|
90
90
|
exports.postCustomer = postCustomer;
|
|
91
91
|
const deleteCustomer = (_f) => __awaiter(void 0, [_f], void 0, function* ({ prisma, id }) {
|
|
92
|
-
const customer = yield prisma.
|
|
92
|
+
const customer = yield prisma.customer.delete({
|
|
93
93
|
where: {
|
|
94
94
|
id,
|
|
95
95
|
},
|
|
@@ -12,7 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.deleteExpense = exports.postExpense = exports.postExpenses = exports.getExpenseById = exports.getExpenses = void 0;
|
|
14
14
|
const getExpenses = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
-
const expenses = yield prisma.
|
|
15
|
+
const expenses = yield prisma.expense.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -24,7 +24,7 @@ const getExpenses = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma,
|
|
|
24
24
|
});
|
|
25
25
|
exports.getExpenses = getExpenses;
|
|
26
26
|
const getExpenseById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ id, prisma, }) {
|
|
27
|
-
const expense = yield prisma.
|
|
27
|
+
const expense = yield prisma.expense.findUnique({
|
|
28
28
|
where: {
|
|
29
29
|
id,
|
|
30
30
|
},
|
|
@@ -37,10 +37,10 @@ const getExpenseById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ id,
|
|
|
37
37
|
exports.getExpenseById = getExpenseById;
|
|
38
38
|
const postExpenses = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
|
|
39
39
|
const expenses = yield prisma.$transaction([
|
|
40
|
-
prisma.
|
|
40
|
+
prisma.expense.count({
|
|
41
41
|
where: queryWhere,
|
|
42
42
|
}),
|
|
43
|
-
prisma.
|
|
43
|
+
prisma.expense.findMany({
|
|
44
44
|
orderBy: {
|
|
45
45
|
createdAt: 'desc',
|
|
46
46
|
},
|
|
@@ -56,7 +56,7 @@ const postExpenses = (_c) => __awaiter(void 0, [_c], void 0, function* ({ curren
|
|
|
56
56
|
});
|
|
57
57
|
exports.postExpenses = postExpenses;
|
|
58
58
|
const postExpense = (_d) => __awaiter(void 0, [_d], void 0, function* ({ currency, description, expenseCategoryId, id, name, prisma, ref, total, }) {
|
|
59
|
-
const expense = yield prisma.
|
|
59
|
+
const expense = yield prisma.expense.upsert({
|
|
60
60
|
where: {
|
|
61
61
|
id,
|
|
62
62
|
},
|
|
@@ -81,7 +81,7 @@ const postExpense = (_d) => __awaiter(void 0, [_d], void 0, function* ({ currenc
|
|
|
81
81
|
});
|
|
82
82
|
exports.postExpense = postExpense;
|
|
83
83
|
const deleteExpense = (_e) => __awaiter(void 0, [_e], void 0, function* ({ prisma, id, }) {
|
|
84
|
-
const expense = yield prisma.
|
|
84
|
+
const expense = yield prisma.expense.delete({
|
|
85
85
|
where: {
|
|
86
86
|
id,
|
|
87
87
|
},
|
|
@@ -12,7 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.deleteExpenseCategory = exports.postExpenseCategory = exports.postExpenseCategories = exports.getExpenseCategoryById = exports.getExpenseCategories = void 0;
|
|
14
14
|
const getExpenseCategories = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
-
const expenseCategories = yield prisma.
|
|
15
|
+
const expenseCategories = yield prisma.expenseCategory.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -24,7 +24,7 @@ const getExpenseCategories = (_a) => __awaiter(void 0, [_a], void 0, function* (
|
|
|
24
24
|
});
|
|
25
25
|
exports.getExpenseCategories = getExpenseCategories;
|
|
26
26
|
const getExpenseCategoryById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ id, prisma, }) {
|
|
27
|
-
const expenseCategory = yield prisma.
|
|
27
|
+
const expenseCategory = yield prisma.expenseCategory.findUnique({
|
|
28
28
|
where: {
|
|
29
29
|
id,
|
|
30
30
|
},
|
|
@@ -37,10 +37,10 @@ const getExpenseCategoryById = (_b) => __awaiter(void 0, [_b], void 0, function*
|
|
|
37
37
|
exports.getExpenseCategoryById = getExpenseCategoryById;
|
|
38
38
|
const postExpenseCategories = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
|
|
39
39
|
const expenseCategories = yield prisma.$transaction([
|
|
40
|
-
prisma.
|
|
40
|
+
prisma.expenseCategory.count({
|
|
41
41
|
where: queryWhere,
|
|
42
42
|
}),
|
|
43
|
-
prisma.
|
|
43
|
+
prisma.expenseCategory.findMany({
|
|
44
44
|
orderBy: {
|
|
45
45
|
createdAt: 'desc',
|
|
46
46
|
},
|
|
@@ -56,7 +56,7 @@ const postExpenseCategories = (_c) => __awaiter(void 0, [_c], void 0, function*
|
|
|
56
56
|
});
|
|
57
57
|
exports.postExpenseCategories = postExpenseCategories;
|
|
58
58
|
const postExpenseCategory = (_d) => __awaiter(void 0, [_d], void 0, function* ({ color, description, id, name, prisma, }) {
|
|
59
|
-
const expenseCategory = yield prisma.
|
|
59
|
+
const expenseCategory = yield prisma.expenseCategory.upsert({
|
|
60
60
|
where: {
|
|
61
61
|
id,
|
|
62
62
|
},
|
|
@@ -75,7 +75,7 @@ const postExpenseCategory = (_d) => __awaiter(void 0, [_d], void 0, function* ({
|
|
|
75
75
|
});
|
|
76
76
|
exports.postExpenseCategory = postExpenseCategory;
|
|
77
77
|
const deleteExpenseCategory = (_e) => __awaiter(void 0, [_e], void 0, function* ({ id, prisma, }) {
|
|
78
|
-
const expenseCategory = yield prisma.
|
|
78
|
+
const expenseCategory = yield prisma.expenseCategory.delete({
|
|
79
79
|
where: {
|
|
80
80
|
id,
|
|
81
81
|
},
|
|
@@ -12,7 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.deleteLead = exports.postLead = exports.postLeads = exports.getLeadById = exports.getLeads = void 0;
|
|
14
14
|
const getLeads = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
-
const leads = yield prisma.
|
|
15
|
+
const leads = yield prisma.lead.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -24,7 +24,7 @@ const getLeads = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, })
|
|
|
24
24
|
});
|
|
25
25
|
exports.getLeads = getLeads;
|
|
26
26
|
const getLeadById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ id, prisma, }) {
|
|
27
|
-
const lead = yield prisma.
|
|
27
|
+
const lead = yield prisma.lead.findUnique({
|
|
28
28
|
where: {
|
|
29
29
|
id,
|
|
30
30
|
},
|
|
@@ -37,10 +37,10 @@ const getLeadById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ id, pri
|
|
|
37
37
|
exports.getLeadById = getLeadById;
|
|
38
38
|
const postLeads = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
|
|
39
39
|
const leads = yield prisma.$transaction([
|
|
40
|
-
prisma.
|
|
40
|
+
prisma.lead.count({
|
|
41
41
|
where: queryWhere,
|
|
42
42
|
}),
|
|
43
|
-
prisma.
|
|
43
|
+
prisma.lead.findMany({
|
|
44
44
|
orderBy: {
|
|
45
45
|
createdAt: 'desc',
|
|
46
46
|
},
|
|
@@ -56,7 +56,7 @@ const postLeads = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPa
|
|
|
56
56
|
});
|
|
57
57
|
exports.postLeads = postLeads;
|
|
58
58
|
const postLead = (_d) => __awaiter(void 0, [_d], void 0, function* ({ id, notes, prisma, source, status, type, }) {
|
|
59
|
-
const lead = yield prisma.
|
|
59
|
+
const lead = yield prisma.lead.upsert({
|
|
60
60
|
where: {
|
|
61
61
|
id,
|
|
62
62
|
},
|
|
@@ -77,7 +77,7 @@ const postLead = (_d) => __awaiter(void 0, [_d], void 0, function* ({ id, notes,
|
|
|
77
77
|
});
|
|
78
78
|
exports.postLead = postLead;
|
|
79
79
|
const deleteLead = (_e) => __awaiter(void 0, [_e], void 0, function* ({ id, prisma, }) {
|
|
80
|
-
const lead = yield prisma.
|
|
80
|
+
const lead = yield prisma.lead.delete({
|
|
81
81
|
where: {
|
|
82
82
|
id,
|
|
83
83
|
},
|
|
@@ -12,7 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.deleteMenOrder = exports.postMenuOrder = exports.getMenuOrderById = exports.getMenuOrders = void 0;
|
|
14
14
|
const getMenuOrders = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
-
const menuOrders = yield prisma.
|
|
15
|
+
const menuOrders = yield prisma.menuOrder.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -21,7 +21,7 @@ const getMenuOrders = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prism
|
|
|
21
21
|
});
|
|
22
22
|
exports.getMenuOrders = getMenuOrders;
|
|
23
23
|
const getMenuOrderById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ id, prisma, }) {
|
|
24
|
-
const menuOrder = yield prisma.
|
|
24
|
+
const menuOrder = yield prisma.menuOrder.findUnique({
|
|
25
25
|
where: {
|
|
26
26
|
id,
|
|
27
27
|
},
|
|
@@ -30,7 +30,7 @@ const getMenuOrderById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ id
|
|
|
30
30
|
});
|
|
31
31
|
exports.getMenuOrderById = getMenuOrderById;
|
|
32
32
|
const postMenuOrder = (_c) => __awaiter(void 0, [_c], void 0, function* ({ id, label, order, preferenceId, prisma, }) {
|
|
33
|
-
const menuOrder = yield prisma.
|
|
33
|
+
const menuOrder = yield prisma.menuOrder.upsert({
|
|
34
34
|
where: {
|
|
35
35
|
id,
|
|
36
36
|
},
|
|
@@ -49,7 +49,7 @@ const postMenuOrder = (_c) => __awaiter(void 0, [_c], void 0, function* ({ id, l
|
|
|
49
49
|
});
|
|
50
50
|
exports.postMenuOrder = postMenuOrder;
|
|
51
51
|
const deleteMenOrder = (_d) => __awaiter(void 0, [_d], void 0, function* ({ id, prisma, }) {
|
|
52
|
-
const menuOrder = yield prisma.
|
|
52
|
+
const menuOrder = yield prisma.menuOrder.delete({
|
|
53
53
|
where: {
|
|
54
54
|
id,
|
|
55
55
|
},
|
|
@@ -12,7 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.deletePayment = exports.postPayment = exports.postPayments = exports.getPaymentById = exports.getPayments = void 0;
|
|
14
14
|
const getPayments = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
-
const payments = yield prisma.
|
|
15
|
+
const payments = yield prisma.payment.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -21,7 +21,7 @@ const getPayments = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma,
|
|
|
21
21
|
});
|
|
22
22
|
exports.getPayments = getPayments;
|
|
23
23
|
const getPaymentById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ id, prisma, }) {
|
|
24
|
-
const payment = yield prisma.
|
|
24
|
+
const payment = yield prisma.payment.findUnique({
|
|
25
25
|
where: {
|
|
26
26
|
id,
|
|
27
27
|
},
|
|
@@ -31,10 +31,10 @@ const getPaymentById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ id,
|
|
|
31
31
|
exports.getPaymentById = getPaymentById;
|
|
32
32
|
const postPayments = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
|
|
33
33
|
const payments = yield prisma.$transaction([
|
|
34
|
-
prisma.
|
|
34
|
+
prisma.payment.count({
|
|
35
35
|
where: queryWhere,
|
|
36
36
|
}),
|
|
37
|
-
prisma.
|
|
37
|
+
prisma.payment.findMany({
|
|
38
38
|
orderBy: {
|
|
39
39
|
createdAt: 'desc',
|
|
40
40
|
},
|
|
@@ -47,7 +47,7 @@ const postPayments = (_c) => __awaiter(void 0, [_c], void 0, function* ({ curren
|
|
|
47
47
|
});
|
|
48
48
|
exports.postPayments = postPayments;
|
|
49
49
|
const postPayment = (_d) => __awaiter(void 0, [_d], void 0, function* ({ id, amount, attachment, currency, date, description, mode, paymentType, ref, quoteInvoiceId, prisma, }) {
|
|
50
|
-
const payment = yield prisma.
|
|
50
|
+
const payment = yield prisma.payment.upsert({
|
|
51
51
|
where: {
|
|
52
52
|
id,
|
|
53
53
|
},
|
|
@@ -78,7 +78,7 @@ const postPayment = (_d) => __awaiter(void 0, [_d], void 0, function* ({ id, amo
|
|
|
78
78
|
});
|
|
79
79
|
exports.postPayment = postPayment;
|
|
80
80
|
const deletePayment = (_e) => __awaiter(void 0, [_e], void 0, function* ({ id, prisma, }) {
|
|
81
|
-
const payment = yield prisma.
|
|
81
|
+
const payment = yield prisma.payment.delete({
|
|
82
82
|
where: {
|
|
83
83
|
id,
|
|
84
84
|
},
|
|
@@ -12,7 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.deletePaymentMode = exports.postPaymentMode = exports.getPaymentModeById = exports.getPaymentModes = void 0;
|
|
14
14
|
const getPaymentModes = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
-
const paymentModes = yield prisma.
|
|
15
|
+
const paymentModes = yield prisma.paymentMode.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -21,7 +21,7 @@ const getPaymentModes = (_a) => __awaiter(void 0, [_a], void 0, function* ({ pri
|
|
|
21
21
|
});
|
|
22
22
|
exports.getPaymentModes = getPaymentModes;
|
|
23
23
|
const getPaymentModeById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ id, prisma, }) {
|
|
24
|
-
const paymentMode = yield prisma.
|
|
24
|
+
const paymentMode = yield prisma.paymentMode.findUnique({
|
|
25
25
|
where: {
|
|
26
26
|
id,
|
|
27
27
|
},
|
|
@@ -30,7 +30,7 @@ const getPaymentModeById = (_b) => __awaiter(void 0, [_b], void 0, function* ({
|
|
|
30
30
|
});
|
|
31
31
|
exports.getPaymentModeById = getPaymentModeById;
|
|
32
32
|
const postPaymentMode = (_c) => __awaiter(void 0, [_c], void 0, function* ({ enabled, id, prisma, }) {
|
|
33
|
-
const paymentMode = yield prisma.
|
|
33
|
+
const paymentMode = yield prisma.paymentMode.update({
|
|
34
34
|
where: {
|
|
35
35
|
id,
|
|
36
36
|
},
|
|
@@ -42,7 +42,7 @@ const postPaymentMode = (_c) => __awaiter(void 0, [_c], void 0, function* ({ ena
|
|
|
42
42
|
});
|
|
43
43
|
exports.postPaymentMode = postPaymentMode;
|
|
44
44
|
const deletePaymentMode = (_d) => __awaiter(void 0, [_d], void 0, function* ({ id, prisma, }) {
|
|
45
|
-
const paymentMode = yield prisma.
|
|
45
|
+
const paymentMode = yield prisma.paymentMode.delete({
|
|
46
46
|
where: {
|
|
47
47
|
id,
|
|
48
48
|
},
|
|
@@ -12,7 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.getPreferences = void 0;
|
|
14
14
|
const getPreferences = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
-
const preferences = yield prisma.
|
|
15
|
+
const preferences = yield prisma.preference.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -12,7 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.deleteProduct = exports.postProduct = exports.postProducts = exports.getProductById = exports.getProducts = void 0;
|
|
14
14
|
const getProducts = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
-
const products = yield prisma.
|
|
15
|
+
const products = yield prisma.product.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -25,7 +25,7 @@ const getProducts = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma,
|
|
|
25
25
|
});
|
|
26
26
|
exports.getProducts = getProducts;
|
|
27
27
|
const getProductById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id, }) {
|
|
28
|
-
const product = yield prisma.
|
|
28
|
+
const product = yield prisma.product.findUnique({
|
|
29
29
|
where: {
|
|
30
30
|
id,
|
|
31
31
|
},
|
|
@@ -39,10 +39,10 @@ const getProductById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ pris
|
|
|
39
39
|
exports.getProductById = getProductById;
|
|
40
40
|
const postProducts = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
|
|
41
41
|
const products = yield prisma.$transaction([
|
|
42
|
-
prisma.
|
|
42
|
+
prisma.product.count({
|
|
43
43
|
where: queryWhere,
|
|
44
44
|
}),
|
|
45
|
-
prisma.
|
|
45
|
+
prisma.product.findMany({
|
|
46
46
|
orderBy: {
|
|
47
47
|
createdAt: 'desc',
|
|
48
48
|
},
|
|
@@ -55,7 +55,7 @@ const postProducts = (_c) => __awaiter(void 0, [_c], void 0, function* ({ curren
|
|
|
55
55
|
});
|
|
56
56
|
exports.postProducts = postProducts;
|
|
57
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.
|
|
58
|
+
const product = yield prisma.product.upsert({
|
|
59
59
|
where: {
|
|
60
60
|
id,
|
|
61
61
|
},
|
|
@@ -90,7 +90,7 @@ const postProduct = (_d) => __awaiter(void 0, [_d], void 0, function* ({ prisma,
|
|
|
90
90
|
});
|
|
91
91
|
exports.postProduct = postProduct;
|
|
92
92
|
const deleteProduct = (_e) => __awaiter(void 0, [_e], void 0, function* ({ prisma, id, }) {
|
|
93
|
-
const product = yield prisma.
|
|
93
|
+
const product = yield prisma.product.delete({
|
|
94
94
|
where: {
|
|
95
95
|
id,
|
|
96
96
|
},
|
|
@@ -12,7 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.deleteProductCategory = exports.postProductCategory = exports.postProductCategories = exports.getProductCategoryById = exports.getProductCategories = void 0;
|
|
14
14
|
const getProductCategories = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
-
const productCategories = yield prisma.
|
|
15
|
+
const productCategories = yield prisma.productCategory.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -24,7 +24,7 @@ const getProductCategories = (_a) => __awaiter(void 0, [_a], void 0, function* (
|
|
|
24
24
|
});
|
|
25
25
|
exports.getProductCategories = getProductCategories;
|
|
26
26
|
const getProductCategoryById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id, }) {
|
|
27
|
-
const productCategory = yield prisma.
|
|
27
|
+
const productCategory = yield prisma.productCategory.findUnique({
|
|
28
28
|
where: {
|
|
29
29
|
id,
|
|
30
30
|
},
|
|
@@ -37,10 +37,10 @@ const getProductCategoryById = (_b) => __awaiter(void 0, [_b], void 0, function*
|
|
|
37
37
|
exports.getProductCategoryById = getProductCategoryById;
|
|
38
38
|
const postProductCategories = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
|
|
39
39
|
const productCategories = yield prisma.$transaction([
|
|
40
|
-
prisma.
|
|
40
|
+
prisma.productCategory.count({
|
|
41
41
|
where: queryWhere,
|
|
42
42
|
}),
|
|
43
|
-
prisma.
|
|
43
|
+
prisma.productCategory.findMany({
|
|
44
44
|
orderBy: {
|
|
45
45
|
createdAt: 'desc',
|
|
46
46
|
},
|
|
@@ -53,7 +53,7 @@ const postProductCategories = (_c) => __awaiter(void 0, [_c], void 0, function*
|
|
|
53
53
|
});
|
|
54
54
|
exports.postProductCategories = postProductCategories;
|
|
55
55
|
const postProductCategory = (_d) => __awaiter(void 0, [_d], void 0, function* ({ description, id, name, prisma, }) {
|
|
56
|
-
const productCategory = yield prisma.
|
|
56
|
+
const productCategory = yield prisma.productCategory.upsert({
|
|
57
57
|
where: {
|
|
58
58
|
id,
|
|
59
59
|
},
|
|
@@ -70,7 +70,7 @@ const postProductCategory = (_d) => __awaiter(void 0, [_d], void 0, function* ({
|
|
|
70
70
|
});
|
|
71
71
|
exports.postProductCategory = postProductCategory;
|
|
72
72
|
const deleteProductCategory = (_e) => __awaiter(void 0, [_e], void 0, function* ({ prisma, id, }) {
|
|
73
|
-
const productCategory = yield prisma.
|
|
73
|
+
const productCategory = yield prisma.productCategory.delete({
|
|
74
74
|
where: {
|
|
75
75
|
id,
|
|
76
76
|
},
|
|
@@ -12,7 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.DeleteProfile = exports.postProfile = exports.postProfiles = exports.getProfileByUserId = exports.getProfileById = exports.getProfiles = void 0;
|
|
14
14
|
const getProfiles = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
-
const profiles = yield prisma.
|
|
15
|
+
const profiles = yield prisma.profile.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -21,7 +21,7 @@ const getProfiles = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma,
|
|
|
21
21
|
});
|
|
22
22
|
exports.getProfiles = getProfiles;
|
|
23
23
|
const getProfileById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id, }) {
|
|
24
|
-
const profile = yield prisma.
|
|
24
|
+
const profile = yield prisma.profile.findUnique({
|
|
25
25
|
where: {
|
|
26
26
|
id,
|
|
27
27
|
},
|
|
@@ -30,7 +30,7 @@ const getProfileById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ pris
|
|
|
30
30
|
});
|
|
31
31
|
exports.getProfileById = getProfileById;
|
|
32
32
|
const getProfileByUserId = (_c) => __awaiter(void 0, [_c], void 0, function* ({ prisma, userId, }) {
|
|
33
|
-
const profile = yield prisma.
|
|
33
|
+
const profile = yield prisma.profile.findFirst({
|
|
34
34
|
where: {
|
|
35
35
|
userId,
|
|
36
36
|
},
|
|
@@ -40,10 +40,10 @@ const getProfileByUserId = (_c) => __awaiter(void 0, [_c], void 0, function* ({
|
|
|
40
40
|
exports.getProfileByUserId = getProfileByUserId;
|
|
41
41
|
const postProfiles = (_d) => __awaiter(void 0, [_d], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
|
|
42
42
|
const profiles = yield prisma.$transaction([
|
|
43
|
-
prisma.
|
|
43
|
+
prisma.profile.count({
|
|
44
44
|
where: queryWhere,
|
|
45
45
|
}),
|
|
46
|
-
prisma.
|
|
46
|
+
prisma.profile.findMany({
|
|
47
47
|
orderBy: {
|
|
48
48
|
createdAt: 'desc',
|
|
49
49
|
},
|
|
@@ -56,7 +56,7 @@ const postProfiles = (_d) => __awaiter(void 0, [_d], void 0, function* ({ curren
|
|
|
56
56
|
});
|
|
57
57
|
exports.postProfiles = postProfiles;
|
|
58
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.
|
|
59
|
+
const profile = yield prisma.profile.upsert({
|
|
60
60
|
where: {
|
|
61
61
|
id,
|
|
62
62
|
},
|
|
@@ -91,7 +91,7 @@ const postProfile = (_e) => __awaiter(void 0, [_e], void 0, function* ({ avatar,
|
|
|
91
91
|
});
|
|
92
92
|
exports.postProfile = postProfile;
|
|
93
93
|
const DeleteProfile = (_f) => __awaiter(void 0, [_f], void 0, function* ({ prisma, id, }) {
|
|
94
|
-
const profile = yield prisma.
|
|
94
|
+
const profile = yield prisma.profile.delete({
|
|
95
95
|
where: {
|
|
96
96
|
id,
|
|
97
97
|
},
|
|
@@ -12,7 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.deleteQuoteInvoice = exports.postQuoteInvoice = exports.postQuotesInvoices = exports.getQuoteInvoiceById = exports.getQuotesInvoices = void 0;
|
|
14
14
|
const getQuotesInvoices = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
-
const quotesInvoices = yield prisma.
|
|
15
|
+
const quotesInvoices = yield prisma.quoteInvoice.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -28,7 +28,7 @@ const getQuotesInvoices = (_a) => __awaiter(void 0, [_a], void 0, function* ({ p
|
|
|
28
28
|
});
|
|
29
29
|
exports.getQuotesInvoices = getQuotesInvoices;
|
|
30
30
|
const getQuoteInvoiceById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id, }) {
|
|
31
|
-
const quoteInvoice = yield prisma.
|
|
31
|
+
const quoteInvoice = yield prisma.quoteInvoice.findUnique({
|
|
32
32
|
where: {
|
|
33
33
|
id,
|
|
34
34
|
},
|
|
@@ -45,10 +45,10 @@ const getQuoteInvoiceById = (_b) => __awaiter(void 0, [_b], void 0, function* ({
|
|
|
45
45
|
exports.getQuoteInvoiceById = getQuoteInvoiceById;
|
|
46
46
|
const postQuotesInvoices = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
|
|
47
47
|
const quotesInvoices = yield prisma.$transaction([
|
|
48
|
-
prisma.
|
|
48
|
+
prisma.quoteInvoice.count({
|
|
49
49
|
where: queryWhere,
|
|
50
50
|
}),
|
|
51
|
-
prisma.
|
|
51
|
+
prisma.quoteInvoice.findMany({
|
|
52
52
|
orderBy: {
|
|
53
53
|
createdAt: 'desc',
|
|
54
54
|
},
|
|
@@ -69,7 +69,7 @@ const postQuoteInvoice = (_d) => __awaiter(void 0, [_d], void 0, function* ({ ca
|
|
|
69
69
|
return itemToReturn;
|
|
70
70
|
});
|
|
71
71
|
if (customerId || companyId) {
|
|
72
|
-
quoteInvoice = yield prisma.
|
|
72
|
+
quoteInvoice = yield prisma.quoteInvoice.create({
|
|
73
73
|
data: {
|
|
74
74
|
category,
|
|
75
75
|
companyId,
|
|
@@ -95,7 +95,7 @@ const postQuoteInvoice = (_d) => __awaiter(void 0, [_d], void 0, function* ({ ca
|
|
|
95
95
|
products: true,
|
|
96
96
|
},
|
|
97
97
|
});
|
|
98
|
-
yield prisma.
|
|
98
|
+
yield prisma.quotesInvoicesOnStellarProducts.create({
|
|
99
99
|
data: {
|
|
100
100
|
quoteInvoiceId: quoteInvoice.id,
|
|
101
101
|
productId: productIds[0].id,
|
|
@@ -107,7 +107,7 @@ const postQuoteInvoice = (_d) => __awaiter(void 0, [_d], void 0, function* ({ ca
|
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
109
|
else {
|
|
110
|
-
quoteInvoice = yield prisma.
|
|
110
|
+
quoteInvoice = yield prisma.quoteInvoice.create({
|
|
111
111
|
data: {
|
|
112
112
|
category,
|
|
113
113
|
companyId,
|
|
@@ -145,7 +145,7 @@ const postQuoteInvoice = (_d) => __awaiter(void 0, [_d], void 0, function* ({ ca
|
|
|
145
145
|
}
|
|
146
146
|
if (mode === 'Edit') {
|
|
147
147
|
try {
|
|
148
|
-
const foundQuoteInvoice = yield prisma.
|
|
148
|
+
const foundQuoteInvoice = yield prisma.quoteInvoice.findUnique({
|
|
149
149
|
where: {
|
|
150
150
|
id,
|
|
151
151
|
},
|
|
@@ -176,7 +176,7 @@ const postQuoteInvoice = (_d) => __awaiter(void 0, [_d], void 0, function* ({ ca
|
|
|
176
176
|
yield prisma.stellarService.createMany({
|
|
177
177
|
data: filteredCreateServices,
|
|
178
178
|
});
|
|
179
|
-
quoteInvoice = yield prisma.
|
|
179
|
+
quoteInvoice = yield prisma.quoteInvoice.update({
|
|
180
180
|
where: {
|
|
181
181
|
id,
|
|
182
182
|
},
|
|
@@ -204,7 +204,7 @@ const postQuoteInvoice = (_d) => __awaiter(void 0, [_d], void 0, function* ({ ca
|
|
|
204
204
|
});
|
|
205
205
|
exports.postQuoteInvoice = postQuoteInvoice;
|
|
206
206
|
const deleteQuoteInvoice = (_e) => __awaiter(void 0, [_e], void 0, function* ({ prisma, id, }) {
|
|
207
|
-
const quoteInvoice = yield prisma.
|
|
207
|
+
const quoteInvoice = yield prisma.quoteInvoice.delete({
|
|
208
208
|
where: {
|
|
209
209
|
id,
|
|
210
210
|
},
|
|
@@ -12,7 +12,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.deleteTax = exports.postTax = exports.getTaxById = exports.getTaxes = void 0;
|
|
14
14
|
const getTaxes = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, }) {
|
|
15
|
-
const taxes = yield prisma.
|
|
15
|
+
const taxes = yield prisma.tax.findMany({
|
|
16
16
|
orderBy: {
|
|
17
17
|
createdAt: 'desc',
|
|
18
18
|
},
|
|
@@ -21,7 +21,7 @@ const getTaxes = (_a) => __awaiter(void 0, [_a], void 0, function* ({ prisma, })
|
|
|
21
21
|
});
|
|
22
22
|
exports.getTaxes = getTaxes;
|
|
23
23
|
const getTaxById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma, id, }) {
|
|
24
|
-
const tax = yield prisma.
|
|
24
|
+
const tax = yield prisma.tax.findUnique({
|
|
25
25
|
where: {
|
|
26
26
|
id,
|
|
27
27
|
},
|
|
@@ -30,7 +30,7 @@ const getTaxById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ prisma,
|
|
|
30
30
|
});
|
|
31
31
|
exports.getTaxById = getTaxById;
|
|
32
32
|
const postTax = (_c) => __awaiter(void 0, [_c], void 0, function* ({ description, enabled, id, isDefault, preferenceId, prisma, taxName, taxValue, }) {
|
|
33
|
-
const tax = yield prisma.
|
|
33
|
+
const tax = yield prisma.tax.upsert({
|
|
34
34
|
where: {
|
|
35
35
|
id,
|
|
36
36
|
},
|
|
@@ -55,7 +55,7 @@ const postTax = (_c) => __awaiter(void 0, [_c], void 0, function* ({ description
|
|
|
55
55
|
});
|
|
56
56
|
exports.postTax = postTax;
|
|
57
57
|
const deleteTax = (_d) => __awaiter(void 0, [_d], void 0, function* ({ prisma, id, }) {
|
|
58
|
-
const tax = yield prisma.
|
|
58
|
+
const tax = yield prisma.tax.delete({
|
|
59
59
|
where: {
|
|
60
60
|
id,
|
|
61
61
|
},
|