@chiper-inc/ecommerce-lib
Version:
Chiper Inc Ecommerce Lib
15 lines (14 loc) • 383 B
text/typescript
type QuantityErrorType =
| "MinQuantity"
| "MaxQuantity"
| "Stock"
| "MultipleQuantity";
export class ItemQuantityError extends Error {
public readonly newQuantity: number;
public readonly type: QuantityErrorType;
constructor(message: string, quantity: number, type: QuantityErrorType) {
super(message);
this.newQuantity = quantity;
this.type = type;
}
}