@react-pakistan/util-functions 1.23.12 → 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.
@@ -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: ({ prisma, queryWhere, pageLimit, currentPage, }: PostCompaniesArgs) => Promise<Array<CompanyBE>>;
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* ({ prisma, queryWhere, pageLimit, currentPage, }) {
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
- createdAt: 'desc',
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
- createdAt: 'desc',
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
- createdAt: 'desc',
55
- },
53
+ orderBy,
54
+ include,
56
55
  where: queryWhere,
57
56
  take: pageLimit,
58
57
  skip: (currentPage - 1) * pageLimit,
@@ -8,6 +8,12 @@ interface GetPaymentByIdArgs {
8
8
  }
9
9
  interface PostPaymentsArgs {
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: {
@@ -34,7 +40,7 @@ interface DeletePaymentArgs {
34
40
  }
35
41
  export declare const getPayments: ({ prisma, }: GetPaymentsArgs) => Promise<Array<PaymentBE>>;
36
42
  export declare const getPaymentById: ({ id, prisma, }: GetPaymentByIdArgs) => Promise<PaymentBE>;
37
- export declare const postPayments: ({ currentPage, pageLimit, prisma, queryWhere, }: PostPaymentsArgs) => Promise<Array<PaymentBE>>;
43
+ export declare const postPayments: ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }: PostPaymentsArgs) => Promise<Array<PaymentBE>>;
38
44
  export declare const postPayment: ({ amount, attachment, createdAt, currency, date, description, id, mode, paymentType, prisma, quoteInvoiceId, ref, }: PostPaymentArgs) => Promise<Array<PaymentBE>>;
39
45
  export declare const deletePayment: ({ id, prisma, }: DeletePaymentArgs) => Promise<PaymentBE>;
40
46
  export {};
@@ -29,18 +29,14 @@ const getPaymentById = (_b) => __awaiter(void 0, [_b], void 0, function* ({ id,
29
29
  return payment;
30
30
  });
31
31
  exports.getPaymentById = getPaymentById;
32
- const postPayments = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, pageLimit, prisma, queryWhere, }) {
32
+ const postPayments = (_c) => __awaiter(void 0, [_c], void 0, function* ({ currentPage, include, orderBy, pageLimit, prisma, queryWhere, }) {
33
33
  const payments = yield prisma.$transaction([
34
34
  prisma.payment.count({
35
35
  where: queryWhere,
36
36
  }),
37
37
  prisma.payment.findMany({
38
- orderBy: {
39
- createdAt: 'desc',
40
- },
41
- include: {
42
- quoteInvoice: true,
43
- },
38
+ orderBy,
39
+ include,
44
40
  where: queryWhere,
45
41
  take: pageLimit,
46
42
  skip: (currentPage - 1) * pageLimit,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pakistan/util-functions",
3
- "version": "1.23.12",
3
+ "version": "1.23.14",
4
4
  "description": "A library of all util functions",
5
5
  "main": "index.js",
6
6
  "scripts": {