unee-t / enterprise-rest-api

RestFUL API on Unee-T enterprise
https://eapi.dev.unee-t.com/
0 stars 1 forks source link

API to check the list of possible unit types #8

Closed franck-boullier closed 5 years ago

franck-boullier commented 5 years ago

One of the requirement of #3 is that the 3rd party uses a valid Unit Type when a unit is created or modified.

This document the API to retrieve the list of Active Unit Type

How it should work:

Option 1 - Active Unit types:

Input:

active

Output:

The list of active unit types

The SQL query to retrieve the list of Unit Types:

Below is the query to list this in the UNTE Database

SELECT `designation` 
FROM `ut_unit_types`
WHERE `is_obsolete` = 0
;

Option 1 - All Unit types:

Input:

all

Output:

The list of ALL unit types:

The SQL query to retrieve the list of Unit Types:

Below is the query to list this in the UNTE Database

SELECT `designation` 
  , `is_obsolete`
FROM `ut_unit_types`
;
kaihendry commented 5 years ago

Isn't the active/all a bit over engineered? Why not just return the current list like country codes?

kaihendry commented 5 years ago

Documented in Postman https://documenter.getpostman.com/view/3704379/SVSEtB4z though atm there is an odd sync bug giving the wrong request name of "List country codes Copy"

franck-boullier commented 5 years ago

@kaihendry the current implementation is different from what was specified here.

Can you please describe what you have done so I can understand and test it? And no, the current description in postman does NOT help me understand what you were trying to implement (are you returning all the unit types or just the active ones?)

kaihendry commented 5 years ago
franck-boullier commented 5 years ago

https://eapi.dev.unee-t.com/unittypes?all

This one is missing the status of the Unit Type record (active or not) Is this complex to implement @kaihendry ?

kaihendry commented 5 years ago

Introduced the inactive mapping in https://github.com/unee-t/enterprise-rest-api/commit/af76e490cd8c79391cfa45f71fa9bf4d42aadf7a

franck-boullier commented 5 years ago

Thanks @kaihendry!

Can you please reploy this to the DEMO and PROD environment and close this issue when it's done?

kaihendry commented 5 years ago