Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions models/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,31 +41,33 @@ models:

columns:
- name: order_id
description: This is a unique identifier for an order
description: A unique identifier for each order within the training dataset, used to track and manage individual orders. It is derived from the 'id' column in the 'orders_training'
table.

- name: customer_id
description: Foreign key to the customers table
description: A unique identifier for the customer placing an order. It is used to link the order to the customer in other tables.

- name: order_date
description: Date (UTC) that the order was placed
description: A timestamp representing the date and time when the order was placed in the stg_orders table.

- name: status
description: '{{ doc("orders_status") }}'
description: A representation of the current state or condition of an order, indicating whether it has been processed, shipped, delivered, or canceled.

- name: amount
description: Total amount (AUD) of the order
description: The monetary value of a transaction, which is the numerical representation of the amount paid or received during a payment event.

- name: credit_card_amount
description: Amount of the order (AUD) paid for by credit card
description: The monetary value of a transaction for an order, calculated based on the payment method and amount.

- name: coupon_amount
description: Amount of the order (AUD) paid for by coupon
description: The monetary value of the coupon used in an order.

- name: bank_transfer_amount
description: Amount of the order (AUD) paid for by bank transfer
description: This column represents the monetary value of a transaction when the payment method is bank transfer. It is derived from the amount paid during a payment event where the
payment method is specified as bank transfer.

- name: gift_card_amount
description: Amount of the order (AUD) paid for by gift card
description: The monetary value associated with a gift card used in the payment of an order.

- name: returned_orders
description: This table contains all of the returned orders
Expand All @@ -74,28 +76,28 @@ models:

columns:
- name: order_id
description: This is a unique identifier for an order
description: A unique identifier for orders that have been returned.

- name: customer_id
description: Foreign key to the customers table
description: A unique identifier for customers who have returned orders.

- name: order_date
description: Date (UTC) that the order was placed
description: A timestamp indicating when the order was returned.

- name: status
description: '{{ doc("orders_status") }}'
description: A status indicator for orders that have been returned.

- name: amount
description: Total amount (AUD) of the order
description: The monetary value associated with each returned order.

- name: credit_card_amount
description: Amount of the order (AUD) paid for by credit card
description: The amount of money charged to a credit card for a returned order.

- name: coupon_amount
description: Amount of the order (AUD) paid for by coupon
description: The monetary value of the coupon applied to the returned order.

- name: bank_transfer_amount
description: Amount of the order (AUD) paid for by bank transfer
description: This column represents the amount of money that was transferred through a bank for a returned order.

- name: gift_card_amount
description: Amount of the order (AUD) paid for by gift card
description: The monetary value of the gift card used in a returned order.
33 changes: 33 additions & 0 deletions models/staging/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,56 @@ models:
columns:
- name: customer_id

description: A unique identifier...
- name: first_name
description: A name of a customer.
- name: last_name
description: A last name of a customer
- name: stg_orders
config:
tags: ["staging", "finance"]
columns:
- name: order_id
description: A unique identifier for each order within the training dataset,
used to track and manage individual orders. It is derived from the 'id'
column in the 'orders_training' table.
- name: status

description: A representation of the current state or condition of an order,
indicating whether it has been processed, shipped, delivered, or canceled.
- name: customer_id
description: A unique identifier for the customer placing an order.
- name: order_date
description: A timestamp representing the date and time when the order was
placed.
- name: stg_payments
config:
tags: ["staging", "finance"]
columns:
- name: payment_id
description: A unique identifier for each payment record. This ID is used
to track and reference individual payments within the system.
- name: payment_method

description: A method used for processing payments.
- name: amount
description: The monetary value of a transaction, which is the numerical representation
of the amount paid or received during a payment event.
- name: order_id
description: A unique identifier for a payment order.
- name: stg_signups
config:
tags: ["staging", "PII"]
columns:
- name: signup_id
description: A unique identifier for each record in the signups table. This
ID is inherited from the signups_training table and is used to ensure data
consistency and integrity across related datasets.
- name: customer_email
description: A unique identifier for users who have signed up for training.
- name: signup_date
description: A timestamp representing the date when a user signed up for training.
- name: hashed_password
description: A hashed version of user passwords for secure storage.
- name: customer_id
description: A unique identifier for each user in the signups_training table.