@react-pakistan/util-functions 1.24.76 → 1.24.78

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.
@@ -1,6 +1,7 @@
1
- import { QuoteInvoiceBE } from '../type';
1
+ import { QUOTE_INVOICE_CATEGORY, QuoteInvoiceBE } from '../type';
2
2
  type PrismaClient = any;
3
3
  export interface ListQuoteInvoiceArgs {
4
+ category: QUOTE_INVOICE_CATEGORY;
4
5
  currentPage?: number;
5
6
  includeCompany?: boolean;
6
7
  includeCustomer?: boolean;
@@ -73,7 +74,7 @@ export interface DeleteQuoteInvoiceArgs {
73
74
  * @param {ListQuoteInvoiceArgs} args - Object containing prisma client, pagination, filtering, and ordering options
74
75
  * @returns {Promise<[number, Array<QuoteInvoiceBE>]>} Tuple containing total count and array of quotes/invoices
75
76
  */
76
- export declare const listQuoteInvoice: ({ currentPage, includeCompany, includeCustomer, includePayments, includeProducts, includeServices, orderByColumn, orderByDirection, pageLimit, prisma, searchQuery, }: ListQuoteInvoiceArgs) => Promise<[number, Array<QuoteInvoiceBE>]>;
77
+ export declare const listQuoteInvoice: ({ category, currentPage, includeCompany, includeCustomer, includePayments, includeProducts, includeServices, orderByColumn, orderByDirection, pageLimit, prisma, searchQuery, }: ListQuoteInvoiceArgs) => Promise<[number, Array<QuoteInvoiceBE>]>;
77
78
  /**
78
79
  * Retrieves a single quote/invoice by its ID
79
80
  * @param {UnitQuoteInvoiceByIdArgs} args - Object containing prisma client, quote/invoice ID, and optional query parameters
@@ -66,7 +66,7 @@ var multi_part_search_1 = require("../../../general/multi-part-search");
66
66
  var listQuoteInvoice = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
67
67
  var include, orderBy, idSearchQuery, noteSearchQuery, refSearchQuery, where, _c, count, items;
68
68
  var _d;
69
- var _e = _b.currentPage, currentPage = _e === void 0 ? 1 : _e, _f = _b.includeCompany, includeCompany = _f === void 0 ? false : _f, _g = _b.includeCustomer, includeCustomer = _g === void 0 ? false : _g, _h = _b.includePayments, includePayments = _h === void 0 ? false : _h, _j = _b.includeProducts, includeProducts = _j === void 0 ? false : _j, _k = _b.includeServices, includeServices = _k === void 0 ? false : _k, _l = _b.orderByColumn, orderByColumn = _l === void 0 ? 'createdAt' : _l, _m = _b.orderByDirection, orderByDirection = _m === void 0 ? 'desc' : _m, _o = _b.pageLimit, pageLimit = _o === void 0 ? 5 : _o, prisma = _b.prisma, _p = _b.searchQuery, searchQuery = _p === void 0 ? '' : _p;
69
+ var category = _b.category, _e = _b.currentPage, currentPage = _e === void 0 ? 1 : _e, _f = _b.includeCompany, includeCompany = _f === void 0 ? false : _f, _g = _b.includeCustomer, includeCustomer = _g === void 0 ? false : _g, _h = _b.includePayments, includePayments = _h === void 0 ? false : _h, _j = _b.includeProducts, includeProducts = _j === void 0 ? false : _j, _k = _b.includeServices, includeServices = _k === void 0 ? false : _k, _l = _b.orderByColumn, orderByColumn = _l === void 0 ? 'createdAt' : _l, _m = _b.orderByDirection, orderByDirection = _m === void 0 ? 'desc' : _m, _o = _b.pageLimit, pageLimit = _o === void 0 ? 5 : _o, prisma = _b.prisma, _p = _b.searchQuery, searchQuery = _p === void 0 ? '' : _p;
70
70
  return __generator(this, function (_q) {
71
71
  switch (_q.label) {
72
72
  case 0:
@@ -99,6 +99,7 @@ var listQuoteInvoice = function (_a) { return __awaiter(void 0, [_a], void 0, fu
99
99
  fullText: searchQuery,
100
100
  });
101
101
  where = {
102
+ category: category,
102
103
  OR: __spreadArray(__spreadArray(__spreadArray([], idSearchQuery, true), noteSearchQuery, true), refSearchQuery, true),
103
104
  };
104
105
  return [4 /*yield*/, prisma.$transaction([
@@ -175,12 +176,13 @@ var updateQuoteInvoice = function (_a) { return __awaiter(void 0, [_a], void 0,
175
176
  !expiryDate ||
176
177
  !invoiceStatus ||
177
178
  !mode ||
179
+ !note ||
178
180
  !quoteStatus ||
179
181
  !ref ||
180
182
  !subTotal ||
181
183
  !taxRate ||
182
184
  !total) {
183
- throw new Error('Category, currency, date, discount unit, expiry date, invoice status, mode, quote status, ref, sub total, tax rate, and total are required');
185
+ throw new Error('Category, currency, date, discount unit, expiry date, invoice status, mode, note, quote status, ref, sub total, tax rate, and total are required');
184
186
  }
185
187
  if (mode !== 'Create' && mode !== 'Edit') {
186
188
  throw new Error('Mode must be either "Create" or "Edit"');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pakistan/util-functions",
3
- "version": "1.24.76",
3
+ "version": "1.24.78",
4
4
  "description": "A library of all util functions",
5
5
  "main": "index.js",
6
6
  "scripts": {