Document <> request <> quote


High-level definition

Documents, Quotes, and Requests represent a typical lifecycle: a ticket (Document) is evaluated for refundability (Quote), and an action is taken to request the refund (Request). These entities reference each other to provide end-to-end traceability and auditing.

Relationship overview

  • Document → Quote: A Document can expose a quote representing the latest/selected refund evaluation derived from its data and business rules.
  • Document → Request: A Document can have an associated request when a user or agent initiates a refund process for that ticket.
  • Quote ↔ Document: Quotes are linked to the originating Document (e.g., via ticketId). Consumers often fetch the Quote from the Document.
  • Request ↔ Document: Requests link back to the Document to show which ticket was requested and to fetch ticket context.

Common navigation patterns

  • From a Document to its Quote:
query QuoteFromDocument($ticketNum: String!) {
    document(ticketNum: $ticketNum) {
        id
        ticketNum
        quote {
            id
            status
            refundableBaseFareAmount
            product
        }
    }
}
  • From a Document to its Request:
query RequestFromDocument($ticketNum: String!) {
    document(ticketNum: $ticketNum) {
        id
        ticketNum
        request {
            id
            status
            requestedBy {
                id
                email
            }
        }
    }
}
  • From a Request to its Document:
query RequestAndDocument($id: Int!) {
    requests(filter: { id: $id }) {
        edges {
            node {
                id
                status
                document {
                    id
                    ticketNum
                    pnr
                }
            }
        }
    }
}

Usage guidance

  • Use the Document as your anchor for ticket identity and itinerary details.
  • Use the Quote to present or decide refund eligibility and amounts.
  • Use the Request to track user/agent actions and processing state.