@react-pakistan/util-functions 1.24.97 → 1.24.99

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