Class: Believe::Models::TicketSale

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/believe/models/ticket_sale.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(id:, buyer_name:, currency:, discount:, match_id:, purchase_method:, quantity:, subtotal:, tax:, total:, unit_price:, buyer_email: nil, coupon_code: nil) ⇒ Object

Full ticket sale model with ID.

Parameters:

  • id (String)

    Unique identifier

  • buyer_name (String)

    Name of the ticket buyer

  • currency (String)

    Currency code (GBP, USD, or EUR)

  • discount (String)

    Discount amount applied from coupon

  • match_id (String)

    ID of the match

  • purchase_method (Symbol, ::Believe::Models::PurchaseMethod)

    How the ticket was purchased

  • quantity (Integer)

    Number of tickets purchased

  • subtotal (String)

    Subtotal before discount and tax (unit_price * quantity)

  • tax (String)

    Tax amount (20% UK VAT on discounted subtotal)

  • total (String)

    Final total (subtotal - discount + tax)

  • unit_price (String)

    Price per ticket (decimal string)

  • buyer_email (String, nil) (defaults to: nil)

    Email of the ticket buyer

  • coupon_code (String, nil) (defaults to: nil)

    Coupon code applied, if any



# File 'lib/believe/models/ticket_sale.rb', line 85

Instance Attribute Details

#buyer_emailString?

Email of the ticket buyer

Returns:

  • (String, nil)


77
# File 'lib/believe/models/ticket_sale.rb', line 77

optional :buyer_email, String, nil?: true

#buyer_nameString

Name of the ticket buyer

Returns:

  • (String)


17
# File 'lib/believe/models/ticket_sale.rb', line 17

required :buyer_name, String

#coupon_codeString?

Coupon code applied, if any

Returns:

  • (String, nil)


83
# File 'lib/believe/models/ticket_sale.rb', line 83

optional :coupon_code, String, nil?: true

#currencyString

Currency code (GBP, USD, or EUR)

Returns:

  • (String)


23
# File 'lib/believe/models/ticket_sale.rb', line 23

required :currency, String

#discountString

Discount amount applied from coupon

Returns:

  • (String)


29
# File 'lib/believe/models/ticket_sale.rb', line 29

required :discount, String

#idString

Unique identifier

Returns:

  • (String)


11
# File 'lib/believe/models/ticket_sale.rb', line 11

required :id, String

#match_idString

ID of the match

Returns:

  • (String)


35
# File 'lib/believe/models/ticket_sale.rb', line 35

required :match_id, String

#purchase_methodSymbol, ::Believe::Models::PurchaseMethod

How the ticket was purchased



41
# File 'lib/believe/models/ticket_sale.rb', line 41

required :purchase_method, enum: -> { ::Believe::PurchaseMethod }

#quantityInteger

Number of tickets purchased

Returns:

  • (Integer)


47
# File 'lib/believe/models/ticket_sale.rb', line 47

required :quantity, Integer

#subtotalString

Subtotal before discount and tax (unit_price * quantity)

Returns:

  • (String)


53
# File 'lib/believe/models/ticket_sale.rb', line 53

required :subtotal, String

#taxString

Tax amount (20% UK VAT on discounted subtotal)

Returns:

  • (String)


59
# File 'lib/believe/models/ticket_sale.rb', line 59

required :tax, String

#totalString

Final total (subtotal - discount + tax)

Returns:

  • (String)


65
# File 'lib/believe/models/ticket_sale.rb', line 65

required :total, String

#unit_priceString

Price per ticket (decimal string)

Returns:

  • (String)


71
# File 'lib/believe/models/ticket_sale.rb', line 71

required :unit_price, String