From b884de71ce177d96b197eab1909250e7cbd653ff Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 12 Sep 2024 11:49:53 +0100 Subject: [PATCH] Bug 37592: (QA follow-up) Add API mapping and definition Sticking to API guidelines, this adds the creation_date and modification_date fields to the api definitions and the required to_api_mappings for those fields to be properly populated. Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- Koha/Booking.pm | 5 ++++- api/v1/swagger/definitions/booking.yaml | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Koha/Booking.pm b/Koha/Booking.pm index e5297d8d17..403ca3bf4e 100644 --- a/Koha/Booking.pm +++ b/Koha/Booking.pm @@ -241,7 +241,10 @@ on the API. =cut sub to_api_mapping { - return {}; + return { + created_on => "creation_date", + updated_on => "modification_date" + }; } =head3 delete diff --git a/api/v1/swagger/definitions/booking.yaml b/api/v1/swagger/definitions/booking.yaml index 5a7b8cc77b..d6db77263c 100644 --- a/api/v1/swagger/definitions/booking.yaml +++ b/api/v1/swagger/definitions/booking.yaml @@ -10,6 +10,10 @@ properties: booking_id: description: Internal booking identifier type: integer + creation_date: + description: Creation date and time of this booking + format: date-time + type: string end_date: description: Start date and time of this booking format: date-time @@ -24,6 +28,10 @@ properties: type: - object - 'null' + modification_date: + description: Modification date and time of this booking + format: date-time + type: string patron_id: description: Internal patron identifier type: integer -- 2.39.5