Foodtruck Order — TypeScript Reference - v0.1.0
    Preparing search index...

    Delivered or refunded order and the durable facts shown in operator order history.

    interface DeliveredOrderHistoryEntry {
        checkout:
            | {
                currency: string;
                grossAmountMinor: number;
                operationId: string;
                outcome: "succeeded";
                recordedAt: string;
            }
            | null;
        classification: "commercial"
        | "nonCommercial";
        deliveredAt: string | null;
        finalizedAt: string;
        fulfillmentMode: "eatHere" | "takeAway";
        id: string;
        items: (
            ActiveOrderItem & { grossPriceMinor: number; vatBasisPoints: number }
        )[];
        metadataChanges: {
            changedAt: string;
            field: "queueNumber" | "note";
            newValue: string | null;
            oldValue: string | null;
            orderId: string;
        }[];
        note: string
        | null;
        queueNumber: string | null;
        refund: RefundActionState;
        refunds: {
            attemptNumber: number;
            completedAt: string | null;
            createdAt: string;
            operationId: string;
            otherReason: string | null;
            outcome: "succeeded" | "rejected" | "pending" | "cancelled" | "unknown";
            providerErrorCode: string | null;
            reason:
                | "customer-return"
                | "suspected-malfunction"
                | "suspected-fraud"
                | "duplicate-transaction"
                | "other";
        }[];
        status: "Delivered"
        | "Refunded";
        transitions: OrderStatusTransition[];
    }
    Index
    checkout:
        | {
            currency: string;
            grossAmountMinor: number;
            operationId: string;
            outcome: "succeeded";
            recordedAt: string;
        }
        | null

    Confirmed checkout facts for commercial orders; null otherwise.

    Type Declaration

    • {
          currency: string;
          grossAmountMinor: number;
          operationId: string;
          outcome: "succeeded";
          recordedAt: string;
      }
      • currency: string

        Checkout currency.

      • grossAmountMinor: number

        Confirmed gross amount in integer SEK minor units.

      • operationId: string

        Stable application-owned payment operation identity.

      • outcome: "succeeded"

        Only confirmed successful checkout is associated with a finalized commercial order.

      • recordedAt: string

        ISO timestamp when the confirmed attempt was recorded.

    • null
    classification: "commercial" | "nonCommercial"

    Classification recorded when the order was finalized.

    deliveredAt: string | null

    ISO timestamp when delivery committed, or null when refunded before delivery.

    finalizedAt: string

    ISO timestamp when finalization committed.

    fulfillmentMode: "eatHere" | "takeAway"

    Original eat-here or take-away selection.

    id: string

    Immutable internal order identity.

    items: (ActiveOrderItem & { grossPriceMinor: number; vatBasisPoints: number })[]

    Immutable name, kitchen-label, price, VAT, and quantity snapshots.

    Type Declaration

    • grossPriceMinor: number

      Captured gross price in integer SEK minor units.

    • vatBasisPoints: number

      Captured VAT rate in basis points.

    metadataChanges: {
        changedAt: string;
        field: "queueNumber" | "note";
        newValue: string | null;
        oldValue: string | null;
        orderId: string;
    }[]

    Full append-only queue-number and kitchen-note edit history.

    Type Declaration

    • changedAt: string

      ISO timestamp when the change committed.

    • field: "queueNumber" | "note"

      Edited metadata field.

    • newValue: string | null

      Value after this change.

    • oldValue: string | null

      Value before this change.

    • orderId: string

      Owning immutable order identity.

    note: string | null

    Recorded kitchen note at delivery, when one exists.

    queueNumber: string | null

    Recorded queue label at delivery, when one exists.

    Server-computed refund eligibility and safe latest-operation facts.

    refunds: {
        attemptNumber: number;
        completedAt: string | null;
        createdAt: string;
        operationId: string;
        otherReason: string | null;
        outcome: "succeeded" | "rejected" | "pending" | "cancelled" | "unknown";
        providerErrorCode: string | null;
        reason:
            | "customer-return"
            | "suspected-malfunction"
            | "suspected-fraud"
            | "duplicate-transaction"
            | "other";
    }[]

    Redacted refund attempt chronology.

    Type Declaration

    • attemptNumber: number

      One-based refund attempt number.

    • completedAt: string | null

      ISO timestamp when a definitive outcome was recorded.

    • createdAt: string

      ISO timestamp when the attempt was claimed.

    • operationId: string

      Application-owned identity used for status-only resolution.

    • otherReason: string | null

      Bounded explanation when the selected reason is other.

    • outcome: "succeeded" | "rejected" | "pending" | "cancelled" | "unknown"

      Current durable attempt outcome.

    • providerErrorCode: string | null

      Stable provider error code, when one was supplied.

    • reason:
          | "customer-return"
          | "suspected-malfunction"
          | "suspected-fraud"
          | "duplicate-transaction"
          | "other"

      Provider-neutral selected reason.

    status: "Delivered" | "Refunded"

    Terminal fulfillment state selected by this history read.

    transitions: OrderStatusTransition[]

    Full append-only fulfillment transition history.