chore(avs): fix avs synch rowkey ident problem
This commit is contained in:
parent
d6cdda10c1
commit
b203ededaa
@ -344,9 +344,9 @@ getProblemAvsSynchR = do
|
|||||||
>> redirect ProblemAvsSynchR
|
>> redirect ProblemAvsSynchR
|
||||||
|
|
||||||
((r0,tb0),(r1,tb1),(r2,tb2)) <- runDB $ (,,)
|
((r0,tb0),(r1,tb1),(r2,tb2)) <- runDB $ (,,)
|
||||||
<$> mkLicenceTable AvsNoLicence setTo0 (Just LicenceTableChangeAvs)
|
<$> mkLicenceTable "driveSynchNoLicence" AvsNoLicence setTo0 (Just LicenceTableChangeAvs)
|
||||||
<*> mkLicenceTable AvsLicenceVorfeld setTo1 (Just LicenceTableChangeAvs)
|
<*> mkLicenceTable "driveSynchVorfeld" AvsLicenceVorfeld setTo1 (Just LicenceTableChangeAvs)
|
||||||
<*> mkLicenceTable AvsLicenceRollfeld setTo2 (Just LicenceTableChangeAvs)
|
<*> mkLicenceTable "driveSynchRollfeld" AvsLicenceRollfeld setTo2 (Just LicenceTableChangeAvs)
|
||||||
|
|
||||||
-- for debugging
|
-- for debugging
|
||||||
let sres x = case x of
|
let sres x = case x of
|
||||||
@ -402,12 +402,11 @@ instance HasUser LicenceTableData where
|
|||||||
hasUser = resultUser . _entityVal
|
hasUser = resultUser . _entityVal
|
||||||
|
|
||||||
|
|
||||||
mkLicenceTable :: AvsLicence -> Set AvsPersonId -> Maybe LicenceTableAction -> DB (FormResult (LicenceTableActionData, Set AvsPersonId), Widget)
|
mkLicenceTable :: Text -> AvsLicence -> Set AvsPersonId -> Maybe LicenceTableAction -> DB (FormResult (LicenceTableActionData, Set AvsPersonId), Widget)
|
||||||
mkLicenceTable aLic apids defAct = do
|
mkLicenceTable dbtIdent aLic apids defAct = do
|
||||||
currentRoute <- fromMaybe (error "mkLicenceTable called from 404-handler") <$> liftHandler getCurrentRoute
|
currentRoute <- fromMaybe (error "mkLicenceTable called from 404-handler") <$> liftHandler getCurrentRoute
|
||||||
now <- liftIO getCurrentTime
|
now <- liftIO getCurrentTime
|
||||||
let nowaday = utctDay now
|
let nowaday = utctDay now
|
||||||
dbtIdent = "drivingLicenceSynch" :: Text
|
|
||||||
dbtStyle = def
|
dbtStyle = def
|
||||||
fltrLic qual = if
|
fltrLic qual = if
|
||||||
-- | aLic == AvsNoLicence -> E.true -- could be R, F, both or none at all, but has licence in AVS
|
-- | aLic == AvsNoLicence -> E.true -- could be R, F, both or none at all, but has licence in AVS
|
||||||
@ -420,7 +419,8 @@ mkLicenceTable aLic apids defAct = do
|
|||||||
E.on $ user E.^. UserId E.==. usrAvs E.^. UserAvsUser
|
E.on $ user E.^. UserId E.==. usrAvs E.^. UserAvsUser
|
||||||
E.where_ $ fltrLic qual E.&&. (usrAvs E.^. UserAvsPersonId `E.in_` E.vals apids)
|
E.where_ $ fltrLic qual E.&&. (usrAvs E.^. UserAvsPersonId `E.in_` E.vals apids)
|
||||||
return (user, qualUser, usrAvs E.^. UserAvsPersonId, qual)
|
return (user, qualUser, usrAvs E.^. UserAvsPersonId, qual)
|
||||||
dbtRowKey = queryUserAvs >>> (E.^. UserAvsPersonId)
|
dbtRowKey = (queryUserAvs >>> (E.^. UserAvsPersonId))
|
||||||
|
&&& (queryQualification >>> (E.?. QualificationId))
|
||||||
--dbtProj = dbtProjSimple $ \(user, qualUsr, E.Value api, quali) -> return (user, qualUsr, api, quali)
|
--dbtProj = dbtProjSimple $ \(user, qualUsr, E.Value api, quali) -> return (user, qualUsr, api, quali)
|
||||||
dbtProj = dbtProjSimple $ pure . over _3 E.unValue
|
dbtProj = dbtProjSimple $ pure . over _3 E.unValue
|
||||||
dbtColonnade = mconcat
|
dbtColonnade = mconcat
|
||||||
|
|||||||
Reference in New Issue
Block a user