├── .buildkite
├── hooks
│ └── pre-command
├── pipeline.yml
└── scripts
│ └── run_models.sh
├── .github
├── ISSUE_TEMPLATE
│ ├── bug-report.yml
│ ├── config.yml
│ └── feature-request.yml
├── PULL_REQUEST_TEMPLATE
│ └── maintainer_pull_request_template.md
├── pull_request_template.md
└── workflows
│ └── auto-release.yml
├── .gitignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── dbt_project.yml
├── docs
├── catalog.json
├── index.html
└── manifest.json
├── integration_tests
├── .gitignore
├── ci
│ └── sample.profiles.yml
├── dbt_project.yml
├── packages.yml
├── requirements.txt
└── seeds
│ ├── netsuite2_account_data.csv
│ ├── netsuite2_account_type_data.csv
│ ├── netsuite2_accounting_book_data.csv
│ ├── netsuite2_accounting_book_sub_data.csv
│ ├── netsuite2_accounting_period_data.csv
│ ├── netsuite2_accounting_period_fiscal_cal_data.csv
│ ├── netsuite2_classification_data.csv
│ ├── netsuite2_consolidated_exchange_rate_data.csv
│ ├── netsuite2_currency_data.csv
│ ├── netsuite2_customer_data.csv
│ ├── netsuite2_department_data.csv
│ ├── netsuite2_employee_data.csv
│ ├── netsuite2_entities_data.csv
│ ├── netsuite2_entity_address_data.csv
│ ├── netsuite2_fiscal_calendar_data.csv
│ ├── netsuite2_item_data.csv
│ ├── netsuite2_job_data.csv
│ ├── netsuite2_location_data.csv
│ ├── netsuite2_location_main_address_data.csv
│ ├── netsuite2_subsidiary_data.csv
│ ├── netsuite2_tran_acct_line_data.csv
│ ├── netsuite2_transaction_data.csv
│ ├── netsuite2_transaction_line_data.csv
│ ├── netsuite2_vendor_category_data.csv
│ ├── netsuite2_vendor_data.csv
│ ├── netsuite_accounting_books_data.csv
│ ├── netsuite_accounting_periods_data.csv
│ ├── netsuite_accounts_data.csv
│ ├── netsuite_classes_data.csv
│ ├── netsuite_consolidated_exchange_rates_data.csv
│ ├── netsuite_currencies_data.csv
│ ├── netsuite_customers_data.csv
│ ├── netsuite_departments_data.csv
│ ├── netsuite_expense_accounts_data.csv
│ ├── netsuite_income_accounts_data.csv
│ ├── netsuite_items_data.csv
│ ├── netsuite_locations_data.csv
│ ├── netsuite_subsidiaries_data.csv
│ ├── netsuite_transaction_lines_data.csv
│ ├── netsuite_transactions_data.csv
│ ├── netsuite_vendor_types_data.csv
│ └── netsuite_vendors_data.csv
├── macros
├── fill_pass_through_columns.sql
├── get_accounting_books_columns.sql
├── get_accounting_periods_columns.sql
├── get_accountingbooksubsidiaries_columns.sql
├── get_accountingperiodfiscalcalendars_columns.sql
├── get_accounts_columns.sql
├── get_accounttype_columns.sql
├── get_classes_columns.sql
├── get_consolidated_exchange_rates_columns.sql
├── get_currencies_columns.sql
├── get_customers_columns.sql
├── get_departments_columns.sql
├── get_employee_columns.sql
├── get_entity_columns.sql
├── get_entityaddress_columns.sql
├── get_expense_accounts_columns.sql
├── get_fiscalcalendar_columns.sql
├── get_income_accounts_columns.sql
├── get_items_columns.sql
├── get_job_columns.sql
├── get_locationmainaddress_columns.sql
├── get_locations_columns.sql
├── get_subsidiaries_columns.sql
├── get_transaction_accounting_lines_columns.sql
├── get_transaction_lines_columns.sql
├── get_transactionaccountingline_columns.sql
├── get_transactions_columns.sql
├── get_vendor_types_columns.sql
├── get_vendorcategory_columns.sql
└── get_vendors_columns.sql
├── models
├── docs.md
├── netsuite
│ ├── src_netsuite.yml
│ ├── stg_netsuite__accounting_books.sql
│ ├── stg_netsuite__accounting_periods.sql
│ ├── stg_netsuite__accounts.sql
│ ├── stg_netsuite__classes.sql
│ ├── stg_netsuite__consolidated_exchange_rates.sql
│ ├── stg_netsuite__currencies.sql
│ ├── stg_netsuite__customers.sql
│ ├── stg_netsuite__departments.sql
│ ├── stg_netsuite__expense_accounts.sql
│ ├── stg_netsuite__income_accounts.sql
│ ├── stg_netsuite__items.sql
│ ├── stg_netsuite__locations.sql
│ ├── stg_netsuite__subsidiaries.sql
│ ├── stg_netsuite__transaction_lines.sql
│ ├── stg_netsuite__transactions.sql
│ ├── stg_netsuite__vendor_types.sql
│ ├── stg_netsuite__vendors.sql
│ └── tmp
│ │ ├── stg_netsuite__accounting_books_tmp.sql
│ │ ├── stg_netsuite__accounting_periods_tmp.sql
│ │ ├── stg_netsuite__accounts_tmp.sql
│ │ ├── stg_netsuite__classes_tmp.sql
│ │ ├── stg_netsuite__consolidated_exchange_rates_tmp.sql
│ │ ├── stg_netsuite__currencies_tmp.sql
│ │ ├── stg_netsuite__customers_tmp.sql
│ │ ├── stg_netsuite__departments_tmp.sql
│ │ ├── stg_netsuite__expense_accounts_tmp.sql
│ │ ├── stg_netsuite__income_accounts_tmp.sql
│ │ ├── stg_netsuite__items_tmp.sql
│ │ ├── stg_netsuite__locations_tmp.sql
│ │ ├── stg_netsuite__subsidiaries_tmp.sql
│ │ ├── stg_netsuite__transaction_lines_tmp.sql
│ │ ├── stg_netsuite__transactions_tmp.sql
│ │ ├── stg_netsuite__vendor_types_tmp.sql
│ │ └── stg_netsuite__vendors_tmp.sql
├── netsuite2
│ ├── src_netsuite2.yml
│ ├── stg_netsuite2__account_types.sql
│ ├── stg_netsuite2__accounting_book_subsidiaries.sql
│ ├── stg_netsuite2__accounting_books.sql
│ ├── stg_netsuite2__accounting_period_fiscal_cal.sql
│ ├── stg_netsuite2__accounting_periods.sql
│ ├── stg_netsuite2__accounts.sql
│ ├── stg_netsuite2__classes.sql
│ ├── stg_netsuite2__consolidated_exchange_rates.sql
│ ├── stg_netsuite2__currencies.sql
│ ├── stg_netsuite2__customers.sql
│ ├── stg_netsuite2__departments.sql
│ ├── stg_netsuite2__employees.sql
│ ├── stg_netsuite2__entities.sql
│ ├── stg_netsuite2__entity_address.sql
│ ├── stg_netsuite2__fiscal_calendar.sql
│ ├── stg_netsuite2__items.sql
│ ├── stg_netsuite2__jobs.sql
│ ├── stg_netsuite2__location_main_address.sql
│ ├── stg_netsuite2__locations.sql
│ ├── stg_netsuite2__subsidiaries.sql
│ ├── stg_netsuite2__transaction_accounting_lines.sql
│ ├── stg_netsuite2__transaction_lines.sql
│ ├── stg_netsuite2__transactions.sql
│ ├── stg_netsuite2__vendor_categories.sql
│ ├── stg_netsuite2__vendors.sql
│ └── tmp
│ │ ├── stg_netsuite2__account_types_tmp.sql
│ │ ├── stg_netsuite2__accounting_book_subsidiaries_tmp.sql
│ │ ├── stg_netsuite2__accounting_books_tmp.sql
│ │ ├── stg_netsuite2__accounting_period_fiscal_cal_tmp.sql
│ │ ├── stg_netsuite2__accounting_periods_tmp.sql
│ │ ├── stg_netsuite2__accounts_tmp.sql
│ │ ├── stg_netsuite2__classes_tmp.sql
│ │ ├── stg_netsuite2__consolidated_exchange_rates_tmp.sql
│ │ ├── stg_netsuite2__currencies_tmp.sql
│ │ ├── stg_netsuite2__customers_tmp.sql
│ │ ├── stg_netsuite2__departments_tmp.sql
│ │ ├── stg_netsuite2__employees_tmp.sql
│ │ ├── stg_netsuite2__entities_tmp.sql
│ │ ├── stg_netsuite2__entity_address_tmp.sql
│ │ ├── stg_netsuite2__fiscal_calendar_tmp.sql
│ │ ├── stg_netsuite2__items_tmp.sql
│ │ ├── stg_netsuite2__jobs_tmp.sql
│ │ ├── stg_netsuite2__location_main_address_tmp.sql
│ │ ├── stg_netsuite2__locations_tmp.sql
│ │ ├── stg_netsuite2__subsidiaries_tmp.sql
│ │ ├── stg_netsuite2__transaction_accounting_lines_tmp.sql
│ │ ├── stg_netsuite2__transaction_lines_tmp.sql
│ │ ├── stg_netsuite2__transactions_tmp.sql
│ │ ├── stg_netsuite2__vendor_categories_tmp.sql
│ │ └── stg_netsuite2__vendors_tmp.sql
├── stg_netsuite.yml
└── stg_netsuite2.yml
└── packages.yml
/.buildkite/hooks/pre-command:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -e
4 |
5 | # Export secrets for Docker containers.
6 | # Restrict exposing secrets only to the steps that need them
7 | export GCLOUD_SERVICE_KEY=$(gcloud secrets versions access latest --secret="GCLOUD_SERVICE_KEY" --project="dbt-package-testing-363917")
8 | export CI_POSTGRES_DBT_HOST=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_HOST" --project="dbt-package-testing-363917")
9 | export CI_POSTGRES_DBT_USER=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_USER" --project="dbt-package-testing-363917")
10 | export CI_POSTGRES_DBT_PASS=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_PASS" --project="dbt-package-testing-363917")
11 | export CI_POSTGRES_DBT_DBNAME=$(gcloud secrets versions access latest --secret="CI_POSTGRES_DBT_DBNAME" --project="dbt-package-testing-363917")
12 | export CI_REDSHIFT_DBT_DBNAME=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_DBNAME" --project="dbt-package-testing-363917")
13 | export CI_REDSHIFT_DBT_HOST=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_HOST" --project="dbt-package-testing-363917")
14 | export CI_REDSHIFT_DBT_PASS=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_PASS" --project="dbt-package-testing-363917")
15 | export CI_REDSHIFT_DBT_USER=$(gcloud secrets versions access latest --secret="CI_REDSHIFT_DBT_USER" --project="dbt-package-testing-363917")
16 | export CI_SNOWFLAKE_DBT_ACCOUNT=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_ACCOUNT" --project="dbt-package-testing-363917")
17 | export CI_SNOWFLAKE_DBT_DATABASE=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_DATABASE" --project="dbt-package-testing-363917")
18 | export CI_SNOWFLAKE_DBT_PASS=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_PASS" --project="dbt-package-testing-363917")
19 | export CI_SNOWFLAKE_DBT_ROLE=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_ROLE" --project="dbt-package-testing-363917")
20 | export CI_SNOWFLAKE_DBT_USER=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_USER" --project="dbt-package-testing-363917")
21 | export CI_SNOWFLAKE_DBT_WAREHOUSE=$(gcloud secrets versions access latest --secret="CI_SNOWFLAKE_DBT_WAREHOUSE" --project="dbt-package-testing-363917")
22 | export CI_DATABRICKS_DBT_HOST=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_HOST" --project="dbt-package-testing-363917")
23 | export CI_DATABRICKS_DBT_HTTP_PATH=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_HTTP_PATH" --project="dbt-package-testing-363917")
24 | export CI_DATABRICKS_DBT_TOKEN=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_TOKEN" --project="dbt-package-testing-363917")
25 | export CI_DATABRICKS_DBT_CATALOG=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_DBT_CATALOG" --project="dbt-package-testing-363917")
26 | export CI_DATABRICKS_SQL_DBT_HTTP_PATH=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_SQL_DBT_HTTP_PATH" --project="dbt-package-testing-363917")
27 | export CI_DATABRICKS_SQL_DBT_TOKEN=$(gcloud secrets versions access latest --secret="CI_DATABRICKS_SQL_DBT_TOKEN" --project="dbt-package-testing-363917")
--------------------------------------------------------------------------------
/.buildkite/pipeline.yml:
--------------------------------------------------------------------------------
1 | steps:
2 | - label: ":postgres: Run Tests - Postgres"
3 | key: "run-dbt-postgres"
4 | plugins:
5 | - docker#v3.13.0:
6 | image: "python:3.8"
7 | shell: [ "/bin/bash", "-e", "-c" ]
8 | environment:
9 | - "BASH_ENV=/tmp/.bashrc"
10 | - "CI_POSTGRES_DBT_DBNAME"
11 | - "CI_POSTGRES_DBT_HOST"
12 | - "CI_POSTGRES_DBT_PASS"
13 | - "CI_POSTGRES_DBT_USER"
14 | commands: |
15 | bash .buildkite/scripts/run_models.sh postgres
16 |
17 | - label: ":snowflake-db: Run Tests - Snowflake"
18 | key: "run_dbt_snowflake"
19 | plugins:
20 | - docker#v3.13.0:
21 | image: "python:3.8"
22 | shell: [ "/bin/bash", "-e", "-c" ]
23 | environment:
24 | - "BASH_ENV=/tmp/.bashrc"
25 | - "CI_SNOWFLAKE_DBT_ACCOUNT"
26 | - "CI_SNOWFLAKE_DBT_DATABASE"
27 | - "CI_SNOWFLAKE_DBT_PASS"
28 | - "CI_SNOWFLAKE_DBT_ROLE"
29 | - "CI_SNOWFLAKE_DBT_USER"
30 | - "CI_SNOWFLAKE_DBT_WAREHOUSE"
31 | commands: |
32 | bash .buildkite/scripts/run_models.sh snowflake
33 |
34 | - label: ":gcloud: Run Tests - BigQuery"
35 | key: "run_dbt_bigquery"
36 | plugins:
37 | - docker#v3.13.0:
38 | image: "python:3.8"
39 | shell: [ "/bin/bash", "-e", "-c" ]
40 | environment:
41 | - "BASH_ENV=/tmp/.bashrc"
42 | - "GCLOUD_SERVICE_KEY"
43 | commands: |
44 | bash .buildkite/scripts/run_models.sh bigquery
45 |
46 | - label: ":amazon-redshift: Run Tests - Redshift"
47 | key: "run_dbt_redshift"
48 | plugins:
49 | - docker#v3.13.0:
50 | image: "python:3.8"
51 | shell: [ "/bin/bash", "-e", "-c" ]
52 | environment:
53 | - "BASH_ENV=/tmp/.bashrc"
54 | - "CI_REDSHIFT_DBT_DBNAME"
55 | - "CI_REDSHIFT_DBT_HOST"
56 | - "CI_REDSHIFT_DBT_PASS"
57 | - "CI_REDSHIFT_DBT_USER"
58 | commands: |
59 | bash .buildkite/scripts/run_models.sh redshift
60 |
61 | - label: ":databricks: Run Tests - Databricks"
62 | key: "run_dbt_databricks"
63 | plugins:
64 | - docker#v3.13.0:
65 | image: "python:3.8"
66 | shell: [ "/bin/bash", "-e", "-c" ]
67 | environment:
68 | - "BASH_ENV=/tmp/.bashrc"
69 | - "CI_DATABRICKS_DBT_HOST"
70 | - "CI_DATABRICKS_DBT_HTTP_PATH"
71 | - "CI_DATABRICKS_DBT_TOKEN"
72 | - "CI_DATABRICKS_DBT_CATALOG"
73 | commands: |
74 | bash .buildkite/scripts/run_models.sh databricks
75 |
76 | - label: ":databricks: :database: Run Tests - Databricks SQL Warehouse"
77 | key: "run_dbt_databricks_sql"
78 | plugins:
79 | - docker#v3.13.0:
80 | image: "python:3.8"
81 | shell: [ "/bin/bash", "-e", "-c" ]
82 | environment:
83 | - "BASH_ENV=/tmp/.bashrc"
84 | - "CI_DATABRICKS_DBT_HOST"
85 | - "CI_DATABRICKS_SQL_DBT_HTTP_PATH"
86 | - "CI_DATABRICKS_SQL_DBT_TOKEN"
87 | - "CI_DATABRICKS_DBT_CATALOG"
88 | commands: |
89 | bash .buildkite/scripts/run_models.sh databricks-sql
--------------------------------------------------------------------------------
/.buildkite/scripts/run_models.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -euo pipefail
4 |
5 | apt-get update
6 | apt-get install libsasl2-dev
7 |
8 | python3 -m venv venv
9 | . venv/bin/activate
10 | pip install --upgrade pip setuptools
11 | pip install -r integration_tests/requirements.txt
12 | mkdir -p ~/.dbt
13 | cp integration_tests/ci/sample.profiles.yml ~/.dbt/profiles.yml
14 |
15 | db=$1
16 | echo `pwd`
17 | cd integration_tests
18 | dbt deps
19 |
20 | if [ "$db" = "databricks-sql" ]; then
21 | dbt seed --vars '{netsuite_schema: netsuite_source_integrations_tests_sqlw}' --target "$db" --full-refresh
22 | dbt compile --vars '{netsuite_schema: netsuite_source_integrations_tests_sqlw}' --target "$db"
23 | dbt run --vars '{netsuite_schema: netsuite_source_integrations_tests_sqlw}' --target "$db" --full-refresh
24 | dbt test --vars '{netsuite_schema: netsuite_source_integrations_tests_sqlw}' --target "$db"
25 | dbt run --vars '{netsuite_schema: netsuite_source_integrations_tests_sqlw, netsuite2__multibook_accounting_enabled: false, netsuite2__using_exchange_rate: false, netsuite2__using_vendor_categories: false, netsuite2__using_jobs: false, netsuite2__using_employees: false, netsuite2__fiscal_calendar_enabled: true}' --target "$db" --full-refresh
26 | dbt test --vars '{netsuite_schema: netsuite_source_integrations_tests_sqlw}' --target "$db"
27 |
28 | else
29 |
30 | dbt seed --target "$db" --full-refresh
31 | dbt run --target "$db" --full-refresh
32 | dbt test --target "$db"
33 | dbt run --vars '{netsuite2__multibook_accounting_enabled: false, netsuite2__using_exchange_rate: false, netsuite2__using_vendor_categories: false, netsuite2__using_jobs: false, netsuite2__using_employees: false, netsuite2__fiscal_calendar_enabled: true}' --target "$db" --full-refresh
34 | dbt test --target "$db"
35 | fi
36 |
37 | dbt run-operation fivetran_utils.drop_schemas_automation --target "$db"
38 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug-report.yml:
--------------------------------------------------------------------------------
1 | name: 🐞 Bug
2 | description: Report a bug or an issue you've found within the dbt package
3 | title: "[Bug]
"
4 | labels: ["type:bug"]
5 | body:
6 | - type: markdown
7 | attributes:
8 | value: |
9 | Thanks for using the Fivetran dbt package and for taking the time to fill out this bug report. Your contributions help improve this package for the entire community of users!
10 | - type: checkboxes
11 | attributes:
12 | label: Is there an existing issue for this?
13 | description: Please search to see if an issue already exists for the bug you encountered.
14 | options:
15 | - label: I have searched the existing issues
16 | required: true
17 | - type: textarea
18 | attributes:
19 | label: Describe the issue
20 | description: A concise description of the problem you're experiencing. Also, please provide the steps to reproduce the issue if applicable.
21 | validations:
22 | required: true
23 | - type: textarea
24 | id: logs
25 | attributes:
26 | label: Relevant error log or model output
27 | description: |
28 | If applicable, provide the relevant error log or describe the problematic model output.
29 | render: shell
30 | validations:
31 | required: false
32 | - type: textarea
33 | attributes:
34 | label: Expected behavior
35 | description: A concise description of what you expected to happen.
36 | validations:
37 | required: true
38 | - type: textarea
39 | attributes:
40 | label: Possible solution
41 | description: Were you able to investigate and/or discover a potential fix to this bug in your investigation? If so, it would be much appreciated if you could submit code samples to show us how your fix resolved this issue.
42 | validations:
43 | required: false
44 | - type: textarea
45 | attributes:
46 | label: dbt Project configurations
47 | description: Please provide the variables and any other project specific configurations from your `dbt_project.yml`.
48 | validations:
49 | required: true
50 | - type: textarea
51 | attributes:
52 | label: Package versions
53 | description: Please provide the contents of your `packages.yml`.
54 | validations:
55 | required: true
56 | - type: dropdown
57 | id: database
58 | attributes:
59 | label: What database are you using dbt with?
60 | multiple: true
61 | options:
62 | - postgres
63 | - redshift
64 | - snowflake
65 | - bigquery
66 | - databricks
67 | - other (mention it in "Additional Context")
68 | validations:
69 | required: true
70 | - type: dropdown
71 | id: orchestration_type
72 | attributes:
73 | label: How are you running this dbt package?
74 | multiple: true
75 | options:
76 | - Fivetran Quickstart Data Model
77 | - Fivetran Transformations
78 | - dbt Core™
79 | - dbt Cloud™
80 | - other (mention it in "Additional Context")
81 | validations:
82 | required: true
83 | - type: textarea
84 | attributes:
85 | label: dbt Version
86 | description: Run `dbt --version` in your CLI or dbt cloud environment and copy the contents. Additionally, if you are using Fivetran dbt Transformations, provide the contents of the `dbtVersion` configuration in your `deployment.yml`.
87 | validations:
88 | required: true
89 | - type: textarea
90 | attributes:
91 | label: Additional Context
92 | description: |
93 | Links? References? Anything that will give us more context about the issue you are encountering!
94 |
95 | Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
96 | validations:
97 | required: false
98 | - type: checkboxes
99 | id: pr
100 | attributes:
101 | label: Are you willing to open a PR to help address this issue?
102 | description: Our team will assess this issue and let you know if we will add it to a future sprint. However, if you would like to expedite the solution, we encourage you to contribute to the package via a PR. Our team will then work with you to approve and merge your contributions as soon as possible.
103 | options:
104 | - label: Yes.
105 | - label: Yes, but I will need assistance.
106 | - label: No.
107 | required: false
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | contact_links:
2 | - name: Provide feedback to our dbt package team
3 | url: https://www.surveymonkey.com/r/DQ7K7WW
4 | about: Fill out our survey form to provide valuable feedback to the Fivetran team developing and maintaining the dbt packages.
5 | - name: Fivetran connector question
6 | url: https://support.fivetran.com/hc
7 | about: Have a question about your connector? Check out the Fivetran support portal for more details.
8 | - name: What is dbt
9 | url: https://docs.getdbt.com/docs/introduction
10 | about: Check out the dbt docs for all dbt related information
11 | - name: Hang out in dbt Slack
12 | url: https://www.getdbt.com/community/
13 | about: Have a question or just want to chat with fellow data friends, join dbt Slack and hangout in the tools-fivetran channel with us!
14 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature-request.yml:
--------------------------------------------------------------------------------
1 | name: 🎉 Feature
2 | description: Suggest a new feature for the Fivetran dbt package
3 | title: "[Feature] "
4 | labels: ["type:enhancement"]
5 | body:
6 | - type: markdown
7 | attributes:
8 | value: |
9 | Thanks for using the Fivetran dbt package and for taking the time to fill out this feature request. Your contributions help improve this package for the entire community of users!
10 | - type: checkboxes
11 | attributes:
12 | label: Is there an existing feature request for this?
13 | description: Please search to see if an issue already exists for the feature you would like.
14 | options:
15 | - label: I have searched the existing issues
16 | required: true
17 | - type: textarea
18 | attributes:
19 | label: Describe the Feature
20 | description: A clear and concise description of what you want to happen and why you want the new feature.
21 | validations:
22 | required: true
23 | - type: textarea
24 | attributes:
25 | label: How would you implement this feature?
26 | description: |
27 | How would you build out this feature with your existing data? Any code examples you can provide to help accelerate development on this issue?
28 | validations:
29 | required: true
30 | - type: textarea
31 | attributes:
32 | label: Describe alternatives you've considered
33 | description: |
34 | A clear and concise description of any alternative solutions or features you've considered.
35 | validations:
36 | required: false
37 | - type: checkboxes
38 | id: contributing
39 | attributes:
40 | label: Are you interested in contributing this feature?
41 | description: Our team will assess this feature and let you know if we will add it to a future sprint. However, if you would like to expedite the feature, we encourage you to contribute to the package via a PR. Our team will then work with you to approve and merge your contributions as soon as possible.
42 | options:
43 | - label: Yes.
44 | - label: Yes, but I will need assistance.
45 | - label: No.
46 | required: false
47 | - type: textarea
48 | attributes:
49 | label: Anything else?
50 | description: |
51 | Links? References? Anything that will give us more context about the feature you are suggesting!
52 | validations:
53 | required: false
54 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE/maintainer_pull_request_template.md:
--------------------------------------------------------------------------------
1 | ## PR Overview
2 | **This PR will address the following Issue/Feature:**
3 |
4 | **This PR will result in the following new package version:**
5 |
6 |
7 | **Please provide the finalized CHANGELOG entry which details the relevant changes included in this PR:**
8 |
9 |
10 | ## PR Checklist
11 | ### Basic Validation
12 | Please acknowledge that you have successfully performed the following commands locally:
13 | - [ ] dbt run –full-refresh && dbt test
14 | - [ ] dbt run (if incremental models are present) && dbt test
15 |
16 | Before marking this PR as "ready for review" the following have been applied:
17 | - [ ] The appropriate issue has been linked, tagged, and properly assigned
18 | - [ ] All necessary documentation and version upgrades have been applied
19 | - [ ] docs were regenerated (unless this PR does not include any code or yml updates)
20 | - [ ] BuildKite integration tests are passing
21 | - [ ] Detailed validation steps have been provided below
22 |
23 | ### Detailed Validation
24 | Please share any and all of your validation steps:
25 |
26 |
27 | ### If you had to summarize this PR in an emoji, which would it be?
28 |
29 | :dancer:
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | **Please provide your name and company**
2 |
3 | **Link the issue/feature request which this PR is meant to address**
4 |
5 |
6 | **Detail what changes this PR introduces and how this addresses the issue/feature request linked above.**
7 |
8 | **How did you validate the changes introduced within this PR?**
9 |
10 | **Which warehouse did you use to develop these changes?**
11 |
12 | **Did you update the CHANGELOG?**
13 |
14 |
15 | - [ ] Yes
16 |
17 | **Did you update the dbt_project.yml files with the version upgrade (please leverage standard semantic versioning)? (In both your main project and integration_tests)**
18 |
19 |
20 | - [ ] Yes
21 |
22 | **Typically there are additional maintenance changes required before this will be ready for an upcoming release. Are you comfortable with the Fivetran team making a few commits directly to your branch?**
23 |
24 |
25 | - [ ] Yes
26 | - [ ] No
27 |
28 | **If you had to summarize this PR in an emoji, which would it be?**
29 |
30 | :dancer:
31 |
32 | **Feedback**
33 |
34 | We are so excited you decided to contribute to the Fivetran community dbt package! We continue to work to improve the packages and would greatly appreciate your [feedback](https://www.surveymonkey.com/r/DQ7K7WW) on our existing dbt packages or what you'd like to see next.
35 |
36 | **PR Template**
37 | - [Community Pull Request Template](?expand=1&template=pull_request_template.md) (default)
38 |
39 | - [Maintainer Pull Request Template](?expand=1&template=maintainer_pull_request_template.md) (to be used by maintainers)
40 |
--------------------------------------------------------------------------------
/.github/workflows/auto-release.yml:
--------------------------------------------------------------------------------
1 | name: 'auto release'
2 | on:
3 | pull_request:
4 | types:
5 | - closed
6 | branches:
7 | - main
8 |
9 | jobs:
10 | call-workflow-passing-data:
11 | if: github.event.pull_request.merged
12 | uses: fivetran/dbt_package_automations/.github/workflows/auto-release.yml@main
13 | secrets: inherit
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | target/
3 | dbt_modules/
4 | logs/
5 | keyfile.json
6 | .DS_Store
7 | develop/
8 | env/
9 | dbt_packages/
10 | package-lock.yml
--------------------------------------------------------------------------------
/dbt_project.yml:
--------------------------------------------------------------------------------
1 | config-version: 2
2 | require-dbt-version: [">=1.3.0", "<2.0.0"]
3 | name: 'netsuite_source'
4 | version: '0.12.0'
5 |
6 | models:
7 | netsuite_source:
8 | +materialized: view
9 | +schema: netsuite_source
10 | netsuite:
11 | tmp:
12 | +materialized: view
13 | netsuite2:
14 | tmp:
15 | +materialized: view
16 |
17 | vars:
18 | netsuite_source:
19 | netsuite_accounting_books: "{{ source('netsuite','accounting_books') }}"
20 | netsuite_accounting_periods: "{{ source('netsuite','accounting_periods') }}"
21 | netsuite_accounts: "{{ source('netsuite','accounts') }}"
22 | netsuite_classes: "{{ source('netsuite','classes') }}"
23 | netsuite_consolidated_exchange_rates: "{{ source('netsuite','consolidated_exchange_rates') }}"
24 | netsuite_currencies: "{{ source('netsuite','currencies') }}"
25 | netsuite_customers: "{{ source('netsuite','customers') }}"
26 | netsuite_departments: "{{ source('netsuite','departments') }}"
27 | netsuite_expense_accounts: "{{ source('netsuite','expense_accounts') }}"
28 | netsuite_income_accounts: "{{ source('netsuite','income_accounts') }}"
29 | netsuite_items: "{{ source('netsuite','items') }}"
30 | netsuite_locations: "{{ source('netsuite','locations') }}"
31 | netsuite_subsidiaries: "{{ source('netsuite','subsidiaries') }}"
32 | netsuite_transaction_lines: "{{ source('netsuite','transaction_lines') }}"
33 | netsuite_transactions: "{{ source('netsuite','transactions') }}"
34 | netsuite_vendor_types: "{{ source('netsuite','vendor_types') }}"
35 | netsuite_vendors: "{{ source('netsuite','vendors') }}"
36 | netsuite2_accounting_books: "{{ source('netsuite2','accounting_book') }}"
37 | netsuite2_accounting_periods: "{{ source('netsuite2','accounting_period') }}"
38 | netsuite2_accounts: "{{ source('netsuite2','account') }}"
39 | netsuite2_classes: "{{ source('netsuite2','classification') }}"
40 | netsuite2_consolidated_exchange_rates: "{{ source('netsuite2','consolidated_exchange_rate') }}"
41 | netsuite2_currencies: "{{ source('netsuite2','currency') }}"
42 | netsuite2_customers: "{{ source('netsuite2','customer') }}"
43 | netsuite2_departments: "{{ source('netsuite2','department') }}"
44 | netsuite2_employees: "{{ source('netsuite2','employee') }}"
45 | netsuite2_entities: "{{ source('netsuite2','entity') }}"
46 | netsuite2_items: "{{ source('netsuite2','item') }}"
47 | netsuite2_jobs: "{{ source('netsuite2','job') }}"
48 | netsuite2_locations: "{{ source('netsuite2','location') }}"
49 | netsuite2_subsidiaries: "{{ source('netsuite2','subsidiary') }}"
50 | netsuite2_transaction_accounting_lines: "{{ source('netsuite2','transaction_accounting_line') }}"
51 | netsuite2_transaction_lines: "{{ source('netsuite2','transaction_line') }}"
52 | netsuite2_transactions: "{{ source('netsuite2','transaction') }}"
53 | netsuite2_vendors: "{{ source('netsuite2','vendor') }}"
54 | netsuite2_vendor_categories: "{{ source('netsuite2', 'vendor_category') }}"
55 | netsuite2_accounting_book_subsidiaries: "{{ source('netsuite2', 'accounting_book_subsidiaries') }}"
56 | netsuite2_accounting_period_fiscal_calendars: "{{ source('netsuite2', 'accounting_period_fiscal_calendars') }}"
57 | netsuite2_fiscal_calendar: "{{ source('netsuite2', 'fiscal_calendar') }}"
58 | netsuite2_account_types: "{{ source('netsuite2', 'account_type') }}"
59 | netsuite2_entity_address: "{{ source('netsuite2', 'entity_address') }}"
60 | netsuite2_location_main_address: "{{ source('netsuite2', 'location_main_address') }}"
61 | accounts_pass_through_columns: []
62 | classes_pass_through_columns: []
63 | departments_pass_through_columns: []
64 | transactions_pass_through_columns: []
65 | transaction_lines_pass_through_columns: []
66 | customers_pass_through_columns: []
67 | locations_pass_through_columns: []
68 | subsidiaries_pass_through_columns: []
69 | consolidated_exchange_rates_pass_through_columns: []
70 | vendors_pass_through_columns: []
71 | items_pass_through_columns: []
72 | entities_pass_through_columns: []
73 |
74 | clean-targets:
75 | - target
76 | - dbt_modules
77 | - dbt_packages
78 |
--------------------------------------------------------------------------------
/integration_tests/.gitignore:
--------------------------------------------------------------------------------
1 | target/
2 | dbt_modules/
3 | logs/
4 | env/
--------------------------------------------------------------------------------
/integration_tests/ci/sample.profiles.yml:
--------------------------------------------------------------------------------
1 |
2 | # HEY! This file is used in the dbt package integrations tests with Buildkite.
3 | # You should __NEVER__ check credentials into version control. Thanks for reading :)
4 |
5 | config:
6 | send_anonymous_usage_stats: False
7 | use_colors: True
8 |
9 | integration_tests:
10 | target: redshift
11 | outputs:
12 | redshift:
13 | type: redshift
14 | host: "{{ env_var('CI_REDSHIFT_DBT_HOST') }}"
15 | user: "{{ env_var('CI_REDSHIFT_DBT_USER') }}"
16 | pass: "{{ env_var('CI_REDSHIFT_DBT_PASS') }}"
17 | dbname: "{{ env_var('CI_REDSHIFT_DBT_DBNAME') }}"
18 | port: 5439
19 | schema: netsuite_source_integration_tests_6
20 | threads: 8
21 | bigquery:
22 | type: bigquery
23 | method: service-account-json
24 | project: 'dbt-package-testing'
25 | schema: netsuite_source_integration_tests_6
26 | threads: 8
27 | keyfile_json: "{{ env_var('GCLOUD_SERVICE_KEY') | as_native }}"
28 | snowflake:
29 | type: snowflake
30 | account: "{{ env_var('CI_SNOWFLAKE_DBT_ACCOUNT') }}"
31 | user: "{{ env_var('CI_SNOWFLAKE_DBT_USER') }}"
32 | password: "{{ env_var('CI_SNOWFLAKE_DBT_PASS') }}"
33 | role: "{{ env_var('CI_SNOWFLAKE_DBT_ROLE') }}"
34 | database: "{{ env_var('CI_SNOWFLAKE_DBT_DATABASE') }}"
35 | warehouse: "{{ env_var('CI_SNOWFLAKE_DBT_WAREHOUSE') }}"
36 | schema: netsuite_source_integration_tests_6
37 | threads: 8
38 | postgres:
39 | type: postgres
40 | host: "{{ env_var('CI_POSTGRES_DBT_HOST') }}"
41 | user: "{{ env_var('CI_POSTGRES_DBT_USER') }}"
42 | pass: "{{ env_var('CI_POSTGRES_DBT_PASS') }}"
43 | dbname: "{{ env_var('CI_POSTGRES_DBT_DBNAME') }}"
44 | port: 5432
45 | schema: netsuite_source_integration_tests_6
46 | threads: 8
47 | databricks:
48 | catalog: "{{ env_var('CI_DATABRICKS_DBT_CATALOG') }}"
49 | host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}"
50 | http_path: "{{ env_var('CI_DATABRICKS_DBT_HTTP_PATH') }}"
51 | schema: netsuite_source_integration_tests_6
52 | threads: 8
53 | token: "{{ env_var('CI_DATABRICKS_DBT_TOKEN') }}"
54 | type: databricks
55 | databricks-sql:
56 | catalog: "{{ env_var('CI_DATABRICKS_DBT_CATALOG') }}"
57 | host: "{{ env_var('CI_DATABRICKS_DBT_HOST') }}"
58 | http_path: "{{ env_var('CI_DATABRICKS_SQL_DBT_HTTP_PATH') }}"
59 | schema: netsuite_source_integrations_tests_sqlw
60 | threads: 8
61 | token: "{{ env_var('CI_DATABRICKS_SQL_DBT_TOKEN') }}"
62 | type: databricks
--------------------------------------------------------------------------------
/integration_tests/dbt_project.yml:
--------------------------------------------------------------------------------
1 | name: 'netsuite_source_integration_tests'
2 |
3 | version: '0.12.0'
4 |
5 | profile: 'integration_tests'
6 | config-version: 2
7 |
8 | vars:
9 | netsuite_source:
10 | netsuite_schema: netsuite_source_integration_tests_6
11 | netsuite_data_model_override: netsuite
12 | netsuite_accounting_books_identifier: "netsuite_accounting_books_data"
13 | netsuite_accounting_periods_identifier: "netsuite_accounting_periods_data"
14 | netsuite_accounts_identifier: "netsuite_accounts_data"
15 | netsuite_classes_identifier: "netsuite_classes_data"
16 | netsuite_consolidated_exchange_rates_identifier: "netsuite_consolidated_exchange_rates_data"
17 | netsuite_currencies_identifier: "netsuite_currencies_data"
18 | netsuite_customers_identifier: "netsuite_customers_data"
19 | netsuite_departments_identifier: "netsuite_departments_data"
20 | netsuite_expense_accounts_identifier: "netsuite_expense_accounts_data"
21 | netsuite_income_accounts_identifier: "netsuite_income_accounts_data"
22 | netsuite_items_identifier: "netsuite_items_data"
23 | netsuite_locations_identifier: "netsuite_locations_data"
24 | netsuite_subsidiaries_identifier: "netsuite_subsidiaries_data"
25 | netsuite_transaction_lines_identifier: "netsuite_transaction_lines_data"
26 | netsuite_transactions_identifier: "netsuite_transactions_data"
27 | netsuite_vendor_types_identifier: "netsuite_vendor_types_data"
28 | netsuite_vendors_identifier: "netsuite_vendors_data"
29 | netsuite2_accounting_book_identifier: "netsuite2_accounting_book_data"
30 | netsuite2_accounting_period_identifier: "netsuite2_accounting_period_data"
31 | netsuite2_account_identifier: "netsuite2_account_data"
32 | netsuite2_classification_identifier: "netsuite2_classification_data"
33 | netsuite2_consolidated_exchange_rate_identifier: "netsuite2_consolidated_exchange_rate_data"
34 | netsuite2_currency_identifier: "netsuite2_currency_data"
35 | netsuite2_customer_identifier: "netsuite2_customer_data"
36 | netsuite2_department_identifier: "netsuite2_department_data"
37 | netsuite2_employee_identifier: "netsuite2_employee_data"
38 | netsuite2_entity_identifier: "netsuite2_entities_data"
39 | netsuite2_item_identifier: "netsuite2_item_data"
40 | netsuite2_job_identifier: "netsuite2_job_data"
41 | netsuite2_location_identifier: "netsuite2_location_data"
42 | netsuite2_subsidiary_identifier: "netsuite2_subsidiary_data"
43 | netsuite2_transaction_accounting_line_identifier: "netsuite2_tran_acct_line_data"
44 | netsuite2_transaction_line_identifier: "netsuite2_transaction_line_data"
45 | netsuite2_transaction_identifier: "netsuite2_transaction_data"
46 | netsuite2_vendor_identifier: "netsuite2_vendor_data"
47 | netsuite2_vendor_category_identifier: "netsuite2_vendor_category_data"
48 | netsuite2_accounting_book_subsidiaries_identifier: "netsuite2_accounting_book_sub_data"
49 | netsuite2_accounting_period_fiscal_calendars_identifier: "netsuite2_accounting_period_fiscal_cal_data"
50 | netsuite2_fiscal_calendar_identifier: "netsuite2_fiscal_calendar_data"
51 | netsuite2_account_type_identifier: "netsuite2_account_type_data"
52 | netsuite2_entity_address_identifier: "netsuite2_entity_address_data"
53 | netsuite2_location_main_address_identifier: "netsuite2_location_main_address_data"
54 |
55 | models:
56 | +schema: "{{ 'netsuite_source_integrations_tests_sqlw' if target.name == 'databricks-sql' else 'netsuite_source' }}"
57 |
58 | seeds:
59 | +quote_columns: "{{ true if target.type in ('redshift','postgres') else false }}"
60 | netsuite_source_integration_tests:
61 | +column_types:
62 | ending: timestamp
63 | due_date: timestamp
64 | netsuite2_account_data:
65 | +column_types:
66 | eliminate: "{{ 'string' if target.type in ('bigquery', 'spark', 'databricks') else 'varchar' }}"
67 |
68 | dispatch:
69 | - macro_namespace: dbt_utils
70 | search_order: ['spark_utils', 'dbt_utils']
--------------------------------------------------------------------------------
/integration_tests/packages.yml:
--------------------------------------------------------------------------------
1 | packages:
2 | - local: ../
--------------------------------------------------------------------------------
/integration_tests/requirements.txt:
--------------------------------------------------------------------------------
1 | dbt-snowflake>=1.3.0,<1.8.0
2 | dbt-bigquery>=1.3.0,<1.8.0
3 | dbt-redshift>=1.3.0,<1.8.0
4 | dbt-postgres>=1.3.0,<1.8.0
5 | dbt-spark>=1.3.0,<1.8.0
6 | dbt-spark[PyHive]>=1.3.0,<1.8.0
7 | dbt-databricks>=1.6.0,<1.8.0
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_account_data.csv:
--------------------------------------------------------------------------------
1 | id,_fivetran_deleted,_fivetran_synced,accountsearchdisplayname,accountsearchdisplaynamecopy,acctnumber,accttype,billableexpensesacct,cashflowrate,category1099misc,class,currency,custrecord_fam_account_showinfixedasset,date_deleted,deferralacct,department,description,displaynamewithhierarchy,eliminate,externalid,fullname,generalrate,includechildren,inventory,isinactive,issummary,lastmodifieddate,location,parent,reconcilewithmatching,revalue,sbankname,sbankroutingnumber,sspecacct,subsidiary,eliminate,sspecacct
2 | 133,FALSE,2022-04-07 7:05:11,Power,Power,,OthExpense,,AVERAGE,,,,"3, 4, 5, 6",,,,,Power,,Allowance for Doubtful Account,Power,AVERAGE,T,F,F,F,2017-05-21 1:41:07,,,F,F,,,Power,"1, 3, 4, 6",F,Tax
3 | 157,FALSE,2022-04-07 7:05:11,Levels,Levels,,OthExpense,,AVERAGE,,,,"3, 4, 5, 6",,,,,Levels,,,Levels,AVERAGE,T,F,F,F,2017-05-02 22:46:13,,,F,F,,,Levels,"1, 3, 4, 6",F,
4 | 118,FALSE,2022-04-07 7:05:11,Are,Are,,NonPosting,,AVERAGE,,,,,,,,,Are,,,Are,AVERAGE,T,F,F,F,,,,F,F,,,Are,"1, 3, 4, 6",F,
5 | 125,FALSE,2022-04-07 7:05:11,Over,Over,,NonPosting,,AVERAGE,,,,,,,,,Over,,,Over,AVERAGE,T,F,F,F,,,,F,F,,,Over,"1, 3, 4, 6",F,CTA-E
6 | 121,FALSE,2022-04-07 7:05:11,Nine,Nine,,COGS,,AVERAGE,,,,,,,,,Nine,,,Nine,AVERAGE,T,F,F,F,2021-02-10 9:19:54,,,F,F,,,Nine,"1, 3, 4, 6",,
7 | 117,FALSE,2022-04-07 7:05:11,Thousand,Thousand,,NonPosting,,AVERAGE,,,,,,,,,Thousand,,,Thousand,AVERAGE,T,F,F,F,,,,F,F,,,Thousand,"1, 3, 4, 6",T,
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_account_type_data.csv:
--------------------------------------------------------------------------------
1 | id,_fivetran_deleted,_fivetran_synced,balancesheet,date_deleted,defaultcashflowratetype,defaultgeneralratetype,eliminationalgo,includeinrevaldefault,internalid,left,longname,seqnum,usercanchangerevaloption
2 | NonPosting,FALSE,2022-07-10 22:45:54,F,,AVERAGE,AVERAGE,,F,16,F,Non Posting,16,F
3 | OthIncome,FALSE,2022-07-10 22:45:53,F,,AVERAGE,AVERAGE,IS,F,14,F,Other Income,14,F
4 | Income,FALSE,2022-07-10 22:45:55,F,,AVERAGE,AVERAGE,IS,F,11,F,Income,11,F
5 | OthExpense,FALSE,2022-07-10 22:45:57,F,,AVERAGE,AVERAGE,IS,F,15,T,Other Expense,15,F
6 | COGS,FALSE,2022-07-10 22:45:51,F,,AVERAGE,AVERAGE,IS,F,12,T,Cost of Goods Sold,12,F
7 | Expense,FALSE,2022-07-10 22:45:55,F,,AVERAGE,AVERAGE,IS,F,13,T,Expense,13,F
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_accounting_book_data.csv:
--------------------------------------------------------------------------------
1 | id,_fivetran_deleted,_fivetran_synced,basebook,date_deleted,effectiveperiod,externalid,isadjustmentonly,isconsolidated,isprimary,lastmodifieddate,name,subsidiariesstring
2 | 1,FALSE,2022-07-10 22:45:15,,,,,F,T,T,2017-09-13 4:51:41,Primary Accounting Book,"test, test1, test2"
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_accounting_book_sub_data.csv:
--------------------------------------------------------------------------------
1 | _fivetran_id,_fivetran_deleted,_fivetran_synced,accountingbook,date_deleted,status,subsidiary
2 | elQ8j1SQu1+7dMOGYNn3tADPMg0=,FALSE,2022-07-10 22:37:35,1,,ACTIVE,6
3 | 4ycE2BStkYGZR2FRnq4fsjzbEi4=,FALSE,2022-07-10 22:37:35,1,,ACTIVE,1
4 | kvTNUwWWZir4SwH1/2pflIgfECg=,FALSE,2022-07-10 22:37:35,1,,ACTIVE,3
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_accounting_period_data.csv:
--------------------------------------------------------------------------------
1 | id,_fivetran_deleted,_fivetran_synced,alllocked,allownonglchanges,aplocked,arlocked,closed,closedondate,date_deleted,enddate,isadjust,isinactive,isposting,isquarter,isyear,lastmodifieddate,parent,periodname,startdate
2 | 5,FALSE,2022-07-10 23:00:33,T,F,T,T,T,2002-03-31 0:00:00,,2002-03-31 0:00:00,F,F,T,F,F,2019-02-20 12:32:15,2,Mar 2002,2002-03-01 0:00:00
3 | 8,FALSE,2022-07-10 23:00:33,T,F,T,T,T,2002-05-31 0:00:00,,2002-05-31 0:00:00,F,F,T,F,F,2019-02-20 12:32:15,6,May 2002,2002-05-01 0:00:00
4 | 9,FALSE,2022-07-10 23:00:33,T,F,T,T,T,2002-06-30 0:00:00,,2002-06-30 0:00:00,F,F,T,F,F,2019-02-20 12:32:15,6,Jun 2002,2002-06-01 0:00:00
5 | 21,FALSE,2022-07-10 23:00:33,T,F,T,T,T,2001-02-28 0:00:00,,2001-02-28 0:00:00,F,F,T,F,F,2019-02-20 12:32:15,19,Feb 2001,2001-02-01 0:00:00
6 | 20,FALSE,2022-07-10 23:00:33,T,F,T,T,T,2001-01-31 0:00:00,,2001-01-31 0:00:00,F,F,T,F,F,2019-02-20 12:32:15,19,Jan 2001,2001-01-01 0:00:00
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_accounting_period_fiscal_cal_data.csv:
--------------------------------------------------------------------------------
1 | _fivetran_id,_fivetran_deleted,_fivetran_synced,accountingperiod,date_deleted,fiscalcalendar,parent
2 | t6+LTClexXfChh/pMhoj1F9SpSs=,FALSE,2022-07-10 22:17:10,245,,1,244
3 | hbwug8y6jPTTembEaYVZlsljZuQ=,FALSE,2022-07-10 22:17:10,252,,1,239
4 | hxkIkIIeDjsG8OgPAlvQVe9a6TE=,FALSE,2022-07-10 22:17:10,275,,2,274
5 | H00Ert0t6kQHovZX4pHHC4N4d0Y=,FALSE,2022-07-10 22:17:10,6,,2,1
6 | KI+pra1uPLFPsBHFuvT/tXCaWdg=,FALSE,2022-07-10 22:17:10,20,,3,171
7 | JIpeyH5xsYzCF0YbPKr7obXrkhA=,FALSE,2022-07-10 22:17:10,21,,3,205
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_classification_data.csv:
--------------------------------------------------------------------------------
1 | id,_fivetran_deleted,_fivetran_synced,date_deleted,externalid,fullname,includechildren,isinactive,lastmodifieddate,name,parent,subsidiary
2 | 15,FALSE,2022-07-10 22:53:58,,,Internal,T,F,2017-05-17 16:56:08,Internal,,"1, 3, 4, 6"
3 | 10,FALSE,2022-05-27 13:36:34,,,Accessories,T,F,2017-05-10 14:39:12,Accessories,,"1, 3, 4, 6"
4 | 2,FALSE,2022-05-27 13:36:34,,,Furniture,T,F,2017-05-10 14:39:12,Furniture,,"1, 3, 4, 6"
5 | 1,FALSE,2022-05-27 13:36:34,,,Hardware,T,F,2017-05-10 14:39:12,Hardware,,"1, 3, 4, 6"
6 | 13,FALSE,2022-05-27 13:36:34,,,Consumer Goods,T,F,2017-05-10 14:39:12,Consumer Goods,,"1, 3, 4, 6"
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_consolidated_exchange_rate_data.csv:
--------------------------------------------------------------------------------
1 | id,_fivetran_deleted,_fivetran_synced,averagerate,currentrate,date_deleted,externalid,fromcurrency,fromsubsidiary,historicalrate,postingperiod,tocurrency,tosubsidiary,accountingbook
2 | 1979,FALSE,2022-07-10 22:16:59,1,1,,,1,1,1,289,1,1,1
3 | 1944,FALSE,2022-07-10 22:16:59,1,1,,,1,1,1,282,1,1,1
4 | 1930,FALSE,2022-07-10 22:16:59,1,1,,,1,1,1,280,1,1,1
5 | 1958,FALSE,2022-07-10 22:16:59,1,1,,,1,1,1,285,1,1,1
6 | 1951,FALSE,2022-07-10 22:16:59,1,1,,,1,1,1,284,1,1,1
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_currency_data.csv:
--------------------------------------------------------------------------------
1 | id,_fivetran_deleted,_fivetran_synced,currencyprecision,date_deleted,displaysymbol,exchangerate,externalid,fxrateupdatetimezone,includeinfxrateupdates,isbasecurrency,isinactive,lastmodifieddate,name,overridecurrencyformat,symbol,symbolplacement
2 | 4,FALSE,2022-05-27 10:58:32,2,,€,1.11289001,,,T,F,F,2017-05-13 15:44:05,Euro,F,EUR,1
3 | 3,FALSE,2022-05-27 10:58:32,2,,$,0.76457273,,,T,F,F,2017-05-12 22:50:55,Canadian dollar,F,CAD,1
4 | 2,FALSE,2022-05-27 10:58:32,2,,£,1.33165497,,,T,F,F,2017-05-12 22:51:06,British pound,F,GBP,1
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_customer_data.csv:
--------------------------------------------------------------------------------
1 | id,_fivetran_deleted,_fivetran_synced,accountnumber,alcoholrecipienttype,altemail,altname,altphone,assignedwebsite,balancesearch,billingratecard,billingschedule,billingtransactiontype,billpay,buyingreason,buyingtimeframe,campaignevent,category,clickstream,comments,companyname,consolbalancesearch,consoldaysoverduesearch,consoloverduebalancesearch,consolunbilledorderssearch,contact,contactlist,creditholdoverride,creditlimit,currency,custentity1,custentity10,custentity12,custentity13,custentity14,custentity15,custentity16,custentity18,custentity21,custentity4,custentity5,custentity6,custentity7,custentity8,custentity9,custentity_2663_customer_refund,custentity_2663_direct_debit,custentity_cust_priority,custentity_fmt_cur_sales_order,custentity_fmt_cust_credit_on_hold,custentity_fmt_customer_credit_on_hold,custentity_lead_category,custentity_ppob,custentity_supervisor,date_deleted,datecreated,defaultbankaccount,defaultbillingaddress,defaultorderpriority,defaultshippingaddress,duplicate,email,emailpreference,emailtransactions,enddate,entityid,entitynumber,entitystatus,entitytitle,estimatedbudget,externalid,fax,faxtransactions,firstname,firstorderdate,firstsaledate,firstvisit,giveaccess,globalsubscriptionstatus,homephone,isbudgetapproved,isinactive,isperson,keywords,language,lastmodifieddate,lastname,lastorderdate,lastpagevisited,lastsaledate,lastvisit,leadsource,middlename,mobilephone,negativenumberformat,numberformat,oncredithold,overduebalancesearch,parent,partner,phone,prefccprocessor,pricelevel,printoncheckas,printtransactions,probability,receivablesaccount,referrer,reminderdays,resalenumber,salesreadiness,salesrep,salutation,searchstage,shipcomplete,shippingcarrier,shippingitem,sourcewebsite,startdate,terms,territory,thirdpartyacct,thirdpartycarrier,thirdpartycountry,thirdpartyzipcode,title,unbilledorderssearch,url,visits,weblead,dateclosed
2 | 1409,FALSE,2022-05-27 13:17:39,,,,Joe Shmoe,,,0,,,,F,,,,,,,,0,0,0,0,,,AUTO,,1,,,,,,,,F,,,,,,,,,,50,,F,,2,,,,2017-05-27 8:56:10,,,,,T,jm@fake.com,DEFAULT,F,,CCS,,6,Joe Shmoe,,,,F,Joe,2017-05-07 0:00:00,,,F,1,,F,F,T,,en_US,2017-05-09 6:07:35,Li,,,,,,,,,,F,0,,,,,,,F,0,-10,,,,,1008,,Lead,F,nonups,,,,2,,,,,,,0,,,F,2017-05-27 0:00:00
3 | 1408,FALSE,2022-05-27 13:17:39,,,,Fake Name,,,0,,,,F,,,,,,,,0,0,0,0,,,AUTO,,1,,,,,,,,F,,,,,,,,,,50,,F,,2,,,,2017-05-27 8:52:49,,,,,T,jm@fake.com,DEFAULT,F,,CCS,,6,Fake Name,,,,F,Fake,,,,F,1,,F,F,T,,en_US,2017-05-09 6:07:33,Li,,,,,,,,,,F,0,,,,,,,F,0,-10,,,,,1008,,Lead,F,nonups,,,,2,,,,,,,0,,,F,2017-05-27 0:00:00
4 | 1388,FALSE,2022-05-27 13:17:39,,,,Jess is Best,,,0,,,,F,,,,,Cat > Couch,,,0,0,0,0,,,AUTO,,1,,,,,,,,F,,,3,,,,,,,50,,,,,,,,2017-05-10 19:14:00,,,,,T,jm@fake.com,DEFAULT,F,,CCS,,6,Jess is Best,,,,F,Jess,,,2017-05-10 10:07:29,T,2,,F,F,T,,en_US,2017-05-09 6:07:26,Best,,,,2017-05-23 8:15:26,,,,,,F,0,,,,,,,F,0,-10,,,,,,,Lead,F,nonups,,,,2,8,,,,,,0,,11,T,2017-05-10 0:00:00
5 | 1440,FALSE,2022-05-27 13:17:39,,,,Cedar Cat,,,0,,,,F,,,,,Cat,,CCS,0,0,0,0,,,AUTO,,1,,,,,,,,F,,,,,,,,,,50,,F,F,,,,,2017-05-11 21:46:11,,,,,T,jm@fake.com,DEFAULT,F,,CCS,7,6,Cedar Cat,,,,F,,,,2017-05-11 14:45:51,F,1,,F,F,F,,en_US,2017-05-09 6:07:47,,,,,2017-05-11 15:17:17,100237,,,,,F,0,,,,,,,F,0,-10,,,,,,,Lead,F,nonups,,,,2,,,,,,,0,,3,F,2017-05-11 0:00:00
6 | 1376,FALSE,2022-05-27 13:17:39,,,,Alfredo,,,0,,,,F,,,,,Couch,,,0,0,0,0,,,AUTO,,1,,,,,,,,,,,2,,,,,,,50,,,,,,,,2017-07-18 18:32:17,,254,,254,F,jm@fake.com,DEFAULT,F,,CCS,,6,Alfredo,,,,F,Alfredo,,,2017-07-18 11:29:30,T,1,,F,F,T,,en_US,2017-05-09 6:07:20,Pizza,,,,2017-07-18 11:32:22,,,,,,F,0,,,8675309,,,,F,0,-10,,,,,,,Lead,F,nonups,92,,,2,8,,,,,,0,,2,T,2017-07-18 0:00:00
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_department_data.csv:
--------------------------------------------------------------------------------
1 | id,_fivetran_deleted,_fivetran_synced,date_deleted,externalid,fullname,includechildren,isinactive,lastmodifieddate,name,parent,subsidiary
2 | 10,FALSE,2022-05-27 10:50:52,,,TV Watcher,F,F,2017-05-07 14:41:24,TV Watcher,5,1
3 | 5,FALSE,2022-07-10 22:01:51,,,Sleep Perfectionist,T,F,2017-06-13 11:38:27,Sleep Perfectionist,,"1, 3, 4, 6"
4 | 6,FALSE,2022-07-10 22:01:51,,,Cat Groomer,T,F,2017-06-13 11:38:36,Cat Groomer,5,"1, 3, 4, 6"
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_employee_data.csv:
--------------------------------------------------------------------------------
1 | _fivetran_synced,id,entityid,firstname,lastname,department,subsidiary,email,supervisor,approvallimit,expenselimit,purchaseorderapprovallimit,purchaseorderlimit,currency,isinactive
2 | 2022-05-27 10:45:22,523532,sponge@bob.com,Sponge,Bob,113,1,sponge@bob.com,431513,,,,0,1,F
3 | 2022-05-27 10:45:22,513513,scooby@doo.com,Scooby,Doo,341,1,scooby@doo.com,,,,,0,1,F
4 | 2022-05-27 10:45:22,409409,darth@vader.com,Darth,Vader,351,1,darth@vader.com,,,,,0,1,T
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_entities_data.csv:
--------------------------------------------------------------------------------
1 | id,_fivetran_deleted,_fivetran_synced,altemail,altname,altphone,comments,contact,customer,date_deleted,datecreated,email,employee,entityid,entitynumber,entitytitle,externalid,fax,firstname,genericresource,homephone,isinactive,isperson,laborcost,lastmodifieddate,lastname,middlename,mobilephone,othername,parent,partner,phone,project,projecttemplate,salutation,title,toplevelparent,type,vendor
2 | -4,FALSE,2022-05-27 10:45:22,,-System-,,,-4,-4,,2015-11-22 8:00:00,,-4,-System-,,-System-,,,,-4,,F,F,,2017-05-13 15:32:34,,,,-4,,-4,,-4,-4,,,-4,Internal,-4
3 | 1654,FALSE,2022-05-27 10:45:22,,acme,,,1654,1654,,2017-06-12 22:11:36,,1654,acme,,acme,,,,1654,,F,F,,2017-06-12 22:11:36,,,,1654,,1654,,1654,1654,,,1654,OtherName,1654
4 | -2,FALSE,2022-05-27 10:45:22,,-No Company-,,,-2,-2,,2015-11-22 8:00:00,,-2,-No Company-,,-No Company-,,,,-2,,F,F,,2017-05-13 15:32:34,,,,-2,,-2,,-2,-2,,,-2,Company,-2
5 | -7,FALSE,2022-05-27 10:45:22,,-Anonymous Shopper-,,,-7,-7,,2019-10-18 7:34:52,,-7,-Anonymous Shopper-,,-Anonymous Shopper-,,,,-7,,F,F,,2019-10-18 7:34:52,,,,-7,,-7,,-7,-7,,,-7,Internal,-7
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_entity_address_data.csv:
--------------------------------------------------------------------------------
1 | nkey,_fivetran_deleted,_fivetran_synced,addr1,addr2,addr3,addressee,addrphone,addrtext,attention,city,country,date_deleted,dropdownstate,lastmodifieddate,override,recordowner,state,zip
2 | 1657,FALSE,2022-05-27 12:57:24,,,,,,fake address,,,US,,,,F,1657,,
3 | 472,FALSE,2022-05-27 12:57:24,,,,,8675309,real address,,,US,,,,F,472,,
4 | 1990,FALSE,2022-05-27 12:57:24,1212 Waddap,,,,,super real address,,Chicago,US,,IL,,F,1990,IL,
5 | 3773,FALSE,2022-05-27 12:57:24,,,,,,like legit address,,,,,,,F,3773,,
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_fiscal_calendar_data.csv:
--------------------------------------------------------------------------------
1 | id,externalid,fiscalmonth,isdefault,name,_fivetran_deleted,date_deleted,_fivetran_synced
2 | 1,,JAN,true,Calendar Year,false,,2022-05-27 13:00:58
3 | 2,,APR,false,April Fiscal Year,false,,2022-05-27 13:00:58
4 | 3,,CAL,false,Incorrectly Formed Month Abbreviation,false,,2022-05-27 13:00:58
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_item_data.csv:
--------------------------------------------------------------------------------
1 | _fivetran_synced,id,fullname,itemtype,description,department,class,location,subsidiary,assetaccount,expenseaccount,gainlossaccount,incomeaccount,deferralaccount,parent
2 | 2022-05-27 13:00:58,640,This,Payment,Deposit,,11,,3,,,,6,,
3 | 2022-05-27 13:00:58,976,That,Subtotal,Sub-Total,,,,3,,,,,,
4 | 2022-05-27 13:00:58,628,Those,DwnLdItem,How To Optimize Performance Guide,,,,3,,,,55,,
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_job_data.csv:
--------------------------------------------------------------------------------
1 | id,_fivetran_deleted,_fivetran_synced,accountnumber,actualtime,allowallresourcesfortasks,allowexpenses,allowtime,alternatecontact,altname,billingschedule,calculatedenddate,calculatedenddatebaseline,category,comments,companyname,contact,contactlist,currency,currencyprecision,custentity1,custentity4,custentity5,customer,date_deleted,datecreated,defaultbillingaddress,defaultshippingaddress,enddate,entityid,entitynumber,entitystatus,entitytitle,estimatedcost,estimatedgrossprofit,estimatedgrossprofitpercent,estimatedlaborcost,estimatedlaborcostbaseline,estimatedlaborrevenue,estimatedrevenue,estimatedtime,estimatedtimeoverride,estimatedtimeoverridebaseline,externalid,files,forecastchargerunondemand,fxrate,includecrmtasksintotals,isexempttime,isinactive,isproductivetime,isutilizedtime,jobbillingtype,jobitem,jobprice,jobtype,lastbaselinedate,lastmodifieddate,limittimetoassignees,materializetime,parent,percentcomplete,percenttimecomplete,primarycontact,projectedenddate,projectedenddatebaseline,projectmanager,startdate,startdatebaseline,timeapproval,timeremaining
2 | 1548,FALSE,2022-05-27 13:12:02,,,F,T,T,,Another Cat Name,,,,,,Another Cat Name,,,1,2,,,,1547,,2017-05-19 1:02:54,731,731,,Another Cat Name,,,Another Cat Name,,,,,,,,,,,,,,1,F,F,F,T,T,,,,,,2017-05-19 19:34:44,F,F,1547,,0,,2017-06-30 0:00:00,,,2017-05-01 0:00:00,,1,0
3 | 1499,FALSE,2022-05-27 13:12:02,,,F,T,T,,Should this be a dog name,,,,,,Should this be a dog name,,,1,2,,,,465,,2017-05-13 22:03:58,1042,1042,,Should this be a dog name,,,Should this be a dog name,,,,,,,,,,,,,,1,F,F,F,T,T,,,,,,2017-05-14 21:05:43,F,F,465,,0,,,,,2017-05-13 0:00:00,,1,0
4 | 1502,FALSE,2022-05-27 13:12:02,,,F,T,T,,Nah only cats here,,,,,,Nah only cats here,,,1,2,,,,1491,,2017-05-21 14:06:47,944,944,,Nah only cats here,,2,Nah only cats here,,,,,,,,,,,,,,1,F,F,F,T,T,,,,,,2017-05-03 22:14:14,F,F,1491,,0,,,,,2017-03-01 0:00:00,,1,0
5 | 1504,FALSE,2022-05-27 13:12:02,,,F,T,T,,You still reading these?,,,,,,You still reading these?,,,1,2,,,,1491,,2017-05-22 1:52:36,498,498,,You still reading these?,,2,You still reading these?,,,,,,,,,,,,,,1,F,F,F,T,T,,,,,,2017-05-03 22:07:58,F,F,1491,,0,,,,,2017-05-21 0:00:00,,1,0
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_location_data.csv:
--------------------------------------------------------------------------------
1 | id,_fivetran_deleted,_fivetran_synced,date_deleted,defaultallocationpriority,externalid,fullname,includeinsupplyplanning,isinactive,lastmodifieddate,latitude,locationtype,longitude,mainaddress,makeinventoryavailable,makeinventoryavailablestore,name,parent,returnaddress,subsidiary,tranprefix,usebins
2 | 9,FALSE,2022-07-10 23:20:30,,,,Sweet Home Chicago,F,F,2017-07-25 8:27:47,,,,,F,F,Looking,2,,3,,F
3 | 4,FALSE,2022-05-27 14:03:12,,,,Chi Town,F,F,2017-05-24 20:12:05,,,,44,F,F,For,2,45,1,,T
4 | 3,FALSE,2022-05-27 14:03:12,,,,Blues Brothers,F,F,2017-05-24 20:12:30,,,,42,F,F,Data,1,43,1,,T
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_location_main_address_data.csv:
--------------------------------------------------------------------------------
1 | nkey,_fivetran_deleted,_fivetran_synced,addr1,addr2,addr3,addressee,addrphone,addrtext,attention,city,country,date_deleted,dropdownstate,lastmodifieddate,override,recordowner,state,zip
2 | 4768,FALSE,2022-05-27 10:59:45,,,,,,Koala office,,,,,,2019-06-22 2:50:09,T,4768,,
3 | 4728,FALSE,2022-05-27 10:59:45,,,,,,Kangaroo U,,,,,,2019-06-22 2:50:09,T,4728,,
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_subsidiary_data.csv:
--------------------------------------------------------------------------------
1 | id,_fivetran_deleted,_fivetran_synced,country,currency,date_deleted,dropdownstate,edition,email,externalid,fax,federalidnumber,fiscalcalendar,fullname,iselimination,isinactive,languagelocale,lastmodifieddate,legalname,mainaddress,name,parent,purchaseorderamount,purchaseorderquantity,purchaseorderquantitydiff,receiptamount,receiptquantity,receiptquantitydiff,returnaddress,shippingaddress,showsubsidiaryname,ssnortin,state,state1taxnumber,tranprefix,url
2 | 4,FALSE,2022-07-10 23:14:17,US,1,,AK,US,,,,,1,CeCe,F,F,en_US,2019-07-06 21:13:49,,1126,Meow Meow,3,,,,,,,,,F,,AK,,,
3 | 6,FALSE,2022-05-27 13:56:54,US,1,,GA,US,,,,,1,Cat Jam,F,F,en_US,2017-06-13 5:39:53,,4659,Purr,3,,,,,,,,,F,,GA,,,
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_tran_acct_line_data.csv:
--------------------------------------------------------------------------------
1 | accountingbook,transaction,transactionline,_fivetran_deleted,_fivetran_synced,account,amount,amountpaid,amountunpaid,credit,date_deleted,debit,exchangerate,netamount,overheadparentitem,paymentamountunused,paymentamountused,posting,amountlinked
2 | 1,4735,0,FALSE,2022-07-10 22:40:48,,,,,,,,1,,,,,T,0
3 | 1,4455,0,FALSE,2022-07-10 22:40:48,,,,,,,,1,,,,,T,0
4 | 1,2399,0,FALSE,2022-07-10 22:40:48,,,,,,,,1,,,,,T,0
5 | 1,4458,0,FALSE,2022-07-10 22:40:48,,,,,,,,1,,,,,T,0
6 | 1,4533,0,FALSE,2022-07-10 22:40:48,,,,,,,,1,,,,,T,0
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_transaction_data.csv:
--------------------------------------------------------------------------------
1 | _fivetran_synced,id,transactionnumber,type,memo,trandate,status,createddate,duedate,closedate,currency,entity,postingperiod,posting,isreversal,reversal,reversaldate,reversaldefer
2 | 2022-05-27 13:41:13,5914,,VendBill,,2017-05-07 0:00:00,A,2017-05-07 10:34:43,2017-05-05 0:00:00,,1,1570,,T,F,325251,2023-08-01 0:00:00,F
3 | 2022-05-27 13:41:13,3,,VendBill,,2015-09-10 0:00:00,B,2017-05-12 3:41:25,2015-10-09 0:00:00,2015-10-05 0:00:00,1,36,251,T,F,325252,2023-08-02 0:00:00,F
4 | 2022-05-27 13:41:13,302,,VendBill,ZZZZZ,2016-03-20 0:00:00,B,2017-04-25 3:41:25,2016-04-19 0:00:00,2017-05-07 0:00:00,1,5,261,T,F,325323,2023-08-03 0:00:00,F
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_transaction_line_data.csv:
--------------------------------------------------------------------------------
1 | id,transaction,_fivetran_deleted,_fivetran_synced,actualshipdate,amortizationenddate,amortizationresidual,amortizationsched,amortizstartdate,amountlinked,assemblycomponent,billeddate,billingschedule,billvariancestatus,blandedcost,bomquantity,buildvariance,category,chargetype,class,cleared,cleareddate,commitinventory,commitmentfirm,componentyield,costestimate,costestimaterate,costestimatetype,createdfrom,createdpo,creditforeignamount,custcol1,custcol3,custcol4,custcol5,custcol6,custcol_far_trn_relatedasset,custcol_gw_inv,custcol_hand,custcol_helmetsize,custcol_pfc_configuration,custcol_pfc_pfconfigurator,custcol_pfc_wo,custcol_ropetype,date_deleted,debitforeignamount,department,documentnumber,donotdisplayline,dropship,entity,estgrossprofit,estgrossprofitpercent,estimatedamount,expectedreceiptdate,expectedshipdate,expenseaccount,foreignamount,foreignamountpaid,foreignamountunpaid,foreignpaymentamountunused,foreignpaymentamountused,fulfillable,fxamountlinked,hasfulfillableitems,inventoryreportinglocation,isbillable,isclosed,iscogs,isfullyshipped,isfxvariance,isinventoryaffecting,isrevrectransaction,isscrap,item,itemsource,itemtype,kitcomponent,kitmemberof,landedcostcategory,landedcostperline,linelastmodifieddate,linesequencenumber,location,mainline,matchbilltoreceipt,memo,netamount,oldcommitmentfirm,operationdisplaytext,orderpriority,paymentmethod,price,processedbyrevcommit,quantity,quantitybackordered,quantitybilled,quantitycommitted,quantitypacked,quantitypicked,quantityrejected,quantityshiprecv,rate,rateamount,ratepercent,requestnote,revenueelement,shipmethod,specialorder,subsidiary,taxline,transactiondiscount,transactionlinetype,transferorderitemlineid,uniquekey,units,vsoeisestimate,eliminate
2 | 5,2542,FALSE,2022-05-27 13:29:19,,,,,,,T,,,,F,,,,,,F,,1,F,,,,,,,,,,,,,,,,,,,,,,,,,T,F,541,,,,,2017-05-31 0:00:00,,,,,,,T,0,F,,F,F,F,F,F,F,F,F,80,,InvtPart,F,1,,F,2017-05-01 19:42:52,5,,F,F,Elden Ring,,F,,,,1,,-2,,0,,0,0,0,0,,,,,,,F,1,F,F,,,1471,,,F
3 | 5,2187,FALSE,2022-05-27 13:29:17,,,,,,,T,,,,F,,,,,,F,,1,F,,,,,2186,,,,,,,,,,,,,,,,,,,,T,F,1296,,,,,2017-05-26 0:00:00,,,,,,,T,0,F,,F,F,F,F,F,F,F,F,252,,InvtPart,F,1,,F,2017-05-16 11:46:05,5,,F,F,The Witcher 3: The Wild Hunt,,F,,,,1,,-2,,0,,0,0,0,0,,,,,,,F,1,F,F,,,17717,,,F
4 | 4,2248,FALSE,2022-05-27 13:29:17,,,,,,,T,,,,F,,,,,,F,,1,F,,,,,2247,,,,,,,,,,,,,,,,,,,,T,F,1049,,,,,,,,,,,,T,0,F,,F,F,F,F,F,F,F,F,385,WORK_ORDER,InvtPart,F,1,,F,2017-05-29 10:35:27,4,,F,F,Outer Wilds,,F,,,,1,,-4,,0,,0,0,0,0,,,,,,,F,1,F,F,,,29504,,,F
5 | 3,725,FALSE,2022-05-27 13:29:17,,,,,,,F,,,,F,,,,,,F,,1,F,,,,,,,,,,,,,,,,,,,,,,,,,T,F,827,,,,,,,,,,,,T,0,F,,F,F,F,F,F,F,F,F,57,,InvtPart,T,2,,F,2017-05-02 10:13:14,3,,F,F,Xcom,,F,,,,-1,,-120,,0,,0,0,0,0,,,,,,,F,1,F,F,,,19043,,,F
6 | 5,613,FALSE,2022-05-27 13:29:17,,,,,,,F,,,,F,,,,,,F,,1,F,,,,,,,,,,,,,,,,,,,,,,,,,T,F,737,,,,,,,,,,,,T,0,F,,F,F,F,F,F,F,F,F,53,,InvtPart,T,4,,F,2017-05-02 10:13:14,5,,F,F,Dark Souls,,F,,,,-1,,-10,,0,,0,0,0,0,,,,,,,F,1,F,F,,,27854,,,F
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_vendor_category_data.csv:
--------------------------------------------------------------------------------
1 | id,_fivetran_deleted,_fivetran_synced,date_deleted,externalid,isinactive,istaxagency,lastmodifieddate,name
2 | 4,FALSE,2022-05-27 10:46:16,,,F,F,,Carlos Sainz
3 | 8,FALSE,2022-05-27 10:46:16,,,F,F,,Sergio Perez
4 | 1,FALSE,2022-05-27 10:46:16,,,F,F,,Luis Hamilton
5 | 19,FALSE,2022-05-27 10:46:16,,,F,F,,Daniel Riccardo
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite2_vendor_data.csv:
--------------------------------------------------------------------------------
1 | id,_fivetran_deleted,_fivetran_synced,accountnumber,altemail,altname,altphone,balance,balanceprimary,billpay,category,comments,companyname,contact,contactlist,creditlimit,currency,custentity_2663_payment_method,custentity_is_manufacturer,custentity_rvc,custentity_vendor_lead_time,custentity_wrnty_center_phone,date_deleted,datecreated,defaultbankaccount,defaultbillingaddress,defaultshippingaddress,defaultvendorpaymentaccount,duplicate,email,emailpreference,emailtransactions,entityid,entitynumber,entitytitle,expenseaccount,externalid,fax,faxtransactions,firstname,giveaccess,globalsubscriptionstatus,homephone,incoterm,isinactive,isjobresourcevend,isperson,laborcost,lastmodifieddate,lastname,legalname,middlename,mobilephone,payablesaccount,phone,printoncheckas,printtransactions,purchaseorderamount,purchaseorderquantity,purchaseorderquantitydiff,receiptamount,receiptquantity,receiptquantitydiff,rolesforsearch,salutation,subsidiaryedition,terms,timeapprover,title,unbilledorders,unbilledordersprimary,url,workcalendar
2 | 1651,FALSE,2022-05-27 10:51:42,,,Geralt of Rivia,,0,0,F,3,,,,,,1,,,,,,,2017-06-12 9:24:48,,,,,F,,DEFAULT,F,Geralt of Rivia,,Geralt of Rivia,,,,F,,F,2,,,F,F,F,,2017-06-12 9:24:48,,,,,,,,F,,,,,,,,,US,,,,0,0,,
3 | 1645,FALSE,2022-05-27 10:51:42,,,Arthur Morgan,,0,0,F,3,,,,,,1,,,,,,,2019-07-06 21:13:51,,,,,F,,DEFAULT,F,Arthur Morgan,,Arthur Morgan,,,,F,,F,2,,,F,F,F,,2019-07-06 21:13:51,,,,,,,,F,,,,,,,,,US,,,,0,0,,
4 | 1669,FALSE,2022-05-27 10:51:42,,,Ash Ketchum,,0,0,F,3,,,,,,1,,,,,,,2017-06-13 5:58:39,,,,,F,,DEFAULT,F,Ash Ketchum,,Ash Ketchum,,,,F,,F,2,,,F,F,F,,2017-06-13 5:58:39,,,,,,,,F,,,,,,,,,US,,,,0,0,,
5 | 1664,FALSE,2022-05-27 10:51:42,,,Tarnished,,0,0,F,3,,,,,,1,,,,,,,2017-06-13 5:39:52,,,,,F,,DEFAULT,F,Tarnished,,Tarnished,,,,F,,F,2,,,F,F,F,,2017-06-13 5:39:52,,,,,,,,F,,,,,,,,,US,,,,0,0,,
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite_accounting_books_data.csv:
--------------------------------------------------------------------------------
1 | accounting_book_id,is_primary
2 | 1,Yes
3 | 2,No
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite_accounting_periods_data.csv:
--------------------------------------------------------------------------------
1 | accounting_period_id,name,full_name,fiscal_calendar_id,year_id,starting,ending,quarter,year_0,is_adjustment,closed
2 | 280,d343027645172d15bf219e54e899f1a3,268dbee4ab7d7a4d8413af4367d49d38,1,12,2012-08-10 00:00:00,2012-08-31 00:00:00,Yes,Yes,No,Yes
3 | 330,06ea1bab0ade3f24947a7f8bd0e8c0f6,c35ebe4a4399ca185c0b3d1b097415fe,2,23,2023-08-10 00:00:00,2023-08-31 00:00:00,No,No,No,No
4 | 348,6ecbd576a63e911653e17209b365a71c,338ca957f0ec018e46647be6d5b20c73,3,56,2024-08-10 00:00:00,2024-08-31 00:00:00,No,No,No,No
5 | 383,e31b70e3459c8ddf10fcdd843cb07fea,920717c568173d0c9c761320b783f244,4,89,2025-08-10 00:00:00,2025-08-31 00:00:00,Yes,Yes,No,No
6 | 285,4b34d72157ef4260c915b5ff50f81a2d,0b5c4efed176ec69102f68642dab0e37,5,74,2012-12-10 00:00:00,2012-12-31 00:00:00,Yes,Yes,No,Yes
7 | 335,750b6eb12d76bcc6b6c9fb9f44120ab3,6750f5c64be1ce8853d64b50a3ad99f9,6,85,2023-12-10 00:00:00,2023-12-31 00:00:00,Yes,Yes,No,No
8 | 353,4955a658629a01a65132a593a4232d22,679305717b5f369602e028e91e27c3d4,7,65,2024-12-10 00:00:00,2024-12-31 00:00:00,Yes,Yes,No,No
9 | 388,230f6a284363d0ca053acc3248aa3b5d,3fd9787a0d26d626b99ac386dcba2ccd,8,55,2025-12-10 00:00:00,2025-12-31 00:00:00,No,No,No,No
10 | 272,1f436de81f4a3a107480ade89e9561f2,c79dfd2cd64caba23ee1e75b98b3c957,9,44,2012-02-10 00:00:00,2012-02-29 00:00:00,No,No,No,Yes
11 | 322,db3826f3f4cf616ffbaf9dcc0ba5d998,ff6dd5907e9e4861c5de1a201de4e696,10,19,2023-02-10 00:00:00,2023-02-28 00:00:00,Yes,Yes,No,No
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite_accounts_data.csv:
--------------------------------------------------------------------------------
1 | account_id,parent_id,name,type_name,account_number,general_rate_type,is_leftside,is_balancesheet
2 | 530,,8769f2a4710dce527c26a6962560eb68,eb45bd2725cb8ac50d0795432a918f86,10000,a2770969c827f0f2910f6179418462df,No,No
3 | 531,530,4f776429f32750022c01847c813b00cd,eb45bd2725cb8ac50d0795432a918f86,10001,a2770969c827f0f2910f6179418462df,No,No
4 | 532,530,e17c5b5a8046fa938ae6c28848445e5a,eb45bd2725cb8ac50d0795432a918f86,10002,a2770969c827f0f2910f6179418462df,No,No
5 | 533,530,8deba561c94866c69412c5ad9785955d,eb45bd2725cb8ac50d0795432a918f86,10003,a2770969c827f0f2910f6179418462df,Yes,Yes
6 | 534,530,4d17a0007c857ebc8fa6be1e6d8e6eb2,eb45bd2725cb8ac50d0795432a918f86,10004,a2770969c827f0f2910f6179418462df,Yes,Yes
7 | 535,530,8bc09cee29171553028ae27eebf6cdf5,eb45bd2725cb8ac50d0795432a918f86,10005,a2770969c827f0f2910f6179418462df,Yes,Yes
8 | 1037,530,7790e9be35e2c705c2c62b04b503d962,eb45bd2725cb8ac50d0795432a918f86,10006,a2770969c827f0f2910f6179418462df,No,No
9 | 1044,530,d739f290e21e40f880af009b06f115d2,eb45bd2725cb8ac50d0795432a918f86,10007,a2770969c827f0f2910f6179418462df,No,No
10 | 1067,530,29c0ed5ce3ffa0115971fe05cd92e577,eb45bd2725cb8ac50d0795432a918f86,10008,a2770969c827f0f2910f6179418462df,Yes,Yes
11 | 1050,530,f3537e12e19781fd44ca2b77be86afc8,eb45bd2725cb8ac50d0795432a918f86,10021,a2770969c827f0f2910f6179418462df,No,No
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite_classes_data.csv:
--------------------------------------------------------------------------------
1 | class_id,full_name
2 | 1,a7ace9d7b0d52558c00f7540af56ed57
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite_consolidated_exchange_rates_data.csv:
--------------------------------------------------------------------------------
1 | consolidated_exchange_rate_id,accounting_book_id,accounting_period_id,average_rate,current_rate,historical_rate,from_subsidiary_id,to_subsidiary_id,_fivetran_deleted
2 | 1,1,173,1,1,1,2,2,FALSE
3 | 2,1,142,1,1,1,2,2,FALSE
4 | 3,1,182,1,1,1,2,2,FALSE
5 | 4,1,132,1,1,1,2,2,FALSE
6 | 5,1,294,1,1,1,2,2,FALSE
7 | 6,1,114,1,1,1,2,2,FALSE
8 | 7,1,166,1,1,1,2,2,FALSE
9 | 8,1,141,1,1,1,2,2,FALSE
10 | 9,1,187,1,1,1,2,2,FALSE
11 | 10,1,129,1,1,1,2,2,FALSE
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite_currencies_data.csv:
--------------------------------------------------------------------------------
1 | currency_id,name,symbol,_fivetran_deleted
2 | 4,Euro,EUR,FALSE
3 | 11,Norwegian Krone,NOK,FALSE
4 | 1,US Dollar,USD,FALSE
5 | 10,Israeli New Shekel,ILS,FALSE
6 | 9,Icelandic Krona,ISK,FALSE
7 | 5,Indian Rupee,INR,FALSE
8 | 8,Swedish Krona,SEK,FALSE
9 | 3,Canadian Dollar,CAD,FALSE
10 | 14,United Arab Emirates Dirham,AED,FALSE
11 | 2,British Pound,GBP,FALSE
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite_customers_data.csv:
--------------------------------------------------------------------------------
1 | customer_id,company_name,city,state,zipcode,country,date_first_order,_fivetran_deleted
2 | 80407,ac8fcc431ac90effb12e1e0971922e02,,,,,,FALSE
3 | 312341,0d13ec53f5ba24084dfef05b1ab587fa,,,,,,FALSE
4 | 275886,55c040f24a5db41de2cdfe00d5bb7320,,,,,,FALSE
5 | 324864,2669977b16cdcfa4fa86bdb025146629,,,,,,FALSE
6 | 317850,4b5954bd8fd20576d72fe974cced2b56,,,,,,FALSE
7 | 299217,4985a0fd67ee0454d1bee87328804446,,,,,,FALSE
8 | 292403,3eb3502ce77d02bc8dfb1298a49ee839,,,,,,FALSE
9 | 286699,c40b667b74affc1c43ac142a31bcb2f8,,,,,,FALSE
10 | 289701,721a21b1d7ee927d35497e82ae414234,,,,,,FALSE
11 | 312340,af2eefb2216c6d99d6c74be5ec7e96d3,,,,,,FALSE
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite_departments_data.csv:
--------------------------------------------------------------------------------
1 | department_id,name,full_name
2 | 210,f8f61911f3df7c353059e659d7501624,ee8af764a9fefe4422548073579ee1c0
3 | 221,a52202dfb23d5fbf9087e3e7debfee1c,4628aca8c1d9e65ba0b36eea8e6ab88a
4 | 109,5231dee7156b84b0d1854de1a18dd169,04852619f092ed2d2277cff3a07400cf
5 | 226,2fae32629d4ef4fc6341f1751b405e45,cfcb26064227081e3e183bf8f14b88b1
6 | 212,30f6724a02fc69093960468c0a2fbcd4,d38c4be1aacab0fd12f39f04f4f7141d
7 | 111,deb10517653c255364175796ace3553f,c0d89576099059637ae395cd72acef94
8 | 205,f8691fe924367e100e3408857a534a57,784c3dcaa731fd2d960f022b61114123
9 | 114,7cb15e416d62919b1b40298324fbe30b,e14d024704219ae5c7409ba5ee143194
10 | 115,93f19c8ecd9f502f568d2a4e1878638d,6f1ff21122e3d2bf7a833311ad7d4c39
11 | 101,45db51f999b9e9fc7263a7e0ebc2d7f0,7485b69fa4ace5eb023eca9dee0681c7
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite_expense_accounts_data.csv:
--------------------------------------------------------------------------------
1 | expense_account_id,name,parent_id,account_number
2 | 300,7bf48cb939975c27a0d9cfa99c6f3461,,60000
3 | 768,3706083d9300b9a8c4daec012e51d192,,70092
4 | 771,e8e2f38d0dcc5e96db4523eef53343ff,,70093
5 | 293,9c2be7b8250ef7646b4c9d14dd1a44b4,,50000
6 | 770,aad7455fa778d7eece006cb9b2aeff20,,70091
7 | 651,a93d98cec2489ffef8aabf7dfa62b1ce,,89999
8 | 58,134958285988bdb99b7c17836278fc55,,6000
9 | 401,8e4c1670d90cfa740339dcc2b0c4d6b6,,70000
10 | 630,6d623d2246e7726edc1ef5d20638569c,,
11 | 340,54798a84c5f5ab0827db0267f303224a,336,64004
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite_income_accounts_data.csv:
--------------------------------------------------------------------------------
1 | income_account_id,name,parent_id,account_number
2 | 108,ae171f16fbfa72ae2e2069fcae274785,,4050
3 | 289,1f08d08fd864b99cbeebd88b9a0784a7,,40000
4 | 404,20a2b190bb5f3b1a64c1bded9494b9a6,,80000
5 | 786,081c662c21d4bf12fefe35ca30ff9109,289,40090
6 | 1085,8970632dd87cbcf60df1e1a85345cbff,289,40003
7 | 290,516e498c46de053aa5e93eef23c0b278,289,40001
8 | 292,aa768ebb1902000800ac9e1fec358be1,289,40060
9 | 1084,4c3faf21a98ce665b1ecad443aa60fd5,289,40002
10 | 406,a86c8ebbb3d54ba790e02bbc0a1dfe71,404,80002
11 | 408,eb79e7326aaeea8c0b3e3fda9681c2c3,404,80004
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite_items_data.csv:
--------------------------------------------------------------------------------
1 | item_id,name,type_name,sales_description
2 | -5,480fda7106f6ff118d95e193cea0f515,e51e08a727173e8719e480316459991e,37a6259cc0c1dae299a7866489dff0bd
3 | 13034,02c174ac21eec3db7c15911ea335de6f,c2ba7e785c49050f48da9aacc45c2b85,37a6259cc0c1dae299a7866489dff0bd
4 | 1223,59808f0e7d225823f8b0d74daffe497e,c2ba7e785c49050f48da9aacc45c2b85,37a6259cc0c1dae299a7866489dff0bd
5 | 13032,20f02d1acec7a00989fadfffd3d50d90,c2ba7e785c49050f48da9aacc45c2b85,37a6259cc0c1dae299a7866489dff0bd
6 | 1525,1901fc419da848cf771aefac0439d4fd,c2ba7e785c49050f48da9aacc45c2b85,5b4804abb6d9ea560626f7c4e0cb14fd
7 | 13839,acd9ee7a6394634f865ca396c067e17e,c2ba7e785c49050f48da9aacc45c2b85,acd9ee7a6394634f865ca396c067e17e
8 | 1225,a9f770db958688d0fefaa2e839c3a080,c2ba7e785c49050f48da9aacc45c2b85,a9f770db958688d0fefaa2e839c3a080
9 | -6,b1a389b9473800c94c69660147efde2d,104d9898c04874d0fbac36e125fa1369,37a6259cc0c1dae299a7866489dff0bd
10 | -2,2194aaec8cc7086ab0e93f74547e5f53,2194aaec8cc7086ab0e93f74547e5f53,37a6259cc0c1dae299a7866489dff0bd
11 | -4,252f070fb5103f833ea89c8c03defda0,8b4d1c6b3fac12f4650d1ad245d11933,37a6259cc0c1dae299a7866489dff0bd
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite_locations_data.csv:
--------------------------------------------------------------------------------
1 | location_id,name,full_name,city,country
2 | 104,d8b00929dec65d422303256336ada04f,804e2fea16f7682e05742b4af28e8d14,3I/e1y/dpFDjKZzxNa/UbQ==,0mhyB4Nqa9q2KM7DfP6Lcw==
3 | 105,7b88a4aca50f33c258efc438d098c9f4,5491af4e99f5a6d72e48049ac6bc4ae1,sqfRhwvI6LT3XkWi4vX7aQ==,0mhyB4Nqa9q2KM7DfP6Lcw==
4 | 107,4442e4af0916f53a07fb8ca9a49b98ed,b008d623841a324ae0855ea92d6946dc,3I/e1y/dpFDjKZzxNa/UbQ==,DEFLLiC1TmrcRzaQOsFhfw==
5 | 108,1fc91e86962825bb745de53d1657b3e4,0e4dd695f0cd2e5d7dfc61d01fec2674,3I/e1y/dpFDjKZzxNa/UbQ==,DEFLLiC1TmrcRzaQOsFhfw==
6 | 106,a2f89a300f983190022374848c4353b0,21a62bb87dc860a0114d94cec79f3363,3I/e1y/dpFDjKZzxNa/UbQ==,DEFLLiC1TmrcRzaQOsFhfw==
7 | 2,f253efe302d32ab264a76e0ce65be769,c31da6413bef3f4793569904c0ac8b0e,3I/e1y/dpFDjKZzxNa/UbQ==,UNqd90tIaAXdn5x5hMtb/g==
8 | 5,41bcdff2f00e6d3b0efb83c35ab77920,858b3c77f6c8b9b36f776e8b9811a87d,3I/e1y/dpFDjKZzxNa/UbQ==,UNqd90tIaAXdn5x5hMtb/g==
9 | 1,4cc6684df7b4a92b1dec6fce3264fac8,4cc6684df7b4a92b1dec6fce3264fac8,ve9OlLDKTT2Ep7Y6atd3Ow==,UNqd90tIaAXdn5x5hMtb/g==
10 | 4,67100af8b08e073c3ba7f4de2707584b,e1d83f3624ba5be5cb1d3d1a57071620,LW+9SKlwQZpBql/gdzIitA==,UNqd90tIaAXdn5x5hMtb/g==
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite_subsidiaries_data.csv:
--------------------------------------------------------------------------------
1 | subsidiary_id,fiscal_calendar_id,name,parent_id
2 | 5,1,c1051fc571b335a6de11b9ce8dadd126,1
3 | 2,1,00004ec12e22586838c200543606065b,1
4 | 7,2,2055d7db135734f4abf9487c64dc03a8,1
5 | 1,2,1b93663256d502306bc812c240e733cb,
6 | 3,2,9a41291c75b78d535ebc4ba26281cc10,1
7 | 6,2,46ce2cf2687df548c902cdf61813d4e9,1
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite_transaction_lines_data.csv:
--------------------------------------------------------------------------------
1 | transaction_id,transaction_line_id,subsidiary_id,account_id,company_id,item_id,amount,non_posting_line,class_id,location_id,department_id,memo
2 | 31192,6,1,,,-7,0,Yes,,,,ukaNJqM5WW7qBs/vsAP8+w==
3 | 786136,2,1,,82110,14039,0,Yes,,,,ukaNJqM5WW7qBs/vsAP8+w==
4 | 934944,4,1,,82110,14039,0,Yes,,,,ukaNJqM5WW7qBs/vsAP8+w==
5 | 934522,5,1,,,-7,0,Yes,,,,ukaNJqM5WW7qBs/vsAP8+w==
6 | 35289,2,1,,,-7,0,Yes,,,,ukaNJqM5WW7qBs/vsAP8+w==
7 | 121843,4,1,,,-7,0,Yes,,,,ukaNJqM5WW7qBs/vsAP8+w==
8 | 440240,8,1,,82110,14039,0,Yes,,,,ukaNJqM5WW7qBs/vsAP8+w==
9 | 14338,4,1,,,-7,0,Yes,,,,ukaNJqM5WW7qBs/vsAP8+w==
10 | 100635,8,1,,,-7,0,Yes,,,,ukaNJqM5WW7qBs/vsAP8+w==
11 | 962678,4,1,,82110,14039,0,Yes,,,,ukaNJqM5WW7qBs/vsAP8+w==
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite_transactions_data.csv:
--------------------------------------------------------------------------------
1 | transaction_id,status,transaction_date,currency_id,accounting_period_id,due_date,transaction_type,is_intercompany,is_advanced_intercompany,_fivetran_deleted
2 | 724979,623e49c4c00c1e871198703d97e7aedc,2020-06-19 00:00:00,1,152,2020-06-19 00:00:00,d92c25d41fcd9f8ab35545ef34b1e7ed,No,No,FALSE
3 | 727862,623e49c4c00c1e871198703d97e7aedc,2020-06-19 00:00:00,1,152,2020-06-19 00:00:00,d92c25d41fcd9f8ab35545ef34b1e7ed,No,No,FALSE
4 | 719799,623e49c4c00c1e871198703d97e7aedc,2020-06-19 00:00:00,1,152,2020-06-19 00:00:00,d92c25d41fcd9f8ab35545ef34b1e7ed,No,No,FALSE
5 | 719811,623e49c4c00c1e871198703d97e7aedc,2020-06-19 00:00:00,1,152,2020-06-19 00:00:00,d92c25d41fcd9f8ab35545ef34b1e7ed,No,No,FALSE
6 | 720001,623e49c4c00c1e871198703d97e7aedc,2020-06-19 00:00:00,1,152,2020-06-19 00:00:00,d92c25d41fcd9f8ab35545ef34b1e7ed,No,No,FALSE
7 | 719904,623e49c4c00c1e871198703d97e7aedc,2020-06-19 00:00:00,1,152,2020-06-19 00:00:00,d92c25d41fcd9f8ab35545ef34b1e7ed,No,No,FALSE
8 | 719906,623e49c4c00c1e871198703d97e7aedc,2020-06-19 00:00:00,1,152,2020-06-19 00:00:00,d92c25d41fcd9f8ab35545ef34b1e7ed,No,No,FALSE
9 | 719801,623e49c4c00c1e871198703d97e7aedc,2020-06-19 00:00:00,1,152,2020-06-19 00:00:00,d92c25d41fcd9f8ab35545ef34b1e7ed,No,No,FALSE
10 | 719803,126b8230f95c78e8688bb6eb1848d5b0,2020-06-19 00:00:00,1,152,2020-06-19 00:00:00,d92c25d41fcd9f8ab35545ef34b1e7ed,No,No,FALSE
11 | 719901,126b8230f95c78e8688bb6eb1848d5b0,2020-06-19 00:00:00,1,152,2020-06-19 00:00:00,d92c25d41fcd9f8ab35545ef34b1e7ed,No,No,FALSE
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite_vendor_types_data.csv:
--------------------------------------------------------------------------------
1 | vendor_type_id,name,_fivetran_deleted
2 | 10,5f12b792a42da894452af9541d0d834f,FALSE
3 | 11,6f041af43be87a195bd3f075922f344a,FALSE
4 | 3,93b6e35bd5fdd20b7b6eff3fbc4f96ef,FALSE
5 | 5,a1f1db73d8a16df986f2c849cb38649c,FALSE
6 | 4,aa50cb6e580e5d512be9e4dea6643925,FALSE
7 | 9,9e3314f7fd575fe6c6fd1f0038362fe7,FALSE
8 | 8,7e4446f9d4ced638f353b640c5e571bd,FALSE
9 | 12,25befec7033aa9feec4a5a586d4e1366,FALSE
10 | 1,b29f286b3bc1c1356acdbec3228b016b,FALSE
11 | 2,47464a2431a94596ff50e19bee5b28d9,FALSE
--------------------------------------------------------------------------------
/integration_tests/seeds/netsuite_vendors_data.csv:
--------------------------------------------------------------------------------
1 | vendor_id,vendor_type_id,company_name,create_date,_fivetran_deleted
2 | 221949,220384,9d8e79654cc4d739fdd1565e062f1cef,2020-06-23 22:02:40,FALSE
3 | 135485,133920,f90a2bce95f2f76737f5c06fd1ab3449,2020-01-31 15:51:00,FALSE
4 | 92242,90677,1172feba90409c579d20ed56ca9796df,2019-09-26 03:13:40,FALSE
5 | 7820,6255,f761c4e5157e676ecb054de44e328f86,2019-01-14 21:06:16,FALSE
6 | 57258,55693,f73b6560e888594169d9c31523c53810,2019-05-23 10:45:28,FALSE
7 | 315545,313980,6079f9de8eac9d21c63a68a3cd7b77bb,2020-11-03 18:30:32,FALSE
8 | 292203,290638,c3cd3580b795094615f3d93bb49c3981,2020-09-23 03:19:08,FALSE
9 | 7879,6314,634a06a508d902efb87bf27cc6b8b753,2019-01-14 21:10:04,FALSE
10 | 96545,94980,b39200b75de4db385725cf25c0f2127d,2019-10-13 03:18:40,FALSE
11 | 51225,49660,59ca79fe8babba4336c1f179d2bd9a7d,2019-05-04 04:05:36,FALSE
--------------------------------------------------------------------------------
/macros/fill_pass_through_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro fill_pass_through_columns(pass_through_variable) %}
2 |
3 | {{ adapter.dispatch('fill_pass_through_columns', 'netsuite_source') (pass_through_variable) }}
4 |
5 | {%- endmacro %}
6 |
7 | {% macro default__fill_pass_through_columns(pass_through_variable) %}
8 |
9 | {% if pass_through_variable %}
10 | {% for field in pass_through_variable %}
11 | {% if field is mapping %}
12 | {% if field.transform_sql %}
13 | , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}
14 | {% else %}
15 | , {{ field.alias if field.alias else field.name }}
16 | {% endif %}
17 | {% else %}
18 | , {{ field }}
19 | {% endif %}
20 | {% endfor %}
21 | {% endif %}
22 |
23 | {% endmacro %}
--------------------------------------------------------------------------------
/macros/get_accounting_books_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_accounting_books_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
6 | {"name": "accounting_book_extid", "datatype": dbt.type_string()},
7 | {"name": "accounting_book_id", "datatype": dbt.type_float()},
8 | {"name": "accounting_book_name", "datatype": dbt.type_string()},
9 | {"name": "base_book_id", "datatype": dbt.type_float()},
10 | {"name": "date_created", "datatype": dbt.type_timestamp()},
11 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
12 | {"name": "date_last_modified", "datatype": dbt.type_timestamp()},
13 | {"name": "effective_period_id", "datatype": dbt.type_float()},
14 | {"name": "form_template_component_id", "datatype": dbt.type_string()},
15 | {"name": "form_template_id", "datatype": dbt.type_float()},
16 | {"name": "is_adjustment_only", "datatype": dbt.type_string()},
17 | {"name": "is_arrangement_level_reclass", "datatype": dbt.type_string()},
18 | {"name": "is_consolidated", "datatype": dbt.type_string()},
19 | {"name": "is_contingent_revenue_handling", "datatype": dbt.type_string()},
20 | {"name": "is_include_child_subsidiaries", "datatype": dbt.type_string()},
21 | {"name": "is_primary", "datatype": dbt.type_string()},
22 | {"name": "is_two_step_revenue_allocation", "datatype": dbt.type_string()},
23 | {"name": "status", "datatype": dbt.type_string()},
24 | {"name": "unbilled_receivable_grouping", "datatype": dbt.type_string()}
25 | ] %}
26 |
27 | {{ return(columns) }}
28 |
29 | {% endmacro %}
30 |
31 | {% macro get_netsuite2_accounting_books_columns() %}
32 |
33 | {% set columns = [
34 | {"name": "_fivetran_deleted", "datatype": "boolean"},
35 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
36 | {"name": "basebook", "datatype": dbt.type_int()},
37 | {"name": "contingentrevenuehandling", "datatype": dbt.type_string()},
38 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
39 | {"name": "effectiveperiod", "datatype": dbt.type_int()},
40 | {"name": "externalid", "datatype": dbt.type_string()},
41 | {"name": "id", "datatype": dbt.type_int()},
42 | {"name": "isadjustmentonly", "datatype": dbt.type_string()},
43 | {"name": "isconsolidated", "datatype": dbt.type_string()},
44 | {"name": "isprimary", "datatype": dbt.type_string()},
45 | {"name": "lastmodifieddate", "datatype": dbt.type_timestamp()},
46 | {"name": "name", "datatype": dbt.type_string()},
47 | {"name": "subsidiariesstring", "datatype": dbt.type_string()},
48 | {"name": "twosteprevenueallocation", "datatype": dbt.type_string()},
49 | {"name": "unbilledreceivablegrouping", "datatype": dbt.type_string()}
50 | ] %}
51 |
52 | {{ return(columns) }}
53 |
54 | {% endmacro %}
55 |
--------------------------------------------------------------------------------
/macros/get_accounting_periods_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_accounting_periods_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_id", "datatype": dbt.type_string()},
6 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
7 | {"name": "accounting_period_id", "datatype": dbt.type_float()},
8 | {"name": "closed", "datatype": dbt.type_string()},
9 | {"name": "closed_accounts_payable", "datatype": dbt.type_string()},
10 | {"name": "closed_accounts_receivable", "datatype": dbt.type_string()},
11 | {"name": "closed_all", "datatype": dbt.type_string()},
12 | {"name": "closed_on", "datatype": dbt.type_timestamp()},
13 | {"name": "closed_payroll", "datatype": dbt.type_string()},
14 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
15 | {"name": "date_last_modified", "datatype": dbt.type_timestamp()},
16 | {"name": "ending", "datatype": dbt.type_timestamp()},
17 | {"name": "fiscal_calendar_id", "datatype": dbt.type_float()},
18 | {"name": "fivetran_index", "datatype": dbt.type_string()},
19 | {"name": "full_name", "datatype": dbt.type_string()},
20 | {"name": "is_adjustment", "datatype": dbt.type_string()},
21 | {"name": "isinactive", "datatype": dbt.type_string()},
22 | {"name": "locked_accounts_payable", "datatype": dbt.type_string()},
23 | {"name": "locked_accounts_receivable", "datatype": dbt.type_string()},
24 | {"name": "locked_all", "datatype": dbt.type_string()},
25 | {"name": "locked_payroll", "datatype": dbt.type_string()},
26 | {"name": "name", "datatype": dbt.type_string()},
27 | {"name": "parent_id", "datatype": dbt.type_float()},
28 | {"name": "quarter", "datatype": dbt.type_string()},
29 | {"name": "starting", "datatype": dbt.type_timestamp()},
30 | {"name": "year_0", "datatype": dbt.type_string()},
31 | {"name": "year_id", "datatype": dbt.type_float()}
32 | ] %}
33 |
34 | {{ return(columns) }}
35 |
36 | {% endmacro %}
37 |
38 | {% macro get_netsuite2_accounting_periods_columns() %}
39 |
40 | {% set columns = [
41 | {"name": "_fivetran_deleted", "datatype": "boolean"},
42 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
43 | {"name": "alllocked", "datatype": dbt.type_string()},
44 | {"name": "allownonglchanges", "datatype": dbt.type_string()},
45 | {"name": "aplocked", "datatype": dbt.type_string()},
46 | {"name": "arlocked", "datatype": dbt.type_string()},
47 | {"name": "closed", "datatype": dbt.type_string()},
48 | {"name": "closedondate", "datatype": dbt.type_timestamp()},
49 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
50 | {"name": "enddate", "datatype": dbt.type_timestamp()},
51 | {"name": "id", "datatype": dbt.type_int()},
52 | {"name": "isadjust", "datatype": dbt.type_string()},
53 | {"name": "isinactive", "datatype": dbt.type_string()},
54 | {"name": "isposting", "datatype": dbt.type_string()},
55 | {"name": "isquarter", "datatype": dbt.type_string()},
56 | {"name": "isyear", "datatype": dbt.type_string()},
57 | {"name": "lastmodifieddate", "datatype": dbt.type_timestamp()},
58 | {"name": "parent", "datatype": dbt.type_int()},
59 | {"name": "periodname", "datatype": dbt.type_string()},
60 | {"name": "startdate", "datatype": dbt.type_timestamp()}
61 | ] %}
62 |
63 | {{ return(columns) }}
64 |
65 | {% endmacro %}
66 |
--------------------------------------------------------------------------------
/macros/get_accountingbooksubsidiaries_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_accountingbooksubsidiaries_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_id", "datatype": dbt.type_string()},
6 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
7 | {"name": "accountingbook", "datatype": dbt.type_int()},
8 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
9 | {"name": "status", "datatype": dbt.type_string()},
10 | {"name": "subsidiary", "datatype": dbt.type_int()}
11 | ] %}
12 |
13 | {{ return(columns) }}
14 |
15 | {% endmacro %}
16 |
--------------------------------------------------------------------------------
/macros/get_accountingperiodfiscalcalendars_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_accountingperiodfiscalcalendars_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_id", "datatype": dbt.type_string()},
6 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
7 | {"name": "accountingperiod", "datatype": dbt.type_int()},
8 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
9 | {"name": "fiscalcalendar", "datatype": dbt.type_int()},
10 | {"name": "parent", "datatype": dbt.type_int()}
11 | ] %}
12 |
13 | {{ return(columns) }}
14 |
15 | {% endmacro %}
16 |
--------------------------------------------------------------------------------
/macros/get_accounts_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_accounts_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "account_id", "datatype": dbt.type_float()},
6 | {"name": "accountnumber", "datatype": dbt.type_string()},
7 | {"name": "general_rate_type", "datatype": dbt.type_string()},
8 | {"name": "is_balancesheet", "datatype": dbt.type_string()},
9 | {"name": "is_leftside", "datatype": dbt.type_string()},
10 | {"name": "name", "datatype": dbt.type_string()},
11 | {"name": "parent_id", "datatype": dbt.type_float()},
12 | {"name": "type_name", "datatype": dbt.type_string()}
13 | ] %}
14 |
15 | {{ fivetran_utils.add_pass_through_columns(columns, var('accounts_pass_through_columns')) }}
16 |
17 | {{ return(columns) }}
18 |
19 | {% endmacro %}
20 |
21 | {% macro get_netsuite2_accounts_columns() %}
22 |
23 | {% set columns = [
24 |
25 | {"name": "_fivetran_deleted", "datatype": "boolean"},
26 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
27 | {"name": "id", "datatype": dbt.type_int()},
28 | {"name": "externalid", "datatype": dbt.type_string()},
29 | {"name": "parent", "datatype": dbt.type_int()},
30 | {"name": "acctnumber", "datatype": dbt.type_string()},
31 | {"name": "accttype", "datatype": dbt.type_string()},
32 | {"name": "sspecacct", "datatype": dbt.type_string()},
33 | {"name": "fullname", "datatype": dbt.type_string()},
34 | {"name": "accountsearchdisplaynamecopy", "datatype": dbt.type_string()},
35 | {"name": "description", "datatype": dbt.type_string()},
36 | {"name": "deferralacct", "datatype": dbt.type_int()},
37 | {"name": "cashflowrate", "datatype": dbt.type_string()},
38 | {"name": "generalrate", "datatype": dbt.type_string()},
39 | {"name": "currency", "datatype": dbt.type_int()},
40 | {"name": "class", "datatype": dbt.type_int()},
41 | {"name": "department", "datatype": dbt.type_int()},
42 | {"name": "location", "datatype": dbt.type_int()},
43 | {"name": "includechildren", "datatype": dbt.type_string()},
44 | {"name": "isinactive", "datatype": dbt.type_string()},
45 | {"name": "issummary", "datatype": dbt.type_string()},
46 | {"name": "eliminate", "datatype": dbt.type_string()}
47 | ] %}
48 |
49 | {{ fivetran_utils.add_pass_through_columns(columns, var('accounts_pass_through_columns')) }}
50 |
51 | {{ return(columns) }}
52 |
53 | {% endmacro %}
54 |
--------------------------------------------------------------------------------
/macros/get_accounttype_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_accounttype_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
6 | {"name": "balancesheet", "datatype": dbt.type_string()},
7 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
8 | {"name": "defaultcashflowratetype", "datatype": dbt.type_string()},
9 | {"name": "defaultgeneralratetype", "datatype": dbt.type_string()},
10 | {"name": "eliminationalgo", "datatype": dbt.type_string()},
11 | {"name": "id", "datatype": dbt.type_string()},
12 | {"name": "includeinrevaldefault", "datatype": dbt.type_string()},
13 | {"name": "internalid", "datatype": dbt.type_int()},
14 | {"name": "left", "datatype": dbt.type_string(), "quote": True},
15 | {"name": "longname", "datatype": dbt.type_string()},
16 | {"name": "seqnum", "datatype": dbt.type_int()},
17 | {"name": "usercanchangerevaloption", "datatype": dbt.type_string()}
18 | ] %}
19 |
20 | {{ return(columns) }}
21 |
22 | {% endmacro %}
23 |
--------------------------------------------------------------------------------
/macros/get_classes_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_classes_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "class_id", "datatype": dbt.type_float()},
6 | {"name": "full_name", "datatype": dbt.type_string()}
7 | ] %}
8 |
9 | {{ fivetran_utils.add_pass_through_columns(columns, var('classes_pass_through_columns')) }}
10 |
11 | {{ return(columns) }}
12 |
13 | {% endmacro %}
14 |
15 | {% macro get_netsuite2_classes_columns() %}
16 |
17 | {% set columns = [
18 | {"name": "_fivetran_deleted", "datatype": "boolean"},
19 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
20 | {"name": "externalid", "datatype": dbt.type_string()},
21 | {"name": "fullname", "datatype": dbt.type_string()},
22 | {"name": "id", "datatype": dbt.type_int()},
23 | {"name": "isinactive", "datatype": dbt.type_string()},
24 | {"name": "name", "datatype": dbt.type_string()}
25 | ] %}
26 |
27 | {{ fivetran_utils.add_pass_through_columns(columns, var('classes_pass_through_columns')) }}
28 |
29 | {{ return(columns) }}
30 |
31 | {% endmacro %}
32 |
--------------------------------------------------------------------------------
/macros/get_consolidated_exchange_rates_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_consolidated_exchange_rates_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
6 | {"name": "accounting_book_id", "datatype": dbt.type_float()},
7 | {"name": "accounting_period_id", "datatype": dbt.type_float()},
8 | {"name": "average_budget_rate", "datatype": dbt.type_float()},
9 | {"name": "average_rate", "datatype": dbt.type_float()},
10 | {"name": "consolidated_exchange_rate_id", "datatype": dbt.type_float()},
11 | {"name": "current_budget_rate", "datatype": dbt.type_float()},
12 | {"name": "current_rate", "datatype": dbt.type_float()},
13 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
14 | {"name": "from_subsidiary_id", "datatype": dbt.type_float()},
15 | {"name": "historical_budget_rate", "datatype": dbt.type_float()},
16 | {"name": "historical_rate", "datatype": dbt.type_float()},
17 | {"name": "to_subsidiary_id", "datatype": dbt.type_float()}
18 | ] %}
19 |
20 | {{ fivetran_utils.add_pass_through_columns(columns, var('consolidated_exchange_rates_pass_through_columns')) }}
21 |
22 | {{ return(columns) }}
23 |
24 | {% endmacro %}
25 |
26 | {% macro get_netsuite2_consolidated_exchange_rates_columns() %}
27 |
28 | {% set columns = [
29 | {"name": "_fivetran_deleted", "datatype": "boolean"},
30 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
31 | {"name": "averagerate", "datatype": dbt.type_float()},
32 | {"name": "currentrate", "datatype": dbt.type_float()},
33 | {"name": "fromcurrency", "datatype": dbt.type_int()},
34 | {"name": "fromsubsidiary", "datatype": dbt.type_int()},
35 | {"name": "historicalrate", "datatype": dbt.type_float()},
36 | {"name": "id", "datatype": dbt.type_int()},
37 | {"name": "accountingbook", "datatype": dbt.type_int()},
38 | {"name": "postingperiod", "datatype": dbt.type_int()},
39 | {"name": "tocurrency", "datatype": dbt.type_int()},
40 | {"name": "tosubsidiary", "datatype": dbt.type_int()}
41 | ] %}
42 |
43 | {{ fivetran_utils.add_pass_through_columns(columns, var('consolidated_exchange_rates_pass_through_columns')) }}
44 |
45 | {{ return(columns) }}
46 |
47 | {% endmacro %}
48 |
--------------------------------------------------------------------------------
/macros/get_currencies_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_currencies_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
6 | {"name": "currency_extid", "datatype": dbt.type_string()},
7 | {"name": "currency_id", "datatype": dbt.type_float()},
8 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
9 | {"name": "date_last_modified", "datatype": dbt.type_timestamp()},
10 | {"name": "is_inactive", "datatype": dbt.type_string()},
11 | {"name": "name", "datatype": dbt.type_string()},
12 | {"name": "precision_0", "datatype": dbt.type_float()},
13 | {"name": "symbol", "datatype": dbt.type_string()}
14 | ] %}
15 |
16 | {{ return(columns) }}
17 |
18 | {% endmacro %}
19 |
20 | {% macro get_netsuite2_currencies_columns() %}
21 |
22 | {% set columns = [
23 | {"name": "_fivetran_deleted", "datatype": "boolean"},
24 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
25 | {"name": "currencyprecision", "datatype": dbt.type_int()},
26 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
27 | {"name": "displaysymbol", "datatype": dbt.type_string()},
28 | {"name": "exchangerate", "datatype": dbt.type_float()},
29 | {"name": "externalid", "datatype": dbt.type_string()},
30 | {"name": "fxrateupdatetimezone", "datatype": dbt.type_int()},
31 | {"name": "id", "datatype": dbt.type_int()},
32 | {"name": "includeinfxrateupdates", "datatype": dbt.type_string()},
33 | {"name": "isbasecurrency", "datatype": dbt.type_string()},
34 | {"name": "isinactive", "datatype": dbt.type_string()},
35 | {"name": "lastmodifieddate", "datatype": dbt.type_timestamp()},
36 | {"name": "name", "datatype": dbt.type_string()},
37 | {"name": "overridecurrencyformat", "datatype": dbt.type_string()},
38 | {"name": "symbol", "datatype": dbt.type_string()},
39 | {"name": "symbolplacement", "datatype": dbt.type_int()}
40 | ] %}
41 |
42 | {{ return(columns) }}
43 |
44 | {% endmacro %}
45 |
--------------------------------------------------------------------------------
/macros/get_customers_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_customers_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "city", "datatype": dbt.type_string()},
6 | {"name": "companyname", "datatype": dbt.type_string()},
7 | {"name": "country", "datatype": dbt.type_string()},
8 | {"name": "customer_extid", "datatype": dbt.type_string()},
9 | {"name": "customer_id", "datatype": dbt.type_float()},
10 | {"name": "date_first_order", "datatype": dbt.type_timestamp()},
11 | {"name": "state", "datatype": dbt.type_string()},
12 | {"name": "zipcode", "datatype": dbt.type_string()}
13 | ] %}
14 |
15 | {{ fivetran_utils.add_pass_through_columns(columns, var('customers_pass_through_columns')) }}
16 |
17 | {{ return(columns) }}
18 |
19 | {% endmacro %}
20 |
21 | {% macro get_netsuite2_customers_columns() %}
22 |
23 | {% set columns = [
24 | {"name": "_fivetran_deleted", "datatype": "boolean"},
25 | {"name": "id", "datatype": dbt.type_int()},
26 | {"name": "entityid", "datatype": dbt.type_string()},
27 | {"name": "externalid", "datatype": dbt.type_string()},
28 | {"name": "parent", "datatype": dbt.type_int()},
29 | {"name": "isperson", "datatype": dbt.type_string()},
30 | {"name": "altname", "datatype": dbt.type_string()},
31 | {"name": "companyname", "datatype": dbt.type_string()},
32 | {"name": "firstname", "datatype": dbt.type_string()},
33 | {"name": "lastname", "datatype": dbt.type_string()},
34 | {"name": "email", "datatype": dbt.type_string()},
35 | {"name": "phone", "datatype": dbt.type_string()},
36 | {"name": "defaultbillingaddress", "datatype": dbt.type_int()},
37 | {"name": "defaultshippingaddress", "datatype": dbt.type_int()},
38 | {"name": "receivablesaccount", "datatype": dbt.type_int()},
39 | {"name": "currency", "datatype": dbt.type_int()},
40 | {"name": "firstorderdate", "datatype": dbt.type_timestamp()}
41 | ] %}
42 |
43 | {{ fivetran_utils.add_pass_through_columns(columns, var('customers_pass_through_columns')) }}
44 |
45 | {{ return(columns) }}
46 |
47 | {% endmacro %}
48 |
--------------------------------------------------------------------------------
/macros/get_departments_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_departments_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "department_id", "datatype": dbt.type_float()},
6 | {"name": "full_name", "datatype": dbt.type_string()},
7 | {"name": "name", "datatype": dbt.type_string()}
8 | ] %}
9 |
10 | {{ fivetran_utils.add_pass_through_columns(columns, var('departments_pass_through_columns')) }}
11 |
12 | {{ return(columns) }}
13 |
14 | {% endmacro %}
15 |
16 | {% macro get_netsuite2_departments_columns() %}
17 |
18 | {% set columns = [
19 | {"name": "_fivetran_deleted", "datatype": "boolean"},
20 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
21 | {"name": "fullname", "datatype": dbt.type_string()},
22 | {"name": "id", "datatype": dbt.type_int()},
23 | {"name": "isinactive", "datatype": dbt.type_string()},
24 | {"name": "name", "datatype": dbt.type_string()},
25 | {"name": "parent", "datatype": dbt.type_int()},
26 | {"name": "subsidiary", "datatype": dbt.type_string()}
27 | ] %}
28 |
29 | {{ fivetran_utils.add_pass_through_columns(columns, var('departments_pass_through_columns')) }}
30 |
31 | {{ return(columns) }}
32 |
33 | {% endmacro %}
34 |
--------------------------------------------------------------------------------
/macros/get_employee_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_employee_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
6 | {"name": "accountnumber", "datatype": dbt.type_string()},
7 | {"name": "aliennumber", "datatype": dbt.type_string()},
8 | {"name": "approvallimit", "datatype": dbt.type_float()},
9 | {"name": "approver", "datatype": dbt.type_int()},
10 | {"name": "class", "datatype": dbt.type_int()},
11 | {"name": "comments", "datatype": dbt.type_string()},
12 | {"name": "currency", "datatype": dbt.type_int()},
13 | {"name": "department", "datatype": dbt.type_int()},
14 | {"name": "email", "datatype": dbt.type_string()},
15 | {"name": "employeestatus", "datatype": dbt.type_int()},
16 | {"name": "employeetype", "datatype": dbt.type_int()},
17 | {"name": "entityid", "datatype": dbt.type_string()},
18 | {"name": "expenselimit", "datatype": dbt.type_string()},
19 | {"name": "firstname", "datatype": dbt.type_string()},
20 | {"name": "giveaccess", "datatype": dbt.type_string()},
21 | {"name": "hiredate", "datatype": dbt.type_timestamp()},
22 | {"name": "id", "datatype": dbt.type_int()},
23 | {"name": "isinactive", "datatype": dbt.type_string()},
24 | {"name": "lastname", "datatype": dbt.type_string()},
25 | {"name": "location", "datatype": dbt.type_int()},
26 | {"name": "middlename", "datatype": dbt.type_string()},
27 | {"name": "purchaseorderapprovallimit", "datatype": dbt.type_float()},
28 | {"name": "purchaseorderlimit", "datatype": dbt.type_float()},
29 | {"name": "subsidiary", "datatype": dbt.type_int()},
30 | {"name": "supervisor", "datatype": dbt.type_int()}
31 | ] %}
32 |
33 | {{ return(columns) }}
34 |
35 | {% endmacro %}
36 |
--------------------------------------------------------------------------------
/macros/get_entity_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_entity_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
6 | {"name": "contact", "datatype": dbt.type_int()},
7 | {"name": "customer", "datatype": dbt.type_int()},
8 | {"name": "employee", "datatype": dbt.type_int()},
9 | {"name": "entitytitle", "datatype": dbt.type_string()},
10 | {"name": "id", "datatype": dbt.type_int()},
11 | {"name": "isperson", "datatype": dbt.type_string()},
12 | {"name": "parent", "datatype": dbt.type_int()},
13 | {"name": "project", "datatype": dbt.type_int()},
14 | {"name": "type", "datatype": dbt.type_string()},
15 | {"name": "vendor", "datatype": dbt.type_int()}
16 | ] %}
17 |
18 | {{ fivetran_utils.add_pass_through_columns(columns, var('entities_pass_through_columns')) }}
19 |
20 | {{ return(columns) }}
21 |
22 | {% endmacro %}
23 |
--------------------------------------------------------------------------------
/macros/get_entityaddress_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_entityaddress_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
6 | {"name": "addr1", "datatype": dbt.type_string()},
7 | {"name": "addr2", "datatype": dbt.type_string()},
8 | {"name": "addr3", "datatype": dbt.type_string()},
9 | {"name": "addressee", "datatype": dbt.type_string()},
10 | {"name": "addrphone", "datatype": dbt.type_string()},
11 | {"name": "addrtext", "datatype": dbt.type_string()},
12 | {"name": "attention", "datatype": dbt.type_string()},
13 | {"name": "city", "datatype": dbt.type_string()},
14 | {"name": "country", "datatype": dbt.type_string()},
15 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
16 | {"name": "dropdownstate", "datatype": dbt.type_string()},
17 | {"name": "lastmodifieddate", "datatype": dbt.type_timestamp()},
18 | {"name": "nkey", "datatype": dbt.type_int()},
19 | {"name": "override", "datatype": dbt.type_string()},
20 | {"name": "recordowner", "datatype": dbt.type_int()},
21 | {"name": "state", "datatype": dbt.type_string()},
22 | {"name": "zip", "datatype": dbt.type_string()}
23 | ] %}
24 |
25 | {{ return(columns) }}
26 |
27 | {% endmacro %}
28 |
--------------------------------------------------------------------------------
/macros/get_expense_accounts_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_expense_accounts_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
6 | {"name": "account_number", "datatype": dbt.type_string()},
7 | {"name": "comments", "datatype": dbt.type_string()},
8 | {"name": "current_balance", "datatype": dbt.type_float()},
9 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
10 | {"name": "date_last_modified", "datatype": dbt.type_timestamp()},
11 | {"name": "desription", "datatype": dbt.type_string()},
12 | {"name": "expense_account_extid", "datatype": dbt.type_string()},
13 | {"name": "expense_account_id", "datatype": dbt.type_float()},
14 | {"name": "full_name", "datatype": dbt.type_string()},
15 | {"name": "is_including_child_subs", "datatype": dbt.type_string()},
16 | {"name": "is_summary", "datatype": dbt.type_string()},
17 | {"name": "isinactive", "datatype": dbt.type_string()},
18 | {"name": "legal_name", "datatype": dbt.type_string()},
19 | {"name": "name", "datatype": dbt.type_string()},
20 | {"name": "parent_id", "datatype": dbt.type_float()}
21 | ] %}
22 |
23 | {{ return(columns) }}
24 |
25 | {% endmacro %}
26 |
--------------------------------------------------------------------------------
/macros/get_fiscalcalendar_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_fiscalcalendar_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "id", "datatype": dbt.type_int()},
5 | {"name": "externalid", "datatype": dbt.type_string()},
6 | {"name": "fiscalmonth", "datatype": dbt.type_string()},
7 | {"name": "isdefault", "datatype": dbt.type_string()},
8 | {"name": "name", "datatype": dbt.type_string()},
9 | {"name": "_fivetran_deleted", "datatype": "boolean"},
10 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
11 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}
12 | ] %}
13 |
14 | {{ return(columns) }}
15 |
16 | {% endmacro %}
17 |
--------------------------------------------------------------------------------
/macros/get_income_accounts_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_income_accounts_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
6 | {"name": "account_number", "datatype": dbt.type_string()},
7 | {"name": "comments", "datatype": dbt.type_string()},
8 | {"name": "current_balance", "datatype": dbt.type_float()},
9 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
10 | {"name": "date_last_modified", "datatype": dbt.type_timestamp()},
11 | {"name": "desription", "datatype": dbt.type_string()},
12 | {"name": "full_name", "datatype": dbt.type_string()},
13 | {"name": "income_account_extid", "datatype": dbt.type_string()},
14 | {"name": "income_account_id", "datatype": dbt.type_float()},
15 | {"name": "is_including_child_subs", "datatype": dbt.type_string()},
16 | {"name": "is_summary", "datatype": dbt.type_string()},
17 | {"name": "isinactive", "datatype": dbt.type_string()},
18 | {"name": "legal_name", "datatype": dbt.type_string()},
19 | {"name": "name", "datatype": dbt.type_string()},
20 | {"name": "parent_id", "datatype": dbt.type_float()}
21 | ] %}
22 |
23 | {{ return(columns) }}
24 |
25 | {% endmacro %}
26 |
--------------------------------------------------------------------------------
/macros/get_job_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_job_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
6 | {"name": "accountnumber", "datatype": dbt.type_string()},
7 | {"name": "actualtime", "datatype": dbt.type_float()},
8 | {"name": "allowallresourcesfortasks", "datatype": dbt.type_string()},
9 | {"name": "allowexpenses", "datatype": dbt.type_string()},
10 | {"name": "allowtime", "datatype": dbt.type_string()},
11 | {"name": "alternatecontact", "datatype": dbt.type_string()},
12 | {"name": "altname", "datatype": dbt.type_string()},
13 | {"name": "billingschedule", "datatype": dbt.type_int()},
14 | {"name": "calculatedenddate", "datatype": dbt.type_timestamp()},
15 | {"name": "calculatedenddatebaseline", "datatype": dbt.type_timestamp()},
16 | {"name": "category", "datatype": dbt.type_int()},
17 | {"name": "comments", "datatype": dbt.type_string()},
18 | {"name": "companyname", "datatype": dbt.type_string()},
19 | {"name": "contact", "datatype": dbt.type_int()},
20 | {"name": "contactlist", "datatype": dbt.type_string()},
21 | {"name": "currency", "datatype": dbt.type_int()},
22 | {"name": "currencyprecision", "datatype": dbt.type_int()},
23 | {"name": "custentity1", "datatype": dbt.type_string()},
24 | {"name": "custentity4", "datatype": dbt.type_string()},
25 | {"name": "custentity5", "datatype": dbt.type_int()},
26 | {"name": "customer", "datatype": dbt.type_int()},
27 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
28 | {"name": "datecreated", "datatype": dbt.type_timestamp()},
29 | {"name": "defaultbillingaddress", "datatype": dbt.type_int()},
30 | {"name": "defaultshippingaddress", "datatype": dbt.type_int()},
31 | {"name": "enddate", "datatype": dbt.type_timestamp()},
32 | {"name": "entityid", "datatype": dbt.type_string()},
33 | {"name": "entitynumber", "datatype": dbt.type_int()},
34 | {"name": "entitystatus", "datatype": dbt.type_int()},
35 | {"name": "entitytitle", "datatype": dbt.type_string()},
36 | {"name": "estimatedcost", "datatype": dbt.type_float()},
37 | {"name": "estimatedgrossprofit", "datatype": dbt.type_float()},
38 | {"name": "estimatedgrossprofitpercent", "datatype": dbt.type_float()},
39 | {"name": "estimatedlaborcost", "datatype": dbt.type_float()},
40 | {"name": "estimatedlaborcostbaseline", "datatype": dbt.type_float()},
41 | {"name": "estimatedlaborrevenue", "datatype": dbt.type_float()},
42 | {"name": "estimatedrevenue", "datatype": dbt.type_float()},
43 | {"name": "estimatedtime", "datatype": dbt.type_float()},
44 | {"name": "estimatedtimeoverride", "datatype": dbt.type_float()},
45 | {"name": "estimatedtimeoverridebaseline", "datatype": dbt.type_float()},
46 | {"name": "externalid", "datatype": dbt.type_string()},
47 | {"name": "files", "datatype": dbt.type_string()},
48 | {"name": "forecastchargerunondemand", "datatype": dbt.type_string()},
49 | {"name": "fxrate", "datatype": dbt.type_float()},
50 | {"name": "id", "datatype": dbt.type_int()},
51 | {"name": "includecrmtasksintotals", "datatype": dbt.type_string()},
52 | {"name": "isexempttime", "datatype": dbt.type_string()},
53 | {"name": "isinactive", "datatype": dbt.type_string()},
54 | {"name": "isproductivetime", "datatype": dbt.type_string()},
55 | {"name": "isutilizedtime", "datatype": dbt.type_string()},
56 | {"name": "jobbillingtype", "datatype": dbt.type_string()},
57 | {"name": "jobitem", "datatype": dbt.type_int()},
58 | {"name": "jobprice", "datatype": dbt.type_float()},
59 | {"name": "jobtype", "datatype": dbt.type_int()},
60 | {"name": "lastbaselinedate", "datatype": dbt.type_timestamp()},
61 | {"name": "lastmodifieddate", "datatype": dbt.type_timestamp()},
62 | {"name": "limittimetoassignees", "datatype": dbt.type_string()},
63 | {"name": "materializetime", "datatype": dbt.type_string()},
64 | {"name": "parent", "datatype": dbt.type_int()},
65 | {"name": "percentcomplete", "datatype": dbt.type_float()},
66 | {"name": "percenttimecomplete", "datatype": dbt.type_float()},
67 | {"name": "primarycontact", "datatype": dbt.type_string()},
68 | {"name": "projectedenddate", "datatype": dbt.type_timestamp()},
69 | {"name": "projectedenddatebaseline", "datatype": dbt.type_timestamp()},
70 | {"name": "projectmanager", "datatype": dbt.type_int()},
71 | {"name": "startdate", "datatype": dbt.type_timestamp()},
72 | {"name": "startdatebaseline", "datatype": dbt.type_timestamp()},
73 | {"name": "timeapproval", "datatype": dbt.type_int()},
74 | {"name": "timeremaining", "datatype": dbt.type_float()}
75 | ] %}
76 |
77 | {{ return(columns) }}
78 |
79 | {% endmacro %}
80 |
--------------------------------------------------------------------------------
/macros/get_locationmainaddress_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_locationmainaddress_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
6 | {"name": "addr1", "datatype": dbt.type_string()},
7 | {"name": "addr2", "datatype": dbt.type_string()},
8 | {"name": "addr3", "datatype": dbt.type_string()},
9 | {"name": "addressee", "datatype": dbt.type_string()},
10 | {"name": "addrphone", "datatype": dbt.type_string()},
11 | {"name": "addrtext", "datatype": dbt.type_string()},
12 | {"name": "attention", "datatype": dbt.type_string()},
13 | {"name": "city", "datatype": dbt.type_string()},
14 | {"name": "country", "datatype": dbt.type_string()},
15 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
16 | {"name": "dropdownstate", "datatype": dbt.type_string()},
17 | {"name": "lastmodifieddate", "datatype": dbt.type_timestamp()},
18 | {"name": "nkey", "datatype": dbt.type_int()},
19 | {"name": "override", "datatype": dbt.type_string()},
20 | {"name": "recordowner", "datatype": dbt.type_int()},
21 | {"name": "state", "datatype": dbt.type_string()},
22 | {"name": "zip", "datatype": dbt.type_string()}
23 | ] %}
24 |
25 | {{ return(columns) }}
26 |
27 | {% endmacro %}
28 |
--------------------------------------------------------------------------------
/macros/get_locations_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_locations_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
6 | {"name": "city", "datatype": dbt.type_string()},
7 | {"name": "country", "datatype": dbt.type_string()},
8 | {"name": "full_name", "datatype": dbt.type_string()},
9 | {"name": "location_id", "datatype": dbt.type_float()},
10 | {"name": "name", "datatype": dbt.type_string()}
11 | ] %}
12 |
13 | {{ fivetran_utils.add_pass_through_columns(columns, var('locations_pass_through_columns')) }}
14 |
15 | {{ return(columns) }}
16 |
17 | {% endmacro %}
18 |
19 | {% macro get_netsuite2_locations_columns() %}
20 |
21 | {% set columns = [
22 | {"name": "_fivetran_deleted", "datatype": "boolean"},
23 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
24 | {"name": "id", "datatype": dbt.type_int()},
25 | {"name": "name", "datatype": dbt.type_string()},
26 | {"name": "fullname", "datatype": dbt.type_string()},
27 | {"name": "mainaddress", "datatype": dbt.type_int()},
28 | {"name": "parent", "datatype": dbt.type_int()},
29 | {"name": "subsidiary", "datatype": dbt.type_string()}
30 | ] %}
31 |
32 | {{ fivetran_utils.add_pass_through_columns(columns, var('locations_pass_through_columns')) }}
33 |
34 | {{ return(columns) }}
35 |
36 | {% endmacro %}
37 |
--------------------------------------------------------------------------------
/macros/get_subsidiaries_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_subsidiaries_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
6 | {"name": "address", "datatype": dbt.type_string()},
7 | {"name": "address1", "datatype": dbt.type_string()},
8 | {"name": "address2", "datatype": dbt.type_string()},
9 | {"name": "base_currency_id", "datatype": dbt.type_float()},
10 | {"name": "branch_id", "datatype": dbt.type_string()},
11 | {"name": "brn", "datatype": dbt.type_string()},
12 | {"name": "city", "datatype": dbt.type_string()},
13 | {"name": "country", "datatype": dbt.type_string()},
14 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
15 | {"name": "date_last_modified", "datatype": dbt.type_timestamp()},
16 | {"name": "edition", "datatype": dbt.type_string()},
17 | {"name": "federal_number", "datatype": dbt.type_string()},
18 | {"name": "fiscal_calendar_id", "datatype": dbt.type_float()},
19 | {"name": "full_name", "datatype": dbt.type_string()},
20 | {"name": "is_elimination", "datatype": dbt.type_string()},
21 | {"name": "is_moss", "datatype": dbt.type_string()},
22 | {"name": "isinactive", "datatype": dbt.type_string()},
23 | {"name": "isinactive_bool", "datatype": dbt.type_string()},
24 | {"name": "legal_name", "datatype": dbt.type_string()},
25 | {"name": "moss_nexus_id", "datatype": dbt.type_float()},
26 | {"name": "name", "datatype": dbt.type_string()},
27 | {"name": "parent_id", "datatype": dbt.type_float()},
28 | {"name": "purchaseorderamount", "datatype": dbt.type_float()},
29 | {"name": "purchaseorderquantity", "datatype": dbt.type_float()},
30 | {"name": "purchaseorderquantitydiff", "datatype": dbt.type_float()},
31 | {"name": "receiptamount", "datatype": dbt.type_float()},
32 | {"name": "receiptquantity", "datatype": dbt.type_float()},
33 | {"name": "receiptquantitydiff", "datatype": dbt.type_float()},
34 | {"name": "return_address", "datatype": dbt.type_string()},
35 | {"name": "return_address1", "datatype": dbt.type_string()},
36 | {"name": "return_address2", "datatype": dbt.type_string()},
37 | {"name": "return_city", "datatype": dbt.type_string()},
38 | {"name": "return_country", "datatype": dbt.type_string()},
39 | {"name": "return_state", "datatype": dbt.type_string()},
40 | {"name": "return_zipcode", "datatype": dbt.type_string()},
41 | {"name": "shipping_address", "datatype": dbt.type_string()},
42 | {"name": "shipping_address1", "datatype": dbt.type_string()},
43 | {"name": "shipping_address2", "datatype": dbt.type_string()},
44 | {"name": "shipping_city", "datatype": dbt.type_string()},
45 | {"name": "shipping_country", "datatype": dbt.type_string()},
46 | {"name": "shipping_state", "datatype": dbt.type_string()},
47 | {"name": "shipping_zipcode", "datatype": dbt.type_string()},
48 | {"name": "state", "datatype": dbt.type_string()},
49 | {"name": "state_tax_number", "datatype": dbt.type_string()},
50 | {"name": "subnav__searchable_subsidiary", "datatype": dbt.type_float()},
51 | {"name": "subsidiary_extid", "datatype": dbt.type_string()},
52 | {"name": "subsidiary_id", "datatype": dbt.type_float()},
53 | {"name": "taxonomy_reference_id", "datatype": dbt.type_float()},
54 | {"name": "tran_num_prefix", "datatype": dbt.type_string()},
55 | {"name": "uen", "datatype": dbt.type_string()},
56 | {"name": "url", "datatype": dbt.type_string()},
57 | {"name": "zipcode", "datatype": dbt.type_string()}
58 | ] %}
59 |
60 | {{ fivetran_utils.add_pass_through_columns(columns, var('subsidiaries_pass_through_columns')) }}
61 |
62 | {{ return(columns) }}
63 |
64 | {% endmacro %}
65 |
66 | {% macro get_netsuite2_subsidiaries_columns() %}
67 |
68 | {% set columns = [
69 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
70 | {"name": "_fivetran_deleted", "datatype": "boolean"},
71 | {"name": "id", "datatype": dbt.type_int()},
72 | {"name": "name", "datatype": dbt.type_string()},
73 | {"name": "fullname", "datatype": dbt.type_string()},
74 | {"name": "email", "datatype": dbt.type_string()},
75 | {"name": "mainaddress", "datatype": dbt.type_int()},
76 | {"name": "country", "datatype": dbt.type_string()},
77 | {"name": "state", "datatype": dbt.type_string()},
78 | {"name": "fiscalcalendar", "datatype": dbt.type_int()},
79 | {"name": "parent", "datatype": dbt.type_int()},
80 | {"name": "iselimination", "datatype": dbt.type_string()},
81 | {"name": "currency", "datatype": dbt.type_int()}
82 | ] %}
83 |
84 | {{ fivetran_utils.add_pass_through_columns(columns, var('subsidiaries_pass_through_columns')) }}
85 |
86 | {{ return(columns) }}
87 |
88 | {% endmacro %}
89 |
--------------------------------------------------------------------------------
/macros/get_transaction_accounting_lines_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_netsuite2_transaction_accounting_lines_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
6 | {"name": "account", "datatype": dbt.type_int()},
7 | {"name": "accountingbook", "datatype": dbt.type_int()},
8 | {"name": "amount", "datatype": dbt.type_float()},
9 | {"name": "amountpaid", "datatype": dbt.type_float()},
10 | {"name": "amountunpaid", "datatype": dbt.type_float()},
11 | {"name": "credit", "datatype": dbt.type_float()},
12 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
13 | {"name": "debit", "datatype": dbt.type_float()},
14 | {"name": "exchangerate", "datatype": dbt.type_float()},
15 | {"name": "netamount", "datatype": dbt.type_float()},
16 | {"name": "paymentamountunused", "datatype": dbt.type_float()},
17 | {"name": "paymentamountused", "datatype": dbt.type_float()},
18 | {"name": "posting", "datatype": dbt.type_string()},
19 | {"name": "transaction", "datatype": dbt.type_int()},
20 | {"name": "transactionline", "datatype": dbt.type_int()}
21 | ] %}
22 |
23 | {{ return(columns) }}
24 |
25 | {% endmacro %}
26 |
--------------------------------------------------------------------------------
/macros/get_transaction_lines_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_transaction_lines_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "account_id", "datatype": dbt.type_float()},
5 | {"name": "amount", "datatype": dbt.type_float()},
6 | {"name": "class_id", "datatype": dbt.type_float()},
7 | {"name": "company_id", "datatype": dbt.type_float()},
8 | {"name": "department_id", "datatype": dbt.type_float()},
9 | {"name": "item_id", "datatype": dbt.type_float()},
10 | {"name": "location_id", "datatype": dbt.type_float()},
11 | {"name": "memo", "datatype": dbt.type_string()},
12 | {"name": "non_posting_line", "datatype": dbt.type_string()},
13 | {"name": "subsidiary_id", "datatype": dbt.type_float()},
14 | {"name": "transaction_id", "datatype": dbt.type_float()},
15 | {"name": "transaction_line_id", "datatype": dbt.type_float()}
16 | ] %}
17 |
18 | {{ fivetran_utils.add_pass_through_columns(columns, var('transaction_lines_pass_through_columns')) }}
19 |
20 | {{ return(columns) }}
21 |
22 | {% endmacro %}
23 |
24 | {% macro get_netsuite2_transaction_lines_columns() %}
25 |
26 | {% set columns = [
27 | {"name": "_fivetran_deleted", "datatype": "boolean"},
28 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
29 | {"name": "id", "datatype": dbt.type_int()},
30 | {"name": "transaction", "datatype": dbt.type_int()},
31 | {"name": "linesequencenumber", "datatype": dbt.type_int()},
32 | {"name": "memo", "datatype": dbt.type_string()},
33 | {"name": "entity", "datatype": dbt.type_int()},
34 | {"name": "item", "datatype": dbt.type_int()},
35 | {"name": "class", "datatype": dbt.type_int()},
36 | {"name": "location", "datatype": dbt.type_int()},
37 | {"name": "subsidiary", "datatype": dbt.type_int()},
38 | {"name": "department", "datatype": dbt.type_int()},
39 | {"name": "isclosed", "datatype": dbt.type_string()},
40 | {"name": "isbillable", "datatype": dbt.type_string()},
41 | {"name": "iscogs", "datatype": dbt.type_string()},
42 | {"name": "cleared", "datatype": dbt.type_string()},
43 | {"name": "commitmentfirm", "datatype": dbt.type_string()},
44 | {"name": "mainline", "datatype": dbt.type_string()},
45 | {"name": "taxline", "datatype": dbt.type_string()},
46 | {"name": "eliminate", "datatype": dbt.type_string()},
47 | {"name": "netamount", "datatype": dbt.type_float()}
48 | ] %}
49 |
50 | {{ fivetran_utils.add_pass_through_columns(columns, var('transaction_lines_pass_through_columns')) }}
51 |
52 | {{ return(columns) }}
53 |
54 | {% endmacro %}
55 |
--------------------------------------------------------------------------------
/macros/get_transactionaccountingline_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_transactionaccountingline_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
6 | {"name": "account", "datatype": dbt.type_int()},
7 | {"name": "accountingbook", "datatype": dbt.type_int()},
8 | {"name": "amount", "datatype": dbt.type_float()},
9 | {"name": "amountlinked", "datatype": dbt.type_float()},
10 | {"name": "amountpaid", "datatype": dbt.type_float()},
11 | {"name": "amountunpaid", "datatype": dbt.type_float()},
12 | {"name": "credit", "datatype": dbt.type_float()},
13 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
14 | {"name": "debit", "datatype": dbt.type_float()},
15 | {"name": "exchangerate", "datatype": dbt.type_float()},
16 | {"name": "netamount", "datatype": dbt.type_float()},
17 | {"name": "overheadparentitem", "datatype": dbt.type_int()},
18 | {"name": "paymentamountunused", "datatype": dbt.type_float()},
19 | {"name": "paymentamountused", "datatype": dbt.type_float()},
20 | {"name": "posting", "datatype": dbt.type_string()},
21 | {"name": "transaction", "datatype": dbt.type_int()},
22 | {"name": "transactionline", "datatype": dbt.type_int()}
23 | ] %}
24 |
25 | {{ return(columns) }}
26 |
27 | {% endmacro %}
--------------------------------------------------------------------------------
/macros/get_transactions_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_transactions_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "accounting_period_id", "datatype": dbt.type_float()},
6 | {"name": "currency_id", "datatype": dbt.type_float()},
7 | {"name": "due_date", "datatype": dbt.type_timestamp()},
8 | {"name": "is_advanced_intercompany", "datatype": dbt.type_string()},
9 | {"name": "is_intercompany", "datatype": dbt.type_string()},
10 | {"name": "status", "datatype": dbt.type_string()},
11 | {"name": "trandate", "datatype": dbt.type_timestamp()},
12 | {"name": "transaction_id", "datatype": dbt.type_float()},
13 | {"name": "transaction_type", "datatype": dbt.type_string()}
14 | ] %}
15 |
16 | {{ fivetran_utils.add_pass_through_columns(columns, var('transactions_pass_through_columns')) }}
17 |
18 | {{ return(columns) }}
19 |
20 | {% endmacro %}
21 |
22 | {% macro get_netsuite2_transactions_columns() %}
23 |
24 | {% set columns = [
25 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
26 | {"name": "id", "datatype": dbt.type_int()},
27 | {"name": "transactionnumber", "datatype": dbt.type_string()},
28 | {"name": "type", "datatype": dbt.type_string()},
29 | {"name": "memo", "datatype": dbt.type_string()},
30 | {"name": "trandate", "datatype": dbt.type_timestamp()},
31 | {"name": "status", "datatype": dbt.type_string()},
32 | {"name": "createdby", "datatype": dbt.type_int()},
33 | {"name": "createddate", "datatype": dbt.type_timestamp()},
34 | {"name": "duedate", "datatype": dbt.type_timestamp()},
35 | {"name": "closedate", "datatype": dbt.type_timestamp()},
36 | {"name": "currency", "datatype": dbt.type_int()},
37 | {"name": "entity", "datatype": dbt.type_int()},
38 | {"name": "lastmodifiedby", "datatype": dbt.type_int()},
39 | {"name": "postingperiod", "datatype": dbt.type_int()},
40 | {"name": "posting", "datatype": dbt.type_string()},
41 | {"name": "intercoadj", "datatype": dbt.type_string()},
42 | {"name": "isreversal", "datatype": dbt.type_string()},
43 | {"name": "reversal", "datatype": dbt.type_int()},
44 | {"name": "reversaldate", "datatype": dbt.type_timestamp()},
45 | {"name": "reversaldefer", "datatype": dbt.type_string()},
46 | {"name": "_fivetran_deleted", "datatype": "boolean"}
47 | ] %}
48 |
49 | {{ fivetran_utils.add_pass_through_columns(columns, var('transactions_pass_through_columns')) }}
50 |
51 | {{ return(columns) }}
52 |
53 | {% endmacro %}
--------------------------------------------------------------------------------
/macros/get_vendor_types_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_vendor_types_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
6 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
7 | {"name": "isinactive", "datatype": dbt.type_string()},
8 | {"name": "name", "datatype": dbt.type_string()},
9 | {"name": "parent_id", "datatype": dbt.type_float()},
10 | {"name": "vendor_type_extid", "datatype": dbt.type_string()},
11 | {"name": "vendor_type_id", "datatype": dbt.type_float()}
12 | ] %}
13 |
14 | {{ return(columns) }}
15 |
16 | {% endmacro %}
17 |
--------------------------------------------------------------------------------
/macros/get_vendorcategory_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_vendorcategory_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
6 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
7 | {"name": "externalid", "datatype": dbt.type_string()},
8 | {"name": "id", "datatype": dbt.type_int()},
9 | {"name": "isinactive", "datatype": dbt.type_string()},
10 | {"name": "istaxagency", "datatype": dbt.type_string()},
11 | {"name": "lastmodifieddate", "datatype": dbt.type_timestamp()},
12 | {"name": "name", "datatype": dbt.type_string()}
13 | ] %}
14 |
15 | {{ return(columns) }}
16 |
17 | {% endmacro %}
18 |
--------------------------------------------------------------------------------
/macros/get_vendors_columns.sql:
--------------------------------------------------------------------------------
1 | {% macro get_vendors_columns() %}
2 |
3 | {% set columns = [
4 | {"name": "_fivetran_deleted", "datatype": "boolean"},
5 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
6 | {"name": "account_owner", "datatype": dbt.type_string()},
7 | {"name": "accountnumber", "datatype": dbt.type_string()},
8 | {"name": "accounts_email", "datatype": dbt.type_string()},
9 | {"name": "annual_revenue", "datatype": dbt.type_float()},
10 | {"name": "auto_renewals", "datatype": dbt.type_string()},
11 | {"name": "auto_send_statements", "datatype": dbt.type_string()},
12 | {"name": "billaddress", "datatype": dbt.type_string()},
13 | {"name": "billing_class_id", "datatype": dbt.type_float()},
14 | {"name": "city", "datatype": dbt.type_string()},
15 | {"name": "comments", "datatype": dbt.type_string()},
16 | {"name": "companyname", "datatype": dbt.type_string()},
17 | {"name": "country", "datatype": dbt.type_string()},
18 | {"name": "create_date", "datatype": dbt.type_timestamp()},
19 | {"name": "creditlimit", "datatype": dbt.type_float()},
20 | {"name": "currency_id", "datatype": dbt.type_float()},
21 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
22 | {"name": "date_last_modified", "datatype": dbt.type_timestamp()},
23 | {"name": "dic", "datatype": dbt.type_string()},
24 | {"name": "email", "datatype": dbt.type_string()},
25 | {"name": "email_bill_payment_vouchers", "datatype": dbt.type_string()},
26 | {"name": "email_cash_sales", "datatype": dbt.type_string()},
27 | {"name": "email_credit_notes", "datatype": dbt.type_string()},
28 | {"name": "email_invoices", "datatype": dbt.type_string()},
29 | {"name": "email_item_fulfilments", "datatype": dbt.type_string()},
30 | {"name": "email_purchase_orders", "datatype": dbt.type_string()},
31 | {"name": "email_quotes", "datatype": dbt.type_string()},
32 | {"name": "email_sales_orders", "datatype": dbt.type_string()},
33 | {"name": "email_statements", "datatype": dbt.type_string()},
34 | {"name": "employee_number", "datatype": dbt.type_string()},
35 | {"name": "exemption_certificate_no", "datatype": dbt.type_string()},
36 | {"name": "expense_account_id", "datatype": dbt.type_float()},
37 | {"name": "fax", "datatype": dbt.type_string()},
38 | {"name": "full_name", "datatype": dbt.type_string()},
39 | {"name": "home_phone", "datatype": dbt.type_string()},
40 | {"name": "hris_id", "datatype": dbt.type_string()},
41 | {"name": "ico", "datatype": dbt.type_string()},
42 | {"name": "id_number_in_the_country_of_r", "datatype": dbt.type_string()},
43 | {"name": "id_type_in_the_country_of_r_id", "datatype": dbt.type_float()},
44 | {"name": "in_transit_balance", "datatype": dbt.type_float()},
45 | {"name": "incoterm", "datatype": dbt.type_string()},
46 | {"name": "industry_id", "datatype": dbt.type_float()},
47 | {"name": "invoice_via_procurement_syste", "datatype": dbt.type_string()},
48 | {"name": "invoicing_details", "datatype": dbt.type_string()},
49 | {"name": "is1099eligible", "datatype": dbt.type_string()},
50 | {"name": "is_partner", "datatype": dbt.type_string()},
51 | {"name": "is_person", "datatype": dbt.type_string()},
52 | {"name": "isemailhtml", "datatype": dbt.type_string()},
53 | {"name": "isemailpdf", "datatype": dbt.type_string()},
54 | {"name": "isinactive", "datatype": dbt.type_string()},
55 | {"name": "labor_cost", "datatype": dbt.type_float()},
56 | {"name": "last_modified_date", "datatype": dbt.type_timestamp()},
57 | {"name": "last_sales_activity", "datatype": dbt.type_timestamp()},
58 | {"name": "line1", "datatype": dbt.type_string()},
59 | {"name": "line2", "datatype": dbt.type_string()},
60 | {"name": "line3", "datatype": dbt.type_string()},
61 | {"name": "loginaccess", "datatype": dbt.type_string()},
62 | {"name": "lsa_link", "datatype": dbt.type_string()},
63 | {"name": "lsa_link_name", "datatype": dbt.type_string()},
64 | {"name": "mobile_phone", "datatype": dbt.type_string()},
65 | {"name": "msa_effective_date", "datatype": dbt.type_timestamp()},
66 | {"name": "name", "datatype": dbt.type_string()},
67 | {"name": "no__of_employees", "datatype": dbt.type_float()},
68 | {"name": "openbalance", "datatype": dbt.type_float()},
69 | {"name": "openbalance_foreign", "datatype": dbt.type_float()},
70 | {"name": "payables_account_id", "datatype": dbt.type_float()},
71 | {"name": "payment_terms_id", "datatype": dbt.type_float()},
72 | {"name": "phone", "datatype": dbt.type_string()},
73 | {"name": "prepayment_balance", "datatype": dbt.type_float()},
74 | {"name": "printoncheckas", "datatype": dbt.type_string()},
75 | {"name": "purchaseorderamount", "datatype": dbt.type_float()},
76 | {"name": "purchaseorderquantity", "datatype": dbt.type_float()},
77 | {"name": "purchaseorderquantitydiff", "datatype": dbt.type_float()},
78 | {"name": "purchases_email", "datatype": dbt.type_string()},
79 | {"name": "receiptamount", "datatype": dbt.type_float()},
80 | {"name": "receiptquantity", "datatype": dbt.type_float()},
81 | {"name": "receiptquantitydiff", "datatype": dbt.type_float()},
82 | {"name": "represents_subsidiary_id", "datatype": dbt.type_float()},
83 | {"name": "restrict_access_to_expensify", "datatype": dbt.type_string()},
84 | {"name": "salesforce_id", "datatype": dbt.type_string()},
85 | {"name": "shipaddress", "datatype": dbt.type_string()},
86 | {"name": "shipping_email", "datatype": dbt.type_string()},
87 | {"name": "state", "datatype": dbt.type_string()},
88 | {"name": "subsidiary", "datatype": dbt.type_float()},
89 | {"name": "tax_contact_first_name", "datatype": dbt.type_string()},
90 | {"name": "tax_contact_id", "datatype": dbt.type_float()},
91 | {"name": "tax_contact_last_name", "datatype": dbt.type_string()},
92 | {"name": "tax_contact_middle_name", "datatype": dbt.type_string()},
93 | {"name": "tax_number", "datatype": dbt.type_string()},
94 | {"name": "taxidnum", "datatype": dbt.type_string()},
95 | {"name": "time_approver_id", "datatype": dbt.type_float()},
96 | {"name": "transactions_need_approval", "datatype": dbt.type_string()},
97 | {"name": "uen", "datatype": dbt.type_string()},
98 | {"name": "unbilled_orders", "datatype": dbt.type_float()},
99 | {"name": "unbilled_orders_foreign", "datatype": dbt.type_float()},
100 | {"name": "url", "datatype": dbt.type_string()},
101 | {"name": "vat_registration_no", "datatype": dbt.type_string()},
102 | {"name": "vendor_extid", "datatype": dbt.type_string()},
103 | {"name": "vendor_id", "datatype": dbt.type_float()},
104 | {"name": "vendor_type_id", "datatype": dbt.type_float()},
105 | {"name": "zipcode", "datatype": dbt.type_string()}
106 | ] %}
107 |
108 | {{ fivetran_utils.add_pass_through_columns(columns, var('vendors_pass_through_columns')) }}
109 |
110 | {{ return(columns) }}
111 |
112 | {% endmacro %}
113 |
114 | {% macro get_netsuite2_vendors_columns() %}
115 |
116 | {% set columns = [
117 | {"name": "_fivetran_deleted", "datatype": "boolean"},
118 | {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()},
119 | {"name": "accountnumber", "datatype": dbt.type_string()},
120 | {"name": "altemail", "datatype": dbt.type_string()},
121 | {"name": "altname", "datatype": dbt.type_string()},
122 | {"name": "altphone", "datatype": dbt.type_string()},
123 | {"name": "balance", "datatype": dbt.type_float()},
124 | {"name": "balanceprimary", "datatype": dbt.type_float()},
125 | {"name": "billingclass", "datatype": dbt.type_int()},
126 | {"name": "category", "datatype": dbt.type_int()},
127 | {"name": "comments", "datatype": dbt.type_string()},
128 | {"name": "companyname", "datatype": dbt.type_string()},
129 | {"name": "contact", "datatype": dbt.type_int()},
130 | {"name": "contactlist", "datatype": dbt.type_string()},
131 | {"name": "creditlimit", "datatype": dbt.type_float()},
132 | {"name": "currency", "datatype": dbt.type_int()},
133 | {"name": "date_deleted", "datatype": dbt.type_timestamp()},
134 | {"name": "datecreated", "datatype": dbt.type_timestamp()},
135 | {"name": "defaultbankaccount", "datatype": dbt.type_int()},
136 | {"name": "defaultbillingaddress", "datatype": dbt.type_int()},
137 | {"name": "defaultshippingaddress", "datatype": dbt.type_int()},
138 | {"name": "defaultvendorpaymentaccount", "datatype": dbt.type_int()},
139 | {"name": "email", "datatype": dbt.type_string()},
140 | {"name": "emailpreference", "datatype": dbt.type_string()},
141 | {"name": "emailtransactions", "datatype": dbt.type_string()},
142 | {"name": "entityid", "datatype": dbt.type_string()},
143 | {"name": "entitynumber", "datatype": dbt.type_int()},
144 | {"name": "entitytitle", "datatype": dbt.type_string()},
145 | {"name": "expenseaccount", "datatype": dbt.type_int()},
146 | {"name": "externalid", "datatype": dbt.type_string()},
147 | {"name": "fax", "datatype": dbt.type_string()},
148 | {"name": "faxtransactions", "datatype": dbt.type_string()},
149 | {"name": "firstname", "datatype": dbt.type_string()},
150 | {"name": "giveaccess", "datatype": dbt.type_string()},
151 | {"name": "homephone", "datatype": dbt.type_string()},
152 | {"name": "id", "datatype": dbt.type_int()},
153 | {"name": "incoterm", "datatype": dbt.type_int()},
154 | {"name": "isautogeneratedrepresentingentity", "datatype": dbt.type_string()},
155 | {"name": "isinactive", "datatype": dbt.type_string()},
156 | {"name": "isjobresourcevend", "datatype": dbt.type_string()},
157 | {"name": "isperson", "datatype": dbt.type_string()},
158 | {"name": "laborcost", "datatype": dbt.type_float()},
159 | {"name": "lastmodifieddate", "datatype": dbt.type_timestamp()},
160 | {"name": "lastname", "datatype": dbt.type_string()},
161 | {"name": "legalname", "datatype": dbt.type_string()},
162 | {"name": "middlename", "datatype": dbt.type_string()},
163 | {"name": "mobilephone", "datatype": dbt.type_string()},
164 | {"name": "payablesaccount", "datatype": dbt.type_int()},
165 | {"name": "phone", "datatype": dbt.type_string()},
166 | {"name": "printoncheckas", "datatype": dbt.type_string()},
167 | {"name": "printtransactions", "datatype": dbt.type_string()},
168 | {"name": "purchaseorderamount", "datatype": dbt.type_float()},
169 | {"name": "purchaseorderquantity", "datatype": dbt.type_float()},
170 | {"name": "purchaseorderquantitydiff", "datatype": dbt.type_float()},
171 | {"name": "receiptamount", "datatype": dbt.type_float()},
172 | {"name": "receiptquantity", "datatype": dbt.type_float()},
173 | {"name": "receiptquantitydiff", "datatype": dbt.type_float()},
174 | {"name": "representingsubsidiary", "datatype": dbt.type_int()},
175 | {"name": "rolesforsearch", "datatype": dbt.type_string()},
176 | {"name": "salutation", "datatype": dbt.type_string()},
177 | {"name": "subsidiaryedition", "datatype": dbt.type_string()},
178 | {"name": "terms", "datatype": dbt.type_int()},
179 | {"name": "title", "datatype": dbt.type_string()},
180 | {"name": "unbilledorders", "datatype": dbt.type_float()},
181 | {"name": "unbilledordersprimary", "datatype": dbt.type_float()},
182 | {"name": "url", "datatype": dbt.type_string()},
183 | {"name": "workcalendar", "datatype": dbt.type_int()}
184 | ] %}
185 |
186 | {{ fivetran_utils.add_pass_through_columns(columns, var('vendors_pass_through_columns')) }}
187 |
188 | {{ return(columns) }}
189 |
190 | {% endmacro %}
191 |
--------------------------------------------------------------------------------
/models/docs.md:
--------------------------------------------------------------------------------
1 | # Table Definitions
2 |
3 | {% docs account_periods_table %} Table detailing all accounting periods, including monthly, quarterly and yearly. {% enddocs %}
4 |
5 | {% docs accounting_books_table %} Table detailing all accounting books set up in Netsuite. {% enddocs %}
6 |
7 | {% docs accounts_table %} Table detailing all accounts set up in Netsuite. {% enddocs %}
8 |
9 | {% docs classes_table %} Table detailing all classes set up in Netsuite. {% enddocs %}
10 |
11 | {% docs consolidated_exchange_rates_table %} Table detailing average, historical and current exchange rates for all accounting periods. {% enddocs %}
12 |
13 | {% docs customers_table %} Table detailing all customer information. {% enddocs %}
14 |
15 | {% docs currencies_table %} Table detailing all currency information. {% enddocs %}
16 |
17 | {% docs departments_table %} Table detailing all departments set up in Netsuite. {% enddocs %}
18 |
19 | {% docs expense_accounts_table %} Table detailing all expense accounts. {% enddocs %}
20 |
21 | {% docs income_accounts_table %} Table detailing all income accounts. {% enddocs %}
22 |
23 | {% docs items_table %} Table detailing information about the items created in Netsuite. {% enddocs %}
24 |
25 | {% docs locations_table %} Table detailing all locations, including store, warehouse and office locations. {% enddocs %}
26 |
27 | {% docs subsidiaries_table %} Table detailing all subsidiaries. {% enddocs %}
28 |
29 | {% docs transaction_lines_table %} A table detailing all transaction lines for all transactions. {% enddocs %}
30 |
31 | {% docs transaction_table %} A table detailing all transactions. {% enddocs %}
32 |
33 | {% docs vendor_types_table %} A table detailing all the various types of vendors. {% enddocs %}
34 |
35 | {% docs vendor_table %} A table detailing all vendor information. {% enddocs %}
36 |
37 | {% docs entities_table %} Table detailing all entities in Netsuite. {% enddocs %}
38 |
39 | {% docs employee_table %} Table detailing all employees in Netsuite. {% enddocs %}
40 |
41 | {% docs jobs_table %} Table detailing all jobs. {% enddocs %}
42 |
43 | {% docs transaction_accounting_lines_table %} A table detailing all transaction lines for all transactions. {% enddocs %}
44 |
45 | {% docs vendor_categories_table %} A table containing categories and how they map to vendors. {% enddocs %}
46 |
47 | {% docs accounting_book_subsidiaries_table %} A table containing the various account books and the respective subsidiaries. {% enddocs %}
48 |
49 | {% docs accounting_period_fiscal_calendars_table %} A table containing the accounting fiscal calendar periods. {% enddocs %}
50 |
51 | {% docs account_types_table %} A table containing the various account types within Netsuite. {% enddocs %}
52 |
53 | {% docs entity_address_table %} A table containing addresses and the various entities which they map. {% enddocs %}
54 |
55 | {% docs location_main_address_table %} A table containing the location main addresses. {% enddocs %}
56 |
57 | # Field Definitions
58 | {% docs _fivetran_id %} Unique ID used by Fivetran to sync and dedupe data. {% enddocs %}
59 |
60 | {% docs _fivetran_synced %} Timestamp of when a record was last synced. {% enddocs %}
61 |
62 | {% docs _fivetran_deleted %} Timestamp of when a record was deleted. {% enddocs %}
63 |
64 | {% docs vendor_id %} The unique identifier of the vendor. {% enddocs %}
65 |
66 | {% docs alt_name %} Name of the person or company. {% enddocs %}
67 |
68 | {% docs company_name %} Name of the company. {% enddocs %}
69 |
70 | {% docs create_date_at %} Timestamp of the record creation. {% enddocs %}
71 |
72 | {% docs vendor_category_id %} Unique identifier of the vendor category. {% enddocs %}
73 |
74 | {% docs accounting_period_id %} The accounting period id of the accounting period which the transaction took place in. {% enddocs %}
75 |
76 | {% docs created_at %} Timestamp of when the record was created. {% enddocs %}
77 |
78 | {% docs currency_id %} The currency id of the currency used within the record. {% enddocs %}
79 |
80 | {% docs entity_id %} The entity id of the entity used for the record. {% enddocs %}
81 |
82 | {% docs employee_id %} The employee id of the employee used for the record. {% enddocs %}
83 |
84 | {% docs supervisor_id %} The employee id of the employee's supervisor used for the record. {% enddocs %}
85 |
86 | {% docs transaction_id %} The transaction id of referenced for the record. {% enddocs %}
87 |
88 | {% docs department_id %} The unique identifier of the department used for the record. {% enddocs %}
89 |
90 | {% docs subsidiary_id %} The unique identifier of the subsidiary used for the record. {% enddocs %}
91 |
92 | {% docs location_id %} The unique identifier of the location used for the record. {% enddocs %}
93 |
94 | {% docs class_id %} The unique identifier of the class used for the record. {% enddocs %}
95 |
96 | {% docs item_id %} The unique identifier of the item used within the record. {% enddocs %}
97 |
98 | {% docs fiscal_calendar_id %} Reference to the fiscal calendar used for the record. {% enddocs %}
99 |
100 | {% docs main_address_id %} Reference to the main address used for the record. {% enddocs %}
101 |
102 | {% docs addr1 %} The associated address 1. {% enddocs %}
103 |
104 | {% docs addr2 %} The associated address 2. {% enddocs %}
105 |
106 | {% docs addr3 %} The associated address 3. {% enddocs %}
107 |
108 | {% docs addressee %} The individual associated with the address {% enddocs %}
109 |
110 | {% docs full_address %} The full address associated. {% enddocs %}
111 |
112 | {% docs city %} The associated city. {% enddocs %}
113 |
114 | {% docs country %} The associated country. {% enddocs %}
115 |
116 | {% docs state %} The associated state. {% enddocs %}
117 |
118 | {% docs nkey %} The associated Netsuite key. {% enddocs %}
119 |
120 | {% docs zipcode %} The associated zipcode. {% enddocs %}
121 |
122 | {% docs customer_id %} Unique identifier of the customer. {% enddocs %}
123 |
124 | {% docs accounting_book_id %} Unique identifier of the accounting book. {% enddocs %}
125 |
126 | {% docs account_type_id %} Unique identifier of thea account type. {% enddocs %}
--------------------------------------------------------------------------------
/models/netsuite/stg_netsuite__accounting_books.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite__accounting_books_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | /*
14 | The below macro is used to generate the correct SQL for package staging models. It takes a list of columns
15 | that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns
16 | in the source (source_columns from dbt_salesforce_source/macros/).
17 | For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).
18 | */
19 |
20 | {{
21 | fivetran_utils.fill_staging_columns(
22 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__accounting_books_tmp')),
23 | staging_columns=get_accounting_books_columns()
24 | )
25 | }}
26 |
27 | from base
28 | ),
29 |
30 | final as (
31 |
32 | select
33 | accounting_book_id,
34 | is_primary,
35 | _fivetran_deleted
36 |
37 | from fields
38 | )
39 |
40 | select *
41 | from final
42 | where not coalesce(_fivetran_deleted, false)
43 |
--------------------------------------------------------------------------------
/models/netsuite/stg_netsuite__accounting_periods.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite__accounting_periods_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | /*
14 | The below macro is used to generate the correct SQL for package staging models. It takes a list of columns
15 | that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns
16 | in the source (source_columns from dbt_salesforce_source/macros/).
17 | For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).
18 | */
19 |
20 | {{
21 | fivetran_utils.fill_staging_columns(
22 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__accounting_periods_tmp')),
23 | staging_columns=get_accounting_periods_columns()
24 | )
25 | }}
26 |
27 | from base
28 | ),
29 |
30 | final as (
31 |
32 | select
33 | accounting_period_id,
34 | name,
35 | full_name,
36 | fiscal_calendar_id,
37 | year_id,
38 | starting as starting_at,
39 | ending as ending_at,
40 | quarter,
41 | year_0,
42 | is_adjustment,
43 | closed as is_closed,
44 | _fivetran_deleted
45 |
46 | from fields
47 | )
48 |
49 | select *
50 | from final
51 | where not coalesce(_fivetran_deleted, false)
52 |
--------------------------------------------------------------------------------
/models/netsuite/stg_netsuite__accounts.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite__accounts_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | /*
14 | The below macro is used to generate the correct SQL for package staging models. It takes a list of columns
15 | that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns
16 | in the source (source_columns from dbt_salesforce_source/macros/).
17 | For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).
18 | */
19 |
20 | {{
21 | fivetran_utils.fill_staging_columns(
22 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__accounts_tmp')),
23 | staging_columns=get_accounts_columns()
24 | )
25 | }}
26 |
27 | from base
28 | ),
29 |
30 | final as (
31 |
32 | select
33 | account_id,
34 | parent_id,
35 | name,
36 | type_name,
37 | accountnumber as account_number,
38 | general_rate_type,
39 | is_leftside,
40 | is_balancesheet,
41 | _fivetran_deleted
42 |
43 | --The below macro adds the fields defined within your accounts_pass_through_columns variable into the staging model
44 | {{ netsuite_source.fill_pass_through_columns(var('accounts_pass_through_columns', [])) }}
45 |
46 | from fields
47 | )
48 |
49 | select *
50 | from final
51 |
--------------------------------------------------------------------------------
/models/netsuite/stg_netsuite__classes.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite__classes_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | /*
14 | The below macro is used to generate the correct SQL for package staging models. It takes a list of columns
15 | that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns
16 | in the source (source_columns from dbt_salesforce_source/macros/).
17 | For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).
18 | */
19 |
20 | {{
21 | fivetran_utils.fill_staging_columns(
22 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__classes_tmp')),
23 | staging_columns=get_classes_columns()
24 | )
25 | }}
26 |
27 | from base
28 | ),
29 |
30 | final as (
31 |
32 | select
33 | class_id,
34 | full_name,
35 | _fivetran_deleted
36 |
37 | --The below macro adds the fields defined within your classes_pass_through_columns variable into the staging model
38 | {{ netsuite_source.fill_pass_through_columns(var('classes_pass_through_columns', [])) }}
39 |
40 | from fields
41 | )
42 |
43 | select *
44 | from final
45 |
--------------------------------------------------------------------------------
/models/netsuite/stg_netsuite__consolidated_exchange_rates.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite__consolidated_exchange_rates_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | /*
14 | The below macro is used to generate the correct SQL for package staging models. It takes a list of columns
15 | that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns
16 | in the source (source_columns from dbt_salesforce_source/macros/).
17 | For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).
18 | */
19 |
20 | {{
21 | fivetran_utils.fill_staging_columns(
22 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__consolidated_exchange_rates_tmp')),
23 | staging_columns=get_consolidated_exchange_rates_columns()
24 | )
25 | }}
26 |
27 | from base
28 | ),
29 |
30 | final as (
31 |
32 | select
33 | consolidated_exchange_rate_id,
34 | accounting_book_id,
35 | accounting_period_id,
36 | average_rate,
37 | current_rate,
38 | historical_rate,
39 | from_subsidiary_id,
40 | to_subsidiary_id,
41 | _fivetran_deleted
42 |
43 | --The below macro adds the fields defined within your consolidated_exchange_rates_pass_through_columns variable into the staging model
44 | {{ netsuite_source.fill_pass_through_columns(var('consolidated_exchange_rates_pass_through_columns', [])) }}
45 |
46 | from fields
47 | )
48 |
49 | select *
50 | from final
51 | where not coalesce(_fivetran_deleted, false)
52 |
--------------------------------------------------------------------------------
/models/netsuite/stg_netsuite__currencies.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite__currencies_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | /*
14 | The below macro is used to generate the correct SQL for package staging models. It takes a list of columns
15 | that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns
16 | in the source (source_columns from dbt_salesforce_source/macros/).
17 | For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).
18 | */
19 |
20 | {{
21 | fivetran_utils.fill_staging_columns(
22 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__currencies_tmp')),
23 | staging_columns=get_currencies_columns()
24 | )
25 | }}
26 |
27 | from base
28 | ),
29 |
30 | final as (
31 |
32 | select
33 | currency_id,
34 | name,
35 | symbol,
36 | _fivetran_deleted
37 |
38 | from fields
39 | )
40 |
41 | select *
42 | from final
43 | where not coalesce(_fivetran_deleted, false)
44 |
--------------------------------------------------------------------------------
/models/netsuite/stg_netsuite__customers.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite__customers_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | /*
14 | The below macro is used to generate the correct SQL for package staging models. It takes a list of columns
15 | that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns
16 | in the source (source_columns from dbt_salesforce_source/macros/).
17 | For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).
18 | */
19 |
20 | {{
21 | fivetran_utils.fill_staging_columns(
22 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__customers_tmp')),
23 | staging_columns=get_customers_columns()
24 | )
25 | }}
26 |
27 | from base
28 | ),
29 |
30 | final as (
31 |
32 | select
33 | customer_id,
34 | companyname as company_name,
35 | customer_extid as customer_external_id,
36 | city,
37 | state,
38 | zipcode,
39 | country,
40 | date_first_order as date_first_order_at,
41 | _fivetran_deleted
42 |
43 | --The below macro adds the fields defined within your customers_pass_through_columns variable into the staging model
44 | {{ netsuite_source.fill_pass_through_columns(var('customers_pass_through_columns', [])) }}
45 |
46 |
47 | from fields
48 | )
49 |
50 | select *
51 | from final
52 | where not coalesce(_fivetran_deleted, false)
53 |
--------------------------------------------------------------------------------
/models/netsuite/stg_netsuite__departments.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite__departments_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | /*
14 | The below macro is used to generate the correct SQL for package staging models. It takes a list of columns
15 | that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns
16 | in the source (source_columns from dbt_salesforce_source/macros/).
17 | For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).
18 | */
19 |
20 | {{
21 | fivetran_utils.fill_staging_columns(
22 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__departments_tmp')),
23 | staging_columns=get_departments_columns()
24 | )
25 | }}
26 |
27 | from base
28 | ),
29 |
30 | final as (
31 |
32 | select
33 | department_id,
34 | name,
35 | full_name,
36 | _fivetran_deleted
37 |
38 | --The below macro adds the fields defined within your departments_pass_through_columns variable into the staging model
39 | {{ netsuite_source.fill_pass_through_columns(var('departments_pass_through_columns', [])) }}
40 |
41 | from fields
42 | )
43 |
44 | select *
45 | from final
46 |
--------------------------------------------------------------------------------
/models/netsuite/stg_netsuite__expense_accounts.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite__expense_accounts_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | /*
14 | The below macro is used to generate the correct SQL for package staging models. It takes a list of columns
15 | that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns
16 | in the source (source_columns from dbt_salesforce_source/macros/).
17 | For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).
18 | */
19 |
20 | {{
21 | fivetran_utils.fill_staging_columns(
22 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__expense_accounts_tmp')),
23 | staging_columns=get_expense_accounts_columns()
24 | )
25 | }}
26 |
27 | from base
28 | ),
29 |
30 | final as (
31 |
32 | select
33 | expense_account_id,
34 | name,
35 | parent_id,
36 | account_number,
37 | _fivetran_deleted
38 |
39 | from fields
40 | )
41 |
42 | select *
43 | from final
44 | where not coalesce(_fivetran_deleted, false)
45 |
--------------------------------------------------------------------------------
/models/netsuite/stg_netsuite__income_accounts.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite__income_accounts_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | /*
14 | The below macro is used to generate the correct SQL for package staging models. It takes a list of columns
15 | that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns
16 | in the source (source_columns from dbt_salesforce_source/macros/).
17 | For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).
18 | */
19 |
20 | {{
21 | fivetran_utils.fill_staging_columns(
22 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__income_accounts_tmp')),
23 | staging_columns=get_income_accounts_columns()
24 | )
25 | }}
26 |
27 | from base
28 | ),
29 |
30 | final as (
31 |
32 | select
33 | income_account_id,
34 | name,
35 | parent_id,
36 | account_number,
37 | _fivetran_deleted
38 |
39 | from fields
40 | )
41 |
42 | select *
43 | from final
44 | where not coalesce(_fivetran_deleted, false)
45 |
--------------------------------------------------------------------------------
/models/netsuite/stg_netsuite__items.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite__items_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | /*
14 | The below macro is used to generate the correct SQL for package staging models. It takes a list of columns
15 | that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns
16 | in the source (source_columns from dbt_salesforce_source/macros/).
17 | For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).
18 | */
19 |
20 | {{
21 | fivetran_utils.fill_staging_columns(
22 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__items_tmp')),
23 | staging_columns=get_items_columns()
24 | )
25 | }}
26 |
27 | from base
28 | ),
29 |
30 | final as (
31 |
32 | select
33 | item_id,
34 | name,
35 | type_name,
36 | salesdescription as sales_description,
37 | _fivetran_deleted
38 |
39 | --The below macro adds the fields defined within your items_pass_through_columns variable into the staging model
40 | {{ netsuite_source.fill_pass_through_columns(var('items_pass_through_columns', [])) }}
41 |
42 | from fields
43 | )
44 |
45 | select *
46 | from final
47 | where not coalesce(_fivetran_deleted, false)
48 |
--------------------------------------------------------------------------------
/models/netsuite/stg_netsuite__locations.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite__locations_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | /*
14 | The below macro is used to generate the correct SQL for package staging models. It takes a list of columns
15 | that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns
16 | in the source (source_columns from dbt_salesforce_source/macros/).
17 | For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).
18 | */
19 |
20 | {{
21 | fivetran_utils.fill_staging_columns(
22 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__locations_tmp')),
23 | staging_columns=get_locations_columns()
24 | )
25 | }}
26 |
27 | from base
28 | ),
29 |
30 | final as (
31 |
32 | select
33 | location_id,
34 | name,
35 | full_name,
36 | city,
37 | country,
38 | _fivetran_deleted
39 |
40 | --The below macro adds the fields defined within your locations_pass_through_columns variable into the staging model
41 | {{ netsuite_source.fill_pass_through_columns(var('locations_pass_through_columns', [])) }}
42 |
43 | from fields
44 | )
45 |
46 | select *
47 | from final
48 | where not coalesce(_fivetran_deleted, false)
49 |
--------------------------------------------------------------------------------
/models/netsuite/stg_netsuite__subsidiaries.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite__subsidiaries_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | /*
14 | The below macro is used to generate the correct SQL for package staging models. It takes a list of columns
15 | that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns
16 | in the source (source_columns from dbt_salesforce_source/macros/).
17 | For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).
18 | */
19 |
20 | {{
21 | fivetran_utils.fill_staging_columns(
22 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__subsidiaries_tmp')),
23 | staging_columns=get_subsidiaries_columns()
24 | )
25 | }}
26 |
27 | from base
28 | ),
29 |
30 | final as (
31 |
32 | select
33 | subsidiary_id,
34 | fiscal_calendar_id,
35 | full_name,
36 | name,
37 | parent_id,
38 | _fivetran_deleted
39 |
40 | --The below macro adds the fields defined within your subsidiaries_pass_through_columns variable into the staging model
41 | {{ netsuite_source.fill_pass_through_columns(var('subsidiaries_pass_through_columns', [])) }}
42 |
43 | from fields
44 | )
45 |
46 | select *
47 | from final
48 | where not coalesce(_fivetran_deleted, false)
49 |
50 |
--------------------------------------------------------------------------------
/models/netsuite/stg_netsuite__transaction_lines.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite__transaction_lines_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | /*
14 | The below macro is used to generate the correct SQL for package staging models. It takes a list of columns
15 | that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns
16 | in the source (source_columns from dbt_salesforce_source/macros/).
17 | For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).
18 | */
19 |
20 | {{
21 | fivetran_utils.fill_staging_columns(
22 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__transaction_lines_tmp')),
23 | staging_columns=get_transaction_lines_columns()
24 | )
25 | }}
26 |
27 | from base
28 | ),
29 |
30 | final as (
31 |
32 | select
33 | transaction_id,
34 | transaction_line_id,
35 | subsidiary_id,
36 | account_id,
37 | company_id,
38 | item_id,
39 | amount,
40 | non_posting_line,
41 | class_id,
42 | location_id,
43 | department_id,
44 | memo
45 |
46 | --The below macro adds the fields defined within your transaction_lines_pass_through_columns variable into the staging model
47 | {{ netsuite_source.fill_pass_through_columns(var('transaction_lines_pass_through_columns', [])) }}
48 |
49 | from fields
50 | )
51 |
52 | select *
53 | from final
54 |
--------------------------------------------------------------------------------
/models/netsuite/stg_netsuite__transactions.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite__transactions_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | /*
14 | The below macro is used to generate the correct SQL for package staging models. It takes a list of columns
15 | that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns
16 | in the source (source_columns from dbt_salesforce_source/macros/).
17 | For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).
18 | */
19 |
20 | {{
21 | fivetran_utils.fill_staging_columns(
22 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__transactions_tmp')),
23 | staging_columns=get_transactions_columns()
24 | )
25 | }}
26 |
27 | from base
28 | ),
29 |
30 | final as (
31 |
32 | select
33 | transaction_id,
34 | status,
35 | trandate as transaction_date,
36 | currency_id,
37 | accounting_period_id,
38 | due_date as due_date_at,
39 | transaction_type,
40 | is_intercompany,
41 | is_advanced_intercompany,
42 | _fivetran_deleted
43 |
44 | --The below macro adds the fields defined within your transactions_pass_through_columns variable into the staging model
45 | {{ netsuite_source.fill_pass_through_columns(var('transactions_pass_through_columns', [])) }}
46 |
47 | from fields
48 | )
49 |
50 | select *
51 | from final
52 | where not coalesce(_fivetran_deleted, false)
53 |
--------------------------------------------------------------------------------
/models/netsuite/stg_netsuite__vendor_types.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite__vendor_types_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | /*
14 | The below macro is used to generate the correct SQL for package staging models. It takes a list of columns
15 | that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns
16 | in the source (source_columns from dbt_salesforce_source/macros/).
17 | For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).
18 | */
19 |
20 | {{
21 | fivetran_utils.fill_staging_columns(
22 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__vendor_types_tmp')),
23 | staging_columns=get_vendor_types_columns()
24 | )
25 | }}
26 |
27 | from base
28 | ),
29 |
30 | final as (
31 |
32 | select
33 | vendor_type_id,
34 | name,
35 | _fivetran_deleted
36 |
37 | from fields
38 | )
39 |
40 | select *
41 | from final
42 | where not coalesce(_fivetran_deleted, false)
43 |
--------------------------------------------------------------------------------
/models/netsuite/stg_netsuite__vendors.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite__vendors_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | /*
14 | The below macro is used to generate the correct SQL for package staging models. It takes a list of columns
15 | that are expected/needed (staging_columns from dbt_salesforce_source/models/tmp/) and compares it with columns
16 | in the source (source_columns from dbt_salesforce_source/macros/).
17 | For more information refer to our dbt_fivetran_utils documentation (https://github.com/fivetran/dbt_fivetran_utils.git).
18 | */
19 |
20 | {{
21 | fivetran_utils.fill_staging_columns(
22 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite__vendors_tmp')),
23 | staging_columns=get_vendors_columns()
24 | )
25 | }}
26 |
27 | from base
28 | ),
29 |
30 | final as (
31 |
32 | select
33 | vendor_id,
34 | companyname as company_name,
35 | create_date as create_date_at,
36 | vendor_type_id,
37 | _fivetran_deleted
38 |
39 | --The below macro adds the fields defined within your vendors_pass_through_columns variable into the staging model
40 | {{ netsuite_source.fill_pass_through_columns(var('vendors_pass_through_columns', [])) }}
41 |
42 | from fields
43 | )
44 |
45 | select *
46 | from final
47 | where not coalesce(_fivetran_deleted, false)
48 |
--------------------------------------------------------------------------------
/models/netsuite/tmp/stg_netsuite__accounting_books_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | select *
4 | from {{ var('netsuite_accounting_books') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite/tmp/stg_netsuite__accounting_periods_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | select *
4 | from {{ var('netsuite_accounting_periods') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite/tmp/stg_netsuite__accounts_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | select *
4 | from {{ var('netsuite_accounts') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite/tmp/stg_netsuite__classes_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | select *
4 | from {{ var('netsuite_classes') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite/tmp/stg_netsuite__consolidated_exchange_rates_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | select *
4 | from {{ var('netsuite_consolidated_exchange_rates') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite/tmp/stg_netsuite__currencies_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | select *
4 | from {{ var('netsuite_currencies') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite/tmp/stg_netsuite__customers_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | select *
4 | from {{ var('netsuite_customers') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite/tmp/stg_netsuite__departments_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | select *
4 | from {{ var('netsuite_departments') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite/tmp/stg_netsuite__expense_accounts_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | select *
4 | from {{ var('netsuite_expense_accounts') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite/tmp/stg_netsuite__income_accounts_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | select *
4 | from {{ var('netsuite_income_accounts') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite/tmp/stg_netsuite__items_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | select *
4 | from {{ var('netsuite_items') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite/tmp/stg_netsuite__locations_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | select *
4 | from {{ var('netsuite_locations') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite/tmp/stg_netsuite__subsidiaries_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | select *
4 | from {{ var('netsuite_subsidiaries') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite/tmp/stg_netsuite__transaction_lines_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | select *
4 | from {{ var('netsuite_transaction_lines') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite/tmp/stg_netsuite__transactions_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | select *
4 | from {{ var('netsuite_transactions') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite/tmp/stg_netsuite__vendor_types_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | select *
4 | from {{ var('netsuite_vendor_types') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite/tmp/stg_netsuite__vendors_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == 'netsuite') }}
2 |
3 | select *
4 | from {{ var('netsuite_vendors') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__account_types.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__account_types_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__account_types_tmp')),
15 | staging_columns=get_accounttype_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | _fivetran_deleted,
25 | _fivetran_synced,
26 | id as account_type_id,
27 | balancesheet = 'T' as is_balancesheet,
28 | {%- if target.type == 'bigquery' -%}
29 | `left`
30 | {%- elif target.type == 'snowflake' -%}
31 | "LEFT"
32 | {%- elif target.type in ('redshift', 'postgres') -%}
33 | "left"
34 | {%- else -%}
35 | left
36 | {%- endif -%} = 'T' as is_leftside,
37 | longname as type_name
38 |
39 | from fields
40 | )
41 |
42 | select *
43 | from final
44 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__accounting_book_subsidiaries.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=(var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2') and var('netsuite2__multibook_accounting_enabled', true))) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__accounting_book_subsidiaries_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__accounting_book_subsidiaries_tmp')),
15 | staging_columns=get_accountingbooksubsidiaries_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | _fivetran_id,
25 | _fivetran_synced,
26 | accountingbook as accounting_book_id,
27 | status,
28 | subsidiary as subsidiary_id
29 |
30 | from fields
31 | where not coalesce(_fivetran_deleted, false)
32 | )
33 |
34 | select *
35 | from final
36 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__accounting_books.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=(var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2') and var('netsuite2__multibook_accounting_enabled', true))) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__accounting_books_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__accounting_books_tmp')),
15 | staging_columns=get_netsuite2_accounting_books_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | _fivetran_synced,
25 | id as accounting_book_id,
26 | name as accounting_book_name,
27 | basebook as base_book_id,
28 | effectiveperiod as effective_period_id,
29 | isadjustmentonly = 'T' as is_adjustment_only,
30 | isconsolidated = 'T' as is_consolidated,
31 | contingentrevenuehandling as is_contingent_revenue_handling,
32 | isprimary = 'T' as is_primary,
33 | twosteprevenueallocation as is_two_step_revenue_allocation
34 | from fields
35 | where not coalesce(_fivetran_deleted, false)
36 | )
37 |
38 | select *
39 | from final
40 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__accounting_period_fiscal_cal.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__accounting_period_fiscal_cal_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__accounting_period_fiscal_cal_tmp')),
15 | staging_columns=get_accountingperiodfiscalcalendars_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | _fivetran_id,
25 | _fivetran_synced,
26 | accountingperiod as accounting_period_id,
27 | fiscalcalendar as fiscal_calendar_id,
28 | parent as parent_id
29 | from fields
30 | where not coalesce(_fivetran_deleted, false)
31 | )
32 |
33 | select *
34 | from final
35 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__accounting_periods.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__accounting_periods_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | {{
14 | fivetran_utils.fill_staging_columns(
15 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__accounting_periods_tmp')),
16 | staging_columns=get_netsuite2_accounting_periods_columns()
17 | )
18 | }}
19 | from base
20 | ),
21 |
22 | final as (
23 |
24 | select
25 | _fivetran_synced,
26 | id as accounting_period_id,
27 | parent as parent_id,
28 | periodname as name,
29 | cast(startdate as date) as starting_at,
30 | cast(enddate as date) as ending_at,
31 | closedondate as closed_at,
32 | isquarter = 'T' as is_quarter,
33 | isyear = 'T' as is_year,
34 | isadjust = 'T' as is_adjustment,
35 | isposting = 'T' as is_posting,
36 | closed = 'T' as is_closed,
37 | alllocked = 'T' as is_all_locked,
38 | arlocked = 'T' as is_ar_locked,
39 | aplocked = 'T' as is_ap_locked
40 | from fields
41 | where not coalesce(_fivetran_deleted, false)
42 | )
43 |
44 | select *
45 | from final
46 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__accounts.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__accounts_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__accounts_tmp')),
15 | staging_columns=get_netsuite2_accounts_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | _fivetran_synced,
25 | id as account_id,
26 | externalid as account_external_id,
27 | parent as parent_id,
28 | acctnumber as account_number,
29 | accttype as account_type_id,
30 | sspecacct as special_account_type_id,
31 | fullname as name,
32 | accountsearchdisplaynamecopy as display_name,
33 | description as account_description,
34 | deferralacct as deferral_account_id,
35 | cashflowrate as cash_flow_rate_type,
36 | generalrate as general_rate_type,
37 | currency as currency_id,
38 | class as class_id,
39 | department as department_id,
40 | location as location_id,
41 | includechildren = 'T' as is_including_child_subs,
42 | isinactive = 'T' as is_inactive,
43 | issummary = 'T' as is_summary,
44 | eliminate = 'T' as is_eliminate,
45 | _fivetran_deleted
46 |
47 | --The below macro adds the fields defined within your accounts_pass_through_columns variable into the staging model
48 | {{ netsuite_source.fill_pass_through_columns(var('accounts_pass_through_columns', [])) }}
49 |
50 |
51 | from fields
52 | )
53 |
54 | select *
55 | from final
56 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__classes.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__classes_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__classes_tmp')),
15 | staging_columns=get_netsuite2_classes_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | _fivetran_synced,
25 | id as class_id,
26 | externalid as class_external_id,
27 | name,
28 | fullname as full_name,
29 | isinactive = 'T' as is_inactive,
30 | _fivetran_deleted
31 |
32 | --The below macro adds the fields defined within your classes_pass_through_columns variable into the staging model
33 | {{ netsuite_source.fill_pass_through_columns(var('classes_pass_through_columns', [])) }}
34 |
35 | from fields
36 | )
37 |
38 | select *
39 | from final
40 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__consolidated_exchange_rates.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=(var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2') and var('netsuite2__using_exchange_rate', true))) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__consolidated_exchange_rates_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__consolidated_exchange_rates_tmp')),
15 | staging_columns=get_netsuite2_consolidated_exchange_rates_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | id as consolidated_exchange_rate_id,
25 | postingperiod as accounting_period_id,
26 | fromcurrency as from_currency_id,
27 | fromsubsidiary as from_subsidiary_id,
28 | tocurrency as to_currency_id,
29 | tosubsidiary as to_subsidiary_id,
30 | accountingbook as accounting_book_id,
31 | currentrate as current_rate,
32 | averagerate as average_rate,
33 | historicalrate as historical_rate
34 |
35 | --The below macro adds the fields defined within your consolidated_exchange_rates_pass_through_columns variable into the staging model
36 | {{ netsuite_source.fill_pass_through_columns(var('consolidated_exchange_rates_pass_through_columns', [])) }}
37 |
38 | from fields
39 | where not coalesce(_fivetran_deleted, false)
40 | )
41 |
42 | select *
43 | from final
44 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__currencies.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__currencies_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__currencies_tmp')),
15 | staging_columns=get_netsuite2_currencies_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | _fivetran_synced,
25 | id as currency_id,
26 | name,
27 | symbol
28 | from fields
29 | where not coalesce(_fivetran_deleted, false)
30 | )
31 |
32 | select *
33 | from final
34 |
35 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__customers.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__customers_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__customers_tmp')),
15 | staging_columns=get_netsuite2_customers_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | id as customer_id,
25 | entityid as entity_id,
26 | externalid as customer_external_id,
27 | parent as parent_id,
28 | isperson = 'T' as is_person,
29 | altname as alt_name,
30 | companyname as company_name,
31 | firstname as first_name,
32 | lastname as last_name,
33 | email as email_address,
34 | phone as phone_number,
35 | defaultbillingaddress as default_billing_address_id,
36 | defaultshippingaddress as default_shipping_address_id,
37 | receivablesaccount as receivables_account_id,
38 | currency as currency_id,
39 | cast(firstorderdate as date) as date_first_order_at
40 |
41 | --The below macro adds the fields defined within your customers_pass_through_columns variable into the staging model
42 | {{ netsuite_source.fill_pass_through_columns(var('customers_pass_through_columns', [])) }}
43 |
44 | from fields
45 | where not coalesce(_fivetran_deleted, false)
46 | )
47 |
48 | select *
49 | from final
50 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__departments.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__departments_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__departments_tmp')),
15 | staging_columns=get_netsuite2_departments_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | _fivetran_synced,
25 | id as department_id,
26 | parent as parent_id,
27 | name,
28 | fullname as full_name,
29 | subsidiary as subsidiary_id,
30 | isinactive = 'T' as is_inactive,
31 | _fivetran_deleted
32 |
33 | --The below macro adds the fields defined within your departments_pass_through_columns variable into the staging model
34 | {{ netsuite_source.fill_pass_through_columns(var('departments_pass_through_columns', [])) }}
35 |
36 | from fields
37 | )
38 |
39 | select *
40 | from final
41 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__employees.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=(var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2') and var('netsuite2__using_employees', true))) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__employees_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__employees_tmp')),
15 | staging_columns=get_employee_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | _fivetran_synced,
25 | id as employee_id,
26 | entityid as entity_id,
27 | firstname as first_name,
28 | lastname as last_name,
29 | department as department_id,
30 | subsidiary as subsidiary_id,
31 | email,
32 | supervisor as supervisor_id,
33 | approvallimit as approval_limit,
34 | expenselimit as expense_limit,
35 | purchaseorderapprovallimit as purchase_order_approval_limit,
36 | purchaseorderlimit as purchase_order_limit,
37 | currency as currency_id,
38 | isinactive = 'T' as is_inactive
39 | from fields
40 | )
41 |
42 | select *
43 | from final
44 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__entities.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__entities_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__entities_tmp')),
15 | staging_columns=get_entity_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | _fivetran_synced,
25 | id as entity_id,
26 | parent as parent_id,
27 | entitytitle as entity_name,
28 | type as entity_type,
29 | isperson = 'T' as is_person,
30 | contact as contact_id,
31 | customer as customer_id,
32 | employee as employee_id,
33 | project as job_id,
34 | vendor as vendor_id
35 |
36 | --The below macro adds the fields defined within your entities_pass_through_columns variable into the staging model
37 | {{ netsuite_source.fill_pass_through_columns(var('entities_pass_through_columns', [])) }}
38 |
39 | from fields
40 | )
41 |
42 | select *
43 | from final
44 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__entity_address.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__entity_address_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__entity_address_tmp')),
15 | staging_columns=get_entityaddress_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | _fivetran_synced,
25 | addr1,
26 | addr2,
27 | addr3,
28 | addressee,
29 | addrtext as full_address,
30 | city,
31 | country,
32 | coalesce(state, dropdownstate) as state,
33 | nkey,
34 | zip as zipcode
35 | from fields
36 | where not coalesce(_fivetran_deleted, false)
37 | )
38 |
39 | select *
40 | from final
41 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__fiscal_calendar.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2') and var('netsuite2__fiscal_calendar_enabled', false)) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__fiscal_calendar_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__fiscal_calendar_tmp')),
15 | staging_columns=get_fiscalcalendar_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | id as fiscal_calendar_id,
25 | externalid as external_id,
26 | fiscalmonth as fiscal_month,
27 | isdefault as is_default,
28 | name,
29 | date_deleted,
30 | _fivetran_deleted,
31 | _fivetran_synced
32 | from fields
33 | where not coalesce(_fivetran_deleted, false)
34 | )
35 |
36 | select *
37 | from final
38 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__items.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__items_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | {{
14 | fivetran_utils.fill_staging_columns(
15 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__items_tmp')),
16 | staging_columns=get_netsuite2_items_columns()
17 | )
18 | }}
19 | from base
20 | ),
21 |
22 | final as (
23 |
24 | select
25 | _fivetran_synced,
26 | id as item_id,
27 | fullname as name,
28 | itemtype as type_name,
29 | description as sales_description,
30 | department as department_id,
31 | class as class_id,
32 | location as location_id,
33 | subsidiary as subsidiary_id,
34 | assetaccount as asset_account_id,
35 | expenseaccount as expense_account_id,
36 | gainlossaccount as gain_loss_account_id,
37 | incomeaccount as income_account_id,
38 | intercoexpenseaccount as interco_expense_account_id,
39 | intercoincomeaccount as interco_income_account_id,
40 | deferralaccount as deferred_expense_account_id,
41 | deferredrevenueaccount as deferred_revenue_account_id,
42 | parent as parent_item_id
43 |
44 | --The below macro adds the fields defined within your items_pass_through_columns variable into the staging model
45 | {{ netsuite_source.fill_pass_through_columns(var('items_pass_through_columns', [])) }}
46 |
47 | from fields
48 | where not coalesce(_fivetran_deleted, false)
49 | )
50 |
51 | select *
52 | from final
53 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__jobs.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=(var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2') and var('netsuite2__using_jobs', true))) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__jobs_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__jobs_tmp')),
15 | staging_columns=get_job_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | _fivetran_synced,
25 | id as job_id,
26 | externalid as job_external_id,
27 | customer as customer_id,
28 | entityid as entity_id,
29 | defaultbillingaddress as billing_address_id,
30 | defaultshippingaddress as shipping_address_id,
31 | parent as parent_id
32 | from fields
33 | )
34 |
35 | select *
36 | from final
37 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__location_main_address.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__location_main_address_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__location_main_address_tmp')),
15 | staging_columns=get_locationmainaddress_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | _fivetran_synced,
25 | addr1,
26 | addr2,
27 | addr3,
28 | addressee,
29 | addrtext as full_address,
30 | city,
31 | country,
32 | coalesce(state, dropdownstate) as state,
33 | nkey,
34 | zip as zipcode
35 | from fields
36 | where not coalesce(_fivetran_deleted, false)
37 | )
38 |
39 | select *
40 | from final
41 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__locations.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__locations_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__locations_tmp')),
15 | staging_columns=get_netsuite2_locations_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | _fivetran_synced,
25 | id as location_id,
26 | name,
27 | fullname as full_name,
28 | mainaddress as main_address_id,
29 | parent as parent_id,
30 | subsidiary as subsidiary_id
31 |
32 | --The below macro adds the fields defined within your locations_pass_through_columns variable into the staging model
33 | {{ netsuite_source.fill_pass_through_columns(var('locations_pass_through_columns', [])) }}
34 |
35 | from fields
36 | where not coalesce(_fivetran_deleted, false)
37 | )
38 |
39 | select *
40 | from final
41 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__subsidiaries.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__subsidiaries_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__subsidiaries_tmp')),
15 | staging_columns=get_netsuite2_subsidiaries_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | _fivetran_synced,
25 | id as subsidiary_id,
26 | name,
27 | fullname as full_name,
28 | email as email_address,
29 | mainaddress as main_address_id,
30 | country,
31 | state,
32 | fiscalcalendar as fiscal_calendar_id,
33 | parent as parent_id,
34 | iselimination = 'T' as is_elimination,
35 | currency as currency_id
36 |
37 | --The below macro adds the fields defined within your subsidiaries_pass_through_columns variable into the staging model
38 | {{ netsuite_source.fill_pass_through_columns(var('subsidiaries_pass_through_columns', [])) }}
39 |
40 | from fields
41 | where not coalesce(_fivetran_deleted, false)
42 | )
43 |
44 | select *
45 | from final
46 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__transaction_accounting_lines.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__transaction_accounting_lines_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__transaction_accounting_lines_tmp')),
15 | staging_columns=get_transactionaccountingline_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | _fivetran_deleted,
25 | _fivetran_synced,
26 | transaction as transaction_id,
27 | transactionline as transaction_line_id,
28 | accountingbook as accounting_book_id,
29 | account as account_id,
30 | posting = 'T' as is_posting,
31 | exchangerate as exchange_rate,
32 | amount,
33 | credit as credit_amount,
34 | debit as debit_amount,
35 | netamount as net_amount,
36 | amountpaid as paid_amount,
37 | amountunpaid as unpaid_amount
38 | from fields
39 | )
40 |
41 | select *
42 | from final
43 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__transaction_lines.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__transaction_lines_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__transaction_lines_tmp')),
15 | staging_columns=get_netsuite2_transaction_lines_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | _fivetran_synced,
25 | id as transaction_line_id,
26 | transaction as transaction_id,
27 | linesequencenumber as transaction_line_number,
28 | memo,
29 | entity as entity_id,
30 | item as item_id,
31 | class as class_id,
32 | location as location_id,
33 | subsidiary as subsidiary_id,
34 | department as department_id,
35 | isclosed = 'T' as is_closed,
36 | isbillable = 'T' as is_billable,
37 | iscogs = 'T' as is_cogs,
38 | cleared = 'T' as is_cleared,
39 | commitmentfirm = 'T' as is_commitment_firm,
40 | mainline = 'T' as is_main_line,
41 | taxline = 'T' as is_tax_line,
42 | eliminate = 'T' as is_eliminate,
43 | netamount
44 |
45 | --The below macro adds the fields defined within your transaction_lines_pass_through_columns variable into the staging model
46 | {{ netsuite_source.fill_pass_through_columns(var('transaction_lines_pass_through_columns', [])) }}
47 |
48 | from fields
49 | )
50 |
51 | select *
52 | from final
53 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__transactions.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__transactions_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__transactions_tmp')),
15 | staging_columns=get_netsuite2_transactions_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | _fivetran_synced,
25 | cast(_fivetran_synced as date) as _fivetran_synced_date,
26 | id as transaction_id,
27 | transactionnumber as transaction_number,
28 | type as transaction_type,
29 | memo,
30 | cast(trandate as date) as transaction_date,
31 | status,
32 | createddate as created_at,
33 | cast(duedate as date) as due_date_at,
34 | cast(closedate as date) as closed_at,
35 | currency as currency_id,
36 | entity as entity_id,
37 | postingperiod as accounting_period_id,
38 | posting = 'T' as is_posting,
39 | intercoadj = 'T' as is_intercompany_adjustment,
40 | isreversal = 'T' as is_reversal,
41 | reversal as reversal_transaction_id,
42 | cast(reversaldate as date) as reversal_date,
43 | reversaldefer = 'T' as is_reversal_defer
44 |
45 | --The below macro adds the fields defined within your transactions_pass_through_columns variable into the staging model
46 | {{ netsuite_source.fill_pass_through_columns(var('transactions_pass_through_columns', [])) }}
47 |
48 | from fields
49 | where not coalesce(_fivetran_deleted, false)
50 | )
51 |
52 | select *
53 | from final
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__vendor_categories.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=(var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2') and var('netsuite2__using_vendor_categories', true))) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__vendor_categories_tmp') }}
7 | ),
8 |
9 | fields as (
10 |
11 | select
12 | {{
13 | fivetran_utils.fill_staging_columns(
14 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__vendor_categories_tmp')),
15 | staging_columns=get_vendorcategory_columns()
16 | )
17 | }}
18 | from base
19 | ),
20 |
21 | final as (
22 |
23 | select
24 | id as vendor_category_id,
25 | name,
26 | _fivetran_synced
27 | from fields
28 | where not coalesce(_fivetran_deleted, false)
29 | )
30 |
31 | select *
32 | from final
33 |
--------------------------------------------------------------------------------
/models/netsuite2/stg_netsuite2__vendors.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | with base as (
4 |
5 | select *
6 | from {{ ref('stg_netsuite2__vendors_tmp') }}
7 |
8 | ),
9 |
10 | fields as (
11 |
12 | select
13 | {{
14 | fivetran_utils.fill_staging_columns(
15 | source_columns=adapter.get_columns_in_relation(ref('stg_netsuite2__vendors_tmp')),
16 | staging_columns=get_netsuite2_vendors_columns()
17 | )
18 | }}
19 | from base
20 | ),
21 |
22 | final as (
23 |
24 | select
25 | _fivetran_synced,
26 | id as vendor_id,
27 | altname as alt_name,
28 | companyname as company_name,
29 | datecreated as create_date_at,
30 | category as vendor_category_id
31 |
32 | --The below macro adds the fields defined within your vendors_pass_through_columns variable into the staging model
33 | {{ netsuite_source.fill_pass_through_columns(var('vendors_pass_through_columns', [])) }}
34 |
35 | from fields
36 | where not coalesce(_fivetran_deleted, false)
37 | )
38 |
39 | select *
40 | from final
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__account_types_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | select *
4 | from {{ var('netsuite2_account_types') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__accounting_book_subsidiaries_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=(var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2') and var('netsuite2__multibook_accounting_enabled', true))) }}
2 |
3 | select *
4 | from {{ var('netsuite2_accounting_book_subsidiaries') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__accounting_books_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=(var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2') and var('netsuite2__multibook_accounting_enabled', true))) }}
2 |
3 | select *
4 | from {{ var('netsuite2_accounting_books') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__accounting_period_fiscal_cal_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | select *
4 | from {{ var('netsuite2_accounting_period_fiscal_calendars') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__accounting_periods_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | select *
4 | from {{ var('netsuite2_accounting_periods') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__accounts_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | select *
4 | from {{ var('netsuite2_accounts') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__classes_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | select *
4 | from {{ var('netsuite2_classes') }}
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__consolidated_exchange_rates_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=(var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2') and var('netsuite2__using_exchange_rate', true))) }}
2 |
3 | select *
4 | from {{ var('netsuite2_consolidated_exchange_rates') }}
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__currencies_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | select *
4 | from {{ var('netsuite2_currencies') }}
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__customers_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | select *
4 | from {{ var('netsuite2_customers') }}
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__departments_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | select *
4 | from {{ var('netsuite2_departments') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__employees_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=(var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2') and var('netsuite2__using_employees', true))) }}
2 |
3 | select *
4 | from {{ var('netsuite2_employees') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__entities_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | select *
4 | from {{ var('netsuite2_entities') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__entity_address_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | select *
4 | from {{ var('netsuite2_entity_address') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__fiscal_calendar_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2') and var('netsuite2__fiscal_calendar_enabled', false)) }}
2 |
3 | select *
4 | from {{ var('netsuite2_fiscal_calendar') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__items_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | select *
4 | from {{ var('netsuite2_items') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__jobs_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=(var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2') and var('netsuite2__using_jobs', true))) }}
2 |
3 | select *
4 | from {{ var('netsuite2_jobs') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__location_main_address_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | select *
4 | from {{ var('netsuite2_location_main_address') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__locations_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | select *
4 | from {{ var('netsuite2_locations') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__subsidiaries_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | select *
4 | from {{ var('netsuite2_subsidiaries') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__transaction_accounting_lines_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | select *
4 | from {{ var('netsuite2_transaction_accounting_lines') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__transaction_lines_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | select *
4 | from {{ var('netsuite2_transaction_lines') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__transactions_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | select *
4 | from {{ var('netsuite2_transactions') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__vendor_categories_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=(var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2') and var('netsuite2__using_vendor_categories', true))) }}
2 |
3 | select *
4 | from {{ var('netsuite2_vendor_categories') }}
5 |
--------------------------------------------------------------------------------
/models/netsuite2/tmp/stg_netsuite2__vendors_tmp.sql:
--------------------------------------------------------------------------------
1 | {{ config(enabled=var('netsuite_data_model', 'netsuite') == var('netsuite_data_model_override','netsuite2')) }}
2 |
3 | select *
4 | from {{ var('netsuite2_vendors') }}
5 |
--------------------------------------------------------------------------------
/packages.yml:
--------------------------------------------------------------------------------
1 | packages:
2 | - package: fivetran/fivetran_utils
3 | version: [">=0.4.0", "<0.5.0"]
4 |
5 | - package: dbt-labs/spark_utils
6 | version: [">=0.3.0", "<0.4.0"]
--------------------------------------------------------------------------------