feat(tests): integrate qenv for dynamic configuration and enhance SKR API tests
This commit is contained in:
@@ -344,9 +344,28 @@ export class Reports {
|
||||
|
||||
// Apply date filter if provided
|
||||
if (params?.dateFrom || params?.dateTo) {
|
||||
// Normalize dates for inclusive comparison
|
||||
const dateFrom = params.dateFrom ? new Date(params.dateFrom) : null;
|
||||
const dateTo = params.dateTo ? new Date(params.dateTo) : null;
|
||||
|
||||
// Set dateFrom to start of day (00:00:00.000)
|
||||
if (dateFrom) {
|
||||
dateFrom.setHours(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
// Set dateTo to end of day (23:59:59.999) for inclusive comparison
|
||||
if (dateTo) {
|
||||
dateTo.setHours(23, 59, 59, 999);
|
||||
}
|
||||
|
||||
transactions = transactions.filter((transaction) => {
|
||||
if (params.dateFrom && transaction.date < params.dateFrom) return false;
|
||||
if (params.dateTo && transaction.date > params.dateTo) return false;
|
||||
const txDate = transaction.date instanceof Date
|
||||
? transaction.date
|
||||
: new Date(transaction.date);
|
||||
const txTime = txDate.getTime();
|
||||
|
||||
if (dateFrom && txTime < dateFrom.getTime()) return false;
|
||||
if (dateTo && txTime > dateTo.getTime()) return false;
|
||||
return true;
|
||||
});
|
||||
}
|
||||
@@ -453,9 +472,28 @@ export class Reports {
|
||||
|
||||
// Apply date filter
|
||||
if (params?.dateFrom || params?.dateTo) {
|
||||
// Normalize dates for inclusive comparison
|
||||
const dateFrom = params.dateFrom ? new Date(params.dateFrom) : null;
|
||||
const dateTo = params.dateTo ? new Date(params.dateTo) : null;
|
||||
|
||||
// Set dateFrom to start of day (00:00:00.000)
|
||||
if (dateFrom) {
|
||||
dateFrom.setHours(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
// Set dateTo to end of day (23:59:59.999) for inclusive comparison
|
||||
if (dateTo) {
|
||||
dateTo.setHours(23, 59, 59, 999);
|
||||
}
|
||||
|
||||
transactions = transactions.filter((transaction) => {
|
||||
if (params.dateFrom && transaction.date < params.dateFrom) return false;
|
||||
if (params.dateTo && transaction.date > params.dateTo) return false;
|
||||
const txDate = transaction.date instanceof Date
|
||||
? transaction.date
|
||||
: new Date(transaction.date);
|
||||
const txTime = txDate.getTime();
|
||||
|
||||
if (dateFrom && txTime < dateFrom.getTime()) return false;
|
||||
if (dateTo && txTime > dateTo.getTime()) return false;
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user