Skip to content

Commit

Permalink
Merge pull request #58 from fivetran/feature/add-created-at-and-updat…
Browse files Browse the repository at this point in the history
…ed-at

[Feature] Add `created_at` and `updated at` fields
  • Loading branch information
fivetran-avinash authored Nov 26, 2024
2 parents c2c1703 + f7d3b30 commit 6e98ab6
Show file tree
Hide file tree
Showing 21 changed files with 140 additions and 11 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# dbt_quickbooks_source v0.12.0
[PR #58](https://github.com/fivetran/dbt_quickbooks_source/pull/57) introduces the following updates:

## Breaking Changes
- Introduced the following timestamp fields to the listed `stg_quickbooks__*` models to better analyze real-time transaction data:
- `created_at`: `bill`, `bill_payment`, `credit_memo`, `invoice`, `payment`, `transfer`
- `updated_at`: `bill`, `bill_payment`, `credit_memo`, `deposit`, `invoice`, `journal_entry`, `payment`, `purchase`, `refund_receipt`, `sales_receipt`, `transfer`, `vendor_credit`
- These new fields are incorporated in the `dbt_quickbooks` package's `quickbooks__general_ledger` model via the `*_double_entry` intermediate models. You can learn more about these changes in the [v0.17.0 release of the `dbt_quickbooks` package](https://github.com/fivetran/dbt_quickbooks/releases/tag/v0.17.0).
- As this introduces new columns to our staging models and changes our schema, this is a breaking change.

# dbt_quickbooks_source v0.11.0
[PR #57](https://github.com/fivetran/dbt_quickbooks_source/pull/57) introduces the following updates:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ If you are **not** using the [QuickBooks transformation package](https://github.
```yaml
packages:
- package: fivetran/quickbooks_source
version: [">=0.11.0", "<0.12.0"] # we recommend using ranges to capture non-breaking changes automatically
version: [">=0.12.0", "<0.13.0"] # we recommend using ranges to capture non-breaking changes automatically
```
### Step 3: Define database and schema variables
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
config-version: 2
name: 'quickbooks_source'

version: '0.11.0'
version: '0.12.0'

require-dbt-version: [">=1.3.0", "<2.0.0"]

Expand Down
2 changes: 1 addition & 1 deletion docs/catalog.json

Large diffs are not rendered by default.

37 changes: 32 additions & 5 deletions docs/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/manifest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion integration_tests/dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'quickbooks_source_integration_tests'
version: '0.11.0'
version: '0.12.0'


profile: 'integration_tests'
Expand Down
36 changes: 36 additions & 0 deletions models/src_quickbooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ sources:
description: Date of the day the payment took place.
- name: vendor_id
description: Reference to the vendor for this transaction.
- name: created_at
description: Timestamp of the date which the bill payment was created.
- name: updated_at
description: Timestamp of the date which the bill payment was last updated.
- name: _fivetran_deleted
description: "{{ doc('_fivetran_deleted') }}"

Expand Down Expand Up @@ -189,6 +193,10 @@ sources:
description: "{{ doc('account_id') }} with the account which the bill is credited."
- name: private_note
description: User entered, organization-private note about the transaction.
- name: created_at
description: Timestamp of the date which the bill was created.
- name: updated_at
description: Timestamp of the date which the bill was last updated.
- name: _fivetran_deleted
description: "{{ doc('_fivetran_deleted') }}"

Expand Down Expand Up @@ -294,6 +302,10 @@ sources:
description: The number of home currency units it takes to equal one unit of currency specified by currency_id.
- name: transaction_date
description: Date of the day when the credit memo occurred.
- name: created_at
description: Timestamp of the date which the credit memo was created.
- name: updated_at
description: Timestamp of the date which the credit memo was last updated.
- name: _fivetran_deleted
description: "{{ doc('_fivetran_deleted') }}"

Expand Down Expand Up @@ -390,6 +402,8 @@ sources:
description: Status of the deposit transaction.
- name: home_total_amount
description: Indicates the total amount of the transaction in the home currency. This includes the total of all the charges, allowances, and taxes.
- name: updated_at
description: Timestamp of the date which the deposit was last updated.
- name: _fivetran_deleted
description: "{{ doc('_fivetran_deleted') }}"

Expand Down Expand Up @@ -568,6 +582,10 @@ sources:
description: Date which the invoice payment is due.
- name: class_id
description: "{{ doc('class_id') }} with the invoice."
- name: created_at
description: Timestamp of the date which the invoice was created.
- name: updated_at
description: Timestamp of the date which the invoice was last updated.
- name: _fivetran_deleted
description: "{{ doc('_fivetran_deleted') }}"

Expand Down Expand Up @@ -653,6 +671,8 @@ sources:
description: The value of this field will always be set to zero.
- name: transaction_date
description: Date of the day when the journal entry was transacted.
- name: updated_at
description: Timestamp of the date which the journal entry was last updated.
- name: _fivetran_deleted
description: "{{ doc('_fivetran_deleted') }}"

Expand Down Expand Up @@ -697,6 +717,10 @@ sources:
description: Date of the day when the payment occurred.
- name: customer_id
description: "{{ doc('customer_id') }} with the payment."
- name: created_at
description: Timestamp of the date which the payment was created.
- name: updated_at
description: Timestamp of the date which the payment was last updated.
- name: _fivetran_deleted
description: "{{ doc('_fivetran_deleted') }}"

Expand Down Expand Up @@ -755,6 +779,8 @@ sources:
description: Indicates the total amount of the transaction.
- name: payment_type
description: Payment type of the purchase. Type can be Cash, Check, or CreditCard.
- name: updated_at
description: Timestamp of the date which the purchase was last updated.
- name: vendor_id
description: Reference to the vendor for the purchase.
- name: _fivetran_deleted
Expand Down Expand Up @@ -900,6 +926,8 @@ sources:
description: The number of home currency units it takes to equal one unit of currency specified by currency_id.
- name: transaction_date
description: Date of the day in which the refund occurred.
- name: updated_at
description: Timestamp of the date which the refund receipt was last updated.
- name: _fivetran_deleted
description: "{{ doc('_fivetran_deleted') }}"

Expand Down Expand Up @@ -960,6 +988,8 @@ sources:
description: The number of home currency units it takes to equal one unit of currency specified by currency_id.
- name: transaction_date
description: Date of the day which the sale occurred.
- name: updated_at
description: Timestamp of the date which the sales receipt was last updated.
- name: _fivetran_deleted
description: "{{ doc('_fivetran_deleted') }}"

Expand All @@ -977,6 +1007,10 @@ sources:
description: "{{ doc('account_id') }} with where the transfer is to."
- name: transaction_date
description: Date of the day which the transfer occurred.
- name: created_at
description: Timestamp of the date which the transfer was created.
- name: updated_at
description: Timestamp of the date which the transfer was last updated.
- name: _fivetran_deleted
description: "{{ doc('_fivetran_deleted') }}"

Expand Down Expand Up @@ -1041,6 +1075,8 @@ sources:
description: User entered, organization-private note about the transaction.
- name: transaction_date
description: The date entered by the user when this transaction occurred.
- name: updated_at
description: Timestamp of the date which the vendor credit was last updated.
- name: vendor_id
description: Reference to the vendor for this transaction.
- name: _fivetran_deleted
Expand Down
38 changes: 38 additions & 0 deletions models/stg_quickbooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ models:
description: Date of the day the transaction took place.
- name: vendor_id
description: Reference to the vendor for this transaction.
- name: created_at
description: Timestamp of the date which the bill payment was created.
- name: updated_at
description: Timestamp of the date which the bill payment was last updated.
- name: _fivetran_deleted
description: Boolean created by Fivetran to indicate whether the record has been deleted.

Expand Down Expand Up @@ -235,6 +239,10 @@ models:
description: Account id of the account which the bill is credited.
- name: private_note
description: User entered, organization-private note about the transaction.
- name: created_at
description: Timestamp of the date which the bill was created.
- name: updated_at
description: Timestamp of the date which the bill was last updated.
- name: _fivetran_deleted
description: Boolean created by Fivetran to indicate whether the record has been deleted.

Expand Down Expand Up @@ -371,6 +379,10 @@ models:
description: The number of home currency units it takes to equal one unit of currency specified by currency_id.
- name: transaction_date
description: Date when the credit memo occurred.
- name: created_at
description: Timestamp of the date which the credit memo was created.
- name: updated_at
description: Timestamp of the date which the credit memo was last updated.
- name: _fivetran_deleted
description: Boolean created by Fivetran to indicate whether the record has been deleted.

Expand Down Expand Up @@ -493,6 +505,8 @@ models:
description: Date which the deposit transaction occurred.
- name: transaction_status
description: Status of the deposit transaction.
- name: updated_at
description: Timestamp of the date which the deposit was last updated.
- name: _fivetran_deleted
description: Boolean created by Fivetran to indicate whether the record has been deleted.

Expand Down Expand Up @@ -718,6 +732,10 @@ models:
description: Date which the invoice payment is due.
- name: class_id
description: Reference to the class to which the invoice is associated with.
- name: created_at
description: Timestamp of the date which the invoice was created.
- name: updated_at
description: Timestamp of the date which the invoice was last updated.
- name: _fivetran_deleted
description: Boolean created by Fivetran to indicate whether the record has been deleted.

Expand Down Expand Up @@ -810,6 +828,8 @@ models:
description: "{{ doc('id') }} journal entry."
tests:
- not_null
- name: source_relation
description: "{{ doc('source_relation') }}"
- name: is_adjustment
description: Indicates the total amount of the transaction. This includes the total of all the charges, allowances, and taxes. By default, this is recalculated by the system based on sub-items total and overridden.
- name: created_at
Expand All @@ -826,6 +846,8 @@ models:
description: The value of this field will always be set to zero.
- name: transaction_date
description: Date when the journal entry was transacted.
- name: updated_at
description: Timestamp of the date which the journal entry was last updated.
- name: _fivetran_deleted
description: Boolean created by Fivetran to indicate whether the record has been deleted.

Expand Down Expand Up @@ -887,6 +909,10 @@ models:
description: Date when the payment occurred.
- name: customer_id
description: Reference to a customer or job.
- name: created_at
description: Timestamp of the date which the payment was created.
- name: updated_at
description: Timestamp of the date which the payment was last updated.
- name: _fivetran_deleted
description: Boolean created by Fivetran to indicate whether the record has been deleted.

Expand Down Expand Up @@ -971,6 +997,8 @@ models:
values: ['Cash', 'Check', 'CreditCard']
- name: vendor_id
description: Reference to the vendor for the purchase.
- name: updated_at
description: Timestamp of the date which the purchase was last updated.
- name: _fivetran_deleted
description: Boolean created by Fivetran to indicate whether the record has been deleted.

Expand Down Expand Up @@ -1146,6 +1174,8 @@ models:
description: The number of home currency units it takes to equal one unit of currency specified by currency_id.
- name: transaction_date
description: Date in which the refund occurred.
- name: updated_at
description: Timestamp of the date which the refund receipt was last updated.
- name: _fivetran_deleted
description: Boolean created by Fivetran to indicate whether the record has been deleted.

Expand Down Expand Up @@ -1223,6 +1253,8 @@ models:
description: The number of home currency units it takes to equal one unit of currency specified by currency_id.
- name: transaction_date
description: Date which the sale occurred.
- name: updated_at
description: Timestamp of the date which the sales receipt was last updated.
- name: _fivetran_deleted
description: Boolean created by Fivetran to indicate whether the record has been deleted.

Expand All @@ -1248,6 +1280,10 @@ models:
description: Account id of the account which the transfer is to.
- name: transaction_date
description: Date which the transfer occurred.
- name: created_at
description: Timestamp of the date which the bill payment was created.
- name: updated_at
description: Timestamp of the date which the bill payment was last updated.
- name: _fivetran_deleted
description: Boolean created by Fivetran to indicate whether the record has been deleted.

Expand Down Expand Up @@ -1326,6 +1362,8 @@ models:
description: The date entered by the user when this transaction occurred.
- name: vendor_id
description: Reference to the vendor for this transaction.
- name: updated_at
description: Timestamp of the date which the vendor credit was last updated.
- name: _fivetran_deleted
description: Boolean created by Fivetran to indicate whether the record has been deleted.

Expand Down
2 changes: 2 additions & 0 deletions models/stg_quickbooks__bill.sql
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ final as (
cast(department_id as {{ dbt.type_string() }}) as department_id,
cast( {{ dbt.date_trunc('day', 'due_date') }} as date) as due_date_at,
cast( {{ dbt.date_trunc('day', 'transaction_date') }} as date) as transaction_date,
created_at,
updated_at,
exchange_rate,
cast(payable_account_id as {{ dbt.type_string() }}) as payable_account_id,
total_amount,
Expand Down
2 changes: 2 additions & 0 deletions models/stg_quickbooks__bill_payment.sql
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ final as (
total_amount,
cast( {{ dbt.date_trunc('day', 'transaction_date') }} as date) as transaction_date,
cast(vendor_id as {{ dbt.type_string() }}) as vendor_id,
created_at,
updated_at,
_fivetran_deleted,
source_relation
from fields
Expand Down
2 changes: 2 additions & 0 deletions models/stg_quickbooks__credit_memo.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ final as (
cast(customer_id as {{ dbt.type_string() }}) as customer_id,
exchange_rate,
cast( {{ dbt.date_trunc('day', 'transaction_date') }} as date) as transaction_date,
created_at,
updated_at,
_fivetran_deleted,
source_relation
from fields
Expand Down
1 change: 1 addition & 0 deletions models/stg_quickbooks__deposit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ final as (
total_amount,
home_total_amount,
cast( {{ dbt.date_trunc('day', 'transaction_date') }} as date) as transaction_date,
updated_at,
transaction_status,
_fivetran_deleted,
source_relation
Expand Down
2 changes: 2 additions & 0 deletions models/stg_quickbooks__invoice.sql
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ final as (
delivery_type,
cast( {{ dbt.date_trunc('day', 'due_date') }} as date) as due_date,
cast(class_id as {{ dbt.type_string() }}) as class_id,
created_at,
updated_at,
_fivetran_deleted,
source_relation
from fields
Expand Down
1 change: 1 addition & 0 deletions models/stg_quickbooks__journal_entry.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ final as (
private_note,
total_amount,
cast( {{ dbt.date_trunc('day', 'transaction_date') }} as date) as transaction_date,
updated_at,
_fivetran_deleted,
source_relation
from fields
Expand Down
2 changes: 2 additions & 0 deletions models/stg_quickbooks__payment.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ final as (
exchange_rate,
cast( {{ dbt.date_trunc('day', 'transaction_date') }} as date) as transaction_date,
cast(customer_id as {{ dbt.type_string() }}) as customer_id,
created_at,
updated_at,
_fivetran_deleted,
source_relation
from fields
Expand Down
3 changes: 2 additions & 1 deletion models/stg_quickbooks__purchase.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fields as (
),

final as (

select
cast(id as {{ dbt.type_string() }}) as purchase_id,
cast(account_id as {{ dbt.type_string() }}) as account_id,
Expand All @@ -48,6 +48,7 @@ final as (
cast(customer_id as {{ dbt.type_string() }}) as customer_id,
cast(vendor_id as {{ dbt.type_string() }}) as vendor_id,
cast( {{ dbt.date_trunc('day', 'transaction_date') }} as date) as transaction_date,
updated_at,
_fivetran_deleted,
source_relation
from fields
Expand Down
1 change: 1 addition & 0 deletions models/stg_quickbooks__refund_receipt.sql
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ final as (
currency_id,
exchange_rate,
cast( {{ dbt.date_trunc('day', 'transaction_date') }} as date) as transaction_date,
updated_at,
_fivetran_deleted,
source_relation
from fields
Expand Down
1 change: 1 addition & 0 deletions models/stg_quickbooks__sales_receipt.sql
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ final as (
currency_id,
exchange_rate,
cast( {{ dbt.date_trunc('day', 'transaction_date') }} as date) as transaction_date,
updated_at,
_fivetran_deleted,
source_relation
from fields
Expand Down
2 changes: 2 additions & 0 deletions models/stg_quickbooks__transfer.sql
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ final as (
cast(from_account_id as {{ dbt.type_string() }}) as from_account_id,
cast(to_account_id as {{ dbt.type_string() }}) as to_account_id,
cast( {{ dbt.date_trunc('day', 'transaction_date') }} as date) as transaction_date,
created_at,
updated_at,
_fivetran_deleted,
source_relation
from fields
Expand Down
1 change: 1 addition & 0 deletions models/stg_quickbooks__vendor_credit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ final as (
cast(department_id as {{ dbt.type_string() }}) as department_id,
private_note,
cast( {{ dbt.date_trunc('day', 'transaction_date') }} as date) as transaction_date,
updated_at,
cast(vendor_id as {{ dbt.type_string() }}) as vendor_id,
_fivetran_deleted,
source_relation
Expand Down

0 comments on commit 6e98ab6

Please sign in to comment.