GEWIS / sudosos-backend

SudoSOS is a Node.js-based Bar and POS system made for study association GEWIS.
https://sudosos.gewis.nl
GNU Affero General Public License v3.0
6 stars 3 forks source link

[Feature] Transform MEMBER users that are not synchronized anymore to LOCAL_USER and vice versa #350

Open Yoronex opened 1 month ago

Yoronex commented 1 month ago

What would you like?

See title.

Why is this needed?

When a user disappears from GEWISDB, they can no longer log in at SudoSOS, as the GEWIS.nl authentication method is no longer available to them. Therefore, we should automatically transform these accounts to local accounts, so these users can remain active in SudoSOS. This is necessary, because accounts can only be deleted if their balance is exactly 0. If they are still in debt, they need to be able to pay of their debt. If they still have some balance left, they should be able to spend this money one way or another.

If their deletion from GEWISDB was somehow a mistake, we should assume these accounts can be restored and will pop up again during syncing. However, we will only transform a LOCAL account back to a MEMBER account if they log in via gewis.nl. Their password (if present) should be deleted.

How could it be implemented?

Note that during the transformation, we should disallow the user to go into debt. LOCAL users should not be able to go into debt (unless specifically allowed by the BACPM).

Other information

No response