@react-pakistan/util-functions 1.24.65 → 1.24.66

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 (110) hide show
  1. package/README.md +6 -3
  2. package/api/stellar-solutions/app-user/index.d.ts +63 -14
  3. package/api/stellar-solutions/app-user/index.js +106 -52
  4. package/api/stellar-solutions/bank/index.d.ts +65 -16
  5. package/api/stellar-solutions/bank/index.js +115 -65
  6. package/api/stellar-solutions/branch/index.d.ts +64 -15
  7. package/api/stellar-solutions/branch/index.js +119 -65
  8. package/api/stellar-solutions/company/index.d.ts +58 -24
  9. package/api/stellar-solutions/company/index.js +106 -78
  10. package/api/stellar-solutions/company-report/index.d.ts +12 -5
  11. package/api/stellar-solutions/company-report/index.js +12 -7
  12. package/api/stellar-solutions/contact/index.d.ts +54 -20
  13. package/api/stellar-solutions/contact/index.js +109 -88
  14. package/api/stellar-solutions/currency/index.d.ts +63 -14
  15. package/api/stellar-solutions/currency/index.js +113 -61
  16. package/api/stellar-solutions/customer/index.d.ts +70 -28
  17. package/api/stellar-solutions/customer/index.js +131 -101
  18. package/api/stellar-solutions/expense/index.d.ts +58 -22
  19. package/api/stellar-solutions/expense/index.js +128 -92
  20. package/api/stellar-solutions/expense-category/index.d.ts +58 -22
  21. package/api/stellar-solutions/expense-category/index.js +125 -86
  22. package/api/stellar-solutions/lead/index.js +0 -1
  23. package/api/stellar-solutions/menu-order/index.d.ts +29 -7
  24. package/api/stellar-solutions/menu-order/index.js +74 -27
  25. package/api/stellar-solutions/payment/index.d.ts +62 -27
  26. package/api/stellar-solutions/payment/index.js +144 -123
  27. package/api/stellar-solutions/payment-mode/index.d.ts +44 -12
  28. package/api/stellar-solutions/payment-mode/index.js +115 -49
  29. package/api/stellar-solutions/preference/index.d.ts +14 -3
  30. package/api/stellar-solutions/preference/index.js +44 -14
  31. package/api/stellar-solutions/product/index.d.ts +46 -31
  32. package/api/stellar-solutions/product/index.js +142 -113
  33. package/api/stellar-solutions/product-category/index.d.ts +44 -27
  34. package/api/stellar-solutions/product-category/index.js +123 -87
  35. package/api/stellar-solutions/profile/index.d.ts +48 -17
  36. package/api/stellar-solutions/profile/index.js +124 -65
  37. package/api/stellar-solutions/quote-invoice/index.d.ts +67 -8
  38. package/api/stellar-solutions/quote-invoice/index.js +123 -57
  39. package/api/stellar-solutions/quote-invoice-report/index.d.ts +12 -5
  40. package/api/stellar-solutions/quote-invoice-report/index.js +10 -5
  41. package/api/stellar-solutions/tax/index.d.ts +46 -14
  42. package/api/stellar-solutions/tax/index.js +135 -63
  43. package/api/stellar-solutions/type.d.ts +178 -112
  44. package/api/stellar-solutions/type.js +60 -2
  45. package/constants/countries-timezones.js +0 -1
  46. package/constants/currencies.js +0 -1
  47. package/general/basic-get.js +22 -21
  48. package/general/basic-post.js +19 -18
  49. package/general/calculate-pages.js +3 -1
  50. package/general/check-even-odd-length.js +3 -2
  51. package/general/delete-image-from-private-supabase.js +0 -1
  52. package/general/delete-image-from-public-supabase.js +0 -1
  53. package/general/dynamic-page-limit.js +3 -2
  54. package/general/enum-to-text.js +7 -4
  55. package/general/fetch-data.js +0 -1
  56. package/general/fetch-supabase-image.js +0 -1
  57. package/general/fetch-supabase-private-assets.js +15 -14
  58. package/general/format-date.js +8 -8
  59. package/general/format-number.js +3 -2
  60. package/general/format-time.js +3 -2
  61. package/general/full-year-range.js +2 -2
  62. package/general/generate-blog-schema.d.ts +3 -3
  63. package/general/generate-blog-schema.js +20 -13
  64. package/general/generate-breadcrumb-schema.d.ts +4 -4
  65. package/general/generate-breadcrumb-schema.js +9 -10
  66. package/general/generate-faq-schema.d.ts +5 -5
  67. package/general/generate-faq-schema.js +18 -11
  68. package/general/generate-grid.js +0 -1
  69. package/general/generate-organization-schema.d.ts +3 -3
  70. package/general/generate-organization-schema.js +25 -18
  71. package/general/get-available-page-limit.js +2 -2
  72. package/general/get-calendar-dates.js +14 -3
  73. package/general/get-full-name.d.ts +1 -1
  74. package/general/get-number-of-days-in-month.d.ts +1 -1
  75. package/general/get-pathname.js +4 -1
  76. package/general/is-odd.js +1 -1
  77. package/general/is-previous-button-disabled.js +3 -1
  78. package/general/parse-frontmatter.js +0 -1
  79. package/general/remove-data-image-prefix.js +3 -2
  80. package/general/repeat-times.js +0 -1
  81. package/general/resolve-current-date.js +1 -2
  82. package/general/resolve-grid.js +3 -2
  83. package/general/slugify.js +11 -9
  84. package/general/text-to-enum.js +6 -1
  85. package/general/text-to-sentence-case.js +3 -1
  86. package/general/time-out.js +5 -4
  87. package/general/truncate-text.js +3 -1
  88. package/general/upload-blob-to-private-supabase.js +2 -2
  89. package/general/upload-blob-to-public-supabase.js +2 -2
  90. package/general/upload-image-to-private-supabase.js +2 -2
  91. package/general/upload-image-to-public-supabase.js +2 -2
  92. package/general/validate-email.js +1 -1
  93. package/hooks/use-fetch.js +11 -12
  94. package/hooks/use-module-entity.js +5 -6
  95. package/hooks/use-sticky.js +0 -1
  96. package/hooks/with-seo.d.ts +1 -1
  97. package/hooks/with-seo.js +3 -4
  98. package/local-storage/get-storage-value.js +0 -1
  99. package/package.json +22 -13
  100. package/setupTests.js +1 -2
  101. package/storybook/generate-sitemap.js +0 -1
  102. package/storybook/preview.js +1 -4
  103. package/storybook/react-design-story-script.js +0 -2
  104. package/storybook/react-emoji-collection.js +8 -6
  105. package/storybook/react-emoji-story-script.js +0 -2
  106. package/storybook/react-icon-collection.js +4 -3
  107. package/storybook/react-icon-story-script.js +0 -2
  108. package/storybook/react-logo-collection.js +4 -3
  109. package/storybook/react-logo-story-script.js +0 -2
  110. package/storybook/responsive-component.js +14 -7
@@ -1,5 +1,15 @@
1
1
  "use strict";
2
- /* eslint-disable @typescript-eslint/no-explicit-any, no-restricted-globals */
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
3
13
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
14
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
15
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -37,86 +47,148 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
37
47
  }
38
48
  };
39
49
  Object.defineProperty(exports, "__esModule", { value: true });
40
- exports.deleteTax = exports.postTax = exports.getTaxById = exports.getTaxes = void 0;
41
- var getTaxes = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
42
- var taxes;
43
- var prisma = _b.prisma;
44
- return __generator(this, function (_c) {
45
- switch (_c.label) {
46
- case 0: return [4 /*yield*/, prisma.tax.findMany({
47
- orderBy: {
48
- createdAt: 'desc',
49
- },
50
- })];
50
+ exports.deleteTax = exports.updateTax = exports.unitTaxById = exports.listTax = void 0;
51
+ /**
52
+ * Retrieves a paginated list of taxes
53
+ * @param {ListTaxArgs} args - Object containing prisma client, pagination, and filter options
54
+ * @returns {Promise<[number, Array<TaxBE>]>} Tuple of [total count, tax array]
55
+ */
56
+ var listTax = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
57
+ var skip, _c, count, data;
58
+ var _d = _b.currentPage, currentPage = _d === void 0 ? 1 : _d, _e = _b.include, include = _e === void 0 ? {} : _e, _f = _b.orderBy, orderBy = _f === void 0 ? { createdAt: 'desc' } : _f, _g = _b.pageLimit, pageLimit = _g === void 0 ? 10 : _g, prisma = _b.prisma, _h = _b.queryWhere, queryWhere = _h === void 0 ? {} : _h;
59
+ return __generator(this, function (_j) {
60
+ switch (_j.label) {
61
+ case 0:
62
+ if (currentPage < 1) {
63
+ throw new Error('Current page must be greater than or equal to 1');
64
+ }
65
+ if (pageLimit < 1) {
66
+ throw new Error('Page limit must be greater than or equal to 1');
67
+ }
68
+ skip = (currentPage - 1) * pageLimit;
69
+ return [4 /*yield*/, Promise.all([
70
+ prisma.tax.count({
71
+ where: queryWhere,
72
+ }),
73
+ prisma.tax.findMany({
74
+ include: include,
75
+ orderBy: orderBy,
76
+ skip: skip,
77
+ take: pageLimit,
78
+ where: queryWhere,
79
+ }),
80
+ ])];
51
81
  case 1:
52
- taxes = _c.sent();
53
- return [2 /*return*/, taxes];
82
+ _c = _j.sent(), count = _c[0], data = _c[1];
83
+ return [2 /*return*/, [count, data]];
54
84
  }
55
85
  });
56
86
  }); };
57
- exports.getTaxes = getTaxes;
58
- var getTaxById = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
87
+ exports.listTax = listTax;
88
+ /**
89
+ * Retrieves a single tax by its ID
90
+ * @param {UnitTaxByIdArgs} args - Object containing prisma client, tax ID, and optional filters
91
+ * @returns {Promise<TaxBE | null>} Tax or null if not found
92
+ */
93
+ var unitTaxById = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
59
94
  var tax;
60
- var prisma = _b.prisma, id = _b.id;
61
- return __generator(this, function (_c) {
62
- switch (_c.label) {
63
- case 0: return [4 /*yield*/, prisma.tax.findUnique({
64
- where: {
65
- id: id,
66
- },
67
- })];
95
+ var id = _b.id, _c = _b.include, include = _c === void 0 ? {} : _c, prisma = _b.prisma, _d = _b.queryWhere, queryWhere = _d === void 0 ? {} : _d;
96
+ return __generator(this, function (_e) {
97
+ switch (_e.label) {
98
+ case 0:
99
+ if (!id) {
100
+ throw new Error('Tax ID is required');
101
+ }
102
+ if (queryWhere.id && queryWhere.id !== id) {
103
+ throw new Error('ID mismatch between parameter and queryWhere');
104
+ }
105
+ return [4 /*yield*/, prisma.tax.findUnique({
106
+ include: include,
107
+ where: __assign({ id: id }, queryWhere),
108
+ })];
68
109
  case 1:
69
- tax = _c.sent();
110
+ tax = _e.sent();
70
111
  return [2 /*return*/, tax];
71
112
  }
72
113
  });
73
114
  }); };
74
- exports.getTaxById = getTaxById;
75
- var postTax = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
76
- var tax;
77
- var description = _b.description, enabled = _b.enabled, id = _b.id, isDefault = _b.isDefault, preferenceId = _b.preferenceId, prisma = _b.prisma, taxName = _b.taxName, taxRate = _b.taxRate;
78
- return __generator(this, function (_c) {
79
- switch (_c.label) {
80
- case 0: return [4 /*yield*/, prisma.tax.upsert({
81
- where: {
82
- id: id,
83
- },
84
- update: {
85
- description: description,
86
- enabled: enabled,
87
- isDefault: isDefault,
88
- preferenceId: preferenceId,
89
- taxName: taxName,
90
- taxRate: taxRate,
91
- },
92
- create: {
93
- description: description,
94
- enabled: enabled,
95
- isDefault: isDefault,
96
- preferenceId: preferenceId,
97
- taxName: taxName,
98
- taxRate: taxRate,
99
- },
100
- })];
115
+ exports.unitTaxById = unitTaxById;
116
+ /**
117
+ * Creates or updates a tax
118
+ * @param {UpdateTaxArgs} args - Object containing prisma client and tax data
119
+ * @returns {Promise<TaxBE>} Created or updated tax
120
+ */
121
+ var updateTax = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
122
+ var taxData, tax;
123
+ var description = _b.description, enabled = _b.enabled, id = _b.id, _c = _b.include, include = _c === void 0 ? {} : _c, isDefault = _b.isDefault, preferenceId = _b.preferenceId, prisma = _b.prisma, _d = _b.queryWhere, queryWhere = _d === void 0 ? {} : _d, taxName = _b.taxName, taxRate = _b.taxRate;
124
+ return __generator(this, function (_e) {
125
+ switch (_e.label) {
126
+ case 0:
127
+ if (!id) {
128
+ throw new Error('Tax ID is required');
129
+ }
130
+ if (!preferenceId) {
131
+ throw new Error('Preference ID is required');
132
+ }
133
+ if (!taxName) {
134
+ throw new Error('Tax name is required');
135
+ }
136
+ if (!taxRate) {
137
+ throw new Error('Tax rate is required');
138
+ }
139
+ if (typeof enabled !== 'boolean') {
140
+ throw new Error('Enabled must be a boolean');
141
+ }
142
+ if (typeof isDefault !== 'boolean') {
143
+ throw new Error('Is default must be a boolean');
144
+ }
145
+ if (queryWhere.id && queryWhere.id !== id) {
146
+ throw new Error('ID mismatch between parameter and queryWhere');
147
+ }
148
+ taxData = {
149
+ description: description || null,
150
+ enabled: enabled,
151
+ isDefault: isDefault,
152
+ preferenceId: preferenceId,
153
+ taxName: taxName,
154
+ taxRate: taxRate,
155
+ };
156
+ return [4 /*yield*/, prisma.tax.upsert({
157
+ include: include,
158
+ where: __assign({ id: id }, queryWhere),
159
+ update: taxData,
160
+ create: __assign({ id: id }, taxData),
161
+ })];
101
162
  case 1:
102
- tax = _c.sent();
163
+ tax = _e.sent();
103
164
  return [2 /*return*/, tax];
104
165
  }
105
166
  });
106
167
  }); };
107
- exports.postTax = postTax;
168
+ exports.updateTax = updateTax;
169
+ /**
170
+ * Deletes a tax by ID
171
+ * @param {DeleteTaxArgs} args - Object containing prisma client, tax ID, and optional filters
172
+ * @returns {Promise<TaxBE>} Deleted tax
173
+ */
108
174
  var deleteTax = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
109
175
  var tax;
110
- var prisma = _b.prisma, id = _b.id;
111
- return __generator(this, function (_c) {
112
- switch (_c.label) {
113
- case 0: return [4 /*yield*/, prisma.tax.delete({
114
- where: {
115
- id: id,
116
- },
117
- })];
176
+ var id = _b.id, _c = _b.include, include = _c === void 0 ? {} : _c, prisma = _b.prisma, _d = _b.queryWhere, queryWhere = _d === void 0 ? {} : _d;
177
+ return __generator(this, function (_e) {
178
+ switch (_e.label) {
179
+ case 0:
180
+ if (!id) {
181
+ throw new Error('Tax ID is required');
182
+ }
183
+ if (queryWhere.id && queryWhere.id !== id) {
184
+ throw new Error('ID mismatch between parameter and queryWhere');
185
+ }
186
+ return [4 /*yield*/, prisma.tax.delete({
187
+ include: include,
188
+ where: __assign({ id: id }, queryWhere),
189
+ })];
118
190
  case 1:
119
- tax = _c.sent();
191
+ tax = _e.sent();
120
192
  return [2 /*return*/, tax];
121
193
  }
122
194
  });
@@ -1,19 +1,34 @@
1
+ /**
2
+ * Gender options for user profiles
3
+ */
1
4
  export declare enum GENDER {
2
5
  MALE = "MALE",
3
6
  FEMALE = "FEMALE"
4
7
  }
8
+ /**
9
+ * Quote and Invoice category types
10
+ */
5
11
  export declare enum QUOTE_INVOICE_CATEGORY {
6
12
  QUOTE = "QUOTE",
7
13
  INVOICE = "INVOICE"
8
14
  }
15
+ /**
16
+ * Discount unit types (fixed amount or percentage)
17
+ */
9
18
  export declare enum DISCOUNT_UNIT {
10
19
  FIXED_VALUE = "FIXED_VALUE",
11
20
  PERCENTAGE_VALUE = "PERCENTAGE_VALUE"
12
21
  }
22
+ /**
23
+ * Invoice payment status
24
+ */
13
25
  export declare enum INVOICE_STATUS {
14
26
  UNPAID = "UNPAID",
15
27
  PAID = "PAID"
16
28
  }
29
+ /**
30
+ * Quote lifecycle status
31
+ */
17
32
  export declare enum QUOTE_STATUS {
18
33
  DRAFT = "DRAFT",
19
34
  PENDING = "PENDING",
@@ -21,13 +36,79 @@ export declare enum QUOTE_STATUS {
21
36
  ACCEPTED = "ACCEPTED",
22
37
  DECLINED = "DECLINED"
23
38
  }
39
+ /**
40
+ * Payment type (full or partial)
41
+ */
24
42
  export declare enum PAYMENT_TYPE {
25
43
  FULL_AMOUNT = "FULL_AMOUNT",
26
44
  PARTIAL_AMOUNT = "PARTIAL_AMOUNT"
27
45
  }
28
- export interface ProfileBE {
29
- avatar?: string;
46
+ /**
47
+ * Lead source options
48
+ */
49
+ export declare enum LEAD_SOURCE {
50
+ ADVERTISING = "ADVERTISING",
51
+ CUSTOMER_REFERRAL = "CUSTOMER_REFERRAL",
52
+ FRIEND = "FRIEND",
53
+ LINKEDIN = "LINKEDIN",
54
+ OTHER = "OTHER",
55
+ PROFESSIONAL_NETWORK = "PROFESSIONAL_NETWORK",
56
+ SALES = "SALES",
57
+ SOCIAL_MEDIA = "SOCIAL_MEDIA",
58
+ WEBSITE = "WEBSITE"
59
+ }
60
+ /**
61
+ * Lead status options
62
+ */
63
+ export declare enum LEAD_STATUS {
64
+ ASSIGNED = "ASSIGNED",
65
+ CANCELLED = "CANCELLED",
66
+ DRAFT = "DRAFT",
67
+ IN_NEGOTIATION = "IN_NEGOTIATION",
68
+ LOOSE = "LOOSE",
69
+ NEW = "NEW",
70
+ 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"
80
+ }
81
+ /**
82
+ * Base timestamp fields present in all entities
83
+ */
84
+ export interface TimestampFields {
30
85
  createdAt: string;
86
+ updatedAt: string;
87
+ }
88
+ /**
89
+ * Common fields for preference-related entities
90
+ */
91
+ export interface PreferenceRelatedFields extends TimestampFields {
92
+ enabled: boolean;
93
+ id: string;
94
+ isDefault: boolean;
95
+ preferenceId: string;
96
+ preference?: PreferenceBE;
97
+ }
98
+ /**
99
+ * Application user entity
100
+ */
101
+ export interface AppUserBE extends TimestampFields {
102
+ email: string;
103
+ firstName: string;
104
+ id: string;
105
+ lastName: string;
106
+ }
107
+ /**
108
+ * User profile entity with extended personal information
109
+ */
110
+ export interface ProfileBE extends TimestampFields {
111
+ avatar?: string;
31
112
  dob?: string;
32
113
  email: string;
33
114
  firstName: string;
@@ -38,12 +119,22 @@ export interface ProfileBE {
38
119
  location?: string;
39
120
  phone: string;
40
121
  skill?: string;
41
- updatedAt: string;
42
122
  userId: string;
43
123
  }
44
- export interface ProductBE {
124
+ /**
125
+ * Product category entity
126
+ */
127
+ export interface ProductCategoryBE extends TimestampFields {
128
+ description?: string;
129
+ id: string;
130
+ name: string;
131
+ products: Array<ProductBE>;
132
+ }
133
+ /**
134
+ * Product entity
135
+ */
136
+ export interface ProductBE extends TimestampFields {
45
137
  buyPrice: string;
46
- createdAt: string;
47
138
  currency: string;
48
139
  description?: string;
49
140
  id: string;
@@ -54,51 +145,61 @@ export interface ProductBE {
54
145
  quantity: string;
55
146
  ref?: string;
56
147
  salePrice: string;
57
- updatedAt: string;
58
148
  }
59
- export interface ProductCategoryBE {
60
- createdAt: string;
61
- description?: string;
62
- id: string;
63
- name: string;
64
- products: Array<ProductBE>;
65
- updatedAt: string;
66
- }
67
- export interface CompanyBE {
149
+ /**
150
+ * Company entity
151
+ */
152
+ export interface CompanyBE extends TimestampFields {
68
153
  contacts: Array<ContactBE>;
69
154
  country: string;
70
- createdAt: string;
71
155
  email: string;
72
156
  id: string;
73
157
  name: string;
74
158
  phone: string;
75
159
  quotesInvoices: Array<QuoteInvoiceBE>;
76
- updatedAt: string;
77
160
  website?: string;
78
161
  }
79
- export interface ContactBE {
162
+ /**
163
+ * Contact entity (associated with a company)
164
+ */
165
+ export interface ContactBE extends TimestampFields {
80
166
  company?: CompanyBE;
81
167
  companyId: string;
82
168
  country: string;
83
- createdAt: string;
84
169
  email: string;
85
170
  firstName: string;
86
171
  id: string;
87
172
  lastName: string;
88
173
  phone: string;
89
- updatedAt: string;
90
174
  }
91
- export interface ExpenseCategoryBE {
175
+ /**
176
+ * Customer entity
177
+ */
178
+ export interface CustomerBE extends TimestampFields {
179
+ address?: string;
180
+ city: string;
181
+ country: string;
182
+ email?: string;
183
+ firstName: string;
184
+ id: string;
185
+ invoices: Array<QuoteInvoiceBE>;
186
+ lastName: string;
187
+ phone: string;
188
+ }
189
+ /**
190
+ * Expense category entity
191
+ */
192
+ export interface ExpenseCategoryBE extends TimestampFields {
92
193
  color: string;
93
- createdAt: string;
94
194
  description?: string;
95
195
  expenses: Array<ExpenseBE>;
96
196
  id: string;
97
197
  name: string;
98
- updatedAt: string;
99
198
  }
100
- export interface ExpenseBE {
101
- createdAt: string;
199
+ /**
200
+ * Expense entity
201
+ */
202
+ export interface ExpenseBE extends TimestampFields {
102
203
  currency: string;
103
204
  description: string;
104
205
  expenseCategory?: ExpenseCategoryBE;
@@ -107,13 +208,14 @@ export interface ExpenseBE {
107
208
  name: string;
108
209
  ref?: string;
109
210
  total: string;
110
- updatedAt: string;
111
211
  }
112
- export interface QuoteInvoiceBE {
212
+ /**
213
+ * Quote/Invoice entity
214
+ */
215
+ export interface QuoteInvoiceBE extends TimestampFields {
113
216
  category: QUOTE_INVOICE_CATEGORY;
114
217
  company?: CompanyBE;
115
218
  companyId?: string;
116
- createdAt: string;
117
219
  currency: string;
118
220
  customer?: CustomerBE;
119
221
  customerId?: string;
@@ -132,10 +234,11 @@ export interface QuoteInvoiceBE {
132
234
  subTotal: string;
133
235
  taxRate: string;
134
236
  total: string;
135
- updatedAt: string;
136
237
  }
137
- export interface ServiceBE {
138
- createdAt: string;
238
+ /**
239
+ * Service entity (for quotes/invoices)
240
+ */
241
+ export interface ServiceBE extends TimestampFields {
139
242
  description?: string;
140
243
  id: string;
141
244
  name: string;
@@ -143,13 +246,14 @@ export interface ServiceBE {
143
246
  quantity: string;
144
247
  quoteInvoice?: QuoteInvoiceBE;
145
248
  quoteInvoiceId: string;
146
- updatedAt: string;
147
249
  }
148
- export interface PaymentBE {
250
+ /**
251
+ * Payment entity
252
+ */
253
+ export interface PaymentBE extends TimestampFields {
149
254
  amount: string;
150
255
  attachment?: string;
151
256
  balance: string;
152
- createdAt: string;
153
257
  currency: string;
154
258
  date: string;
155
259
  description?: string;
@@ -160,134 +264,96 @@ export interface PaymentBE {
160
264
  quoteInvoice?: QuoteInvoiceBE;
161
265
  quoteInvoiceId: string;
162
266
  ref?: string;
163
- updatedAt: string;
164
267
  }
165
- export interface PreferenceBE {
268
+ /**
269
+ * User preferences and settings entity
270
+ */
271
+ export interface PreferenceBE extends TimestampFields {
166
272
  banks: Array<BankBE>;
167
273
  branches: Array<BranchBE>;
168
- createdAt: string;
169
274
  currencies: Array<CurrencyBE>;
170
275
  id: string;
171
276
  menuOrder: Array<MenuOrderBE>;
172
277
  onboarding: boolean;
173
278
  paymentModes: Array<PaymentModeBE>;
174
279
  taxes: Array<TaxBE>;
175
- updatedAt: string;
176
- }
177
- export interface AppUserBE {
178
- createdAt: string;
179
- email: string;
180
- firstName: string;
181
- id: string;
182
- lastName: string;
183
- updatedAt: string;
184
280
  }
185
- export interface MenuOrderBE {
186
- createdAt: string;
281
+ /**
282
+ * Menu order configuration entity
283
+ */
284
+ export interface MenuOrderBE extends TimestampFields {
187
285
  id: string;
188
286
  label: string;
189
287
  order: number;
190
288
  preference?: PreferenceBE;
191
289
  preferenceId: string;
192
- updatedAt: string;
193
290
  }
194
- export interface PaymentModeBE {
195
- createdAt: string;
196
- enabled: boolean;
197
- id: string;
198
- isDefault: boolean;
291
+ /**
292
+ * Payment mode entity
293
+ */
294
+ export interface PaymentModeBE extends PreferenceRelatedFields {
199
295
  label: string;
200
296
  payments: Array<PaymentBE>;
201
- preference?: PreferenceBE;
202
- preferenceId: string;
203
- updatedAt: string;
204
297
  }
205
- export interface BankBE {
298
+ /**
299
+ * Bank account entity
300
+ */
301
+ export interface BankBE extends PreferenceRelatedFields {
206
302
  accountNumber: string;
207
303
  accountTitle: string;
208
304
  bankAddress?: string;
209
305
  bankName: string;
210
- createdAt: string;
211
- enabled: boolean;
212
306
  iban?: string;
213
- id: string;
214
- isDefault: boolean;
215
- preference?: PreferenceBE;
216
- preferenceId: string;
217
307
  swiftCode?: string;
218
- updatedAt: string;
219
308
  }
220
- export interface TaxBE {
221
- createdAt: string;
309
+ /**
310
+ * Tax configuration entity
311
+ */
312
+ export interface TaxBE extends PreferenceRelatedFields {
222
313
  description?: string;
223
- enabled: boolean;
224
- id: string;
225
- isDefault: boolean;
226
- preference?: PreferenceBE;
227
- preferenceId: string;
228
314
  taxName: string;
229
315
  taxRate: string;
230
- updatedAt: string;
231
316
  }
232
- export interface BranchBE {
317
+ /**
318
+ * Branch/Location entity
319
+ */
320
+ export interface BranchBE extends PreferenceRelatedFields {
233
321
  branchAddress: string;
234
322
  branchName: string;
235
- createdAt: string;
236
- enabled: boolean;
237
- id: string;
238
- isDefault: boolean;
239
323
  personEmail: string;
240
324
  personName: string;
241
325
  personPhone: string;
242
- preference?: PreferenceBE;
243
- preferenceId: string;
244
- updatedAt: string;
245
326
  }
246
- export interface CurrencyBE {
327
+ /**
328
+ * Currency entity
329
+ */
330
+ export interface CurrencyBE extends PreferenceRelatedFields {
247
331
  code: string;
248
- createdAt: string;
249
- enabled: boolean;
250
- id: string;
251
- isDefault: boolean;
252
332
  label: string;
253
- preference?: PreferenceBE;
254
- preferenceId: string;
255
- updatedAt: string;
256
333
  }
257
- export interface CustomerBE {
258
- address?: string;
259
- city: string;
260
- country: string;
261
- createdAt: string;
262
- email?: string;
263
- firstName: string;
334
+ /**
335
+ * Lead entity for CRM
336
+ */
337
+ export interface LeadBE extends TimestampFields {
264
338
  id: string;
265
- invoices: Array<QuoteInvoiceBE>;
266
- lastName: string;
267
- phone: string;
268
- updatedAt: string;
339
+ notes?: string;
340
+ source: LEAD_SOURCE;
341
+ status: LEAD_STATUS;
342
+ type: LEAD_TYPE;
269
343
  }
270
- export interface RequestFormBE {
344
+ /**
345
+ * Request form submission entity
346
+ */
347
+ export interface RequestFormBE extends TimestampFields {
271
348
  businessType: string;
272
349
  companyName: string;
273
350
  companySize?: string;
274
- createdAt: string;
275
351
  designation: string;
276
352
  firstName: string;
277
353
  headOffice?: string;
278
354
  id: string;
279
355
  lastName: string;
280
356
  phoneNumber: string;
281
- updatedAt: string;
282
357
  website?: string;
283
358
  workEmail: string;
284
359
  }
285
- export interface LeadBE {
286
- createdAt: string;
287
- id: string;
288
- notes?: string;
289
- source: 'ADVERTISING' | 'CUSTOMER_REFERRAL' | 'FRIEND' | 'LINKEDIN' | 'OTHER' | 'PROFESSIONAL_NETWORK' | 'SALES' | 'SOCIAL_MEDIA' | 'WEBSITE';
290
- status: 'ASSIGNED' | 'CANCELLED' | 'DRAFT' | 'IN_NEGOTIATION' | 'LOOSE' | 'NEW' | 'ON_HOLD' | 'WAITING' | 'WON';
291
- type: 'COMPANY' | 'CONTACT';
292
- updatedAt: string;
293
- }