@react-pakistan/util-functions 1.24.98 → 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.
- package/api/stellar-solutions/app-user/index.d.ts +9 -9
- package/api/stellar-solutions/app-user/index.js +4 -4
- package/api/stellar-solutions/bank/index.d.ts +9 -9
- package/api/stellar-solutions/bank/index.js +4 -4
- package/api/stellar-solutions/branch/index.d.ts +9 -9
- package/api/stellar-solutions/branch/index.js +4 -4
- package/api/stellar-solutions/company/index.d.ts +9 -9
- package/api/stellar-solutions/company/index.js +4 -4
- package/api/stellar-solutions/company-report/index.d.ts +3 -3
- package/api/stellar-solutions/company-report/index.js +1 -1
- package/api/stellar-solutions/constants.d.ts +9 -0
- package/api/stellar-solutions/constants.js +12 -0
- package/api/stellar-solutions/contact/index.d.ts +9 -9
- package/api/stellar-solutions/contact/index.js +4 -4
- package/api/stellar-solutions/currency/index.d.ts +9 -9
- package/api/stellar-solutions/currency/index.js +4 -4
- package/api/stellar-solutions/customer/index.d.ts +11 -11
- package/api/stellar-solutions/customer/index.js +5 -5
- package/api/stellar-solutions/expense/index.d.ts +9 -9
- package/api/stellar-solutions/expense/index.js +4 -4
- package/api/stellar-solutions/expense-category/index.d.ts +9 -9
- package/api/stellar-solutions/expense-category/index.js +4 -4
- package/api/stellar-solutions/lead/index.d.ts +9 -9
- package/api/stellar-solutions/lead/index.js +4 -4
- package/api/stellar-solutions/menu-order/index.d.ts +9 -9
- package/api/stellar-solutions/menu-order/index.js +4 -4
- package/api/stellar-solutions/payment/index.d.ts +9 -9
- package/api/stellar-solutions/payment/index.js +4 -4
- package/api/stellar-solutions/payment-mode/index.d.ts +9 -9
- package/api/stellar-solutions/payment-mode/index.js +4 -4
- package/api/stellar-solutions/preference/index.d.ts +5 -5
- package/api/stellar-solutions/preference/index.js +2 -2
- package/api/stellar-solutions/product/cache.d.ts +94 -0
- package/api/stellar-solutions/product/cache.js +280 -0
- package/api/stellar-solutions/product/index.d.ts +12 -14
- package/api/stellar-solutions/product/index.js +28 -12
- package/api/stellar-solutions/product-category/cache.d.ts +94 -0
- package/api/stellar-solutions/product-category/cache.js +280 -0
- package/api/stellar-solutions/product-category/index.d.ts +10 -10
- package/api/stellar-solutions/product-category/index.js +19 -4
- package/api/stellar-solutions/profile/index.d.ts +13 -13
- package/api/stellar-solutions/profile/index.js +6 -6
- package/api/stellar-solutions/quote-invoice/index.d.ts +9 -9
- package/api/stellar-solutions/quote-invoice/index.js +4 -4
- package/api/stellar-solutions/quote-invoice-report/index.d.ts +3 -3
- package/api/stellar-solutions/quote-invoice-report/index.js +1 -1
- package/api/stellar-solutions/tax/index.d.ts +9 -9
- package/api/stellar-solutions/tax/index.js +4 -4
- package/api/stellar-solutions/type.d.ts +49 -45
- package/api/stellar-solutions/type.js +6 -1
- package/index.d.ts +6 -5
- package/index.js +6 -6
- package/package.json +1 -1
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
24
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
50
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
51
|
+
if (ar || !(i in from)) {
|
|
52
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
53
|
+
ar[i] = from[i];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
57
|
+
};
|
|
58
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
|
+
exports.isProductCategoriesCacheStale = exports.preloadProductCategories = exports.invalidateProductCategoriesCache = exports.getCachedProductCategoryById = exports.getCachedProductCategories = exports.getCachedProductCategoriesSync = void 0;
|
|
60
|
+
var constants_1 = require("../constants");
|
|
61
|
+
var type_1 = require("../type");
|
|
62
|
+
var api_methods_1 = require("../../../constants/api-methods");
|
|
63
|
+
var fetch_data_1 = require("../../../general/fetch-data");
|
|
64
|
+
var get_storage_value_1 = require("../../../local-storage/get-storage-value");
|
|
65
|
+
var set_storage_value_1 = require("../../../local-storage/set-storage-value");
|
|
66
|
+
/**
|
|
67
|
+
* Synchronous utility function to get product categories from cache only
|
|
68
|
+
* Returns cached data immediately if available and fresh, otherwise returns empty array
|
|
69
|
+
* Does not trigger any API calls
|
|
70
|
+
*
|
|
71
|
+
* @returns ProductCategoryTypeBE[] - Array of cached product categories or empty array
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* const categories = getCachedProductCategoriesSync();
|
|
75
|
+
* if (categories.length > 0) {
|
|
76
|
+
* console.log(categories[0].name);
|
|
77
|
+
* }
|
|
78
|
+
*/
|
|
79
|
+
var getCachedProductCategoriesSync = function () {
|
|
80
|
+
try {
|
|
81
|
+
var cachedData = (0, get_storage_value_1.getStorageValue)(type_1.LS_KEYS.PRODUCT_CATEGORIES);
|
|
82
|
+
if (!cachedData) {
|
|
83
|
+
return { count: 0, items: [] };
|
|
84
|
+
}
|
|
85
|
+
var currentTime = new Date().getTime();
|
|
86
|
+
var cachedTime = new Date(cachedData.cachedAt).getTime();
|
|
87
|
+
var ageInMs = currentTime - cachedTime;
|
|
88
|
+
// If cached data is less than 1 week old, return it
|
|
89
|
+
if (ageInMs < constants_1.ONE_DAY_IN_MS) {
|
|
90
|
+
return {
|
|
91
|
+
count: cachedData.productCategories.length,
|
|
92
|
+
items: cachedData.productCategories,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
return { count: 0, items: [] };
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
console.error('Error getting cached product categories:', error);
|
|
99
|
+
return { count: 0, items: [] };
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
exports.getCachedProductCategoriesSync = getCachedProductCategoriesSync;
|
|
103
|
+
/**
|
|
104
|
+
* Utility function to get product categories from cache or fetch from API
|
|
105
|
+
*
|
|
106
|
+
* This function manages a localStorage cache of product categories with the following logic:
|
|
107
|
+
* - If categories exist in cache and are less than 1 week old, return cached version
|
|
108
|
+
* - If categories exist but are older than 1 week, fetch fresh data and update cache
|
|
109
|
+
* - If categories don't exist in cache, fetch from API and cache them
|
|
110
|
+
*
|
|
111
|
+
* @param searchQuery - Optional search query to filter categories
|
|
112
|
+
* @param filters - Optional filters object to apply additional filtering (bypasses cache)
|
|
113
|
+
* @param pageLimit - Number of categories to fetch (default: 100)
|
|
114
|
+
* @returns Promise<ProductCategoryTypeBE[]> - Array of product categories
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* const categories = await getCachedProductCategories();
|
|
118
|
+
* console.log(categories[0].name);
|
|
119
|
+
*
|
|
120
|
+
* // With search
|
|
121
|
+
* const filtered = await getCachedProductCategories('Electronics');
|
|
122
|
+
*
|
|
123
|
+
* // With filters
|
|
124
|
+
* const filteredCategories = await getCachedProductCategories(undefined, { enabled: true });
|
|
125
|
+
*/
|
|
126
|
+
var getCachedProductCategories = function (searchQuery_1, filters_1) {
|
|
127
|
+
var args_1 = [];
|
|
128
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
129
|
+
args_1[_i - 2] = arguments[_i];
|
|
130
|
+
}
|
|
131
|
+
return __awaiter(void 0, __spreadArray([searchQuery_1, filters_1], args_1, true), void 0, function (searchQuery, filters, pageLimit) {
|
|
132
|
+
var response_1, cachedData, currentTime, cachedTime, ageInMs, response, updatedCache, error_1;
|
|
133
|
+
var _a;
|
|
134
|
+
if (pageLimit === void 0) { pageLimit = 100; }
|
|
135
|
+
return __generator(this, function (_b) {
|
|
136
|
+
switch (_b.label) {
|
|
137
|
+
case 0:
|
|
138
|
+
_b.trys.push([0, 4, , 5]);
|
|
139
|
+
if (!((searchQuery && searchQuery.trim()) ||
|
|
140
|
+
(filters && Object.keys(filters).length > 0))) return [3 /*break*/, 2];
|
|
141
|
+
return [4 /*yield*/, (0, fetch_data_1.fetchData)({
|
|
142
|
+
url: constants_1.API_ROUTES.PRODUCT_CATEGORIES,
|
|
143
|
+
body: JSON.stringify(__assign(__assign({ searchQuery: searchQuery }, filters), { pageLimit: pageLimit, currentPage: 1 })),
|
|
144
|
+
method: api_methods_1.API_METHODS.POST,
|
|
145
|
+
})];
|
|
146
|
+
case 1:
|
|
147
|
+
response_1 = _b.sent();
|
|
148
|
+
return [2 /*return*/, (response_1 === null || response_1 === void 0 ? void 0 : response_1.data) || { count: 0, items: [] }];
|
|
149
|
+
case 2:
|
|
150
|
+
cachedData = (0, get_storage_value_1.getStorageValue)(type_1.LS_KEYS.PRODUCT_CATEGORIES);
|
|
151
|
+
currentTime = new Date().getTime();
|
|
152
|
+
// Check if cached data exists and is still fresh
|
|
153
|
+
if (cachedData) {
|
|
154
|
+
cachedTime = new Date(cachedData.cachedAt).getTime();
|
|
155
|
+
ageInMs = currentTime - cachedTime;
|
|
156
|
+
// If cached data is less than 1 week old, return it
|
|
157
|
+
if (ageInMs < constants_1.ONE_DAY_IN_MS) {
|
|
158
|
+
return [2 /*return*/, {
|
|
159
|
+
count: cachedData.productCategories.length,
|
|
160
|
+
items: cachedData.productCategories,
|
|
161
|
+
}];
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return [4 /*yield*/, (0, fetch_data_1.fetchData)({
|
|
165
|
+
url: constants_1.API_ROUTES.PRODUCT_CATEGORIES,
|
|
166
|
+
body: JSON.stringify({
|
|
167
|
+
pageLimit: pageLimit,
|
|
168
|
+
currentPage: 1,
|
|
169
|
+
}),
|
|
170
|
+
method: api_methods_1.API_METHODS.POST,
|
|
171
|
+
})];
|
|
172
|
+
case 3:
|
|
173
|
+
response = _b.sent();
|
|
174
|
+
if ((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.items) {
|
|
175
|
+
updatedCache = {
|
|
176
|
+
productCategories: response.data.items,
|
|
177
|
+
cachedAt: new Date().toISOString(),
|
|
178
|
+
};
|
|
179
|
+
(0, set_storage_value_1.setStorageValue)(type_1.LS_KEYS.PRODUCT_CATEGORIES, updatedCache);
|
|
180
|
+
return [2 /*return*/, response.data];
|
|
181
|
+
}
|
|
182
|
+
return [2 /*return*/, { count: 0, items: [] }];
|
|
183
|
+
case 4:
|
|
184
|
+
error_1 = _b.sent();
|
|
185
|
+
console.error('Error fetching product categories:', error_1);
|
|
186
|
+
return [2 /*return*/, { count: 0, items: [] }];
|
|
187
|
+
case 5: return [2 /*return*/];
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
exports.getCachedProductCategories = getCachedProductCategories;
|
|
193
|
+
/**
|
|
194
|
+
* Utility function to get a specific product category by ID from cache
|
|
195
|
+
* If not found in cache, returns null (does not trigger API call)
|
|
196
|
+
*
|
|
197
|
+
* @param categoryId - The ID of the category to retrieve
|
|
198
|
+
* @returns ProductCategoryTypeBE | null - The category or null if not found
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* const category = getCachedProductCategoryById('cat-123');
|
|
202
|
+
* if (category) {
|
|
203
|
+
* console.log(category.name);
|
|
204
|
+
* }
|
|
205
|
+
*/
|
|
206
|
+
var getCachedProductCategoryById = function (categoryId) {
|
|
207
|
+
if (!categoryId) {
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
try {
|
|
211
|
+
var productCategories = (0, exports.getCachedProductCategoriesSync)().items;
|
|
212
|
+
return productCategories.find(function (cat) { return cat.id === categoryId; }) || null;
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
console.error('Error getting cached product category by ID:', error);
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
exports.getCachedProductCategoryById = getCachedProductCategoryById;
|
|
220
|
+
/**
|
|
221
|
+
* Utility function to invalidate (remove) product categories from cache
|
|
222
|
+
* Useful when categories have been updated and you want to force a refresh
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* invalidateProductCategoriesCache();
|
|
226
|
+
* const freshCategories = await getCachedProductCategories();
|
|
227
|
+
*/
|
|
228
|
+
var invalidateProductCategoriesCache = function () {
|
|
229
|
+
try {
|
|
230
|
+
localStorage.removeItem(type_1.LS_KEYS.PRODUCT_CATEGORIES);
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
console.error('Error invalidating product categories cache:', error);
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
exports.invalidateProductCategoriesCache = invalidateProductCategoriesCache;
|
|
237
|
+
/**
|
|
238
|
+
* Utility function to preload product categories into cache
|
|
239
|
+
* Useful to call on app initialization or login
|
|
240
|
+
*
|
|
241
|
+
* @returns Promise<ProductCategoryTypeBE[]> - Array of preloaded categories
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* // On app initialization
|
|
245
|
+
* await preloadProductCategories();
|
|
246
|
+
*/
|
|
247
|
+
var preloadProductCategories = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
248
|
+
return __generator(this, function (_a) {
|
|
249
|
+
return [2 /*return*/, (0, exports.getCachedProductCategories)()];
|
|
250
|
+
});
|
|
251
|
+
}); };
|
|
252
|
+
exports.preloadProductCategories = preloadProductCategories;
|
|
253
|
+
/**
|
|
254
|
+
* Utility function to check if product categories cache is stale
|
|
255
|
+
* Returns true if cache is older than 1 week or doesn't exist
|
|
256
|
+
*
|
|
257
|
+
* @returns boolean - True if cache is stale or doesn't exist
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* if (isProductCategoriesCacheStale()) {
|
|
261
|
+
* await getCachedProductCategories(); // This will fetch fresh data
|
|
262
|
+
* }
|
|
263
|
+
*/
|
|
264
|
+
var isProductCategoriesCacheStale = function () {
|
|
265
|
+
try {
|
|
266
|
+
var cachedData = (0, get_storage_value_1.getStorageValue)(type_1.LS_KEYS.PRODUCT_CATEGORIES);
|
|
267
|
+
if (!cachedData) {
|
|
268
|
+
return true;
|
|
269
|
+
}
|
|
270
|
+
var currentTime = new Date().getTime();
|
|
271
|
+
var cachedTime = new Date(cachedData.cachedAt).getTime();
|
|
272
|
+
var ageInMs = currentTime - cachedTime;
|
|
273
|
+
return ageInMs >= constants_1.ONE_DAY_IN_MS;
|
|
274
|
+
}
|
|
275
|
+
catch (error) {
|
|
276
|
+
console.error('Error checking product categories cache staleness:', error);
|
|
277
|
+
return true;
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
exports.isProductCategoriesCacheStale = isProductCategoriesCacheStale;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export * from './cache';
|
|
2
|
+
import { ProductCategoryTypeBE } from '../type';
|
|
2
3
|
type PrismaClient = any;
|
|
3
4
|
export interface ListProductCategoryArgs {
|
|
4
5
|
currentPage?: number;
|
|
@@ -27,25 +28,24 @@ export interface DeleteProductCategoryArgs {
|
|
|
27
28
|
/**
|
|
28
29
|
* Retrieves a paginated list of product categories
|
|
29
30
|
* @param {ListProductCategoryArgs} args - Object containing prisma client, pagination, filtering, and ordering options
|
|
30
|
-
* @returns {Promise<[number, Array<
|
|
31
|
+
* @returns {Promise<[number, Array<ProductCategoryTypeBE>]>} Tuple containing total count and array of product categories
|
|
31
32
|
*/
|
|
32
|
-
export declare const listProductCategory: ({ currentPage, includeProducts, orderByColumn, orderByDirection, pageLimit, prisma, searchQuery, }: ListProductCategoryArgs) => Promise<[number, Array<
|
|
33
|
+
export declare const listProductCategory: ({ currentPage, includeProducts, orderByColumn, orderByDirection, pageLimit, prisma, searchQuery, }: ListProductCategoryArgs) => Promise<[number, Array<ProductCategoryTypeBE>]>;
|
|
33
34
|
/**
|
|
34
35
|
* Retrieves a single product category by its ID
|
|
35
36
|
* @param {UnitProductCategoryByIdArgs} args - Object containing prisma client, product category ID, and optional query parameters
|
|
36
|
-
* @returns {Promise<
|
|
37
|
+
* @returns {Promise<ProductCategoryTypeBE | null>} Product category or null if not found
|
|
37
38
|
*/
|
|
38
|
-
export declare const unitProductCategoryById: ({ id, includeProducts, prisma, }: UnitProductCategoryByIdArgs) => Promise<
|
|
39
|
+
export declare const unitProductCategoryById: ({ id, includeProducts, prisma, }: UnitProductCategoryByIdArgs) => Promise<ProductCategoryTypeBE | null>;
|
|
39
40
|
/**
|
|
40
41
|
* Creates or updates a product category
|
|
41
42
|
* @param {UpdateProductCategoryArgs} args - Object containing prisma client, product category data, and optional query parameters
|
|
42
|
-
* @returns {Promise<
|
|
43
|
+
* @returns {Promise<ProductCategoryTypeBE>} Created or updated product category
|
|
43
44
|
*/
|
|
44
|
-
export declare const updateProductCategory: ({ description, id, name, prisma, }: UpdateProductCategoryArgs) => Promise<
|
|
45
|
+
export declare const updateProductCategory: ({ description, id, name, prisma, }: UpdateProductCategoryArgs) => Promise<ProductCategoryTypeBE>;
|
|
45
46
|
/**
|
|
46
47
|
* Deletes a product category by ID
|
|
47
48
|
* @param {DeleteProductCategoryArgs} args - Object containing prisma client, product category ID, and optional query parameters
|
|
48
|
-
* @returns {Promise<
|
|
49
|
+
* @returns {Promise<ProductCategoryTypeBE>} Deleted product category
|
|
49
50
|
*/
|
|
50
|
-
export declare const deleteProductCategory: ({ id, prisma, }: DeleteProductCategoryArgs) => Promise<
|
|
51
|
-
export {};
|
|
51
|
+
export declare const deleteProductCategory: ({ id, prisma, }: DeleteProductCategoryArgs) => Promise<ProductCategoryTypeBE>;
|
|
@@ -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.deleteProductCategory = exports.updateProductCategory = exports.unitProductCategoryById = exports.listProductCategory = 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 product categories
|
|
63
78
|
* @param {ListProductCategoryArgs} args - Object containing prisma client, pagination, filtering, and ordering options
|
|
64
|
-
* @returns {Promise<[number, Array<
|
|
79
|
+
* @returns {Promise<[number, Array<ProductCategoryTypeBE>]>} Tuple containing total count and array of product categories
|
|
65
80
|
*/
|
|
66
81
|
var listProductCategory = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
67
82
|
var include, orderBy, idSearchQuery, nameSearchQuery, descriptionSearchQuery, where, _c, count, items;
|
|
@@ -119,7 +134,7 @@ exports.listProductCategory = listProductCategory;
|
|
|
119
134
|
/**
|
|
120
135
|
* Retrieves a single product category by its ID
|
|
121
136
|
* @param {UnitProductCategoryByIdArgs} args - Object containing prisma client, product category ID, and optional query parameters
|
|
122
|
-
* @returns {Promise<
|
|
137
|
+
* @returns {Promise<ProductCategoryTypeBE | null>} Product category or null if not found
|
|
123
138
|
*/
|
|
124
139
|
var unitProductCategoryById = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
125
140
|
var include, where, productCategory;
|
|
@@ -150,7 +165,7 @@ exports.unitProductCategoryById = unitProductCategoryById;
|
|
|
150
165
|
/**
|
|
151
166
|
* Creates or updates a product category
|
|
152
167
|
* @param {UpdateProductCategoryArgs} args - Object containing prisma client, product category data, and optional query parameters
|
|
153
|
-
* @returns {Promise<
|
|
168
|
+
* @returns {Promise<ProductCategoryTypeBE>} Created or updated product category
|
|
154
169
|
*/
|
|
155
170
|
var updateProductCategory = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
156
171
|
var productCategoryData, where, productCategory;
|
|
@@ -186,7 +201,7 @@ exports.updateProductCategory = updateProductCategory;
|
|
|
186
201
|
/**
|
|
187
202
|
* Deletes a product category by ID
|
|
188
203
|
* @param {DeleteProductCategoryArgs} args - Object containing prisma client, product category ID, and optional query parameters
|
|
189
|
-
* @returns {Promise<
|
|
204
|
+
* @returns {Promise<ProductCategoryTypeBE>} Deleted product category
|
|
190
205
|
*/
|
|
191
206
|
var deleteProductCategory = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
192
207
|
var where, productCategory;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProfileTypeBE } from '../type';
|
|
2
2
|
type PrismaClient = any;
|
|
3
3
|
interface GetProfilesArgs {
|
|
4
4
|
orderByColumn?: string;
|
|
@@ -42,37 +42,37 @@ interface DeleteProfileArgs {
|
|
|
42
42
|
/**
|
|
43
43
|
* Retrieves all profiles
|
|
44
44
|
* @param {GetProfilesArgs} args - Object containing prisma client
|
|
45
|
-
* @returns {Promise<Array<
|
|
45
|
+
* @returns {Promise<Array<ProfileTypeBE>>} Array of profiles ordered by creation date (newest first)
|
|
46
46
|
*/
|
|
47
|
-
export declare const getProfiles: ({ orderByColumn, orderByDirection, prisma, }: GetProfilesArgs) => Promise<Array<
|
|
47
|
+
export declare const getProfiles: ({ orderByColumn, orderByDirection, prisma, }: GetProfilesArgs) => Promise<Array<ProfileTypeBE>>;
|
|
48
48
|
/**
|
|
49
49
|
* Retrieves a profile by its ID
|
|
50
50
|
* @param {GetProfileByIdArgs} args - Object containing prisma client and profile ID
|
|
51
|
-
* @returns {Promise<
|
|
51
|
+
* @returns {Promise<ProfileTypeBE | null>} Profile or null if not found
|
|
52
52
|
*/
|
|
53
|
-
export declare const getProfileById: ({ prisma, id, }: GetProfileByIdArgs) => Promise<
|
|
53
|
+
export declare const getProfileById: ({ prisma, id, }: GetProfileByIdArgs) => Promise<ProfileTypeBE | null>;
|
|
54
54
|
/**
|
|
55
55
|
* Retrieves a profile by user ID
|
|
56
56
|
* @param {GetProfileByUserIdArgs} args - Object containing prisma client and user ID
|
|
57
|
-
* @returns {Promise<
|
|
57
|
+
* @returns {Promise<ProfileTypeBE | null>} Profile or null if not found
|
|
58
58
|
*/
|
|
59
|
-
export declare const getProfileByUserId: ({ prisma, userId, }: GetProfileByUserIdArgs) => Promise<
|
|
59
|
+
export declare const getProfileByUserId: ({ prisma, userId, }: GetProfileByUserIdArgs) => Promise<ProfileTypeBE | null>;
|
|
60
60
|
/**
|
|
61
61
|
* Retrieves paginated profiles with filtering
|
|
62
62
|
* @param {PostProfilesArgs} args - Object containing prisma client, pagination, and filtering options
|
|
63
|
-
* @returns {Promise<[number, Array<
|
|
63
|
+
* @returns {Promise<[number, Array<ProfileTypeBE>]>} Tuple of [total count, profiles array]
|
|
64
64
|
*/
|
|
65
|
-
export declare const postProfiles: ({ currentPage, orderByColumn, orderByDirection, pageLimit, prisma, }: PostProfilesArgs) => Promise<[number, Array<
|
|
65
|
+
export declare const postProfiles: ({ currentPage, orderByColumn, orderByDirection, pageLimit, prisma, }: PostProfilesArgs) => Promise<[number, Array<ProfileTypeBE>]>;
|
|
66
66
|
/**
|
|
67
67
|
* Creates a new profile or updates an existing one
|
|
68
68
|
* @param {PostProfileArgs} args - Object containing prisma client and profile data
|
|
69
|
-
* @returns {Promise<
|
|
69
|
+
* @returns {Promise<ProfileTypeBE>} Created or updated profile
|
|
70
70
|
*/
|
|
71
|
-
export declare const postProfile: ({ avatar, dob, email, firstName, gender, id, language, lastName, location, phone, prisma, skill, userId, }: PostProfileArgs) => Promise<
|
|
71
|
+
export declare const postProfile: ({ avatar, dob, email, firstName, gender, id, language, lastName, location, phone, prisma, skill, userId, }: PostProfileArgs) => Promise<ProfileTypeBE>;
|
|
72
72
|
/**
|
|
73
73
|
* Deletes a profile by ID
|
|
74
74
|
* @param {DeleteProfileArgs} args - Object containing prisma client and profile ID
|
|
75
|
-
* @returns {Promise<
|
|
75
|
+
* @returns {Promise<ProfileTypeBE>} Deleted profile
|
|
76
76
|
*/
|
|
77
|
-
export declare const deleteProfile: ({ prisma, id, }: DeleteProfileArgs) => Promise<
|
|
77
|
+
export declare const deleteProfile: ({ prisma, id, }: DeleteProfileArgs) => Promise<ProfileTypeBE>;
|
|
78
78
|
export {};
|
|
@@ -51,7 +51,7 @@ exports.deleteProfile = exports.postProfile = exports.postProfiles = exports.get
|
|
|
51
51
|
/**
|
|
52
52
|
* Retrieves all profiles
|
|
53
53
|
* @param {GetProfilesArgs} args - Object containing prisma client
|
|
54
|
-
* @returns {Promise<Array<
|
|
54
|
+
* @returns {Promise<Array<ProfileTypeBE>>} Array of profiles ordered by creation date (newest first)
|
|
55
55
|
*/
|
|
56
56
|
var getProfiles = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
57
57
|
var profiles;
|
|
@@ -74,7 +74,7 @@ exports.getProfiles = getProfiles;
|
|
|
74
74
|
/**
|
|
75
75
|
* Retrieves a profile by its ID
|
|
76
76
|
* @param {GetProfileByIdArgs} args - Object containing prisma client and profile ID
|
|
77
|
-
* @returns {Promise<
|
|
77
|
+
* @returns {Promise<ProfileTypeBE | null>} Profile or null if not found
|
|
78
78
|
*/
|
|
79
79
|
var getProfileById = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
80
80
|
var profile;
|
|
@@ -100,7 +100,7 @@ exports.getProfileById = getProfileById;
|
|
|
100
100
|
/**
|
|
101
101
|
* Retrieves a profile by user ID
|
|
102
102
|
* @param {GetProfileByUserIdArgs} args - Object containing prisma client and user ID
|
|
103
|
-
* @returns {Promise<
|
|
103
|
+
* @returns {Promise<ProfileTypeBE | null>} Profile or null if not found
|
|
104
104
|
*/
|
|
105
105
|
var getProfileByUserId = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
106
106
|
var profile;
|
|
@@ -126,7 +126,7 @@ exports.getProfileByUserId = getProfileByUserId;
|
|
|
126
126
|
/**
|
|
127
127
|
* Retrieves paginated profiles with filtering
|
|
128
128
|
* @param {PostProfilesArgs} args - Object containing prisma client, pagination, and filtering options
|
|
129
|
-
* @returns {Promise<[number, Array<
|
|
129
|
+
* @returns {Promise<[number, Array<ProfileTypeBE>]>} Tuple of [total count, profiles array]
|
|
130
130
|
*/
|
|
131
131
|
var postProfiles = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
132
132
|
var profiles;
|
|
@@ -161,7 +161,7 @@ exports.postProfiles = postProfiles;
|
|
|
161
161
|
/**
|
|
162
162
|
* Creates a new profile or updates an existing one
|
|
163
163
|
* @param {PostProfileArgs} args - Object containing prisma client and profile data
|
|
164
|
-
* @returns {Promise<
|
|
164
|
+
* @returns {Promise<ProfileTypeBE>} Created or updated profile
|
|
165
165
|
*/
|
|
166
166
|
var postProfile = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
167
167
|
var profileData, profile_1, profile;
|
|
@@ -209,7 +209,7 @@ exports.postProfile = postProfile;
|
|
|
209
209
|
/**
|
|
210
210
|
* Deletes a profile by ID
|
|
211
211
|
* @param {DeleteProfileArgs} args - Object containing prisma client and profile ID
|
|
212
|
-
* @returns {Promise<
|
|
212
|
+
* @returns {Promise<ProfileTypeBE>} Deleted profile
|
|
213
213
|
*/
|
|
214
214
|
var deleteProfile = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
215
215
|
var profile;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { QUOTE_INVOICE_CATEGORY,
|
|
1
|
+
import { QUOTE_INVOICE_CATEGORY, QuoteInvoiceTypeBE } from '../type';
|
|
2
2
|
type PrismaClient = any;
|
|
3
3
|
export interface ListQuoteInvoiceArgs {
|
|
4
4
|
category: QUOTE_INVOICE_CATEGORY;
|
|
@@ -72,26 +72,26 @@ export interface DeleteQuoteInvoiceArgs {
|
|
|
72
72
|
/**
|
|
73
73
|
* Retrieves a paginated list of quotes/invoices
|
|
74
74
|
* @param {ListQuoteInvoiceArgs} args - Object containing prisma client, pagination, filtering, and ordering options
|
|
75
|
-
* @returns {Promise<[number, Array<
|
|
75
|
+
* @returns {Promise<[number, Array<QuoteInvoiceTypeBE>]>} Tuple containing total count and array of quotes/invoices
|
|
76
76
|
*/
|
|
77
|
-
export declare const listQuoteInvoice: ({ category, currentPage, includeCompany, includeCustomer, includePayments, includeProducts, includeServices, orderByColumn, orderByDirection, pageLimit, prisma, searchQuery, }: ListQuoteInvoiceArgs) => Promise<[number, Array<
|
|
77
|
+
export declare const listQuoteInvoice: ({ category, currentPage, includeCompany, includeCustomer, includePayments, includeProducts, includeServices, orderByColumn, orderByDirection, pageLimit, prisma, searchQuery, }: ListQuoteInvoiceArgs) => Promise<[number, Array<QuoteInvoiceTypeBE>]>;
|
|
78
78
|
/**
|
|
79
79
|
* Retrieves a single quote/invoice by its ID
|
|
80
80
|
* @param {UnitQuoteInvoiceByIdArgs} args - Object containing prisma client, quote/invoice ID, and optional query parameters
|
|
81
|
-
* @returns {Promise<
|
|
81
|
+
* @returns {Promise<QuoteInvoiceTypeBE | null>} Quote/invoice or null if not found
|
|
82
82
|
*/
|
|
83
|
-
export declare const unitQuoteInvoiceById: ({ id, includeCompany, includeCustomer, includePayments, includeProducts, includeServices, prisma, }: UnitQuoteInvoiceByIdArgs) => Promise<
|
|
83
|
+
export declare const unitQuoteInvoiceById: ({ id, includeCompany, includeCustomer, includePayments, includeProducts, includeServices, prisma, }: UnitQuoteInvoiceByIdArgs) => Promise<QuoteInvoiceTypeBE | null>;
|
|
84
84
|
/**
|
|
85
85
|
* Creates or updates a quote/invoice
|
|
86
86
|
* Handles complex business logic including customer/company associations and service management
|
|
87
87
|
* @param {UpdateQuoteInvoiceArgs} args - Object containing prisma client, quote/invoice data, and optional query parameters
|
|
88
|
-
* @returns {Promise<
|
|
88
|
+
* @returns {Promise<QuoteInvoiceTypeBE>} Created or updated quote/invoice
|
|
89
89
|
*/
|
|
90
|
-
export declare const updateQuoteInvoice: ({ address, category, city, companyId, country, currency, customerId, date, discount, discountUnit, email, expiryDate, firstName, id, includeCompany, includeCustomer, includePayments, includeProducts, includeServices, invoiceStatus, lastName, mode, note, phone, prisma, products, quoteStatus, ref, services, subTotal, taxRate, total, }: UpdateQuoteInvoiceArgs) => Promise<
|
|
90
|
+
export declare const updateQuoteInvoice: ({ address, category, city, companyId, country, currency, customerId, date, discount, discountUnit, email, expiryDate, firstName, id, includeCompany, includeCustomer, includePayments, includeProducts, includeServices, invoiceStatus, lastName, mode, note, phone, prisma, products, quoteStatus, ref, services, subTotal, taxRate, total, }: UpdateQuoteInvoiceArgs) => Promise<QuoteInvoiceTypeBE>;
|
|
91
91
|
/**
|
|
92
92
|
* Deletes a quote/invoice by ID
|
|
93
93
|
* @param {DeleteQuoteInvoiceArgs} args - Object containing prisma client, quote/invoice ID, and optional query parameters
|
|
94
|
-
* @returns {Promise<
|
|
94
|
+
* @returns {Promise<QuoteInvoiceTypeBE>} Deleted quote/invoice
|
|
95
95
|
*/
|
|
96
|
-
export declare const deleteQuoteInvoice: ({ id, prisma, }: DeleteQuoteInvoiceArgs) => Promise<
|
|
96
|
+
export declare const deleteQuoteInvoice: ({ id, prisma, }: DeleteQuoteInvoiceArgs) => Promise<QuoteInvoiceTypeBE>;
|
|
97
97
|
export {};
|
|
@@ -61,7 +61,7 @@ var multi_part_search_1 = require("../../../general/multi-part-search");
|
|
|
61
61
|
/**
|
|
62
62
|
* Retrieves a paginated list of quotes/invoices
|
|
63
63
|
* @param {ListQuoteInvoiceArgs} args - Object containing prisma client, pagination, filtering, and ordering options
|
|
64
|
-
* @returns {Promise<[number, Array<
|
|
64
|
+
* @returns {Promise<[number, Array<QuoteInvoiceTypeBE>]>} Tuple containing total count and array of quotes/invoices
|
|
65
65
|
*/
|
|
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;
|
|
@@ -124,7 +124,7 @@ exports.listQuoteInvoice = listQuoteInvoice;
|
|
|
124
124
|
/**
|
|
125
125
|
* Retrieves a single quote/invoice by its ID
|
|
126
126
|
* @param {UnitQuoteInvoiceByIdArgs} args - Object containing prisma client, quote/invoice ID, and optional query parameters
|
|
127
|
-
* @returns {Promise<
|
|
127
|
+
* @returns {Promise<QuoteInvoiceTypeBE | null>} Quote/invoice or null if not found
|
|
128
128
|
*/
|
|
129
129
|
var unitQuoteInvoiceById = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
130
130
|
var include, where, quoteInvoice;
|
|
@@ -160,7 +160,7 @@ exports.unitQuoteInvoiceById = unitQuoteInvoiceById;
|
|
|
160
160
|
* Creates or updates a quote/invoice
|
|
161
161
|
* Handles complex business logic including customer/company associations and service management
|
|
162
162
|
* @param {UpdateQuoteInvoiceArgs} args - Object containing prisma client, quote/invoice data, and optional query parameters
|
|
163
|
-
* @returns {Promise<
|
|
163
|
+
* @returns {Promise<QuoteInvoiceTypeBE>} Created or updated quote/invoice
|
|
164
164
|
*/
|
|
165
165
|
var updateQuoteInvoice = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
166
166
|
var include, quoteInvoice, mappedServices, where, foundQuoteInvoice, filteredEditServices, filteredCreateServices;
|
|
@@ -343,7 +343,7 @@ exports.updateQuoteInvoice = updateQuoteInvoice;
|
|
|
343
343
|
/**
|
|
344
344
|
* Deletes a quote/invoice by ID
|
|
345
345
|
* @param {DeleteQuoteInvoiceArgs} args - Object containing prisma client, quote/invoice ID, and optional query parameters
|
|
346
|
-
* @returns {Promise<
|
|
346
|
+
* @returns {Promise<QuoteInvoiceTypeBE>} Deleted quote/invoice
|
|
347
347
|
*/
|
|
348
348
|
var deleteQuoteInvoice = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
349
349
|
var where, quoteInvoice;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QuoteInvoiceTypeBE } from '../type';
|
|
2
2
|
type PrismaClient = any;
|
|
3
3
|
export interface PostQuotesInvoicesReportArgs {
|
|
4
4
|
orderByColumn?: string;
|
|
@@ -9,7 +9,7 @@ export interface PostQuotesInvoicesReportArgs {
|
|
|
9
9
|
* Generates a report of all quotes/invoices with sorting (no pagination)
|
|
10
10
|
* Returns all records for reporting purposes
|
|
11
11
|
* @param {PostQuotesInvoicesReportArgs} args - Object containing prisma client and sorting options
|
|
12
|
-
* @returns {Promise<[number, Array<
|
|
12
|
+
* @returns {Promise<[number, Array<QuoteInvoiceTypeBE>]>} Tuple containing total count and array of all quotes/invoices
|
|
13
13
|
*/
|
|
14
|
-
export declare const postQuotesInvoicesReport: ({ orderByColumn, orderByDirection, prisma, }: PostQuotesInvoicesReportArgs) => Promise<[number, Array<
|
|
14
|
+
export declare const postQuotesInvoicesReport: ({ orderByColumn, orderByDirection, prisma, }: PostQuotesInvoicesReportArgs) => Promise<[number, Array<QuoteInvoiceTypeBE>]>;
|
|
15
15
|
export {};
|
|
@@ -41,7 +41,7 @@ exports.postQuotesInvoicesReport = void 0;
|
|
|
41
41
|
* Generates a report of all quotes/invoices with sorting (no pagination)
|
|
42
42
|
* Returns all records for reporting purposes
|
|
43
43
|
* @param {PostQuotesInvoicesReportArgs} args - Object containing prisma client and sorting options
|
|
44
|
-
* @returns {Promise<[number, Array<
|
|
44
|
+
* @returns {Promise<[number, Array<QuoteInvoiceTypeBE>]>} Tuple containing total count and array of all quotes/invoices
|
|
45
45
|
*/
|
|
46
46
|
var postQuotesInvoicesReport = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
47
47
|
var include, orderBy, where, _c, count, items;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TaxTypeBE } from '../type';
|
|
2
2
|
type PrismaClient = any;
|
|
3
3
|
export interface ListTaxArgs {
|
|
4
4
|
currentPage?: number;
|
|
@@ -31,25 +31,25 @@ export interface DeleteTaxArgs {
|
|
|
31
31
|
/**
|
|
32
32
|
* Retrieves a paginated list of taxes
|
|
33
33
|
* @param {ListTaxArgs} args - Object containing prisma client, pagination, filtering, and ordering options
|
|
34
|
-
* @returns {Promise<[number, Array<
|
|
34
|
+
* @returns {Promise<[number, Array<TaxTypeBE>]>} Tuple containing total count and array of taxes
|
|
35
35
|
*/
|
|
36
|
-
export declare const listTax: ({ currentPage, includePreference, orderByColumn, orderByDirection, pageLimit, prisma, searchQuery, }: ListTaxArgs) => Promise<[number, Array<
|
|
36
|
+
export declare const listTax: ({ currentPage, includePreference, orderByColumn, orderByDirection, pageLimit, prisma, searchQuery, }: ListTaxArgs) => Promise<[number, Array<TaxTypeBE>]>;
|
|
37
37
|
/**
|
|
38
38
|
* Retrieves a single tax by its ID
|
|
39
39
|
* @param {UnitTaxByIdArgs} args - Object containing prisma client, tax ID, and optional query parameters
|
|
40
|
-
* @returns {Promise<
|
|
40
|
+
* @returns {Promise<TaxTypeBE | null>} Tax or null if not found
|
|
41
41
|
*/
|
|
42
|
-
export declare const unitTaxById: ({ id, includePreference, prisma, }: UnitTaxByIdArgs) => Promise<
|
|
42
|
+
export declare const unitTaxById: ({ id, includePreference, prisma, }: UnitTaxByIdArgs) => Promise<TaxTypeBE | null>;
|
|
43
43
|
/**
|
|
44
44
|
* Creates or updates a tax
|
|
45
45
|
* @param {UpdateTaxArgs} args - Object containing prisma client, tax data, and optional query parameters
|
|
46
|
-
* @returns {Promise<
|
|
46
|
+
* @returns {Promise<TaxTypeBE>} Created or updated tax
|
|
47
47
|
*/
|
|
48
|
-
export declare const updateTax: ({ description, enabled, id, isDefault, preferenceId, prisma, taxName, taxRate, }: UpdateTaxArgs) => Promise<
|
|
48
|
+
export declare const updateTax: ({ description, enabled, id, isDefault, preferenceId, prisma, taxName, taxRate, }: UpdateTaxArgs) => Promise<TaxTypeBE>;
|
|
49
49
|
/**
|
|
50
50
|
* Deletes a tax by ID
|
|
51
51
|
* @param {DeleteTaxArgs} args - Object containing prisma client, tax ID, and optional query parameters
|
|
52
|
-
* @returns {Promise<
|
|
52
|
+
* @returns {Promise<TaxTypeBE>} Deleted tax
|
|
53
53
|
*/
|
|
54
|
-
export declare const deleteTax: ({ id, prisma, }: DeleteTaxArgs) => Promise<
|
|
54
|
+
export declare const deleteTax: ({ id, prisma, }: DeleteTaxArgs) => Promise<TaxTypeBE>;
|
|
55
55
|
export {};
|