Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Prerequisite

...

You will need these tools:

  • Vagrant
  • PostgreSQL
  • Postman

...

Deploying module on Vagrant

Follow these steps:

...

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:
Image Added

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.

  1. Created affiliation with testtenant1 and user.

    Image Added
  2. Get shadow user with x-okapi-tenant: testtenant1 

    testImage Added


Process (Let's start to setup):

Create a tenant (testtenant1)

  1. create a consortium (it will be only one consortium)




  2. create tenant 




  3. enable tenant for module ( mod_-users )for tenant




  4. New schema will be created (testtenant1_mod_user → testtenant1 - tenant name, mod_user - enabled module)



Assigning/unassigning process and creating shadow user:

  1. Create a user

    Image Added

    This user also will be created in db primary affiliation with primary tenant (diku)

    Image Added

  2. Then, Create assign affiliation with testtenant

    Image Added


  3. 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

    Image Added

    you will see user active: true. If you unassigned this user for testtenant1 it will be false


This is how you can create tenants locally and setup multiple tenants. After that If you want to do more operations with tenants locally look at this flow
deletion of user tenant associations - https://github.com/folio-org/mod-consortia/pull/24 (full flow documented with screenshot)