@react-pakistan/util-functions 1.23.13 → 1.23.15
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/company/index.d.ts +7 -1
- package/api/stellar-solutions/company/index.js +3 -8
- package/api/stellar-solutions/contact/index.d.ts +7 -1
- package/api/stellar-solutions/contact/index.js +3 -7
- package/api/stellar-solutions/customer/index.d.ts +7 -1
- package/api/stellar-solutions/customer/index.js +3 -4
- package/api/stellar-solutions/expense/index.d.ts +7 -1
- package/api/stellar-solutions/expense/index.js +3 -7
- package/api/stellar-solutions/expense-category/index.d.ts +7 -1
- package/api/stellar-solutions/expense-category/index.js +3 -7
- package/api/stellar-solutions/product-category/index.d.ts +7 -1
- package/api/stellar-solutions/product-category/index.js +3 -4
- package/package.json +1 -1
|
@@ -8,6 +8,12 @@ interface GetCompanyByIdArgs {
|
|
|
8
8
|
}
|
|
9
9
|
interface PostCompaniesArgs {
|
|
10
10
|
currentPage: number;
|
|
11
|
+
include: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
14
|
+
orderBy: {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
11
17
|
pageLimit: number;
|
|
12
18
|
prisma: any;
|
|
13
19
|
queryWhere: {
|
|
@@ -29,7 +35,7 @@ interface DeleteCompanyArgs {
|
|
|
29
35
|
}
|
|
30
36
|
export declare const getCompanies: ({ prisma, }: GetCompaniesArgs) => Promise<Array<CompanyBE>>;
|
|
31
37
|
export declare const getCompanyById: ({ prisma, id, }: GetCompanyByIdArgs) => Promise<CompanyBE>;
|
|
32
|
-
export declare const postCompanies: ({
|
|
38
|
+
export declare const postCompanies: ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }: PostCompaniesArgs) => Promise<Array<CompanyBE>>;
|
|
33
39
|
export declare const postCompany: ({ prisma, country, email, name, id, phone, website, }: PostCompanyArgs) => Promise<Array<CompanyBE>>;
|
|
34
40
|
export declare const deleteCompany: ({ prisma, id, }: DeleteCompanyArgs) => Promise<CompanyBE>;
|
|
35
41
|
export {};
|
|
@@ -29,19 +29,14 @@ const getCompanyById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ pris
|
|
|
29
29
|
return company;
|
|
30
30
|
});
|
|
31
31
|
exports.getCompanyById = getCompanyById;
|
|
32
|
-
const postCompanies = (_c) => __awaiter(void 0, [_c], void 0, function* ({
|
|
32
|
+
const postCompanies = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }) {
|
|
33
33
|
const companies = yield prisma.$transaction([
|
|
34
34
|
prisma.company.count({
|
|
35
35
|
where: queryWhere,
|
|
36
36
|
}),
|
|
37
37
|
prisma.company.findMany({
|
|
38
|
-
orderBy
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
include: {
|
|
42
|
-
contacts: true,
|
|
43
|
-
quotesInvoices: true,
|
|
44
|
-
},
|
|
38
|
+
orderBy,
|
|
39
|
+
include,
|
|
45
40
|
where: queryWhere,
|
|
46
41
|
take: pageLimit,
|
|
47
42
|
skip: (currentPage - 1) * pageLimit,
|
|
@@ -8,6 +8,12 @@ interface GetContactByIdArgs {
|
|
|
8
8
|
}
|
|
9
9
|
interface PostContactsArgs {
|
|
10
10
|
currentPage: number;
|
|
11
|
+
include: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
14
|
+
orderBy: {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
11
17
|
pageLimit: number;
|
|
12
18
|
prisma: any;
|
|
13
19
|
queryWhere: {
|
|
@@ -30,7 +36,7 @@ interface DeleteContactArgs {
|
|
|
30
36
|
}
|
|
31
37
|
export declare const getContacts: ({ prisma, }: GetContactsArgs) => Promise<Array<ContactBE>>;
|
|
32
38
|
export declare const getContactById: ({ prisma, id }: GetContactByIdArgs) => Promise<ContactBE>;
|
|
33
|
-
export declare const postContacts: ({ currentPage, pageLimit, prisma, queryWhere, }: PostContactsArgs) => Promise<Array<ContactBE>>;
|
|
39
|
+
export declare const postContacts: ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }: PostContactsArgs) => Promise<Array<ContactBE>>;
|
|
34
40
|
export declare const postContact: ({ prisma, id, companyId, country, email, firstName, lastName, phone, }: PostContactArgs) => Promise<Array<ContactBE>>;
|
|
35
41
|
export declare const deleteContact: ({ prisma, id }: DeleteContactArgs) => Promise<ContactBE>;
|
|
36
42
|
export {};
|
|
@@ -35,18 +35,14 @@ const getContactById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ pris
|
|
|
35
35
|
return contact;
|
|
36
36
|
});
|
|
37
37
|
exports.getContactById = getContactById;
|
|
38
|
-
const postContacts = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
|
|
38
|
+
const postContacts = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }) {
|
|
39
39
|
const contacts = yield prisma.$transaction([
|
|
40
40
|
prisma.contact.count({
|
|
41
41
|
where: queryWhere,
|
|
42
42
|
}),
|
|
43
43
|
prisma.contact.findMany({
|
|
44
|
-
orderBy
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
include: {
|
|
48
|
-
company: true,
|
|
49
|
-
},
|
|
44
|
+
orderBy,
|
|
45
|
+
include,
|
|
50
46
|
where: queryWhere,
|
|
51
47
|
take: pageLimit,
|
|
52
48
|
skip: (currentPage - 1) * pageLimit,
|
|
@@ -12,6 +12,12 @@ interface GetCustomerByPhoneArgs {
|
|
|
12
12
|
}
|
|
13
13
|
interface PostCustomersArgs {
|
|
14
14
|
currentPage: number;
|
|
15
|
+
include: {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
|
+
orderBy: {
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
};
|
|
15
21
|
pageLimit: number;
|
|
16
22
|
prisma: any;
|
|
17
23
|
queryWhere: {
|
|
@@ -36,7 +42,7 @@ interface DeleteCustomerArgs {
|
|
|
36
42
|
export declare const getCustomers: ({ prisma, }: GetCustomersArgs) => Promise<Array<CustomerBE>>;
|
|
37
43
|
export declare const getCustomerById: ({ prisma, id, }: GetCustomerByIdArgs) => Promise<CustomerBE>;
|
|
38
44
|
export declare const getCustomerByPhone: ({ prisma, phone }: GetCustomerByPhoneArgs) => Promise<CustomerBE>;
|
|
39
|
-
export declare const postCustomers: ({ currentPage, pageLimit, prisma, queryWhere, }: PostCustomersArgs) => Promise<Array<CustomerBE>>;
|
|
45
|
+
export declare const postCustomers: ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }: PostCustomersArgs) => Promise<Array<CustomerBE>>;
|
|
40
46
|
export declare const postCustomer: ({ prisma, id, address, city, country, email, firstName, lastName, phone, }: PostCustomerArgs) => Promise<Array<CustomerBE>>;
|
|
41
47
|
export declare const deleteCustomer: ({ prisma, id }: DeleteCustomerArgs) => Promise<CustomerBE>;
|
|
42
48
|
export {};
|
|
@@ -44,15 +44,14 @@ const getCustomerByPhone = (_c) => __awaiter(void 0, [_c], void 0, function* ({
|
|
|
44
44
|
return customer;
|
|
45
45
|
});
|
|
46
46
|
exports.getCustomerByPhone = getCustomerByPhone;
|
|
47
|
-
const postCustomers = (_d) => __awaiter(void 0, [_d], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
|
|
47
|
+
const postCustomers = (_d) => __awaiter(void 0, [_d], void 0, function* ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }) {
|
|
48
48
|
const customers = yield prisma.$transaction([
|
|
49
49
|
prisma.customer.count({
|
|
50
50
|
where: queryWhere,
|
|
51
51
|
}),
|
|
52
52
|
prisma.customer.findMany({
|
|
53
|
-
orderBy
|
|
54
|
-
|
|
55
|
-
},
|
|
53
|
+
orderBy,
|
|
54
|
+
include,
|
|
56
55
|
where: queryWhere,
|
|
57
56
|
take: pageLimit,
|
|
58
57
|
skip: (currentPage - 1) * pageLimit,
|
|
@@ -8,6 +8,12 @@ interface GetExpenseByIdArgs {
|
|
|
8
8
|
}
|
|
9
9
|
interface PostExpensesArgs {
|
|
10
10
|
currentPage: number;
|
|
11
|
+
include: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
14
|
+
orderBy: {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
11
17
|
pageLimit: number;
|
|
12
18
|
prisma: any;
|
|
13
19
|
queryWhere: {
|
|
@@ -30,7 +36,7 @@ interface DeleteExpenseArgs {
|
|
|
30
36
|
}
|
|
31
37
|
export declare const getExpenses: ({ prisma, }: GetExpensesArgs) => Promise<Array<ExpenseBE>>;
|
|
32
38
|
export declare const getExpenseById: ({ id, prisma, }: GetExpenseByIdArgs) => Promise<ExpenseBE>;
|
|
33
|
-
export declare const postExpenses: ({ currentPage, pageLimit, prisma, queryWhere, }: PostExpensesArgs) => Promise<Array<ExpenseBE>>;
|
|
39
|
+
export declare const postExpenses: ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }: PostExpensesArgs) => Promise<Array<ExpenseBE>>;
|
|
34
40
|
export declare const postExpense: ({ currency, description, expenseCategoryId, id, name, prisma, ref, total, }: PostExpenseArgs) => Promise<Array<ExpenseBE>>;
|
|
35
41
|
export declare const deleteExpense: ({ prisma, id, }: DeleteExpenseArgs) => Promise<ExpenseBE>;
|
|
36
42
|
export {};
|
|
@@ -35,18 +35,14 @@ const getExpenseById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ id,
|
|
|
35
35
|
return expense;
|
|
36
36
|
});
|
|
37
37
|
exports.getExpenseById = getExpenseById;
|
|
38
|
-
const postExpenses = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
|
|
38
|
+
const postExpenses = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }) {
|
|
39
39
|
const expenses = yield prisma.$transaction([
|
|
40
40
|
prisma.expense.count({
|
|
41
41
|
where: queryWhere,
|
|
42
42
|
}),
|
|
43
43
|
prisma.expense.findMany({
|
|
44
|
-
orderBy
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
include: {
|
|
48
|
-
expenseCategory: true,
|
|
49
|
-
},
|
|
44
|
+
orderBy,
|
|
45
|
+
include,
|
|
50
46
|
where: queryWhere,
|
|
51
47
|
take: pageLimit,
|
|
52
48
|
skip: (currentPage - 1) * pageLimit,
|
|
@@ -8,6 +8,12 @@ interface GetExpenseCategoryByIdArgs {
|
|
|
8
8
|
}
|
|
9
9
|
interface PostExpenseCategoriesArgs {
|
|
10
10
|
currentPage: number;
|
|
11
|
+
include: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
14
|
+
orderBy: {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
11
17
|
pageLimit: number;
|
|
12
18
|
prisma: any;
|
|
13
19
|
queryWhere: {
|
|
@@ -27,7 +33,7 @@ interface DeleteExpenseCategoryArgs {
|
|
|
27
33
|
}
|
|
28
34
|
export declare const getExpenseCategories: ({ prisma, }: GetExpenseCategoriesArgs) => Promise<Array<ExpenseCategoryBE>>;
|
|
29
35
|
export declare const getExpenseCategoryById: ({ id, prisma, }: GetExpenseCategoryByIdArgs) => Promise<ExpenseCategoryBE>;
|
|
30
|
-
export declare const postExpenseCategories: ({ currentPage, pageLimit, prisma, queryWhere, }: PostExpenseCategoriesArgs) => Promise<{
|
|
36
|
+
export declare const postExpenseCategories: ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }: PostExpenseCategoriesArgs) => Promise<{
|
|
31
37
|
data: Array<ExpenseCategoryBE>;
|
|
32
38
|
error: Error | undefined;
|
|
33
39
|
}>;
|
|
@@ -35,7 +35,7 @@ const getExpenseCategoryById = (_b) => __awaiter(void 0, [_b], void 0, function*
|
|
|
35
35
|
return expenseCategory;
|
|
36
36
|
});
|
|
37
37
|
exports.getExpenseCategoryById = getExpenseCategoryById;
|
|
38
|
-
const postExpenseCategories = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
|
|
38
|
+
const postExpenseCategories = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }) {
|
|
39
39
|
let data;
|
|
40
40
|
let error;
|
|
41
41
|
try {
|
|
@@ -44,12 +44,8 @@ const postExpenseCategories = (_c) => __awaiter(void 0, [_c], void 0, function*
|
|
|
44
44
|
where: queryWhere,
|
|
45
45
|
}),
|
|
46
46
|
prisma.expenseCategory.findMany({
|
|
47
|
-
orderBy
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
include: {
|
|
51
|
-
expenses: true,
|
|
52
|
-
},
|
|
47
|
+
orderBy,
|
|
48
|
+
include,
|
|
53
49
|
where: queryWhere,
|
|
54
50
|
take: pageLimit,
|
|
55
51
|
skip: (currentPage - 1) * pageLimit,
|
|
@@ -8,6 +8,12 @@ interface GetProductCategoryByIdArgs {
|
|
|
8
8
|
}
|
|
9
9
|
interface PostProductCategoriesArgs {
|
|
10
10
|
currentPage: number;
|
|
11
|
+
include: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
14
|
+
orderBy: {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
11
17
|
pageLimit: number;
|
|
12
18
|
prisma: any;
|
|
13
19
|
queryWhere: {
|
|
@@ -26,7 +32,7 @@ interface DeleteProductCategoryArgs {
|
|
|
26
32
|
}
|
|
27
33
|
export declare const getProductCategories: ({ prisma, }: GetProductCategoriesArgs) => Promise<Array<ProductCategoryBE>>;
|
|
28
34
|
export declare const getProductCategoryById: ({ prisma, id, }: GetProductCategoryByIdArgs) => Promise<ProductCategoryBE>;
|
|
29
|
-
export declare const postProductCategories: ({ currentPage, pageLimit, prisma, queryWhere, }: PostProductCategoriesArgs) => Promise<Array<ProductCategoryBE>>;
|
|
35
|
+
export declare const postProductCategories: ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }: PostProductCategoriesArgs) => Promise<Array<ProductCategoryBE>>;
|
|
30
36
|
export declare const postProductCategory: ({ description, id, name, prisma, }: PostProductCategoryArgs) => Promise<Array<ProductCategoryBE>>;
|
|
31
37
|
export declare const deleteProductCategory: ({ prisma, id, }: DeleteProductCategoryArgs) => Promise<ProductCategoryBE>;
|
|
32
38
|
export {};
|
|
@@ -35,7 +35,7 @@ const getProductCategoryById = (_b) => __awaiter(void 0, [_b], void 0, function*
|
|
|
35
35
|
return productCategory;
|
|
36
36
|
});
|
|
37
37
|
exports.getProductCategoryById = getProductCategoryById;
|
|
38
|
-
const postProductCategories = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
|
|
38
|
+
const postProductCategories = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }) {
|
|
39
39
|
let productCategories;
|
|
40
40
|
try {
|
|
41
41
|
productCategories = yield prisma.$transaction([
|
|
@@ -43,9 +43,8 @@ const postProductCategories = (_c) => __awaiter(void 0, [_c], void 0, function*
|
|
|
43
43
|
where: queryWhere,
|
|
44
44
|
}),
|
|
45
45
|
prisma.productCategory.findMany({
|
|
46
|
-
orderBy
|
|
47
|
-
|
|
48
|
-
},
|
|
46
|
+
orderBy,
|
|
47
|
+
include,
|
|
49
48
|
where: queryWhere,
|
|
50
49
|
take: pageLimit,
|
|
51
50
|
skip: (currentPage - 1) * pageLimit,
|