EN

@core / contracts

1.0.0 ▾
verifiedMIT
GitHub

Shared types for GenPM modules: content, sitemap, search, admin resources, payments and tracked events

Code10 filesContext~532 tokensscan passed

The exact tree that will be injected, after .genpmignore. Pinned to

src/lib/contracts/money.tsread-only · 7266529
// Importe monetario: entero en unidades menores (céntimos) + código ISO 4217. Nunca `float`.
import { z } from 'zod';

export type Money = {
  /** Entero en unidades menores: 1999 = 19,99 EUR; 500 = 500 JPY. */
  amount: number;
  /** Código ISO 4217 en mayúsculas: `EUR`, `USD`, `JPY`. */
  currency: string;
};

export const MoneySchema = z.strictObject({
  amount: z.number().int().safe(),
  currency: z.string().regex(/^[A-Z]{3}$/),
});

Report @core/contracts

Sign in with GitHub to report a package.