/** * Do not edit this file it is auto-generated by io-utils / gen-api-models. * See https://github.com/pagopa/io-utils */ /* eslint-disable */ import { withDefault } from "@pagopa/ts-commons/lib/types"; import * as t from "io-ts"; import { IWithinRangeIntegerTag, WithinRangeInteger } from "@pagopa/ts-commons/lib/numbers"; import { PatternString } from "@pagopa/ts-commons/lib/strings"; /** * Metadata needed to process pagoPA payments. */ // required attributes const PaymentDataBaseR = t.interface({ amount: t.union([ WithinRangeInteger<1, 9999999999, IWithinRangeIntegerTag<1, 9999999999>>( 1, 9999999999 ), t.literal(9999999999) ]), notice_number: PatternString("^[0123][0-9]{17}$") }); // optional attributes const PaymentDataBaseO = t.partial({ invalid_after_due_date: withDefault(t.boolean, false) }); export const PaymentDataBase = t.exact( t.intersection([PaymentDataBaseR, PaymentDataBaseO], "PaymentDataBase") ); export type PaymentDataBase = t.TypeOf;