Skip to content

ANDi roles, statuses and types ​

This doc will go through how we currently use the andis-table.

Roles ​

Each ANDI will have a roles field, which is an array of strings that are defined in the user-roles table. Below is the list of important roles which ANDis may have, depending on their jobRole.

Role NameDescription
ANDIAll active ANDIs have this role and it gives them the permission to view the majority of the apps as well as to view/edit their own personal information
BusinessUnitLeadShould be auto assigned to Club Exec, enabling them to see ANDi profiles of their own BU, as well as invoice reconciliation pages.
ClientServicesUsed for members of the Client Services team, enabling additional functionality in places like Record Time and Deliver Engagements. Needed for creating and raising invoices. May be paired with additionalBusinessUnits field for cross-business unit activities in Luna.
CommercialAdminUsed for members of the Finance team, enabling additional functionality in places like Deliver Engagements. Needed especially for finalising and voiding invoices, which are actions in the Invoicing Dashboard displayed as separate to what ClientServices users may see. Takes priority over ClientServices.
PeopleLeadPeople Operations Partner and People Partners will have this role which allows them access to the Nurture ANDIs app. They are only able to view ANDis who are in the business units they oversee - i.e. from the additionalBusinessUnits field.
PeopleLeadAdminThis is very similar to the PeopleLead role except that they are allowed to view ANDis from all business units
PayrollANDIs who work in Payroll will have this role which allows them access to the Payroll app. It gives them the ability to read and generate reports.
OnboardingAdminThis is for members of the Learning & Development team, enabling them to access the /prepare-onboarding page to create and manage onboarding cohorts and instances.
OnboardingANDIs who are onboarding (25 days before they start and 2 days after they join) will have this role. It only allows them to view the Onboarding app.
SharesAdminUsed for members who administer AND's Share Scheme (e.g. Share Scheme Manager, Chief for Finance), enabling access to share-related functionality.
CompanyAdminAssigned to senior leadership and People Operations job roles (e.g. Club Executive, Hub Exec, People Partner, and anyone with a Chief job role), giving company-wide administrative access.
RecruitmentUsed for members of the Talent Acquisition team (e.g. Talent Acquisition Partner, Talent Supply Lead), enabling access to recruitment functionality.

The roles are automatically given to the ANDi when they are Onboarded, Progressed or their Employment contract has been edited. The logic performs a check on their jobRole and assigns them the correct role that they should gain.

NOTE: To allow users to view ANDis from different clubs, the ANDI record may have the additionalBusinessUnits field, which is an array of strings of business units. For example: additionalBusinessUnits: ['Club Ada', 'Club Dekker']

Adding/Modifying a New Role/New Permission ​

The roles are stored in the user-roles table (${Environment}-user-roles-table, owned by the auth service). Any changes to a role's permissions should be made through the auth service's PUT /user-roles/{userRoleId} API (handler: services/auth/commands/src/handlers/updateUserRole.ts), which updates the role's permissions field.

Which roles get auto-assigned to an ANDi is a separate concern from the permissions above — that logic lives in getRolesFromJobRole (packages/utils/src/helpers/getRoleFromJobRole.ts), which maps an ANDi's jobRole to the roles listed in the table above.

How to Give Yourself a Role in the Lower Environments ​

During local development, you might need to change your role to give yourself access to certain apps etc. To do this you'll need to:

  • Find your ANDi record in the staging-andis-table. The quickest way to do this would be to use the workEmail-index GSI and query for your work email address.
  • Edit the roles field and add the role you want to have e.g PeopleLeadAdmin.
  • In your localhost, log out of Luna and back in again to generate a new auth token.
  • If you check the auth endpoint in the network tab, you'll notice you will have the roles you added.
  • The role you assigned to yourself is defined in the environment you are hooked up to e.g if you're working in the polaris environment, the PeopleLeadAdmin will use the permissions defined for the PeopleLeadAdmin in the polaris-user-roles-table.

Status and AndiType ​

During an ANDi's career with AND, their status and andiType will change. They are paired as follows and in the order of a typical ANDi journey:

statusandiTypeDescription
HiredCandidateWhen the Onboarding team mark a candidate in Workable or Pinpoint as Hired, we create an ANDI record in Luna for this new candidate with these fields
DisqualifiedCandidateWhen a candidate in Workable is hired and for some reason they no longer join AND, the Onboarding team will mark them as Disqualified in Workable. This changes their status for the candidate's ANDI record in Luna to Disqualified
OnboardingEmployee25 days before the startDate an ANDi joins, we send them an email to fill out their onboarding form and change their status from Hired to Onboarding and their andiType from Candidate to Employee. Furthermore, we add the Onboarding role to their roles field in order to give them access to the Onboarding app to fill in their details.
ActiveEmployee2 days after their startDate, the ANDi will be in bootcamp and we change their status from Onboarding to Active and give them the ANDI role as well as any other roles depending on their jobRole. e.g if they are a People Partner, they will have the PeopleLead role.
LeaverEmployeeWhen an Andi leaves, their People Partner will create a leaver item for them. As soon as they create said item, their status will change from Active to Leaver
LeftAlumniOn an ANDi's contractualEndDate, their status will change from Leaver to Left and their andiType from Employee to Alumni.

These are the only pairings we have in Luna. There should never be the case of a mix and match of the status and andiType. For example, status is Left and andiType is Hired should never happen.

Type ​

The andis-table is used to store/reference different types of items. As a result, the type field is used to differentiate between these groups.

typeDescription
ANDIInformation about an ANDi e.g firstName, lastName, salary
DOCUMENTInformation about a Document e.g managerHasAccess, signed, category. It contains an andiId for the ANDi it belongs to. The key refers to the path of where it is stored in S3. It follows the structure of: {andiId}/{uuid}.{name of the file}
HISTORY#PROGRESSIONInformation about a progression which is created during the Progression flow e.g level, businessUnit, salary. It contains an andiId for the ANDi who is getting progressed.
HISTORY#LEAVERInformation about a leaver which is created during the Leaver flow e.g contractualEndDate, typeOfExit, annualLeaveAmountCalculated. It contains an andiId for the ANDi who is leaving.
TRANSACTIONInformation about a payment or deduction which is created during the Payment/Deductions flow e.g amount, reason, currency. It contains an andiId for the ANDi recipient. If the transaction was created as part of a leaver flow, it will have a historyId field which is the id for the corresponding HISTORY#LEAVER item.
UPDATE#ADDRESSInformation about an ANDi's address which is created if the address has changed in the Update Profile flow e.g addressLine1, city, postcode. It contains an andiId for the ANDi who changed their address.
UPDATE#BANK_DETAILSInformation about an ANDi's bank details which is created if the bank details have changed in the Update Profile flow e.g accountName, accountNumber, sortCode (all encrypted). It contains an andiId for the ANDi who changed their address.

Made with ❤️ by the Luna team