up
deploy to danak / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-07-17 18:43:34 +03:30
parent e110825783
commit e84f2a5f4c
+7 -4
View File
@@ -63,7 +63,7 @@ export class OrderService {
private readonly orderPrintRepository: OrderPrintRepository, private readonly orderPrintRepository: OrderPrintRepository,
private readonly eventEmitter: EventEmitter2, private readonly eventEmitter: EventEmitter2,
private readonly chatService: ChattService, private readonly chatService: ChattService,
) {} ) { }
async createOrderAsAdmin(adminId: string, dto: CreateOrderAsAdminDto): Promise<Order> { async createOrderAsAdmin(adminId: string, dto: CreateOrderAsAdminDto): Promise<Order> {
let invoiceItem: null | InvoiceItem = null let invoiceItem: null | InvoiceItem = null
@@ -75,7 +75,7 @@ export class OrderService {
throw new NotFoundException(`Invoice item with ID ${dto.invoiceItemId} not found.`); throw new NotFoundException(`Invoice item with ID ${dto.invoiceItemId} not found.`);
} }
if (!invoiceItem.confirmedAt ) { if (!invoiceItem.confirmedAt) {
throw new BadRequestException(`Invoice item is not confirmed`); throw new BadRequestException(`Invoice item is not confirmed`);
} }
@@ -168,7 +168,7 @@ export class OrderService {
return this.orderRepository.findAllPaginated(dto) return this.orderRepository.findAllPaginated(dto)
} else if (permissions.includes(PermissionEnum.VIEW_ASSIGNED_ORDERS)) { } else if (permissions.includes(PermissionEnum.VIEW_ASSIGNED_ORDERS)) {
return this.orderRepository.findAllPaginated({ return this.orderRepository.findAllPaginated({
...dto, ...dto,
designerId: adminId, designerId: adminId,
}) })
@@ -435,7 +435,10 @@ export class OrderService {
// -----------Hrlper Methods ----------- // -----------Hrlper Methods -----------
async findOrderOrFail(id: string): Promise<Order> { async findOrderOrFail(id: string): Promise<Order> {
const order = await this.em.findOne(Order, { id }, { populate: ['user', 'type', 'product', 'creator', 'designer'] }); const order = await this.em.findOne(Order, { id },
{
populate: ['user', 'type', 'product', 'creator', 'designer', 'invoiceItem'],
});
if (!order) { if (!order) {
throw new NotFoundException(`Order with ID ${id} not found.`); throw new NotFoundException(`Order with ID ${id} not found.`);
} }