feat(ADM-018): completed feature
This commit is contained in:
16
project/src/modules/orders/domain/errors.ts
Normal file
16
project/src/modules/orders/domain/errors.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
export class OrderStateTransitionError extends Error {
|
||||
constructor(
|
||||
public readonly from: string,
|
||||
public readonly to: string,
|
||||
) {
|
||||
super(`Order state transition from ${from} to ${to} is not allowed`);
|
||||
this.name = 'OrderStateTransitionError';
|
||||
}
|
||||
}
|
||||
|
||||
export class OrderNotFoundError extends Error {
|
||||
constructor() {
|
||||
super('Order not found');
|
||||
this.name = 'OrderNotFoundError';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user