ЕСОЗ - публічна документація

draft_RC_(GraphQL) Get Employee's data (DMS)

Purpose

This WS is designed to allow employee with appropriate scopes to get employee details.

Key points  

  1. This is a graphQl query method used in Administration panel only.

  2. Only authenticated and authorized employee with appropriate scope can get employee details data.

  3. User can filter list by search params

Specification

""" Employee details contain information about Party (personal data) and Employee (professional data) """ type Employee implements Node { "The ID of an object" id: ID! "Primary key identifier from the database" databaseId: UUID! "Employee position." position: String! @fake(locale: "uk", method: "name.title") "First day on the job." startDate: Date! "Last day on the job" endDate: Date "Whether Employee is active or not?" isActive: Boolean! "Employee type, is choosen from dictionary. The value should be present in the `EMPLOYEE_TYPE` dictionary." employeeType: String! "Employee status, is choosen from dictionary. The value should be present in the `EMPLOYEE_STATUS` dictionary." status: String! "Professional information of employee." additionalInfo: EmployeeAdditionalInfo "Personal information of employee." party: Party! "Division in which employee works." division: Division "Legal entity in which employee works." legalEntity: LegalEntity! "Reads and enables pagination through a set of `Employee roles`." roles( "A condition to be used in determining which values should be returned by the collection." filter: EmployeeRoleFilter "The method to use when ordering collection items." orderBy: EmployeeRoleOrderBy "Read all values in the set after (below) this cursor." after: String "Read all values in the set before (above) this cursor." before: String "Only read the first _n_ values of the set." first: Int "Only read the last _n_ values of the set." last: Int ): EmployeeRoleConnection! } """ Professional information of employee. """ type EmployeeAdditionalInfo { "Employee's specialities" specialities: [Speciality] "Employee's educations" educations: [Education] "Employee's qualification" qualifications: [Qualification] "Employee's science degree" scienceDegree: [ScienceDegree] } """ Information about doctor's speciality. """ type Speciality { "Speciality title" speciality: String! @fake(locale: "uk", method: "name.jobTitle") "In case this speciality is a speciality for job position, speciality Officio should be true." specialityOfficio: Boolean! "Qualification level." level: String! "Qualification type." qualificationType: String! "Institution name where qualification was obtained." attestationName: String! "The date when qualification was obtained." attestationDate: Date! "Qualification certificate expiration date." validToDate: Date "Number of qualification certificate." certificateNumber: String! @fake(randexp: "^[0-9]{10}$") } """ Information about employee's education """ type Education { "The city where diploma was obtained" city: String! "The country of education" country: String! "Education degree" degree: String! "The diploma number" diplomaNumber: String! "Oficial name of institution" institutionName: String! "The date when diploma was obtained" issuedDate: Date "Speciality that in mentioned in diploma" speciality: String! } """ Information about employee's qualification """ type Qualification { "Number of qualification certificate." certificateNumber: String "Official name of institution" institutionName: String! "The date when qualification was obtained." issuedDate: Date "Speciality that in mentioned in qualification certificate" speciality: String! "Type qualification certificate" type: String! } """ Information about employee's science degree """ type ScienceDegree { "The city where science degree was obtained" city: String! "The country where science degree was obtained" country: String! "Science degree" degree: String! "Name science degree diploma" diplomaNumber: String! "Official name of institution" institutionName: String! "The date when science degree was obtained." issuedDate: Date "Speciality that in mentioned in science degree certificate" speciality: String! }

Authorize

  • Verify the validity of access token

    • Return (401, 'Invalid access token') in case of validation fails

  • Verify that token is not expired

    • in case of error - return (401, 'Invalid access token')

  • Check user scopes in order to perform this action (scope = 'employee:read')

    • Return (403, 'Your scope does not allow to access this resource. Missing allowances: employee:read') in case of invalid scope(s)

Validate legal entity

  • Extract client_id from token.

  • Check legal entity status (status = ACTIVE)

    • In case of error - return 409 ('client_id refers to legal entity that is not active')

Service logic

  1. Get employee by id from prm.employees

  2. Render a response according to specification.

ЕСОЗ - публічна документація