Skip to content

Commit

Permalink
fix: Import dates as Utc
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustl22 committed Oct 23, 2024
1 parent f194dd7 commit d619fd0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ class ByGermanyWrestlingApi extends WrestlingApi {
gender: wrestlerJson['gender'] == 'm'
? Gender.male
: (wrestlerJson['gender'] == 'w' ? Gender.female : Gender.other),
birthDate: DateTime.parse(wrestlerJson['birthday']),
birthDate: DateTime.parse(wrestlerJson['birthday']).copyWith(isUtc: true),
nationality: Countries.values
.singleWhereOrNull((element) => element.unofficialNames.contains(wrestlerJson['nationality'])),
)),
Expand Down
4 changes: 2 additions & 2 deletions wrestling_scoreboard_common/test/services/apis_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void main() {
prename: 'Max',
surname: 'Muster',
gender: Gender.male,
birthDate: DateTime(2000, 1, 31),
birthDate: DateTime.utc(2000, 1, 31),
nationality: Countries.deu,
),
);
Expand Down Expand Up @@ -628,7 +628,7 @@ void main() {
prename: 'Tobias',
surname: 'Müller',
gender: Gender.male,
birthDate: DateTime(2000, 3, 02),
birthDate: DateTime.utc(2000, 3, 02),
nationality: Countries.deu,
),
),
Expand Down
6 changes: 3 additions & 3 deletions wrestling_scoreboard_server/test/expected_api_import.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1717,8 +1717,8 @@ COPY public.participation (id, membership_id, lineup_id, weight_class_id, weight
COPY public.person (id, prename, surname, birth_date, gender, nationality, org_sync_id, organization_id) FROM stdin;
24 Mustafa Durak \N \N \N Mustafa_Durak_null 2
25 Fröhlich Peter \N \N \N Fröhlich_Peter_null 2
26 Max Muster 2000-01-30 male DEU Max_Muster_2000-01-31 2
27 Tobias Müller 2000-03-01 male DEU Tobias_Müller_2000-03-02 2
26 Max Muster 2000-01-31 male DEU Max_Muster_2000-01-31 2
27 Tobias Müller 2000-03-02 male DEU Tobias_Müller_2000-03-02 2
\.


Expand All @@ -1727,7 +1727,7 @@ COPY public.person (id, prename, surname, birth_date, gender, nationality, org_s
--

COPY public.secured_user (id, username, password_hash, email, person_id, salt, created_at, privilege) FROM stdin;
2 admin \\xc215302a5e928facc2e5d1d7e77e62f53b874f1f661a19f473906195cdb9792c \N \N 3OJFGA== 2024-10-22 admin
2 admin \\x9b452a2e6bc24ddb4117dfb727f78f5da9ed569201a094a9f3e9d8a1671f891a \N \N 36jSKg== 2024-10-23 admin
\.


Expand Down
6 changes: 3 additions & 3 deletions wrestling_scoreboard_server/test/outdated_api_import.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1717,8 +1717,8 @@ COPY public.participation (id, membership_id, lineup_id, weight_class_id, weight
COPY public.person (id, prename, surname, birth_date, gender, nationality, org_sync_id, organization_id) FROM stdin;
24 Mustafa Durak \N \N \N Mustafa_Durak_null 2
25 Fröhlich Peter \N \N \N Fröhlich_Peter_null 2
26 Max Muster 2000-01-30 male DEU Max_Muster_2000-01-31 2
27 Tobias Müller 2000-03-01 male DEU Tobias_Müller_2000-03-02 2
26 Max Muster 2000-01-31 male DEU Max_Muster_2000-01-31 2
27 Tobias Müller 2000-03-02 male DEU Tobias_Müller_2000-03-02 2
\.


Expand All @@ -1727,7 +1727,7 @@ COPY public.person (id, prename, surname, birth_date, gender, nationality, org_s
--

COPY public.secured_user (id, username, password_hash, email, person_id, salt, created_at, privilege) FROM stdin;
2 admin \\xc215302a5e928facc2e5d1d7e77e62f53b874f1f661a19f473906195cdb9792c \N \N 3OJFGA== 2024-10-22 admin
2 admin \\x9b452a2e6bc24ddb4117dfb727f78f5da9ed569201a094a9f3e9d8a1671f891a \N \N 36jSKg== 2024-10-23 admin
\.


Expand Down

0 comments on commit d619fd0

Please sign in to comment.