@react-pakistan/util-functions 1.25.28 → 1.25.30

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,34 +1,19 @@
1
- /**
2
- * Gender options for user profiles
3
- */
4
1
  export declare enum GENDER {
5
2
  MALE = "MALE",
6
3
  FEMALE = "FEMALE"
7
4
  }
8
- /**
9
- * Quote and Invoice category types
10
- */
11
5
  export declare enum QUOTE_INVOICE_CATEGORY {
12
6
  QUOTE = "QUOTE",
13
7
  INVOICE = "INVOICE"
14
8
  }
15
- /**
16
- * Discount unit types (fixed amount or percentage)
17
- */
18
9
  export declare enum DISCOUNT_UNIT {
19
10
  FIXED_VALUE = "FIXED_VALUE",
20
11
  PERCENTAGE_VALUE = "PERCENTAGE_VALUE"
21
12
  }
22
- /**
23
- * Invoice payment status
24
- */
25
13
  export declare enum INVOICE_STATUS {
26
14
  UNPAID = "UNPAID",
27
15
  PAID = "PAID"
28
16
  }
29
- /**
30
- * Quote lifecycle status
31
- */
32
17
  export declare enum QUOTE_STATUS {
33
18
  DRAFT = "DRAFT",
34
19
  PENDING = "PENDING",
@@ -36,47 +21,35 @@ export declare enum QUOTE_STATUS {
36
21
  ACCEPTED = "ACCEPTED",
37
22
  DECLINED = "DECLINED"
38
23
  }
39
- /**
40
- * Payment type (full or partial)
41
- */
42
24
  export declare enum PAYMENT_TYPE {
43
25
  FULL_AMOUNT = "FULL_AMOUNT",
44
26
  PARTIAL_AMOUNT = "PARTIAL_AMOUNT"
45
27
  }
46
- /**
47
- * Lead source options
48
- */
49
28
  export declare enum LEAD_SOURCE {
50
- ADVERTISING = "ADVERTISING",
51
- CUSTOMER_REFERRAL = "CUSTOMER_REFERRAL",
52
- FRIEND = "FRIEND",
29
+ WEBSITE = "WEBSITE",
30
+ SOCIAL_MEDIA = "SOCIAL_MEDIA",
53
31
  LINKEDIN = "LINKEDIN",
54
- OTHER = "OTHER",
55
32
  PROFESSIONAL_NETWORK = "PROFESSIONAL_NETWORK",
33
+ CUSTOMER_REFERRAL = "CUSTOMER_REFERRAL",
56
34
  SALES = "SALES",
57
- SOCIAL_MEDIA = "SOCIAL_MEDIA",
58
- WEBSITE = "WEBSITE"
35
+ ADVERTISING = "ADVERTISING",
36
+ FRIEND = "FRIEND",
37
+ OTHER = "OTHER"
38
+ }
39
+ export declare enum LEAD_TYPE {
40
+ COMPANY = "COMPANY",
41
+ CONTACT = "CONTACT"
59
42
  }
60
- /**
61
- * Lead status options
62
- */
63
43
  export declare enum LEAD_STATUS {
44
+ NEW = "NEW",
64
45
  ASSIGNED = "ASSIGNED",
65
- CANCELLED = "CANCELLED",
66
- DRAFT = "DRAFT",
67
46
  IN_NEGOTIATION = "IN_NEGOTIATION",
68
- LOOSE = "LOOSE",
69
- NEW = "NEW",
70
47
  ON_HOLD = "ON_HOLD",
71
- WAITING = "WAITING",
72
- WON = "WON"
73
- }
74
- /**
75
- * Lead type (company or contact)
76
- */
77
- export declare enum LEAD_TYPE {
78
- COMPANY = "COMPANY",
79
- CONTACT = "CONTACT"
48
+ WON = "WON",
49
+ LOOSE = "LOOSE",
50
+ CANCELLED = "CANCELLED",
51
+ DRAFT = "DRAFT",
52
+ WAITING = "WAITING"
80
53
  }
81
54
  export declare enum LS_KEYS {
82
55
  BANKS = "stellar_banks_cache",
@@ -94,41 +67,23 @@ export declare enum LS_KEYS {
94
67
  TAXES = "stellar_taxes_cache"
95
68
  }
96
69
  /**
97
- * Base timestamp fields present in all entities
70
+ * Base entity interface with common audit fields and meta support
98
71
  */
99
- export interface TimestampFields {
100
- createdAt: string;
101
- updatedAt: string;
102
- }
103
- /**
104
- * Common fields for preference-related entities
105
- */
106
- export interface PreferenceRelatedFields extends TimestampFields {
107
- enabled: boolean;
72
+ export interface BaseEntity {
108
73
  id: string;
109
- isDefault: boolean;
110
- preferenceId: string;
111
- preference?: PreferenceBE;
74
+ createdAt: Date;
75
+ updatedAt: Date;
76
+ meta?: any;
112
77
  }
113
78
  /**
114
- * Application user entity
79
+ * Profile model type
115
80
  */
116
- export interface AppUserBE extends TimestampFields {
117
- email: string;
118
- firstName: string;
119
- id: string;
120
- lastName: string;
121
- }
122
- /**
123
- * User profile entity with extended personal information
124
- */
125
- export interface ProfileBE extends TimestampFields {
81
+ export interface ProfileBE extends BaseEntity {
126
82
  avatar?: string;
127
- dob?: string;
83
+ dob?: Date;
128
84
  email: string;
129
85
  firstName: string;
130
86
  gender: GENDER;
131
- id: string;
132
87
  language?: string;
133
88
  lastName: string;
134
89
  location?: string;
@@ -137,238 +92,230 @@ export interface ProfileBE extends TimestampFields {
137
92
  userId: string;
138
93
  }
139
94
  /**
140
- * Product category entity
95
+ * Product model type
141
96
  */
142
- export interface ProductCategoryBE extends TimestampFields {
97
+ export interface ProductBE extends BaseEntity {
98
+ currency: string;
143
99
  description?: string;
144
- id: string;
100
+ images: string[];
145
101
  name: string;
146
- products: Array<ProductBE>;
102
+ productCategoryId: string;
103
+ quantity: number;
104
+ ref?: string;
105
+ price: number;
147
106
  }
148
107
  /**
149
- * Product entity
108
+ * ProductCategory model type
150
109
  */
151
- export interface ProductBE extends TimestampFields {
152
- buyPrice: string;
153
- currency: string;
110
+ export interface ProductCategoryBE extends BaseEntity {
154
111
  description?: string;
155
- id: string;
156
- image?: string;
157
112
  name: string;
158
- productCategory?: ProductCategoryBE;
159
- productCategoryId: string;
160
- quantity: string;
161
- ref?: string;
162
- salePrice: string;
163
113
  }
164
114
  /**
165
- * Company entity
115
+ * Company model type
166
116
  */
167
- export interface CompanyBE extends TimestampFields {
168
- contacts: Array<ContactBE>;
117
+ export interface CompanyBE extends BaseEntity {
169
118
  country: string;
170
119
  email: string;
171
- id: string;
172
120
  name: string;
173
121
  phone: string;
174
- quotesInvoices: Array<QuoteInvoiceBE>;
175
122
  website?: string;
176
123
  }
177
124
  /**
178
- * Contact entity (associated with a company)
125
+ * Contact model type
179
126
  */
180
- export interface ContactBE extends TimestampFields {
181
- company?: CompanyBE;
127
+ export interface ContactBE extends BaseEntity {
182
128
  companyId: string;
183
129
  country: string;
184
130
  email: string;
185
131
  firstName: string;
186
- id: string;
187
132
  lastName: string;
188
133
  phone: string;
189
134
  }
190
135
  /**
191
- * Customer entity
136
+ * ExpenseCategory model type
192
137
  */
193
- export interface CustomerBE extends TimestampFields {
194
- address?: string;
195
- city: string;
196
- country: string;
197
- email?: string;
198
- firstName: string;
199
- id: string;
200
- quotesInvoices: Array<QuoteInvoiceBE>;
201
- lastName: string;
202
- phone: string;
203
- }
204
- /**
205
- * Expense category entity
206
- */
207
- export interface ExpenseCategoryBE extends TimestampFields {
208
- color: string;
138
+ export interface ExpenseCategoryBE extends BaseEntity {
209
139
  description?: string;
210
- expenses: Array<ExpenseBE>;
211
- id: string;
212
140
  name: string;
213
141
  }
214
142
  /**
215
- * Expense entity
143
+ * Expense model type
216
144
  */
217
- export interface ExpenseBE extends TimestampFields {
145
+ export interface ExpenseBE extends BaseEntity {
218
146
  currency: string;
219
147
  description: string;
220
- expenseCategory?: ExpenseCategoryBE;
221
148
  expenseCategoryId: string;
222
- id: string;
223
149
  name: string;
224
150
  ref?: string;
225
- total: string;
151
+ total: number;
226
152
  }
227
153
  /**
228
- * Quote/Invoice entity
154
+ * QuoteInvoice model type
229
155
  */
230
- export interface QuoteInvoiceBE extends TimestampFields {
156
+ export interface QuoteInvoiceBE extends BaseEntity {
231
157
  category: QUOTE_INVOICE_CATEGORY;
232
- company?: CompanyBE;
233
158
  companyId?: string;
234
159
  currency: string;
235
- customer?: CustomerBE;
236
160
  customerId?: string;
237
- date: string;
238
- discount?: string;
161
+ date: Date;
162
+ discount: number;
239
163
  discountUnit: DISCOUNT_UNIT;
240
- expiryDate: string;
241
- id: string;
164
+ expiryDate: Date;
242
165
  invoiceStatus: INVOICE_STATUS;
243
- note: string;
244
- payments: Array<PaymentBE>;
245
- products: Array<ProductBE>;
166
+ note?: string;
246
167
  quoteStatus: QUOTE_STATUS;
247
- ref: string;
248
- services: Array<ServiceBE>;
249
- subTotal: string;
250
- taxRate: string;
251
- total: string;
168
+ ref?: string;
169
+ subTotal: number;
170
+ taxRate: number;
171
+ total: number;
252
172
  }
253
173
  /**
254
- * Service entity (for quotes/invoices)
174
+ * Service model type
255
175
  */
256
- export interface ServiceBE extends TimestampFields {
176
+ export interface ServiceBE extends BaseEntity {
257
177
  description?: string;
258
- id: string;
259
178
  name: string;
260
- price: string;
261
- quantity: string;
262
- quoteInvoice?: QuoteInvoiceBE;
263
- quoteInvoiceId: string;
179
+ price: number;
180
+ quantity: number;
181
+ quoteInvoiceId?: string;
264
182
  }
265
183
  /**
266
- * Payment entity
184
+ * Payment model type
267
185
  */
268
- export interface PaymentBE extends TimestampFields {
269
- amount: string;
186
+ export interface PaymentBE extends BaseEntity {
187
+ amount: number;
270
188
  attachment?: string;
271
- balance: string;
189
+ balance: number;
272
190
  currency: string;
273
- date: string;
191
+ date: Date;
274
192
  description?: string;
275
- id: string;
276
- paymentMode?: PaymentModeBE;
277
193
  paymentModeId: string;
278
194
  paymentType: PAYMENT_TYPE;
279
- quoteInvoice?: QuoteInvoiceBE;
280
195
  quoteInvoiceId: string;
281
196
  ref?: string;
282
197
  }
283
198
  /**
284
- * User preferences and settings entity
199
+ * Preference model type
285
200
  */
286
- export interface PreferenceBE extends TimestampFields {
287
- banks: Array<BankBE>;
288
- branches: Array<BranchBE>;
289
- currencies: Array<CurrencyBE>;
290
- id: string;
291
- menuOrder: Array<MenuOrderBE>;
201
+ export interface PreferenceBE extends BaseEntity {
292
202
  onboarding: boolean;
293
- paymentModes: Array<PaymentModeBE>;
294
- taxes: Array<TaxBE>;
295
203
  }
296
204
  /**
297
- * Menu order configuration entity
205
+ * AppUser model type
298
206
  */
299
- export interface MenuOrderBE extends TimestampFields {
300
- id: string;
207
+ export interface AppUserBE extends BaseEntity {
208
+ email: string;
209
+ firstName: string;
210
+ lastName: string;
211
+ }
212
+ /**
213
+ * MenuOrder model type
214
+ */
215
+ export interface MenuOrderBE extends BaseEntity {
301
216
  label: string;
302
217
  order: number;
303
- preference?: PreferenceBE;
304
218
  preferenceId: string;
305
219
  }
306
220
  /**
307
- * Payment mode entity
221
+ * PaymentMode model type
308
222
  */
309
- export interface PaymentModeBE extends PreferenceRelatedFields {
223
+ export interface PaymentModeBE extends BaseEntity {
224
+ enabled: boolean;
225
+ isDefault: boolean;
310
226
  label: string;
311
- payments: Array<PaymentBE>;
227
+ preferenceId: string;
312
228
  }
313
229
  /**
314
- * Bank account entity
230
+ * Bank model type
315
231
  */
316
- export interface BankBE extends PreferenceRelatedFields {
232
+ export interface BankBE extends BaseEntity {
317
233
  accountNumber: string;
318
234
  accountTitle: string;
319
235
  bankAddress?: string;
320
236
  bankName: string;
237
+ enabled: boolean;
321
238
  iban?: string;
239
+ isDefault: boolean;
240
+ preferenceId: string;
322
241
  swiftCode?: string;
323
242
  }
324
243
  /**
325
- * Tax configuration entity
244
+ * Tax model type
326
245
  */
327
- export interface TaxBE extends PreferenceRelatedFields {
246
+ export interface TaxBE extends BaseEntity {
328
247
  description?: string;
248
+ enabled: boolean;
249
+ isDefault: boolean;
250
+ preferenceId: string;
329
251
  taxName: string;
330
- taxRate: string;
252
+ taxRate: number;
331
253
  }
332
254
  /**
333
- * Branch/Location entity
255
+ * Branch model type
334
256
  */
335
- export interface BranchBE extends PreferenceRelatedFields {
257
+ export interface BranchBE extends BaseEntity {
336
258
  branchAddress: string;
337
259
  branchName: string;
260
+ enabled: boolean;
261
+ isDefault: boolean;
338
262
  personEmail: string;
339
263
  personName: string;
340
264
  personPhone: string;
265
+ preferenceId: string;
341
266
  }
342
267
  /**
343
- * Currency entity
268
+ * Currency model type
344
269
  */
345
- export interface CurrencyBE extends PreferenceRelatedFields {
270
+ export interface CurrencyBE extends BaseEntity {
346
271
  code: string;
272
+ enabled: boolean;
273
+ isDefault: boolean;
347
274
  label: string;
275
+ preferenceId: string;
348
276
  }
349
277
  /**
350
- * Lead entity for CRM
278
+ * Customer model type
351
279
  */
352
- export interface LeadBE extends TimestampFields {
353
- id: string;
354
- notes?: string;
355
- source: LEAD_SOURCE;
356
- status: LEAD_STATUS;
357
- type: LEAD_TYPE;
280
+ export interface CustomerBE extends BaseEntity {
281
+ address?: string;
282
+ city: string;
283
+ country: string;
284
+ email?: string;
285
+ firstName: string;
286
+ lastName: string;
287
+ phone: string;
358
288
  }
359
289
  /**
360
- * Request form submission entity
290
+ * RequestForm model type
361
291
  */
362
- export interface RequestFormBE extends TimestampFields {
292
+ export interface RequestFormBE extends BaseEntity {
363
293
  businessType: string;
364
294
  companyName: string;
365
295
  companySize?: string;
366
296
  designation: string;
367
297
  firstName: string;
368
298
  headOffice?: string;
369
- id: string;
370
299
  lastName: string;
371
300
  phoneNumber: string;
372
301
  website?: string;
373
302
  workEmail: string;
374
303
  }
304
+ /**
305
+ * Lead model type
306
+ */
307
+ export interface LeadBE extends BaseEntity {
308
+ notes?: string;
309
+ source: LEAD_SOURCE;
310
+ status: LEAD_STATUS;
311
+ type: LEAD_TYPE;
312
+ }
313
+ /**
314
+ * Join table for QuoteInvoice and Product many-to-many relationship
315
+ */
316
+ export interface QuotesInvoicesOnStellarProducts {
317
+ meta?: any;
318
+ productId: string;
319
+ quantity: number;
320
+ quoteInvoiceId: string;
321
+ }
@@ -3,42 +3,27 @@
3
3
  // ENUMS
4
4
  // ============================================================================
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
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
- /**
8
- * Gender options for user profiles
9
- */
6
+ exports.LS_KEYS = exports.LEAD_STATUS = exports.LEAD_TYPE = exports.LEAD_SOURCE = exports.PAYMENT_TYPE = exports.QUOTE_STATUS = exports.INVOICE_STATUS = exports.DISCOUNT_UNIT = exports.QUOTE_INVOICE_CATEGORY = exports.GENDER = void 0;
10
7
  var GENDER;
11
8
  (function (GENDER) {
12
9
  GENDER["MALE"] = "MALE";
13
10
  GENDER["FEMALE"] = "FEMALE";
14
11
  })(GENDER || (exports.GENDER = GENDER = {}));
15
- /**
16
- * Quote and Invoice category types
17
- */
18
12
  var QUOTE_INVOICE_CATEGORY;
19
13
  (function (QUOTE_INVOICE_CATEGORY) {
20
14
  QUOTE_INVOICE_CATEGORY["QUOTE"] = "QUOTE";
21
15
  QUOTE_INVOICE_CATEGORY["INVOICE"] = "INVOICE";
22
16
  })(QUOTE_INVOICE_CATEGORY || (exports.QUOTE_INVOICE_CATEGORY = QUOTE_INVOICE_CATEGORY = {}));
23
- /**
24
- * Discount unit types (fixed amount or percentage)
25
- */
26
17
  var DISCOUNT_UNIT;
27
18
  (function (DISCOUNT_UNIT) {
28
19
  DISCOUNT_UNIT["FIXED_VALUE"] = "FIXED_VALUE";
29
20
  DISCOUNT_UNIT["PERCENTAGE_VALUE"] = "PERCENTAGE_VALUE";
30
21
  })(DISCOUNT_UNIT || (exports.DISCOUNT_UNIT = DISCOUNT_UNIT = {}));
31
- /**
32
- * Invoice payment status
33
- */
34
22
  var INVOICE_STATUS;
35
23
  (function (INVOICE_STATUS) {
36
24
  INVOICE_STATUS["UNPAID"] = "UNPAID";
37
25
  INVOICE_STATUS["PAID"] = "PAID";
38
26
  })(INVOICE_STATUS || (exports.INVOICE_STATUS = INVOICE_STATUS = {}));
39
- /**
40
- * Quote lifecycle status
41
- */
42
27
  var QUOTE_STATUS;
43
28
  (function (QUOTE_STATUS) {
44
29
  QUOTE_STATUS["DRAFT"] = "DRAFT";
@@ -47,52 +32,40 @@ var QUOTE_STATUS;
47
32
  QUOTE_STATUS["ACCEPTED"] = "ACCEPTED";
48
33
  QUOTE_STATUS["DECLINED"] = "DECLINED";
49
34
  })(QUOTE_STATUS || (exports.QUOTE_STATUS = QUOTE_STATUS = {}));
50
- /**
51
- * Payment type (full or partial)
52
- */
53
35
  var PAYMENT_TYPE;
54
36
  (function (PAYMENT_TYPE) {
55
37
  PAYMENT_TYPE["FULL_AMOUNT"] = "FULL_AMOUNT";
56
38
  PAYMENT_TYPE["PARTIAL_AMOUNT"] = "PARTIAL_AMOUNT";
57
39
  })(PAYMENT_TYPE || (exports.PAYMENT_TYPE = PAYMENT_TYPE = {}));
58
- /**
59
- * Lead source options
60
- */
61
40
  var LEAD_SOURCE;
62
41
  (function (LEAD_SOURCE) {
63
- LEAD_SOURCE["ADVERTISING"] = "ADVERTISING";
64
- LEAD_SOURCE["CUSTOMER_REFERRAL"] = "CUSTOMER_REFERRAL";
65
- LEAD_SOURCE["FRIEND"] = "FRIEND";
42
+ LEAD_SOURCE["WEBSITE"] = "WEBSITE";
43
+ LEAD_SOURCE["SOCIAL_MEDIA"] = "SOCIAL_MEDIA";
66
44
  LEAD_SOURCE["LINKEDIN"] = "LINKEDIN";
67
- LEAD_SOURCE["OTHER"] = "OTHER";
68
45
  LEAD_SOURCE["PROFESSIONAL_NETWORK"] = "PROFESSIONAL_NETWORK";
46
+ LEAD_SOURCE["CUSTOMER_REFERRAL"] = "CUSTOMER_REFERRAL";
69
47
  LEAD_SOURCE["SALES"] = "SALES";
70
- LEAD_SOURCE["SOCIAL_MEDIA"] = "SOCIAL_MEDIA";
71
- LEAD_SOURCE["WEBSITE"] = "WEBSITE";
48
+ LEAD_SOURCE["ADVERTISING"] = "ADVERTISING";
49
+ LEAD_SOURCE["FRIEND"] = "FRIEND";
50
+ LEAD_SOURCE["OTHER"] = "OTHER";
72
51
  })(LEAD_SOURCE || (exports.LEAD_SOURCE = LEAD_SOURCE = {}));
73
- /**
74
- * Lead status options
75
- */
52
+ var LEAD_TYPE;
53
+ (function (LEAD_TYPE) {
54
+ LEAD_TYPE["COMPANY"] = "COMPANY";
55
+ LEAD_TYPE["CONTACT"] = "CONTACT";
56
+ })(LEAD_TYPE || (exports.LEAD_TYPE = LEAD_TYPE = {}));
76
57
  var LEAD_STATUS;
77
58
  (function (LEAD_STATUS) {
59
+ LEAD_STATUS["NEW"] = "NEW";
78
60
  LEAD_STATUS["ASSIGNED"] = "ASSIGNED";
79
- LEAD_STATUS["CANCELLED"] = "CANCELLED";
80
- LEAD_STATUS["DRAFT"] = "DRAFT";
81
61
  LEAD_STATUS["IN_NEGOTIATION"] = "IN_NEGOTIATION";
82
- LEAD_STATUS["LOOSE"] = "LOOSE";
83
- LEAD_STATUS["NEW"] = "NEW";
84
62
  LEAD_STATUS["ON_HOLD"] = "ON_HOLD";
85
- LEAD_STATUS["WAITING"] = "WAITING";
86
63
  LEAD_STATUS["WON"] = "WON";
64
+ LEAD_STATUS["LOOSE"] = "LOOSE";
65
+ LEAD_STATUS["CANCELLED"] = "CANCELLED";
66
+ LEAD_STATUS["DRAFT"] = "DRAFT";
67
+ LEAD_STATUS["WAITING"] = "WAITING";
87
68
  })(LEAD_STATUS || (exports.LEAD_STATUS = LEAD_STATUS = {}));
88
- /**
89
- * Lead type (company or contact)
90
- */
91
- var LEAD_TYPE;
92
- (function (LEAD_TYPE) {
93
- LEAD_TYPE["COMPANY"] = "COMPANY";
94
- LEAD_TYPE["CONTACT"] = "CONTACT";
95
- })(LEAD_TYPE || (exports.LEAD_TYPE = LEAD_TYPE = {}));
96
69
  var LS_KEYS;
97
70
  (function (LS_KEYS) {
98
71
  LS_KEYS["BANKS"] = "stellar_banks_cache";
@@ -0,0 +1,7 @@
1
+ export interface DialCode {
2
+ name: string;
3
+ dial_code: string;
4
+ code: string;
5
+ }
6
+ export declare const dialCodes: DialCode[];
7
+ export declare const dialCodeMap: Map<string, string>;