chore: add announcement logic

This commit is contained in:
Mahyargdz
2025-05-18 14:31:53 +03:30
parent 9eeab529a9
commit 4e4abb5a9c
58 changed files with 1280 additions and 243 deletions
@@ -7,10 +7,10 @@ import { Invoice } from "../entities/invoice.entity";
export class InvoicesRepository extends EntityRepository<Invoice> {
//
async getInvoicesForAdmin(queryDto: InvoicesSearchQueryDto) {
async getInvoicesForAdmin(queryDto: InvoicesSearchQueryDto, businessId: string) {
const { limit, skip } = PaginationUtils(queryDto);
const where: FilterQuery<Invoice> = {};
const where: FilterQuery<Invoice> = { business: { id: businessId } };
if (queryDto.q) {
where.$or = [
@@ -25,7 +25,7 @@ export class InvoicesRepository extends EntityRepository<Invoice> {
}
if (queryDto.companyId) {
where.company = queryDto.companyId;
where.company = { id: queryDto.companyId };
}
if (queryDto.since || queryDto.to) {