User Management

The plaform will require users to log in to gain access. These users will mostly be created by a default admin. The default admin should be created automatically when the system is deployed. The password will also be changed if after signing in for the first time, it is still using the default password. The default login details should be admin / ChangeThisPassword!.

All users should login with their mobile numbers and a password. We believe this will be easier to remember than usernames.

Adding Users

The default admin will be responsible for adding other users to the plaform. Farmer onboarding is described in detail here. Below are the fields to collect when adding users. Required fields are in red.

Field Description
First name The first name of the user. If they fail to enter a value for this show the message "Please enter a first name"
Last name The last name of the user. If they fail to select a value for this show the message "Please enter a last name"
Email The user's email address. Ideally this should be the corporate address. If they fail to enter a value for this show the message "Please enter a valid email address".
Mobile The mobile number of the user. We need to indicate to the user this is what they will use to sign in. If they fail to enter a value for this, show the message "Please enter a mobile number"
Gender The user's gender. Should be male, female, other. If they fail to select a value for this, show the message "Please select a gender"
Department This will be a dropdown of all departments already created in the platform. If they fail to select a value, show the message "Please select a department"
Role This will be a list of roles defined in the system for Agropal. If they fail to select a value, show the message "Please select a role for this user"

You will notice the admin does not enter the password of the user they just added. An email should be sent to users once the admin adds them to the system. The email should contain a link to activate their account. It is during the account activation process that they set a password. Users should automatically be signed in once they activate their accounts.

Deleting or Deactivating Users

It should be possible for admins to delete or deactivate users. Deleting a user should remove the user from the system completely but only if they have no records tied to their account. Deleting a user should remove their record from the list of admins. An admin should also be able to deactivate users. Doing this prevents the user from signing in to the platform to perform any actions. The user record should however, still be in the list of admins.

Password Reset

The sign in page should have a password reset link. Clicking on this should send the user an OTP via email and SMS. Entering the correct OTP should take the user to a page where they can enter their new password. The new password needs to be confirmed.

Roles

Roles will be defined by the developers of the Traceability platform but need to mimic roles of users expected to use the platform. We will need to be able to know how to validate the roles in code thus this cannot be defined at the discretion of Agropal.

Agropal will have the following roles.

Field Description
Admin Responsible for adding other users to the platform and making entries under setup.
Sourcing officer Responsible for onboarding suppliers and adding farms.
Procurement manager Responsible for approving suppliers who are input or material suppliers. Also responsible for approving list of inputs/materials.
Intake supervisor Responsible for receiving fruits from suppliers and issuing fruits to production manager.
Warehouse manager Manages warehouses and inventory. Also issues requests for ancillary items.
Export Manager Responsible for overseeing entries due for shipping.

Permissions

Permissions are also defined by the developers of the system and used internally to enforce what users' roles permit. The following fields are required to create permissions.

Field Description
Name The user friendly name of the permission. Example: can create new users. If they fail to enter a value for this show the message "Please enter a permission name"
Slug The immutable version of the permission name. This is what will actually be used in code to enforce the rules. This needs to be unique and must be generated by the system. The admin should not be able to enter this. Example: can-create-users. Once created, the slug can never be updated.

Permissions need to be assigned to roles and roles assigned to users. The user then inherits all the permissions tied to their role.