first commit

This commit is contained in:
Stefan Hacker
2026-01-29 01:16:54 +01:00
commit 31f807fbd0
12106 changed files with 2480685 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateCustomerNumber = generateCustomerNumber;
exports.generateContractNumber = generateContractNumber;
exports.paginate = paginate;
exports.buildPaginationResponse = buildPaginationResponse;
function generateCustomerNumber() {
const timestamp = Date.now().toString(36).toUpperCase();
const random = Math.random().toString(36).substring(2, 6).toUpperCase();
return `K${timestamp}${random}`;
}
function generateContractNumber(type) {
const prefix = type.substring(0, 3).toUpperCase();
const timestamp = Date.now().toString(36).toUpperCase();
const random = Math.random().toString(36).substring(2, 5).toUpperCase();
return `${prefix}-${timestamp}${random}`;
}
function paginate(page = 1, limit = 20) {
const skip = (page - 1) * limit;
return { skip, take: limit };
}
function buildPaginationResponse(page, limit, total) {
return {
page,
limit,
total,
totalPages: Math.ceil(total / limit),
};
}
//# sourceMappingURL=helpers.js.map