From d5c7beb4507f5a0ba361464173447ed3521d9973 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sat, 2 Jul 2022 18:14:47 +0200 Subject: rudimentary admin api implementation --- lib/Persist.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/Persist.hs') diff --git a/lib/Persist.hs b/lib/Persist.hs index e73b74f..c44ae3b 100644 --- a/lib/Persist.hs +++ b/lib/Persist.hs @@ -77,10 +77,10 @@ TripPing json sql=tt_trip_ping long Double delay Double timestamp UTCTime - deriving Show Generic Eq + deriving Show Generic Eq ToSchema -- TODO: multi-language support? -Announcement sql=tt_announcements +Announcement json sql=tt_announcements Id UUID default=uuid_generate_v4() trip TripID message Text @@ -88,11 +88,12 @@ Announcement sql=tt_announcements day Day url Text Maybe announcedAt UTCTime Maybe + deriving Generic ToSchema -- | this table works as calendar_dates.txt in GTFS ScheduleAmendment json sql=tt_schedule_amendement trip TripID - day Text + day Day status AmendmentStatus -- only one special rule per TripID and Day (else incoherent) TripAndDay trip day @@ -107,8 +108,6 @@ ExtraordinaryTrip sql=tt_extra_trip instance ToSchema RunningTripId where declareNamedSchema _ = declareNamedSchema (Proxy @UUID) -instance ToSchema TripPing where - declareNamedSchema = genericDeclareNamedSchema (swaggerOptions "ping") runSql :: MonadIO m => Pool SqlBackend -> ReaderT SqlBackend (NoLoggingT (ResourceT IO)) a -> m a runSql pool = liftIO . flip runSqlPersistMPool pool -- cgit v1.2.3