@react-pakistan/util-functions 1.23.14 → 1.23.16

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 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
- createdAt: 'desc',
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
- createdAt: 'desc',
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
- createdAt: 'desc',
48
- },
46
+ orderBy,
47
+ include,
49
48
  where: queryWhere,
50
49
  take: pageLimit,
51
50
  skip: (currentPage - 1) * pageLimit,
@@ -81,7 +81,8 @@ const postQuoteInvoice = (_d) => __awaiter(void 0, [_d], void 0, function* ({ ad
81
81
  }
82
82
  if (customerId || companyId) {
83
83
  quoteInvoice = yield prisma.quoteInvoice.create({
84
- data: Object.assign({ id,
84
+ data: Object.assign({
85
+ // id,
85
86
  category,
86
87
  companyId,
87
88
  currency,
@@ -122,7 +123,7 @@ const postQuoteInvoice = (_d) => __awaiter(void 0, [_d], void 0, function* ({ ad
122
123
  else {
123
124
  quoteInvoice = yield prisma.quoteInvoice.create({
124
125
  data: {
125
- id,
126
+ // id,
126
127
  category,
127
128
  companyId,
128
129
  currency,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pakistan/util-functions",
3
- "version": "1.23.14",
3
+ "version": "1.23.16",
4
4
  "description": "A library of all util functions",
5
5
  "main": "index.js",
6
6
  "scripts": {