Notifications in Lino Welfare¶
Side note: Code snippets (lines starting with >>>
) in this document get
tested as part of our development workflow. The following
initialization snippet tells you which demo project is being used in
this document.
>>> from lino import startup
>>> startup('lino_welfare.projects.gerd.settings.doctests')
>>> from lino.api.doctest import *
>>> translation.activate("en")
Testing the client workflow¶
Automatic tests are in lino_welfare.projects.std.tests.test_notify
.
Some processes are not yet covered by any automatic test because they contain JavaScript dialogs. So here is a manual test suite.
The following instructions are for lino_welfare.projects.gerd
,
but similar steps are in lino_book.projects.mathieu
.
Install Lino Welfare, go to the
lino_welfare.projects.gerd
directory, runpm prep
followed byrunserver
.Instead of logging in as Theresia, Caroline etc, consider logging in as Robin and then act as Theresia, Caroline. The advantage is that your menus and labels will be in English.
Managing newcomer requests¶
AssignCoach
and RefuseClient
)
Act as Caroline
Select
, double-click on Emil EIERSCHAL, select the Coaches tab.In the Available coaches panel, click on Assign next to Hubert. Confirm dialog by clicking OK. Note that the console says:
Notify 1 users that EIERSCHAL Emil (175) zugewiesen zu Hubert Huppertz
Note that the Workflow field now says “Coached –> Former”
Switch to the “History” tab and verify that a system note has been created.
Close the detail window and reopen it on Bruno BRAUN (another client). Select the Coaches tab. In the Workflow field click on Refuse. Select “PCSW is not competent” as Refusal reason from the selection list. Confirm dialog by clicking OK.
Switch to the “History” tab and verify that a system note has been created.
Act as Hubert and verify that he has a welcome message “You have 1 unseen notifications”. Click on this message and verify that the “About” field of the notification is a clickable pointer to the client Emil EIERSCHAL.
No notification is sent for RefuseClient since there is no coaching.
As a reception clerk, receive a waiting visitor
(ReceiveVisitor
)
Click on the first client listed in Waiting visitors (EMONTS Daniel).
That client is waiting for Hubert. Click Receive in the Appointments panel. You get a confirmation
Emonts Daniel begins consultation with Hubert Huppertz. Are you sure?
. Click OK. Note that they are now Busy.Close the detail window. Note that Daniel is no longer listed in Waiting visitors.
As a reception clerk, check out a visitor who leaves the center
(CheckoutVisitor
)
From the main menu, select
.Find Daniel Emonts. Click on Checkout. Confirm the message
Emonts Daniel leaves after meeting with Hubert Huppertz. Are you sure?
As a reception clerk, check in a visitor with appointment
(CheckinVisitor
)
Note that the demo data is not very realistic here.
Click on the first client mentioned in Waiting visitors.
Click Checkin on one of the appointments mentioned there
Confirm the dialog
Note that a system note has been created.
EndCoaching
EndCoaching
seems no longer usedCreateClientVisit
CreateCoachingVisit
Managing Notifications¶
I added filter parameters for Messages
.
I was not possible until now to override the verbose_name of the
owner
field of a Controllable
. Now it is possible using
update_controller_field
.
>>> ses = rt.login("robin")
>>> ses.show(rt.models.notify.AllMessages)
===================== ============================ ================== ====== =====================
Created Subject Recipient seen sent
--------------------- ---------------------------- ------------------ ------ ---------------------
2014-05-22 05:48:00 Broadcast message
2014-05-22 05:48:00 Willkommen Bord, Alicia. Alicia Allmanns 2014-05-22 05:48:00
2014-05-22 05:48:00 Willkommen Bord, Caroline. Caroline Carnol 2014-05-22 05:48:00
2014-05-22 05:48:00 Willkommen Bord, Hubert. Hubert Huppertz 2014-05-22 05:48:00
2014-05-22 05:48:00 Willkommen Bord, Judith. Judith Jousten 2014-05-22 05:48:00
2014-05-22 05:48:00 Willkommen Bord, Kerstin. Kerstin Kerres 2014-05-22 05:48:00
2014-05-22 05:48:00 Willkommen Bord, Mélanie. Mélanie Mélard 2014-05-22 05:48:00
2014-05-22 05:48:00 Willkommen Bord, Patrick. Patrick Paraneau 2014-05-22 05:48:00
2014-05-22 05:48:00 Welcome on board, Robin. Robin Rood 2014-05-22 05:48:00
2014-05-22 05:48:00 Willkommen Bord, Rolf. Rolf Rompen 2014-05-22 05:48:00
2014-05-22 05:48:00 Willkommen Bord, Romain. Romain Raffault 2014-05-22 05:48:00
2014-05-22 05:48:00 Willkommen Bord, Theresia. Theresia Thelen 2014-05-22 05:48:00
2014-05-22 05:48:00 Willkommen Bord, Wilfried. Wilfried Willems 2014-05-22 05:48:00
===================== ============================ ================== ====== =====================
>> ses.show(rt.models.notify.MyMessages) [✓]22/05/2014 05:48 The database has been initialized.