From f04dcf088f40e5135e684df3d2f6278c82f161ab Mon Sep 17 00:00:00 2001 From: DuvCabrera <86318128+DuvCabrera@users.noreply.github.com> Date: Wed, 17 Dec 2025 12:01:10 -0300 Subject: [PATCH 1/4] Change division to integer division for timestamps --- lib/src/data/repository/repository_activity_impl.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/data/repository/repository_activity_impl.dart b/lib/src/data/repository/repository_activity_impl.dart index cb51de2..9fcfe3f 100644 --- a/lib/src/data/repository/repository_activity_impl.dart +++ b/lib/src/data/repository/repository_activity_impl.dart @@ -59,8 +59,8 @@ class RepositoryActivityImpl extends RepositoryActivity { Future> listLoggedInAthleteActivities( DateTime before, DateTime after, int page, int perPage) { var queryParams = { - "before": before.millisecondsSinceEpoch / 1000, - "after": after.millisecondsSinceEpoch / 1000, + "before": before.millisecondsSinceEpoch ~/ 1000, + "after": after.millisecondsSinceEpoch ~/ 1000, "page": page, "per_page": perPage }; From dda742b811d97a8677c1756257f7a0981c3ff6c3 Mon Sep 17 00:00:00 2001 From: DuvCabrera <86318128+DuvCabrera@users.noreply.github.com> Date: Tue, 6 Jan 2026 16:43:32 -0300 Subject: [PATCH 2/4] Add 'id' field to Athlete class and update JSON methods Updated the Athlete class to include an 'id' field and modified the factory methods for JSON serialization. --- lib/src/domain/model/model_authentication_response.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/domain/model/model_authentication_response.dart b/lib/src/domain/model/model_authentication_response.dart index c39a940..9d73c6f 100644 --- a/lib/src/domain/model/model_authentication_response.dart +++ b/lib/src/domain/model/model_authentication_response.dart @@ -65,13 +65,14 @@ class TokenResponse { } class Athlete { - Athlete(); + int id; + Athlete(required this.id); factory Athlete.fromRawJson(String str) => Athlete.fromJson(json.decode(str)); String toRawJson() => json.encode(toJson()); - factory Athlete.fromJson(Map json) => Athlete(); + factory Athlete.fromJson(Map json) => Athlete(id:json["id"]); Map toJson() => {}; } From fcf19258894c7e0470f059509c2cc3f4a4e304b8 Mon Sep 17 00:00:00 2001 From: DuvCabrera <86318128+DuvCabrera@users.noreply.github.com> Date: Tue, 6 Jan 2026 17:08:54 -0300 Subject: [PATCH 3/4] Update Athlete constructor to use named parameters --- lib/src/domain/model/model_authentication_response.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/domain/model/model_authentication_response.dart b/lib/src/domain/model/model_authentication_response.dart index 9d73c6f..f2faad8 100644 --- a/lib/src/domain/model/model_authentication_response.dart +++ b/lib/src/domain/model/model_authentication_response.dart @@ -66,7 +66,7 @@ class TokenResponse { class Athlete { int id; - Athlete(required this.id); + Athlete({required this.id}); factory Athlete.fromRawJson(String str) => Athlete.fromJson(json.decode(str)); From 5acae45a37a1a4d054dd2fe34f5f7bba80e84991 Mon Sep 17 00:00:00 2001 From: DuvCabrera <86318128+DuvCabrera@users.noreply.github.com> Date: Wed, 7 Jan 2026 10:29:58 -0300 Subject: [PATCH 4/4] Implement toJson method for Athlete class --- lib/src/domain/model/model_authentication_response.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/domain/model/model_authentication_response.dart b/lib/src/domain/model/model_authentication_response.dart index f2faad8..8ee1891 100644 --- a/lib/src/domain/model/model_authentication_response.dart +++ b/lib/src/domain/model/model_authentication_response.dart @@ -74,5 +74,5 @@ class Athlete { factory Athlete.fromJson(Map json) => Athlete(id:json["id"]); - Map toJson() => {}; + Map toJson() => {"id":id}; }