diff options
author | stuebinm | 2022-07-02 18:14:47 +0200 |
---|---|---|
committer | stuebinm | 2022-07-02 18:14:47 +0200 |
commit | d5c7beb4507f5a0ba361464173447ed3521d9973 (patch) | |
tree | f6eb32fc35053bc986fc37db5a125db800b8d8c0 /lib/Persist.hs | |
parent | 84a620a47bd23d5d0f93ae6c7abe5d622005044d (diff) |
rudimentary admin api implementation
Diffstat (limited to 'lib/Persist.hs')
-rw-r--r-- | lib/Persist.hs | 9 |
1 files changed, 4 insertions, 5 deletions
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 |