Skip to content

Commit

Permalink
Update endpoints and schemas to include advanced weather location count.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carifio24 committed Mar 25, 2024
1 parent f19f8a4 commit e898506
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/stories/solar-eclipse-2024/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const SolarEclipse2024Entry = S.struct({
user_selected_locations: LatLonArray,
cloud_cover_selected_locations: LatLonArray,
text_search_selected_locations: LatLonArray,
advanced_weather_selected_locations_count: S.number,
info_time_ms: S.optional(S.number.pipe(S.int()), { exact: true }),
app_time_ms: S.optional(S.number.pipe(S.int()), { exact: true }),
advanced_weather_time_ms: S.optional(S.number.pipe(S.int()), { exact: true }),
Expand All @@ -28,6 +29,7 @@ export const SolarEclipse2024Update = S.struct({
user_selected_locations: S.optional(LatLonArray, { exact: true }),
cloud_cover_selected_locations: S.optional(LatLonArray, { exact: true }),
text_search_selected_locations: S.optional(LatLonArray, { exact: true }),
delta_advanced_weather_selected_locations_count: S.optional(S.number, { exact: true }),
delta_info_time_ms: S.optional(S.number.pipe(S.int()), { exact: true }),
delta_app_time_ms: S.optional(S.number.pipe(S.int()), { exact: true }),
delta_advanced_weather_time_ms: S.optional(S.number.pipe(S.int()), { exact: true }),
Expand Down Expand Up @@ -83,6 +85,9 @@ export async function updateSolarEclipse2024Data(userUUID: string, update: Solar
dbUpdate.text_search_selected_locations = selected;
dbUpdate.text_search_selected_locations_count = selected.length;
}
if (update.delta_advanced_weather_selected_locations_count) {
dbUpdate.advanced_weather_selected_locations_count = data.advanced_weather_selected_locations_count + update.delta_advanced_weather_selected_locations_count;
}
if (update.delta_info_time_ms) {
dbUpdate.info_time_ms = data.info_time_ms + update.delta_info_time_ms;
}
Expand Down

0 comments on commit e898506

Please sign in to comment.