diff --git a/docs/ApiValidationRules.md b/docs/ApiValidationRules.md index 64bf33a..ec18ec9 100644 --- a/docs/ApiValidationRules.md +++ b/docs/ApiValidationRules.md @@ -61,11 +61,12 @@ PUT / DELETE calls referencing entities that are not found in the database will ### Return value -If a validation rule fails the call should return 400 (Bad request) including an error message in the format already in use: +If a validation rule fails the call should return 400 (Bad request) including an error message in the following format: ```json { - "message" : "reason why this call failed" + "error_field" : "A reference to the respective field(s) which have caused the error", + "error_description" : "Reason why this call failed" } ``` @@ -81,6 +82,10 @@ Date and date+time values are specified as text formatted in [RFC 3339](https:// Usually the "Z" is missing at the end indicating local time. +Generally, times may not be updated to a value in the past. There are exception (see SHIPCALL PUT below). + +Times should also not be set to a value more than 1 year in the future. The reasoning is to prevent shipcalls to stick to the top of the list by implausible (or for the workings of Bremen calling irrelevant) values too far in the future. + ## /shipcall POST 1. The call may only be performed by a user belonging to participant group type BSMD. @@ -123,7 +128,11 @@ Usually the "Z" is missing at the end indicating local time. 1. The call may only be performed by a user belonging to participant group type BSMD. 2. If a agency is selected via the shipcall_participant_map entry, users of this agency may also edit the shipcall. Care has to be taken: The agency must have been set _before_ a member of the group may edit the record. In other words: no setting the agency and editing the record by a member of the agency within the same call. -3. See value rules in /shipcall POST. Exception: Canceled may be set but only if not already set. +3. See value rules in /shipcall POST. + Exceptions: + a) Canceled may be set but only if not already set. + b) ETA/ETD may be in the past. This can happen if an agency has entered an ETA/ETD (times) in the future but + wants to edit fields of the shipcall record (e.g. the draft) but the shipcall was originally created with an ETA/ETD in the past 4. A cancelled shipcall may not be changed (is logical delete) #### Required fields @@ -189,7 +198,7 @@ shipcall_id, participant_id, participant_type 1. A dataset may only be changed by a user belonging to the same participant as the times dataset is referring to. 2. See reference and value checking as specified in /times POST. -3. The shipcall type may not be changed. +3. The shipcall type may not be changed. #### Required fields