feat(F-048): completed feature
This commit is contained in:
@@ -54,7 +54,8 @@ export class OrderService implements OrderServicePort {
|
||||
throw new OrderStateTransitionError(existing.state, next);
|
||||
const updated = await this.repo.updateState(id, next);
|
||||
if (!updated) throw new OrderNotFoundError();
|
||||
if (next === 'PAID') await this.events.emit({ type: 'OrderPaid', orderId: id, userId: existing.userId });
|
||||
if (next === 'PAID')
|
||||
await this.events.emit({ type: 'OrderPaid', orderId: id, userId: existing.userId });
|
||||
if (next === 'CANCELLED')
|
||||
await this.events.emit({ type: 'OrderCancelled', orderId: id, userId: existing.userId });
|
||||
return updated;
|
||||
|
||||
Reference in New Issue
Block a user