add hardcoded rates

This commit is contained in:
Pablo Martin 2024-03-12 11:22:20 +01:00
parent 49fba0667f
commit 05d8640417
2 changed files with 105 additions and 2 deletions

View file

@ -41,4 +41,42 @@ seeds:
min_value: 0
max_value: 8
strictly: False
- name: stg_seed__hardcoded_currency_rates
description: |
A bunch of rates between currencies, taken from our invoicing cycle in February 2024.
These are hardcoded and so will become outdated, but it's the best we have now since we don't have a live feed for exchange rates.
config:
column_types:
from_currency: varchar(3)
to_currency: varchar(3)
rate: numeric
columns:
- name: from_currency
data_type: character varying
description: The 3 character ISO 4217 code for the base currency, in Uppercase.
tests:
- not_null
- dbt_expectations.expect_column_values_to_match_regex:
regex: "^[A-Z]{3}$"
columns:
- name: to_currency
data_type: character varying
description: The 3 character ISO 4217 code for the target currency, in Uppercase.
tests:
- not_null
- dbt_expectations.expect_column_values_to_match_regex:
regex: "^[A-Z]{3}$"
- name: rate
data_type: numeric
description: |
The rate between the two currencies. You should read it as the amount of target currency you get for each unit of base currency.
For example: for the combination EUR-GBP, a rate of 0.8 means you get 0.8 GBP for 1 EUR.
Rates between same-currency pairs are always one.
tests:
- not_null
- dbt_expectations.expect_column_values_to_be_between:
min_value: 0.00000000001
max_value: 999999999999

View file

@ -0,0 +1,65 @@
from_currency,to_currency,rate
EUR,EUR,1
USD,USD,1
GBP,GBP,1
CAD,CAD,1
AUD,AUD,1
ZAR,ZAR,1
NZD,NZD,1
PLN,PLN,1
EUR,USD,1.08286
EUR,GBP,0.85555
EUR,CAD,1.4688
EUR,AUD,1.66453
EUR,ZAR,20.7993
EUR,NZD,1.77391
EUR,PLN,4.31113
USD,EUR,0.92335
USD,GBP,0.79003
USD,CAD,1.3564
USD,AUD,1.53701
USD,ZAR,19.2073
USD,NZD,1.63816
USD,PLN,3.98085
GBP,EUR,1.16864
GBP,USD,1.26559
GBP,CAD,1.71664
GBP,AUD,1.94522
GBP,ZAR,24.3085
GBP,NZD,2.07323
GBP,PLN,5.03811
NZD,EUR,0.56352
NZD,USD,0.6103
NZD,GBP,0.48216
NZD,CAD,0.82781
NZD,AUD,0.9381
NZD,ZAR,11.7222
NZD,PLN,2.42951
CAD,EUR,0.68064
CAD,USD,0.73714
CAD,GBP,0.58237
CAD,AUD,1.133
CAD,ZAR,14.1585
CAD,NZD,1.20756
CAD,PLN,2.93446
AUD,EUR,0.60068
AUD,USD,0.65049
AUD,GBP,0.51391
AUD,CAD,0.88232
AUD,ZAR,12.4941
AUD,NZD,1.06572
AUD,PLN,2.58949
ZAR,EUR,0.04804
ZAR,USD,0.05203
ZAR,GBP,0.0411
ZAR,CAD,0.07057
ZAR,AUD,0.07997
ZAR,NZD,0.08523
ZAR,PLN,0.20712
PLN,EUR,0.23184
PLN,USD,0.25106
PLN,GBP,0.19835
PLN,CAD,0.34054
PLN,AUD,0.38588
PLN,ZAR,4.82218
PLN,NZD,0.41128
1 from_currency to_currency rate
2 EUR EUR 1
3 USD USD 1
4 GBP GBP 1
5 CAD CAD 1
6 AUD AUD 1
7 ZAR ZAR 1
8 NZD NZD 1
9 PLN PLN 1
10 EUR USD 1.08286
11 EUR GBP 0.85555
12 EUR CAD 1.4688
13 EUR AUD 1.66453
14 EUR ZAR 20.7993
15 EUR NZD 1.77391
16 EUR PLN 4.31113
17 USD EUR 0.92335
18 USD GBP 0.79003
19 USD CAD 1.3564
20 USD AUD 1.53701
21 USD ZAR 19.2073
22 USD NZD 1.63816
23 USD PLN 3.98085
24 GBP EUR 1.16864
25 GBP USD 1.26559
26 GBP CAD 1.71664
27 GBP AUD 1.94522
28 GBP ZAR 24.3085
29 GBP NZD 2.07323
30 GBP PLN 5.03811
31 NZD EUR 0.56352
32 NZD USD 0.6103
33 NZD GBP 0.48216
34 NZD CAD 0.82781
35 NZD AUD 0.9381
36 NZD ZAR 11.7222
37 NZD PLN 2.42951
38 CAD EUR 0.68064
39 CAD USD 0.73714
40 CAD GBP 0.58237
41 CAD AUD 1.133
42 CAD ZAR 14.1585
43 CAD NZD 1.20756
44 CAD PLN 2.93446
45 AUD EUR 0.60068
46 AUD USD 0.65049
47 AUD GBP 0.51391
48 AUD CAD 0.88232
49 AUD ZAR 12.4941
50 AUD NZD 1.06572
51 AUD PLN 2.58949
52 ZAR EUR 0.04804
53 ZAR USD 0.05203
54 ZAR GBP 0.0411
55 ZAR CAD 0.07057
56 ZAR AUD 0.07997
57 ZAR NZD 0.08523
58 ZAR PLN 0.20712
59 PLN EUR 0.23184
60 PLN USD 0.25106
61 PLN GBP 0.19835
62 PLN CAD 0.34054
63 PLN AUD 0.38588
64 PLN ZAR 4.82218
65 PLN NZD 0.41128