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

RC_warranty_Get approvals (apps)

Purpose

This WS is designed to show all active approvals made by the user to different clients

Key points

  1. Only active approvals is returned

  2. Approvals filtered by the user based on token details

  3. It is allowed to search approvals (e.g.: by client name)

Specification

Apiary

Validate request

Validate x-consumer-id (user)

  • Ensure that header x-consumer-id passed to request

    • in case of error - 401 ('Unauthorized')

Service logic

Get approvals from Mithril

Service must return only user-related approvals

Call Mithril to get all user-related approvals

  1. Get user_id from token (x-consumer-id header)

  2. Add user_id to query params

    1. in case there some other user_id in query params - all of them must be overwritten by user_id from token

  3. Service shouldn't display approvals to the trusted client_type

    1. select approvals where apps.client_id = (select clients.id where clients.client_type = (select client_type.id where client_type.name = TRUSTED_CLIENT_TYPE))

    2. trusted client_type.name are in the list of TRUSTED_CLIENT_TYPE config

Mithril.Api

Mithril.Rpc: :search_apps

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