Skip to content

Commit d021506

Browse files
committed
feat: Refactor currency handling in AddBookDialog and related components
- Updated AddBookDialog to support multiple currencies dynamically. - Introduced CurrencyService methods for currency symbol retrieval and price formatting. - Modified CurrencySelector to load supported currencies from configuration. - Adjusted tests to reflect changes in currency handling, ensuring GBP is the default. - Enhanced BookHandlerTests to validate book creation and updates with GBP prices. - Updated various tests across the application to use GBP as the primary currency.
1 parent 8b37cc5 commit d021506

25 files changed

Lines changed: 560 additions & 243 deletions
Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
1-
{
2-
"Logging": {
3-
"LogLevel": {
4-
"Default": "Debug",
5-
"Microsoft.AspNetCore": "Information",
6-
"Microsoft.AspNetCore.Hosting": "Information",
7-
"Microsoft.AspNetCore.Routing": "Debug",
8-
"Microsoft.AspNetCore.Identity": "Debug",
9-
"System.Net.Http.HttpClient": "Information",
10-
"Marten": "Debug",
11-
"Wolverine": "Information",
12-
"BookStore": "Debug"
13-
},
14-
"Console": {
15-
"FormatterName": "simple",
16-
"FormatterOptions": {
17-
"IncludeScopes": true,
18-
"SingleLine": false,
19-
"TimestampFormat": "yyyy-MM-dd HH:mm:ss ",
20-
"UseUtcTimestamp": true
21-
}
22-
}
23-
},
24-
"Authentication": {
25-
"Passkey": {
26-
"AllowedOrigins": [
27-
"https://localhost:7260"
28-
]
29-
}
30-
},
31-
"RateLimit": {
32-
"PermitLimit": 2000,
33-
"AuthPermitLimit": 2000,
34-
"AuthWindowSeconds": 60,
35-
"AuthQueueLimit": 10
36-
},
37-
"Localization": {
38-
"DefaultCulture": "en",
39-
"SupportedCultures": [
40-
"pt",
41-
"pt-PT",
42-
"en",
43-
"fr",
44-
"de",
45-
"es"
46-
]
47-
},
48-
"Currency": {
49-
"DefaultCurrency": "USD",
50-
"SupportedCurrencies": [
51-
"USD",
52-
"EUR",
53-
"GBP"
54-
]
55-
}
56-
}
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Debug",
5+
"Microsoft.AspNetCore": "Information",
6+
"Microsoft.AspNetCore.Hosting": "Information",
7+
"Microsoft.AspNetCore.Routing": "Debug",
8+
"Microsoft.AspNetCore.Identity": "Debug",
9+
"System.Net.Http.HttpClient": "Information",
10+
"Marten": "Debug",
11+
"Wolverine": "Information",
12+
"BookStore": "Debug"
13+
},
14+
"Console": {
15+
"FormatterName": "simple",
16+
"FormatterOptions": {
17+
"IncludeScopes": true,
18+
"SingleLine": false,
19+
"TimestampFormat": "yyyy-MM-dd HH:mm:ss ",
20+
"UseUtcTimestamp": true
21+
}
22+
}
23+
},
24+
"Authentication": {
25+
"Passkey": {
26+
"AllowedOrigins": [
27+
"https://localhost:7260"
28+
]
29+
}
30+
},
31+
"RateLimit": {
32+
"PermitLimit": 2000,
33+
"AuthPermitLimit": 2000,
34+
"AuthWindowSeconds": 60,
35+
"AuthQueueLimit": 10
36+
},
37+
"Localization": {
38+
"DefaultCulture": "en",
39+
"SupportedCultures": [
40+
"pt",
41+
"pt-PT",
42+
"en",
43+
"fr",
44+
"de",
45+
"es"
46+
]
47+
},
48+
"Currency": {
49+
"DefaultCurrency": "GBP",
50+
"SupportedCurrencies": [
51+
"USD",
52+
"EUR",
53+
"GBP"
54+
]
55+
}
56+
}
Lines changed: 84 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,84 @@
1-
{
2-
"Logging": {
3-
"LogLevel": {
4-
"Default": "Information",
5-
"Microsoft.AspNetCore": "Warning",
6-
"Microsoft.AspNetCore.Hosting": "Information",
7-
"Microsoft.AspNetCore.Routing": "Warning",
8-
"System.Net.Http.HttpClient": "Warning",
9-
"Marten": "Warning",
10-
"Npgsql": "Warning",
11-
"Wolverine": "Warning",
12-
"BookStore": "Information"
13-
},
14-
"Console": {
15-
"FormatterName": "json",
16-
"FormatterOptions": {
17-
"IncludeScopes": true,
18-
"TimestampFormat": "yyyy-MM-ddTHH:mm:ss.fffZ",
19-
"UseUtcTimestamp": true,
20-
"JsonWriterOptions": {
21-
"Indented": false
22-
}
23-
}
24-
}
25-
},
26-
"AllowedHosts": "*",
27-
"Pagination": {
28-
"DefaultPageSize": 20,
29-
"MaxPageSize": 100
30-
},
31-
"Localization": {
32-
"DefaultCulture": "en",
33-
"SupportedCultures": [
34-
"pt",
35-
"pt-PT",
36-
"en",
37-
"fr",
38-
"de",
39-
"es"
40-
]
41-
},
42-
"Currency": {
43-
"DefaultCurrency": "USD",
44-
"SupportedCurrencies": [
45-
"USD",
46-
"EUR",
47-
"GBP"
48-
]
49-
},
50-
"Authentication": {
51-
"Passkey": {
52-
"ServerDomain": "localhost",
53-
"AllowedOrigins": [
54-
"https://localhost:7260",
55-
"http://localhost:7260"
56-
]
57-
}
58-
},
59-
"Email": {
60-
"DeliveryMethod": "Logging",
61-
"BaseUrl": "https://localhost:7260"
62-
},
63-
"Jwt": {
64-
"SecretKey": "your-secret-key-must-be-at-least-32-characters-long-for-hs256",
65-
"Issuer": "BookStore.ApiService",
66-
"Audience": "BookStore.Web",
67-
"ExpirationMinutes": 60
68-
},
69-
"RateLimit": {
70-
"PermitLimit": 1000,
71-
"WindowInMinutes": 1,
72-
"QueueLimit": 100,
73-
"AuthPermitLimit": 1000,
74-
"AuthWindowSeconds": 60,
75-
"AuthQueueLimit": 100
76-
},
77-
"Account": {
78-
"Cleanup": {
79-
"UnverifiedAccountExpirationHours": 24,
80-
"CleanupIntervalHours": 1,
81-
"Enabled": true
82-
}
83-
}
84-
}
1+
{
2+
"Logging": {
3+
"LogLevel": {
4+
"Default": "Information",
5+
"Microsoft.AspNetCore": "Warning",
6+
"Microsoft.AspNetCore.Hosting": "Information",
7+
"Microsoft.AspNetCore.Routing": "Warning",
8+
"System.Net.Http.HttpClient": "Warning",
9+
"Marten": "Warning",
10+
"Npgsql": "Warning",
11+
"Wolverine": "Warning",
12+
"BookStore": "Information"
13+
},
14+
"Console": {
15+
"FormatterName": "json",
16+
"FormatterOptions": {
17+
"IncludeScopes": true,
18+
"TimestampFormat": "yyyy-MM-ddTHH:mm:ss.fffZ",
19+
"UseUtcTimestamp": true,
20+
"JsonWriterOptions": {
21+
"Indented": false
22+
}
23+
}
24+
}
25+
},
26+
"AllowedHosts": "*",
27+
"Pagination": {
28+
"DefaultPageSize": 20,
29+
"MaxPageSize": 100
30+
},
31+
"Localization": {
32+
"DefaultCulture": "en",
33+
"SupportedCultures": [
34+
"pt",
35+
"pt-PT",
36+
"en",
37+
"fr",
38+
"de",
39+
"es"
40+
]
41+
},
42+
"Currency": {
43+
"DefaultCurrency": "GBP",
44+
"SupportedCurrencies": [
45+
"USD",
46+
"EUR",
47+
"GBP"
48+
]
49+
},
50+
"Authentication": {
51+
"Passkey": {
52+
"ServerDomain": "localhost",
53+
"AllowedOrigins": [
54+
"https://localhost:7260",
55+
"http://localhost:7260"
56+
]
57+
}
58+
},
59+
"Email": {
60+
"DeliveryMethod": "Logging",
61+
"BaseUrl": "https://localhost:7260"
62+
},
63+
"Jwt": {
64+
"SecretKey": "your-secret-key-must-be-at-least-32-characters-long-for-hs256",
65+
"Issuer": "BookStore.ApiService",
66+
"Audience": "BookStore.Web",
67+
"ExpirationMinutes": 60
68+
},
69+
"RateLimit": {
70+
"PermitLimit": 1000,
71+
"WindowInMinutes": 1,
72+
"QueueLimit": 100,
73+
"AuthPermitLimit": 1000,
74+
"AuthWindowSeconds": 60,
75+
"AuthQueueLimit": 100
76+
},
77+
"Account": {
78+
"Cleanup": {
79+
"UnverifiedAccountExpirationHours": 24,
80+
"CleanupIntervalHours": 1,
81+
"Enabled": true
82+
}
83+
}
84+
}

0 commit comments

Comments
 (0)