Fix fact_revenue to use settlement-date FX rates for USD conversion
harbor run -t snowflake-labs/dbt-exchange-rate-settlement-dateharbor download snowflake-labs/dbt-exchange-rate-settlement-dateFix the exchange-rate timing in the existing dbt model.
Update fact_revenue.sql to apply currency conversion using the payment settlement date (not the order date).
/app/dbt_models_duckdb/models/marts/finance/fact_revenue.sql/app/dbt_models_snowflake/models/marts/finance/fact_revenue.sqlThis task supports both DuckDB and Snowflake. Run echo $DB_TYPE in a shell BEFORE you write any code or spawn any subagents — the live env determines which backend the verifier runs against. Do NOT assume a default from this prose. Both /app/dbt_models_duckdb/ and /app/dbt_models_snowflake/ exist on disk; the verifier only checks the project matching the live $DB_TYPE.
DB_TYPE=duckdb$DUCKDB_PATH (default: /app/database/retail.duckdb)DB_TYPE=snowflakeSNOWFLAKE_ACCOUNTSNOWFLAKE_USERSNOWFLAKE_PASSWORDSNOWFLAKE_DATABASE - The clone database to useSNOWFLAKE_SCHEMASNOWFLAKE_WAREHOUSESNOWFLAKE_ROLE (optional)Note: For Snowflake, the entrypoint automatically creates a clone database and sets SNOWFLAKE_DATABASE. The clone is destroyed when the task completes.
You must configure dbt to connect to the database:
profiles.yml in the dbt project directory with profile name retail_dw_masterDBT_PROFILES_DIR environment variable to the directory containing profiles.ymlConfigure with type: duckdb and the database path from $DUCKDB_PATH.
Configure with type: snowflake using password authentication:
schema: to $SNOWFLAKE_SCHEMA — do NOT leave it blank. A blank or omitted schema makes Snowflake silently default to PUBLIC, so your models get built in the wrong schema and the verifier cannot find them.order_date as the settlement date.Add the following columns to fact_revenue:
| Column | Type | Description |
|---|---|---|
settlement_date |
DATE | Settlement date used for FX conversion |
fx_rate |
DECIMAL | Exchange rate used for conversion |
net_revenue_usd |
DECIMAL | net_revenue * fx_rate, rounded to 2 decimals |
total_revenue_usd |
DECIMAL | total_revenue * fx_rate, rounded to 2 decimals |
Maintain the existing grain of the revenue fact output while incorporating settlement date.