Files
fabric_trade_server/dist/common/utils/order-number.js
T
mohmdsdgandCursor cbcea58e94 Deploy via committed dist: local Nest build, server runs with .env
Build on the developer machine without Docker, commit dist/, and run on the server with Dockerfile.dist plus compose env_file.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 21:35:22 +03:30

12 lines
490 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateOrderNumber = generateOrderNumber;
function generateOrderNumber(date = new Date()) {
const year = new Intl.DateTimeFormat('fa-IR-u-ca-persian', {
year: 'numeric',
}).format(date);
const persianYear = year.replace(/[^\d]/g, '') || '1403';
const seq = Math.floor(Math.random() * 9000) + 1000;
return `ORD-${persianYear}-${seq}`;
}
//# sourceMappingURL=order-number.js.map