import { Quantity, QuantityProps } from "@repo/rdx-ddd";

type ItemQuantityProps = Pick<QuantityProps, "value">;

export class ItemQuantity extends Quantity {
  public static DEFAULT_SCALE = 2;

  static create({ value }: ItemQuantityProps) {
    return Quantity.create({
      value,
      scale: ItemQuantity.DEFAULT_SCALE,
    });
  }

  static zero() {
    return ItemQuantity.create({ value: 0 }).data;
  }
}
