This commit is contained in:
2026-02-24 11:29:55 +03:30
parent 87e229b487
commit 3e78ac2d8a
2 changed files with 11 additions and 0 deletions
@@ -42,6 +42,12 @@ export class FindInvoicesDto {
@IsDateString()
from?: string;
@ApiPropertyOptional()
@IsOptional()
@IsDateString()
@IsString()
requestId?: string;
@ApiPropertyOptional({ format: 'date-time' })
@IsOptional()
@IsDateString()
@@ -26,6 +26,7 @@ export class InvoiceRepository extends EntityRepository<Invoice> {
from,
to,
enableTax,
requestId
} = opts;
const offset = (page - 1) * limit;
@@ -36,6 +37,10 @@ export class InvoiceRepository extends EntityRepository<Invoice> {
where.user = { id: userId };
}
if (requestId) {
where.request = { id: requestId };
}
if (typeof enableTax === 'boolean') {
where.enableTax = enableTax;
}