Versions Compared

Key

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

and Overview

The Department Entity service manages the department and its hierarchies metadata. It deals with department entity and department hierarchy only.
Department Hierarchy store only hierarchies definition like metadata for department level and department entity stores actual department data with its ancestry information.

...

It contains department entity information along with its hierarchy level and also attaches master department information (department id - UUID). It keeps all child level information lists at every department node (department record). The leaf level department does not have any children’s info.
ChiThe childld child list contains the department entity ID list, which makes the current department entity parent of all children list (department ID list). This is how it maintains the department entity level.

...

  1. Create Department Entity:
    It passes tenant Id, master department id, hierarchy level, its cand children list with department entity name and code. Tenant, hierarchy level and the master department is are root info about the department entity. If the department entity does not contain any child, that means it is a leaf department entity it can only seek for its parent.

  2. Search Department Entity:
    It can make search requests based on any department entity attribute but can't skip tenant information, it returns the whole department entity details along with its child information. It finds all ancestry information of the current department entity.

  3. Update Department Entity:
    Update the existing department entity by searching based on department entity id and tenant id.
    Mandatory Fields to update department entity "id" and "tenant id".
    We can update any attribute in the department entity except “id” itself.
    updatable attribute list: tenantId, departmentId, code, name, hierarchyLevel hierarchy level and children.

    It does a few validation before updating the department entity.

    • departmentId and children can not be update updated without hierarchyLevelhierarchy level.

    • hierarchyLevel hierarchy level value should be valid for departmentId and children. If the value got mismatch mismatched then it will throw an appropriate error message.

    • It checks in the system before doing an update, that department entity id is available or not. If exist then it'll update else throw a meaningful error message.

...