https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14962

--- Comment #657 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 211879
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211879&action=edit
Bug 14962: (QA follow-up) Name the display item API fields as the API
guidelines require

The display item representation used the column names, against
coding_guidelines_api.md REST1.3.4: relations are <thing>_id and dates are
*_date. This is cheaper to change now than once clients exist.

  itemnumber   -> item_id
  biblionumber -> biblio_id
  date_added   -> added_date
  date_remove  -> removal_date  (it is scheduled, not yet removed)

Koha::Display::Item gets a to_api_mapping, so display items embedded in a
display, the display items endpoints, the batch add endpoint and the public
endpoints all follow, including the query filters. The items of a display sent
to POST/PUT /displays are converted back for the model.

Those nested items had no schema at all, so anything was accepted, including
the old names (read as model attributes by accident). Describe them, with no
additional properties, so a request using the old names is a clear 400.

The Vue app, the Add to display script on the record page, the item table
helper, the Cypress specs and mock data, and the API tests follow. The record
page now always sends removal_date, as null when the date is cleared: the API
requires it, and earlier in this series the field stopped being required.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to