Ship deploy build for multi-company order items.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-15 10:38:10 +03:30
co-authored by Cursor
parent 551fd6f06a
commit 0903a1c1e9
17 changed files with 203 additions and 46 deletions
+9
View File
@@ -1,6 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.computeCashInvoiceExpiry = computeCashInvoiceExpiry;
exports.earliestCashInvoiceExpiry = earliestCashInvoiceExpiry;
const tehran_time_1 = require("./tehran-time");
function computeCashInvoiceExpiry(company) {
const now = new Date();
@@ -14,4 +15,12 @@ function computeCashInvoiceExpiry(company) {
}
return new Date(now.getTime() + company.cashInvoiceValidityHours * 60 * 60 * 1000);
}
function earliestCashInvoiceExpiry(companies) {
if (!companies.length) {
return new Date(Date.now() + 8 * 60 * 60 * 1000);
}
return companies
.map((company) => computeCashInvoiceExpiry(company))
.reduce((earliest, current) => current.getTime() < earliest.getTime() ? current : earliest);
}
//# sourceMappingURL=cash-expiry.js.map