Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add created_at and updated at fields #58

Merged
merged 10 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# dbt_quickbooks_source v0.11.1
fivetran-joemarkiewicz marked this conversation as resolved.
Show resolved Hide resolved
[PR #58](https://github.com/fivetran/dbt_quickbooks_source/pull/57) introduces the following updates:

## Feature Updates
- We introduced these pre-existing timestamp fields from these sources to their equivalent staging models to better analyze real-time transaction data:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would list the field and the exact staging models they were added to instead of requiring the user to have to match them up on their own.

Suggested change
- We introduced these pre-existing timestamp fields from these sources to their equivalent staging models to better analyze real-time transaction data:
- Introduced the following timestamp fields to the listed staging models to better analyze real-time transaction data:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fivetran-catfritz Listing all the staging models would get a bit wordy, so I did a slight tweak to your suggestion. Let me know your thoughts.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True--this makes sense!

- `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 then being brought in downstream in the `dbt_quickbooks` package in the `quickbooks__general_ledger` model via the double entry transaction 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).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- These new fields are then being brought in downstream in the `dbt_quickbooks` package in the `quickbooks__general_ledger` model via the double entry transaction 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).
- 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).


# 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 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.11.1'
fivetran-joemarkiewicz marked this conversation as resolved.
Show resolved Hide resolved

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.11.1'
fivetran-joemarkiewicz marked this conversation as resolved.
Show resolved Hide resolved


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
36 changes: 36 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 @@ -826,6 +844,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.
fivetran-joemarkiewicz marked this conversation as resolved.
Show resolved Hide resolved
- name: _fivetran_deleted
description: Boolean created by Fivetran to indicate whether the record has been deleted.

Expand Down Expand Up @@ -887,6 +907,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 +995,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 +1172,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 +1251,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 +1278,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 +1360,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