import { array , lazy , object , optional , Schema , string } from '../schema' ; import { DeviceCheckoutOptions , deviceCheckoutOptionsSchema , } from './deviceCheckoutOptions' ; import { Money , moneySchema } from './money' ; export interface TerminalCheckout { /** A unique ID for this `TerminalCheckout`. */ id ? : string ; /**
     * Represents an amount of money. `Money` fields can be signed or unsigned.
     * Fields that do not explicitly define whether they are signed or unsigned are
     * considered unsigned and can only hold positive amounts. For signed fields, the
     * sign of the value indicates the purpose of the money transfer. See
     * [Working with Monetary Amounts](https://developer.squareup.com/docs/build-basics/working-with-monetary-amounts)
     * for more information.
     */ amountMoney : Money ; /**
     * An optional user-defined reference ID that can be used to associate
     * this `TerminalCheckout` to another entity in an external system. For example, an order
     * ID generated by a third-party shopping cart. The ID is also associated with any payments
     * used to complete the checkout.
     */ referenceId ? : string ; /** An optional note to associate with the checkout, as well as with any payments used to complete the checkout. */ note ? : string ; deviceOptions : DeviceCheckoutOptions ; /**
     * An RFC 3339 duration, after which the checkout is automatically canceled.
     * A `TerminalCheckout` that is `PENDING` is automatically `CANCELED` and has a cancellation reason
     * of `TIMED_OUT`.
     * Default: 5 minutes from creation
     * Maximum: 5 minutes
     */ deadlineDuration ? : string ; /**
     * The status of the `TerminalCheckout`.
     * Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED`
     */ status ? : string ; cancelReason ? : string ; /** A list of IDs for payments created by this `TerminalCheckout`. */ paymentIds ? : string [ ] ; /** The time when the `TerminalCheckout` was created, as an RFC 3339 timestamp. */ createdAt ? : string ; /** The time when the `TerminalCheckout` was last updated, as an RFC 3339 timestamp. */ updatedAt ? : string ; /** The ID of the application that created the checkout. */ appId ? : string ; /** The location of the device where the `TerminalCheckout` was directed. */ locationId ? : string ; paymentType ? : string ; /** An optional ID of the customer associated with the checkout. */ customerId ? : string ; } export const terminalCheckoutSchema = object ( { id : [ 'id' , optional ( string ( ) ) ] , amountMoney : [ 'amount_money' , lazy ( ( ) => moneySchema ) ] , referenceId : [ 'reference_id' , optional ( string ( ) ) ] , note : [ 'note' , optional ( string ( ) ) ] , deviceOptions : [ 'device_options' , lazy ( ( ) => deviceCheckoutOptionsSchema ) ] , deadlineDuration : [ 'deadline_duration' , optional ( string ( ) ) ] , status : [ 'status' , optional ( string ( ) ) ] , cancelReason : [ 'cancel_reason' , optional ( string ( ) ) ] , paymentIds : [ 'payment_ids' , optional ( array ( string ( ) ) ) ] , createdAt : [ 'created_at' , optional ( string ( ) ) ] , updatedAt : [ 'updated_at' , optional ( string ( ) ) ] , appId : [ 'app_id' , optional ( string ( ) ) ] , locationId : [ 'location_id' , optional ( string ( ) ) ] , paymentType : [ 'payment_type' , optional ( string ( ) ) ] , customerId : [ 'customer_id' , optional ( string ( ) ) ] , } ) ;