// Generated by bynkc — do not edit by hand.
// commons commerce.money

import { Ok, Err, Some, None, type Result, type Option, type ValidationError } from "../runtime.js";

export type CurrencyCode = string & { readonly __brand: "CurrencyCode" };

export const CurrencyCode = {
  of(value: string): Result<CurrencyCode, ValidationError> {
    if (!new RegExp("^" + "[A-Z]{3}" + "$").test(value)) {
      return Err({ field: "CurrencyCode", message: "must match /[A-Z]{3}/", value });
    }
    return Ok(value as CurrencyCode);
  },
  unsafe(value: string): CurrencyCode {
    return value as CurrencyCode;
  },
};

export interface Money {
  readonly minorUnits: number;
  readonly currency: CurrencyCode;
}

export const Money = {
};

