up
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user