spec-version: 0.1.0
name: VehicleStatus
namespace: OneBusAway
dataAssetResourceName: postgres://gable.prod.rds.aws.com:5432:onebusaway.transit.vehicle_status
doc: Contract representing the status of a vehicle in OneBusAway's system.
owner: [email protected]
schema:
- name: vehicle_id
doc: The id of the vehicle
type: string32
constraints:
- charLength: 32
- isNull: FALSE
- isNotEmpty: TRUE
- name: trip_id
doc: (Optional) The id of the vehicle's current trip.
type: union
types: ['null', 'string32']
default: 'null'
constraints:
- isNullThreshold: 0.8
- name: status
doc: The status of the vehicle.
type: enum
symbols: ['SCHEDULED', 'IN_PROGRESS']
constraints:
- isNullThreshold: 0.3
- length: 1
- name: location
doc: (optional) The last known location of the vehicle
type: union
types:
- type: 'null'
- type: struct
alias: Location
name: location
doc: A geographic location
fields:
- name: latitude
doc: The latitude of the location
type: float64
constraints:
- isNull: False
- name: longitude
doc: The longitude of the location
type: float64
constraints:
- isNull: False
constraints:
- isNullThreshold: 0.45
- name: last_location_update_time
doc: The last known real-time update from the transit vehicle containing a location update (in milliseconds since the Unix epoch)
type: date64
constraints:
- isNull: FALSE
- max: today
- name: last_update_time
doc: The last known real-time update from the transit vehicle (in milliseconds since the Unix epoch)
type: date64
constraints:
- isNull: FALSE
- max: today
- name: transaction_id
doc: The unique identifier for each transaction
type: uuid
constraints:
- isNotEmpty: true
- isNull: false
- name: customer_id
doc: The unique identifier for each customer
type: string32
constraints:
- charLength: 32
- isNotEmpty: true
- isNull: false
- name: transaction_amount
doc: The amount for the transaction
type: float64
constraints:
- greaterThan: 0
- isNull: false
- name: discount
doc: The discount applied to the transaction
type: float32
constraints:
- greaterThanOrEqualTo: 0
- lessThanOrEqualTo: 1
- isNull: false
- name: transaction_date
doc: The date and time when the transaction occurred
type: timestamp64
constraints:
- isNull: false
- lessThanOrEqualTo: today
- name: delivery_date
doc: The expected delivery date for the transaction
type: date64
constraints:
- isNullThreshold: 0.1
- greaterThan: transaction_date
- name: customer_feedback
doc: Feedback provided by the customer
type: union
types: ['null', 'string']
constraints:
- lengthLessThanOrEqualTo: 1000
- isNullThreshold: 0.7
- name: product_category
doc: The category of the product sold
type: enum
symbols: ['ELECTRONICS', 'FURNITURE', 'CLOTHING', 'TOYS', 'FOOD']
constraints:
- isNull: false
- name: quantity_sold
doc: The number of units sold in the transaction
type: int32
constraints:
- greaterThan: 0
- isNull: false
- name: unit_price
doc: The price per unit of the product
type: float64
constraints:
- greaterThanOrEqualTo: 0.01
- isNull: false
- name: sales_region
doc: The region where the sales occurred
type: string
constraints:
- lengthGreaterThanOrEqualTo: 3
- lengthLessThanOrEqualTo: 20
- isNotEmpty: true
- isNull: false
- name: return_reason
doc: The reason for the return of the product, if applicable
type: union
types: ['null', 'string']
constraints:
- lengthGreaterThan: 0
- isNullThreshold: 0.95
- name: return_date
doc: The date when the product was returned, if applicable
type: union
types: ['null', 'date64']
constraints:
- greaterThanOrEqualTo: transaction_date
- isNullThreshold: 0.95
- name: sales_representative
doc: The name of the sales representative who handled the transaction
type: string
constraints:
- lengthGreaterThan: 0
- lengthLessThanOrEqualTo: 50
- isNotEmpty: true
- isNull: false