chore(firm): firm users page shows company address

This commit is contained in:
Steffen Jost 2023-10-26 19:13:01 +02:00
parent aae1926840
commit 0f3bf98235
4 changed files with 60 additions and 26 deletions

View File

@ -4,4 +4,5 @@
FirmAllActNotify: Mitteilung versenden FirmAllActNotify: Mitteilung versenden
FirmAllActResetSupervision: Ansprechpartner für alle Firmenangehörigen zurücksetzen FirmAllActResetSupervision: Ansprechpartner für alle Firmenangehörigen zurücksetzen
FirmUserActNotify: Mitteilung versenden
FirmUserActMkSuper: Zum Firmenansprechparnter ernennen

View File

@ -4,3 +4,5 @@
FirmAllActNotify: Send message FirmAllActNotify: Send message
FirmAllActResetSupervision: Reset supervisors for all company associates FirmAllActResetSupervision: Reset supervisors for all company associates
FirmUserActNotify: Send message
FirmUserActMkSuper: Mark as company supervisor

View File

@ -119,35 +119,35 @@ type AllCompanyTableData = DBRow (Entity Company, E.Value Word64, E.Value Word64
resultAllCompanyEntity :: Lens' AllCompanyTableData (Entity Company) resultAllCompanyEntity :: Lens' AllCompanyTableData (Entity Company)
resultAllCompanyEntity = _dbrOutput . _1 resultAllCompanyEntity = _dbrOutput . _1
resultAllCompany :: Lens' AllCompanyTableData Company resultAllCompany :: Lens' AllCompanyTableData Company
resultAllCompany = resultAllCompanyEntity . _entityVal resultAllCompany = resultAllCompanyEntity . _entityVal
resultAllCompanyUsers :: Lens' AllCompanyTableData Word64 resultAllCompanyUsers :: Lens' AllCompanyTableData Word64
resultAllCompanyUsers = _dbrOutput . _2 . _unValue resultAllCompanyUsers = _dbrOutput . _2 . _unValue
resultAllCompanySupervisors :: Lens' AllCompanyTableData Word64 resultAllCompanySupervisors :: Lens' AllCompanyTableData Word64
resultAllCompanySupervisors = _dbrOutput . _3 . _unValue resultAllCompanySupervisors = _dbrOutput . _3 . _unValue
resultAllCompanyEmployeeSupervised :: Lens' AllCompanyTableData Word64 resultAllCompanyEmployeeSupervised :: Lens' AllCompanyTableData Word64
resultAllCompanyEmployeeSupervised = _dbrOutput . _4 . _unValue resultAllCompanyEmployeeSupervised = _dbrOutput . _4 . _unValue
resultAllCompanyEmployeeRerouted :: Lens' AllCompanyTableData Word64 resultAllCompanyEmployeeRerouted :: Lens' AllCompanyTableData Word64
resultAllCompanyEmployeeRerouted = _dbrOutput . _5 . _unValue resultAllCompanyEmployeeRerouted = _dbrOutput . _5 . _unValue
resultAllCompanyEmpRerPost :: Lens' AllCompanyTableData Word64 resultAllCompanyEmpRerPost :: Lens' AllCompanyTableData Word64
resultAllCompanyEmpRerPost = _dbrOutput . _6 . _unValue resultAllCompanyEmpRerPost = _dbrOutput . _6 . _unValue
resultAllCompanyForeignSupers :: Lens' AllCompanyTableData Word64 resultAllCompanyForeignSupers :: Lens' AllCompanyTableData Word64
resultAllCompanyForeignSupers = _dbrOutput . _7 . _unValue resultAllCompanyForeignSupers = _dbrOutput . _7 . _unValue
resultAllCompanyDefaultReroutes :: Lens' AllCompanyTableData Word64 resultAllCompanyDefaultReroutes :: Lens' AllCompanyTableData Word64
resultAllCompanyDefaultReroutes = _dbrOutput . _8 . _unValue resultAllCompanyDefaultReroutes = _dbrOutput . _8 . _unValue
resultAllCompanyActiveReroutes :: Lens' AllCompanyTableData Word64 resultAllCompanyActiveReroutes :: Lens' AllCompanyTableData Word64
resultAllCompanyActiveReroutes = _dbrOutput . _9 . _unValue resultAllCompanyActiveReroutes = _dbrOutput . _9 . _unValue
resultAllCompanyActiveReroutes' :: Lens' AllCompanyTableData Word64 resultAllCompanyActiveReroutes' :: Lens' AllCompanyTableData Word64
resultAllCompanyActiveReroutes' = _dbrOutput . _10 . _unValue resultAllCompanyActiveReroutes' = _dbrOutput . _10 . _unValue
fromUserCompany :: Maybe (E.SqlExpr (Entity UserCompany) -> E.SqlExpr (E.Value Bool)) -> E.SqlExpr (Entity Company) -> E.SqlQuery () fromUserCompany :: Maybe (E.SqlExpr (Entity UserCompany) -> E.SqlExpr (E.Value Bool)) -> E.SqlExpr (Entity Company) -> E.SqlQuery ()
fromUserCompany mbFltr cmpy = do fromUserCompany mbFltr cmpy = do
@ -362,13 +362,44 @@ postFirmAllR = do
----------------------- -----------------------
-- Firm Users Table -- Firm Users Table
data FirmUserAction = FirmUserActNotify
| FirmUserActMkSuper
deriving (Eq, Ord, Enum, Bounded, Read, Show, Generic)
deriving anyclass (Universe, Finite)
nullaryPathPiece ''FirmUserAction $ camelToPathPiece' 3
embedRenderMessage ''UniWorX ''FirmUserAction id
data FirmUserActionData = FirmUserActNotifyData
| FirmUserActMkSuperData
deriving (Eq, Ord, Enum, Bounded, Read, Show, Generic)
getFirmUsersR, postFirmUsersR :: CompanyShorthand -> Handler Html getFirmUsersR, postFirmUsersR :: CompanyShorthand -> Handler Html
getFirmUsersR = postFirmUsersR getFirmUsersR = postFirmUsersR
postFirmUsersR fsh = do postFirmUsersR fsh = do
let _fshId = CompanyKey fsh let fshId = CompanyKey fsh
siteLayout (citext2widget fsh) $ do Company{..} <- runDB $ get404 fshId
setTitle $ citext2Html fsh siteLayout (citext2widget companyName) $ do
[whamlet|!!!STUB!!!TO DO!!!|] setTitle $ citext2Html companyShorthand
[whamlet|
<p>
#{companyPostAddress}
<p>
Für neue Firmangehörige ist Benachrichtigungs-Voreinstellung:
$if companyPrefersPostal
#{icon IconLetter} Briefversand
$else
#{icon IconAt} Email
<p>
AVS Nummer #{companyAvsId}
<h1>
!!!STUB!!!TO DO!!!
<p>
Table showing all company associated users
|]
----------------------------- -----------------------------

View File

@ -624,9 +624,9 @@ fillDb = do
I am aware that violations in the form plagiarism or collaboration with third parties will lead to expulsion from the course. I am aware that violations in the form plagiarism or collaboration with third parties will lead to expulsion from the course.
|] |]
} }
fraportAg <- insert' $ Company "Fraport AG" "Fraport" 1 False Nothing fraportAg <- insert' $ Company "Fraport AG" "Fraport" 1 True $ Just $ markdownToStoredMarkup ("Frankfurt Airport Services Worldwide\n60547 Frankfurt am Main"::Text)
fraGround <- insert' $ Company "Fraport Ground Handling Professionals GmbH" "FraGround" 2 False Nothing -- TODO: better testcases fraGround <- insert' $ Company "Fraport Ground Handling Professionals GmbH" "FraGround" 2 True $ Just $ markdownToStoredMarkup ("Sauerbierstraße 772 \nBürokomplex 80/C/1\n112233 Nieder-Tupfing-Hohen-Kreisingen\nTöpferbezirk"::Text)
nice <- insert' $ Company "N*ICE Aircraft Services & Support GmbH" "N*ICE" 33 False Nothing nice <- insert' $ Company "N*ICE Aircraft Services & Support GmbH" "N*ICE" 33 False $ Just $ markdownToStoredMarkup ("69 Nevermore Blvd.\nHarlaemn\nNew York\nUSA"::Text)
ffacil <- insert' $ Company "Fraport Facility Services GmbH" "GCS" 44 False Nothing ffacil <- insert' $ Company "Fraport Facility Services GmbH" "GCS" 44 False Nothing
bpol <- insert' $ Company "Bundespolizeidirektion Flughafen Frankfurt am Main" "BPol" 5555 False Nothing bpol <- insert' $ Company "Bundespolizeidirektion Flughafen Frankfurt am Main" "BPol" 5555 False Nothing
void . insert' $ UserCompany jost fraportAg True True void . insert' $ UserCompany jost fraportAg True True