ЕСОЗ - публічна документація
RC_warranty_Get approvals (apps)
Purpose
This WS is designed to show all active approvals made by the user to different clients
Key points
Only active approvals is returned
Approvals filtered by the user based on token details
It is allowed to search approvals (e.g.: by client name)
Specification
Validate request
Validate x-consumer-id (user)
Ensure that header
x-consumer-id
passed to requestin 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
Get
user_id
from token (x-consumer-id
header)Add
user_id
to query paramsin case there some other
user_id
in query params - all of them must be overwritten byuser_id
from token
Service shouldn't display approvals to the trusted
client_type
select approvals where apps.client_id = (select clients.id where clients.client_type = (select client_type.id where client_type.name = TRUSTED_CLIENT_TYPE))
trusted
client_type.name
are in the list of TRUSTED_CLIENT_TYPE config
Mithril.Api
Mithril.Rpc: :search_apps
ЕСОЗ - публічна документація