From a156a167283c4c7d620c4e2c7f1d1fe3927a1557 Mon Sep 17 00:00:00 2001 From: Carifio24 Date: Thu, 14 Mar 2024 14:15:53 -0400 Subject: [PATCH] Update endpoint and data schemas to include advanced weather fields. --- src/stories/solar-eclipse-2024/database.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/stories/solar-eclipse-2024/database.ts b/src/stories/solar-eclipse-2024/database.ts index 8288635..061134a 100644 --- a/src/stories/solar-eclipse-2024/database.ts +++ b/src/stories/solar-eclipse-2024/database.ts @@ -17,6 +17,7 @@ export const SolarEclipse2024Entry = S.struct({ cloud_cover_selected_locations: LatLonArray, 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 }), }); export const SolarEclipse2024Update = S.struct({ @@ -24,6 +25,7 @@ export const SolarEclipse2024Update = S.struct({ cloud_cover_selected_locations: S.optional(LatLonArray, { 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 }), }); export type SolarEclipse2024DataT = S.Schema.To; @@ -73,6 +75,9 @@ export async function updateSolarEclipse2024Data(userUUID: string, update: Solar if (update.delta_app_time_ms) { dbUpdate.app_time_ms = data.app_time_ms + update.delta_app_time_ms; } + if (update.delta_advanced_weather_time_ms) { + dbUpdate.advanced_weather_time_ms = data.advanced_weather_time_ms + update.delta_advanced_weather_time_ms; + } const result = await data.update(dbUpdate); return result !== null; }