up
This commit is contained in:
@@ -42,6 +42,12 @@ export class FindInvoicesDto {
|
|||||||
@IsDateString()
|
@IsDateString()
|
||||||
from?: string;
|
from?: string;
|
||||||
|
|
||||||
|
@ApiPropertyOptional()
|
||||||
|
@IsOptional()
|
||||||
|
@IsDateString()
|
||||||
|
@IsString()
|
||||||
|
requestId?: string;
|
||||||
|
|
||||||
@ApiPropertyOptional({ format: 'date-time' })
|
@ApiPropertyOptional({ format: 'date-time' })
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsDateString()
|
@IsDateString()
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ export class InvoiceRepository extends EntityRepository<Invoice> {
|
|||||||
from,
|
from,
|
||||||
to,
|
to,
|
||||||
enableTax,
|
enableTax,
|
||||||
|
requestId
|
||||||
} = opts;
|
} = opts;
|
||||||
|
|
||||||
const offset = (page - 1) * limit;
|
const offset = (page - 1) * limit;
|
||||||
@@ -36,6 +37,10 @@ export class InvoiceRepository extends EntityRepository<Invoice> {
|
|||||||
where.user = { id: userId };
|
where.user = { id: userId };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (requestId) {
|
||||||
|
where.request = { id: requestId };
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof enableTax === 'boolean') {
|
if (typeof enableTax === 'boolean') {
|
||||||
where.enableTax = enableTax;
|
where.enableTax = enableTax;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user