Ship deploy build for multi-company order items.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Vendored
+9
@@ -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
|
||||
Reference in New Issue
Block a user