Prerequisite
...
You will need these tools:
- Vagrant
- PostgreSQL
- Postman
...
Deploying module on Vagrant
Follow these steps:
- Thunderjet - Onboarding plan
- How to run folio backend modules with IntelliJ Idea and interact with Vagrant box environment
- Vagrantfile (use this file as an example. it includes Kafka port, PostgreSQL port and some extra functionalities which help vagrant works smoothly)
- Postman Collection for Mod-Consortia (it include all basic API request) - Redeploy-mod-consortia.postman_collection.json
...
default port 8081 for mod-consortia. your requests from postman collection (get list of tenant request) works expected
Create a tenant locally
If everything is working well until this step, Let's move on to creating tenants locally.
Theory:
Mod-Consortia ER Diagram:
Before creating a tenant, we need to understand what creating why create a tenant locally and use.
If we create a new tenant, we will create schemas for this tenant.
...
Mod-consortia stores tenant information inside the tenant table
To create shadow users and work with assigning/unassigning affiliations, we need these tenants. Let's see how to assigning/unassigning user and create shadow user.
- Created affiliation with testtenant1 and user.
- Get shadow user with x-okapi-tenant: testtenant1
Process (Let's start to setup):
Create a tenant (testtenant1)
- create a consortium (it will be only one consortium)
- create tenant
- enable tenant for module ( mod_-users )for tenant
- New schema will be created (testtenant1_mod_user → testtenant1 - tenant name, mod_user - enabled module)
Assigning/unassigning process and creating shadow user:
- Create a user
This user also will be created in db primary affiliation with primary tenant (diku) - Then, Create assign affiliation with testtenant
- Get user list to see whether it is created or not. This assigned affiliation creates a shadow user for testtenant1. This user stored in testtenant1_mod_users
you will see user active: true. If you unassigned this user for testtenant1 it will be false