@react-pakistan/util-functions 1.23.13 → 1.23.14
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/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,
|