Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions src/orders/orders.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,6 @@ describe('OrdersController', () => {
);
});

it('should error when generating invoice for already invoiced order', () => {
const order = ordersController.create({
items: [
{
price: 10,
quantity: 1,
productId: '1',
stock: 10,
},
],
});
ordersController.invoice(order.id);
expect(() => ordersController.invoice(order.id)).toThrow(
'Order already invoiced',
);
});

it('should error when generating invoice for not itens in order', () => {
const order = ordersController.create({
items: [],
Expand Down
4 changes: 0 additions & 4 deletions src/orders/orders.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ export class OrdersService {
throw new BadRequestException('Canceled order cannot be invoiced');
}

if (order.status === OrderStatus.INVOICED) {
throw new BadRequestException('Order already invoiced');
}

if (order.items.length === 0) {
throw new BadRequestException('Order must contain items');
}
Expand Down
Loading