@react-pakistan/util-functions 1.24.99 → 1.25.1

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.
Files changed (73) hide show
  1. package/api/stellar-solutions/app-user/index.d.ts +9 -9
  2. package/api/stellar-solutions/app-user/index.js +4 -4
  3. package/api/stellar-solutions/bank/cache.d.ts +99 -0
  4. package/api/stellar-solutions/bank/cache.js +256 -0
  5. package/api/stellar-solutions/bank/index.d.ts +10 -10
  6. package/api/stellar-solutions/bank/index.js +19 -4
  7. package/api/stellar-solutions/branch/cache.d.ts +97 -0
  8. package/api/stellar-solutions/branch/cache.js +256 -0
  9. package/api/stellar-solutions/branch/index.d.ts +10 -10
  10. package/api/stellar-solutions/branch/index.js +19 -4
  11. package/api/stellar-solutions/company/cache.d.ts +106 -0
  12. package/api/stellar-solutions/company/cache.js +307 -0
  13. package/api/stellar-solutions/company/index.d.ts +10 -10
  14. package/api/stellar-solutions/company/index.js +19 -4
  15. package/api/stellar-solutions/company-report/index.d.ts +3 -3
  16. package/api/stellar-solutions/company-report/index.js +1 -1
  17. package/api/stellar-solutions/constants.d.ts +12 -0
  18. package/api/stellar-solutions/constants.js +13 -1
  19. package/api/stellar-solutions/contact/cache.d.ts +108 -0
  20. package/api/stellar-solutions/contact/cache.js +307 -0
  21. package/api/stellar-solutions/contact/index.d.ts +10 -10
  22. package/api/stellar-solutions/contact/index.js +19 -4
  23. package/api/stellar-solutions/currency/cache.d.ts +99 -0
  24. package/api/stellar-solutions/currency/cache.js +256 -0
  25. package/api/stellar-solutions/currency/index.d.ts +10 -10
  26. package/api/stellar-solutions/currency/index.js +19 -4
  27. package/api/stellar-solutions/customer/cache.d.ts +108 -0
  28. package/api/stellar-solutions/customer/cache.js +307 -0
  29. package/api/stellar-solutions/customer/index.d.ts +12 -12
  30. package/api/stellar-solutions/customer/index.js +20 -5
  31. package/api/stellar-solutions/expense/cache.d.ts +106 -0
  32. package/api/stellar-solutions/expense/cache.js +307 -0
  33. package/api/stellar-solutions/expense/index.d.ts +10 -10
  34. package/api/stellar-solutions/expense/index.js +19 -4
  35. package/api/stellar-solutions/expense-category/cache.d.ts +94 -0
  36. package/api/stellar-solutions/expense-category/cache.js +280 -0
  37. package/api/stellar-solutions/expense-category/index.d.ts +10 -10
  38. package/api/stellar-solutions/expense-category/index.js +19 -4
  39. package/api/stellar-solutions/lead/index.d.ts +9 -9
  40. package/api/stellar-solutions/lead/index.js +4 -4
  41. package/api/stellar-solutions/menu-order/index.d.ts +9 -9
  42. package/api/stellar-solutions/menu-order/index.js +4 -4
  43. package/api/stellar-solutions/payment/index.d.ts +9 -9
  44. package/api/stellar-solutions/payment/index.js +4 -4
  45. package/api/stellar-solutions/payment-mode/cache.d.ts +97 -0
  46. package/api/stellar-solutions/payment-mode/cache.js +256 -0
  47. package/api/stellar-solutions/payment-mode/index.d.ts +10 -10
  48. package/api/stellar-solutions/payment-mode/index.js +19 -4
  49. package/api/stellar-solutions/preference/cache.d.ts +85 -0
  50. package/api/stellar-solutions/preference/cache.js +229 -0
  51. package/api/stellar-solutions/preference/index.d.ts +6 -6
  52. package/api/stellar-solutions/preference/index.js +17 -2
  53. package/api/stellar-solutions/product/cache.d.ts +9 -9
  54. package/api/stellar-solutions/product/cache.js +4 -4
  55. package/api/stellar-solutions/product/index.d.ts +10 -10
  56. package/api/stellar-solutions/product/index.js +6 -6
  57. package/api/stellar-solutions/product-category/cache.d.ts +9 -9
  58. package/api/stellar-solutions/product-category/cache.js +4 -4
  59. package/api/stellar-solutions/product-category/index.d.ts +9 -9
  60. package/api/stellar-solutions/product-category/index.js +4 -4
  61. package/api/stellar-solutions/profile/index.d.ts +13 -13
  62. package/api/stellar-solutions/profile/index.js +6 -6
  63. package/api/stellar-solutions/quote-invoice/index.d.ts +9 -9
  64. package/api/stellar-solutions/quote-invoice/index.js +4 -4
  65. package/api/stellar-solutions/quote-invoice-report/index.d.ts +3 -3
  66. package/api/stellar-solutions/quote-invoice-report/index.js +1 -1
  67. package/api/stellar-solutions/tax/cache.d.ts +97 -0
  68. package/api/stellar-solutions/tax/cache.js +256 -0
  69. package/api/stellar-solutions/tax/index.d.ts +10 -10
  70. package/api/stellar-solutions/tax/index.js +19 -4
  71. package/api/stellar-solutions/type.d.ts +57 -46
  72. package/api/stellar-solutions/type.js +11 -0
  73. package/package.json +1 -1
@@ -10,6 +10,20 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
+ };
13
27
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
28
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
29
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -57,11 +71,12 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
57
71
  };
58
72
  Object.defineProperty(exports, "__esModule", { value: true });
59
73
  exports.deleteTax = exports.updateTax = exports.unitTaxById = exports.listTax = void 0;
74
+ __exportStar(require("./cache"), exports);
60
75
  var multi_part_search_1 = require("../../../general/multi-part-search");
61
76
  /**
62
77
  * Retrieves a paginated list of taxes
63
78
  * @param {ListTaxArgs} args - Object containing prisma client, pagination, filtering, and ordering options
64
- * @returns {Promise<[number, Array<TaxTypeBE>]>} Tuple containing total count and array of taxes
79
+ * @returns {Promise<[number, Array<TaxBE>]>} Tuple containing total count and array of taxes
65
80
  */
66
81
  var listTax = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
67
82
  var include, orderBy, idSearchQuery, taxNameSearchQuery, where, _c, count, items;
@@ -115,7 +130,7 @@ exports.listTax = listTax;
115
130
  /**
116
131
  * Retrieves a single tax by its ID
117
132
  * @param {UnitTaxByIdArgs} args - Object containing prisma client, tax ID, and optional query parameters
118
- * @returns {Promise<TaxTypeBE | null>} Tax or null if not found
133
+ * @returns {Promise<TaxBE | null>} Tax or null if not found
119
134
  */
120
135
  var unitTaxById = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
121
136
  var include, where, tax;
@@ -146,7 +161,7 @@ exports.unitTaxById = unitTaxById;
146
161
  /**
147
162
  * Creates or updates a tax
148
163
  * @param {UpdateTaxArgs} args - Object containing prisma client, tax data, and optional query parameters
149
- * @returns {Promise<TaxTypeBE>} Created or updated tax
164
+ * @returns {Promise<TaxBE>} Created or updated tax
150
165
  */
151
166
  var updateTax = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
152
167
  var taxData, where, tax;
@@ -198,7 +213,7 @@ exports.updateTax = updateTax;
198
213
  /**
199
214
  * Deletes a tax by ID
200
215
  * @param {DeleteTaxArgs} args - Object containing prisma client, tax ID, and optional query parameters
201
- * @returns {Promise<TaxTypeBE>} Deleted tax
216
+ * @returns {Promise<TaxBE>} Deleted tax
202
217
  */
203
218
  var deleteTax = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
204
219
  var where, tax;
@@ -79,8 +79,19 @@ export declare enum LEAD_TYPE {
79
79
  CONTACT = "CONTACT"
80
80
  }
81
81
  export declare enum LS_KEYS {
82
+ BANKS = "stellar_banks_cache",
83
+ BRANCHES = "stellar_branches_cache",
84
+ COMPANIES = "stellar_companies_cache",
85
+ CONTACTS = "stellar_contacts_cache",
86
+ CURRENCIES = "stellar_currencies_cache",
87
+ CUSTOMERS = "stellar_customers_cache",
88
+ EXPENSE_CATEGORIES = "stellar_expense_categories_cache",
89
+ EXPENSES = "stellar_expenses_cache",
90
+ PAYMENT_MODES = "stellar_payment_modes_cache",
91
+ PREFERENCES = "stellar_preferences_cache",
82
92
  PRODUCT_CATEGORIES = "stellar_product_categories_cache",
83
- PRODUCTS = "stellar_products_cache"
93
+ PRODUCTS = "stellar_products_cache",
94
+ TAXES = "stellar_taxes_cache"
84
95
  }
85
96
  /**
86
97
  * Base timestamp fields present in all entities
@@ -97,12 +108,12 @@ export interface PreferenceRelatedFields extends TimestampFields {
97
108
  id: string;
98
109
  isDefault: boolean;
99
110
  preferenceId: string;
100
- preference?: PreferenceTypeBE;
111
+ preference?: PreferenceBE;
101
112
  }
102
113
  /**
103
114
  * Application user entity
104
115
  */
105
- export interface AppUserTypeBE extends TimestampFields {
116
+ export interface AppUserBE extends TimestampFields {
106
117
  email: string;
107
118
  firstName: string;
108
119
  id: string;
@@ -111,7 +122,7 @@ export interface AppUserTypeBE extends TimestampFields {
111
122
  /**
112
123
  * User profile entity with extended personal information
113
124
  */
114
- export interface ProfileTypeBE extends TimestampFields {
125
+ export interface ProfileBE extends TimestampFields {
115
126
  avatar?: string;
116
127
  dob?: string;
117
128
  email: string;
@@ -128,23 +139,23 @@ export interface ProfileTypeBE extends TimestampFields {
128
139
  /**
129
140
  * Product category entity
130
141
  */
131
- export interface ProductCategoryTypeBE extends TimestampFields {
142
+ export interface ProductCategoryBE extends TimestampFields {
132
143
  description?: string;
133
144
  id: string;
134
145
  name: string;
135
- products: Array<ProductTypeBE>;
146
+ products: Array<ProductBE>;
136
147
  }
137
148
  /**
138
149
  * Product entity
139
150
  */
140
- export interface ProductTypeBE extends TimestampFields {
151
+ export interface ProductBE extends TimestampFields {
141
152
  buyPrice: string;
142
153
  currency: string;
143
154
  description?: string;
144
155
  id: string;
145
156
  image?: string;
146
157
  name: string;
147
- productCategory?: ProductCategoryTypeBE;
158
+ productCategory?: ProductCategoryBE;
148
159
  productCategoryId: string;
149
160
  quantity: string;
150
161
  ref?: string;
@@ -153,21 +164,21 @@ export interface ProductTypeBE extends TimestampFields {
153
164
  /**
154
165
  * Company entity
155
166
  */
156
- export interface CompanyTypeBE extends TimestampFields {
157
- contacts: Array<ContactTypeBE>;
167
+ export interface CompanyBE extends TimestampFields {
168
+ contacts: Array<ContactBE>;
158
169
  country: string;
159
170
  email: string;
160
171
  id: string;
161
172
  name: string;
162
173
  phone: string;
163
- quotesInvoices: Array<QuoteInvoiceTypeBE>;
174
+ quotesInvoices: Array<QuoteInvoiceBE>;
164
175
  website?: string;
165
176
  }
166
177
  /**
167
178
  * Contact entity (associated with a company)
168
179
  */
169
- export interface ContactTypeBE extends TimestampFields {
170
- company?: CompanyTypeBE;
180
+ export interface ContactBE extends TimestampFields {
181
+ company?: CompanyBE;
171
182
  companyId: string;
172
183
  country: string;
173
184
  email: string;
@@ -179,34 +190,34 @@ export interface ContactTypeBE extends TimestampFields {
179
190
  /**
180
191
  * Customer entity
181
192
  */
182
- export interface CustomerTypeBE extends TimestampFields {
193
+ export interface CustomerBE extends TimestampFields {
183
194
  address?: string;
184
195
  city: string;
185
196
  country: string;
186
197
  email?: string;
187
198
  firstName: string;
188
199
  id: string;
189
- quotesInvoices: Array<QuoteInvoiceTypeBE>;
200
+ quotesInvoices: Array<QuoteInvoiceBE>;
190
201
  lastName: string;
191
202
  phone: string;
192
203
  }
193
204
  /**
194
205
  * Expense category entity
195
206
  */
196
- export interface ExpenseCategoryTypeBE extends TimestampFields {
207
+ export interface ExpenseCategoryBE extends TimestampFields {
197
208
  color: string;
198
209
  description?: string;
199
- expenses: Array<ExpenseTypeBE>;
210
+ expenses: Array<ExpenseBE>;
200
211
  id: string;
201
212
  name: string;
202
213
  }
203
214
  /**
204
215
  * Expense entity
205
216
  */
206
- export interface ExpenseTypeBE extends TimestampFields {
217
+ export interface ExpenseBE extends TimestampFields {
207
218
  currency: string;
208
219
  description: string;
209
- expenseCategory?: ExpenseCategoryTypeBE;
220
+ expenseCategory?: ExpenseCategoryBE;
210
221
  expenseCategoryId: string;
211
222
  id: string;
212
223
  name: string;
@@ -216,12 +227,12 @@ export interface ExpenseTypeBE extends TimestampFields {
216
227
  /**
217
228
  * Quote/Invoice entity
218
229
  */
219
- export interface QuoteInvoiceTypeBE extends TimestampFields {
230
+ export interface QuoteInvoiceBE extends TimestampFields {
220
231
  category: QUOTE_INVOICE_CATEGORY;
221
- company?: CompanyTypeBE;
232
+ company?: CompanyBE;
222
233
  companyId?: string;
223
234
  currency: string;
224
- customer?: CustomerTypeBE;
235
+ customer?: CustomerBE;
225
236
  customerId?: string;
226
237
  date: string;
227
238
  discount?: string;
@@ -230,11 +241,11 @@ export interface QuoteInvoiceTypeBE extends TimestampFields {
230
241
  id: string;
231
242
  invoiceStatus: INVOICE_STATUS;
232
243
  note: string;
233
- payments: Array<PaymentTypeBE>;
234
- products: Array<ProductTypeBE>;
244
+ payments: Array<PaymentBE>;
245
+ products: Array<ProductBE>;
235
246
  quoteStatus: QUOTE_STATUS;
236
247
  ref: string;
237
- services: Array<ServiceTypeBE>;
248
+ services: Array<ServiceBE>;
238
249
  subTotal: string;
239
250
  taxRate: string;
240
251
  total: string;
@@ -242,19 +253,19 @@ export interface QuoteInvoiceTypeBE extends TimestampFields {
242
253
  /**
243
254
  * Service entity (for quotes/invoices)
244
255
  */
245
- export interface ServiceTypeBE extends TimestampFields {
256
+ export interface ServiceBE extends TimestampFields {
246
257
  description?: string;
247
258
  id: string;
248
259
  name: string;
249
260
  price: string;
250
261
  quantity: string;
251
- quoteInvoice?: QuoteInvoiceTypeBE;
262
+ quoteInvoice?: QuoteInvoiceBE;
252
263
  quoteInvoiceId: string;
253
264
  }
254
265
  /**
255
266
  * Payment entity
256
267
  */
257
- export interface PaymentTypeBE extends TimestampFields {
268
+ export interface PaymentBE extends TimestampFields {
258
269
  amount: string;
259
270
  attachment?: string;
260
271
  balance: string;
@@ -262,47 +273,47 @@ export interface PaymentTypeBE extends TimestampFields {
262
273
  date: string;
263
274
  description?: string;
264
275
  id: string;
265
- paymentMode?: PaymentModeTypeBE;
276
+ paymentMode?: PaymentModeBE;
266
277
  paymentModeId: string;
267
278
  paymentType: PAYMENT_TYPE;
268
- quoteInvoice?: QuoteInvoiceTypeBE;
279
+ quoteInvoice?: QuoteInvoiceBE;
269
280
  quoteInvoiceId: string;
270
281
  ref?: string;
271
282
  }
272
283
  /**
273
284
  * User preferences and settings entity
274
285
  */
275
- export interface PreferenceTypeBE extends TimestampFields {
276
- banks: Array<BankTypeBE>;
277
- branches: Array<BranchTypeBE>;
278
- currencies: Array<CurrencyTypeBE>;
286
+ export interface PreferenceBE extends TimestampFields {
287
+ banks: Array<BankBE>;
288
+ branches: Array<BranchBE>;
289
+ currencies: Array<CurrencyBE>;
279
290
  id: string;
280
- menuOrder: Array<MenuOrderTypeBE>;
291
+ menuOrder: Array<MenuOrderBE>;
281
292
  onboarding: boolean;
282
- paymentModes: Array<PaymentModeTypeBE>;
283
- taxes: Array<TaxTypeBE>;
293
+ paymentModes: Array<PaymentModeBE>;
294
+ taxes: Array<TaxBE>;
284
295
  }
285
296
  /**
286
297
  * Menu order configuration entity
287
298
  */
288
- export interface MenuOrderTypeBE extends TimestampFields {
299
+ export interface MenuOrderBE extends TimestampFields {
289
300
  id: string;
290
301
  label: string;
291
302
  order: number;
292
- preference?: PreferenceTypeBE;
303
+ preference?: PreferenceBE;
293
304
  preferenceId: string;
294
305
  }
295
306
  /**
296
307
  * Payment mode entity
297
308
  */
298
- export interface PaymentModeTypeBE extends PreferenceRelatedFields {
309
+ export interface PaymentModeBE extends PreferenceRelatedFields {
299
310
  label: string;
300
- payments: Array<PaymentTypeBE>;
311
+ payments: Array<PaymentBE>;
301
312
  }
302
313
  /**
303
314
  * Bank account entity
304
315
  */
305
- export interface BankTypeBE extends PreferenceRelatedFields {
316
+ export interface BankBE extends PreferenceRelatedFields {
306
317
  accountNumber: string;
307
318
  accountTitle: string;
308
319
  bankAddress?: string;
@@ -313,7 +324,7 @@ export interface BankTypeBE extends PreferenceRelatedFields {
313
324
  /**
314
325
  * Tax configuration entity
315
326
  */
316
- export interface TaxTypeBE extends PreferenceRelatedFields {
327
+ export interface TaxBE extends PreferenceRelatedFields {
317
328
  description?: string;
318
329
  taxName: string;
319
330
  taxRate: string;
@@ -321,7 +332,7 @@ export interface TaxTypeBE extends PreferenceRelatedFields {
321
332
  /**
322
333
  * Branch/Location entity
323
334
  */
324
- export interface BranchTypeBE extends PreferenceRelatedFields {
335
+ export interface BranchBE extends PreferenceRelatedFields {
325
336
  branchAddress: string;
326
337
  branchName: string;
327
338
  personEmail: string;
@@ -331,14 +342,14 @@ export interface BranchTypeBE extends PreferenceRelatedFields {
331
342
  /**
332
343
  * Currency entity
333
344
  */
334
- export interface CurrencyTypeBE extends PreferenceRelatedFields {
345
+ export interface CurrencyBE extends PreferenceRelatedFields {
335
346
  code: string;
336
347
  label: string;
337
348
  }
338
349
  /**
339
350
  * Lead entity for CRM
340
351
  */
341
- export interface LeadTypeBE extends TimestampFields {
352
+ export interface LeadBE extends TimestampFields {
342
353
  id: string;
343
354
  notes?: string;
344
355
  source: LEAD_SOURCE;
@@ -95,6 +95,17 @@ var LEAD_TYPE;
95
95
  })(LEAD_TYPE || (exports.LEAD_TYPE = LEAD_TYPE = {}));
96
96
  var LS_KEYS;
97
97
  (function (LS_KEYS) {
98
+ LS_KEYS["BANKS"] = "stellar_banks_cache";
99
+ LS_KEYS["BRANCHES"] = "stellar_branches_cache";
100
+ LS_KEYS["COMPANIES"] = "stellar_companies_cache";
101
+ LS_KEYS["CONTACTS"] = "stellar_contacts_cache";
102
+ LS_KEYS["CURRENCIES"] = "stellar_currencies_cache";
103
+ LS_KEYS["CUSTOMERS"] = "stellar_customers_cache";
104
+ LS_KEYS["EXPENSE_CATEGORIES"] = "stellar_expense_categories_cache";
105
+ LS_KEYS["EXPENSES"] = "stellar_expenses_cache";
106
+ LS_KEYS["PAYMENT_MODES"] = "stellar_payment_modes_cache";
107
+ LS_KEYS["PREFERENCES"] = "stellar_preferences_cache";
98
108
  LS_KEYS["PRODUCT_CATEGORIES"] = "stellar_product_categories_cache";
99
109
  LS_KEYS["PRODUCTS"] = "stellar_products_cache";
110
+ LS_KEYS["TAXES"] = "stellar_taxes_cache";
100
111
  })(LS_KEYS || (exports.LS_KEYS = LS_KEYS = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pakistan/util-functions",
3
- "version": "1.24.99",
3
+ "version": "1.25.1",
4
4
  "description": "A library of all util functions",
5
5
  "main": "index.js",
6
6
  "scripts": {