From 83cfbc50a30d2b952b8446ef8759266d1278bd66 Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Thu, 2 Nov 2023 11:35:50 +0100 Subject: [PATCH 01/13] Use stylelint to indent user loans & reservations mock data files --- ...-9b13da33-2be3-4711-8664-81c27009495e.json | 40 +++++++++---------- ...-1b8c0935-12c7-43c9-9a49-3e591cc079bb.json | 36 ++++++++--------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.docker/wiremock/publizon/mappings/v1_user_loans-9b13da33-2be3-4711-8664-81c27009495e.json b/.docker/wiremock/publizon/mappings/v1_user_loans-9b13da33-2be3-4711-8664-81c27009495e.json index 1783603f88..3cd932b1d2 100644 --- a/.docker/wiremock/publizon/mappings/v1_user_loans-9b13da33-2be3-4711-8664-81c27009495e.json +++ b/.docker/wiremock/publizon/mappings/v1_user_loans-9b13da33-2be3-4711-8664-81c27009495e.json @@ -1,24 +1,24 @@ { - "id" : "9b13da33-2be3-4711-8664-81c27009495e", - "name" : "Loans (list)", - "request" : { - "url" : "/v1/user/loans", - "method" : "GET" + "id": "9b13da33-2be3-4711-8664-81c27009495e", + "name": "Loans (list)", + "request": { + "url": "/v1/user/loans", + "method": "GET" }, - "response" : { - "status" : 200, - "body" : "{\n \"loans\": [\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-33 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='2 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"2022-09-01T06:32:30Z\",\n \"loanExpireDateUtc\": null,\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderDateUtc\": \"{{now offset='-2 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='5 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"2022-09-16T06:32:30Z\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": null,\n \"loanExpireDateUtc\": \"{{now offset='0 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-42 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='55 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now}}\",\n \"loanExpireDateUtc\": \"{{now offset='15 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-22 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='53 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": null,\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now offset='-2 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='533 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-132 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='12 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": null,\n \"loanExpireDateUtc\": null,\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now offset='-323 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n }, {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now offset='-3 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n }, {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"2022-09-03T06:32:30Z\",\n \"loanExpireDateUtc\": \"2022-09-13T06:32:30Z\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='11 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now offset='-2 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='12 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n }, {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"2022-09-07T06:32:30Z\",\n \"loanExpireDateUtc\": \"2022-09-12T06:32:30Z\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='13 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='21 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n }, {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='14 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-4 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='5 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now offset='-1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='21 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n }, {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='12 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='13 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now offset='-1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n }\n ],\n \"libraryData\": {\n \"loanDurationDays\": 0,\n \"maxConcurrentEbookLoansPerBorrower\": 0,\n \"maxConcurrentAudiobookLoansPerBorrower\": 0,\n \"maxAmountPerMonth\": 0\n },\n \"userData\": {\n \"totalLoans\": 2,\n \"totalEbookLoans\": 1,\n \"totalAudioLoans\": 1,\n \"ebookLoansRemaining\": -2,\n \"audiobookLoansRemaining\": -2,\n \"ebookLoanAvailableUtc\": \"2022-08-16T10:04:44.2734375Z\",\n \"audioLoanAvailableUtc\": \"2022-08-16T10:04:44.2734375Z\",\n \"friendlyCardNumber\": \"8R9W59\"\n },\n \"code\": 101,\n \"message\": \"OK\"\n}", - "headers" : { - "vary" : "Origin", - "content-type" : "application/json; charset=utf-8", - "date" : "{{now format='yyyy-MM-dd HH:mm:ssZ'}}", - "strict-transport-security" : "max-age=15552000" + "response": { + "status": 200, + "body": "{\n \"loans\": [\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-33 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='2 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"2022-09-01T06:32:30Z\",\n \"loanExpireDateUtc\": null,\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderDateUtc\": \"{{now offset='-2 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='5 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"2022-09-16T06:32:30Z\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": null,\n \"loanExpireDateUtc\": \"{{now offset='0 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-42 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='55 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now}}\",\n \"loanExpireDateUtc\": \"{{now offset='15 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-22 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='53 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": null,\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now offset='-2 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='533 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-132 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='12 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": null,\n \"loanExpireDateUtc\": null,\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now offset='-323 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n }, {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now offset='-3 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n }, {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"2022-09-03T06:32:30Z\",\n \"loanExpireDateUtc\": \"2022-09-13T06:32:30Z\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='11 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now offset='-2 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='12 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n }, {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"2022-09-07T06:32:30Z\",\n \"loanExpireDateUtc\": \"2022-09-12T06:32:30Z\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='13 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='21 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n }, {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='14 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-4 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='5 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now offset='-1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='21 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n }, {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='12 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076951\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"082bb01a-8979-424b-93a6-7cc7081f8a45\",\n \"orderNumber\": \"0c5a287f-be96-4a68-a85a-453864b330cd\",\n \"orderDateUtc\": \"{{now offset='-32 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='13 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788771076950\",\n \"identifierType\": 15,\n \"title\": \"Tættere end man tror\",\n \"publishersName\": \"Jentas\"\n },\n \"fileExtensionType\": 3\n },\n {\n \"orderId\": \"58058e94-a03f-4018-bec1-816ee7894ab8\",\n \"orderNumber\": \"3c060277-3218-4ad2-98fe-a57bce1cf1e6\",\n \"orderDateUtc\": \"{{now offset='-1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"loanExpireDateUtc\": \"{{now offset='1 days' format='yyyy-MM-dd HH:mm:ssZ'}}\",\n \"isSubscriptionLoan\": false,\n \"libraryBook\": {\n \"identifier\": \"9788711514245\",\n \"identifierType\": 3,\n \"title\": \"Fuldmåne i oktober\",\n \"publishersName\": \"Lindhardt og Ringhof\"\n },\n \"fileExtensionType\": 1\n }\n ],\n \"libraryData\": {\n \"loanDurationDays\": 0,\n \"maxConcurrentEbookLoansPerBorrower\": 0,\n \"maxConcurrentAudiobookLoansPerBorrower\": 0,\n \"maxAmountPerMonth\": 0\n },\n \"userData\": {\n \"totalLoans\": 2,\n \"totalEbookLoans\": 1,\n \"totalAudioLoans\": 1,\n \"ebookLoansRemaining\": -2,\n \"audiobookLoansRemaining\": -2,\n \"ebookLoanAvailableUtc\": \"2022-08-16T10:04:44.2734375Z\",\n \"audioLoanAvailableUtc\": \"2022-08-16T10:04:44.2734375Z\",\n \"friendlyCardNumber\": \"8R9W59\"\n },\n \"code\": 101,\n \"message\": \"OK\"\n}", + "headers": { + "vary": "Origin", + "content-type": "application/json; charset=utf-8", + "date": "{{now format='yyyy-MM-dd HH:mm:ssZ'}}", + "strict-transport-security": "max-age=15552000" }, - "transformers" : [ "response-template" ] + "transformers": ["response-template"] }, - "uuid" : "9b13da33-2be3-4711-8664-81c27009495e", - "persistent" : true, - "priority" : 5, - "insertionIndex" : 19, - "postServeActions" : [ ] -} \ No newline at end of file + "uuid": "9b13da33-2be3-4711-8664-81c27009495e", + "persistent": true, + "priority": 5, + "insertionIndex": 19, + "postServeActions": [] +} diff --git a/.docker/wiremock/publizon/mappings/v1_user_reservations-1b8c0935-12c7-43c9-9a49-3e591cc079bb.json b/.docker/wiremock/publizon/mappings/v1_user_reservations-1b8c0935-12c7-43c9-9a49-3e591cc079bb.json index ca3ec5bb41..80ac54dc4b 100644 --- a/.docker/wiremock/publizon/mappings/v1_user_reservations-1b8c0935-12c7-43c9-9a49-3e591cc079bb.json +++ b/.docker/wiremock/publizon/mappings/v1_user_reservations-1b8c0935-12c7-43c9-9a49-3e591cc079bb.json @@ -1,22 +1,22 @@ { - "id" : "1b8c0935-12c7-43c9-9a49-3e591cc079bb", - "name" : "Reservations (list)", - "request" : { - "url" : "/v1/user/reservations", - "method" : "GET" + "id": "1b8c0935-12c7-43c9-9a49-3e591cc079bb", + "name": "Reservations (list)", + "request": { + "url": "/v1/user/reservations", + "method": "GET" }, - "response" : { - "status" : 200, - "body" : "{\n \"reservations\": [\n {\n \"productId\": \"0ddd10d0-d69f-4734-8a27-ac4546f4b912\",\n \"identifier\": \"9788711321683\",\n \"createdDateUtc\": \"2022-08-16T10:52:39.932Z\",\n \"status\": 1,\n \"productTitle\": \"Bargums synder\",\n \"expireDateUtc\": \"2023-01-27T19:37:15.63Z\",\n \"expectedRedeemDateUtc\": \"2023-01-27T19:37:15.63Z\"\n },\n {\n \"productId\": \"0ddd10d0-d69f-4734-8a27-ac4546f4b912\",\n \"identifier\": \"9788740047905\",\n \"createdDateUtc\": \"2022-08-16T10:52:39.932Z\",\n \"status\": 2,\n \"productTitle\": \"Bargums synder\",\n \"expireDateUtc\": \"2023-01-27T19:37:15.63Z\",\n \"expectedRedeemDateUtc\": \"2023-01-27T19:37:15.63Z\"\n }\n ],\n \"code\": 101,\n \"message\": \"OK\"\n}", - "headers" : { - "content-type" : "application/json; charset=utf-8", - "date" : "{{now format='yyyy-MM-dd HH:mm:ssZ'}}", - "strict-transport-security" : "max-age=15552000" + "response": { + "status": 200, + "body": "{\n \"reservations\": [\n {\n \"productId\": \"0ddd10d0-d69f-4734-8a27-ac4546f4b912\",\n \"identifier\": \"9788711321683\",\n \"createdDateUtc\": \"2022-08-16T10:52:39.932Z\",\n \"status\": 1,\n \"productTitle\": \"Bargums synder\",\n \"expireDateUtc\": \"2023-01-27T19:37:15.63Z\",\n \"expectedRedeemDateUtc\": \"2023-01-27T19:37:15.63Z\"\n },\n {\n \"productId\": \"0ddd10d0-d69f-4734-8a27-ac4546f4b912\",\n \"identifier\": \"9788702319361\",\n \"createdDateUtc\": \"2022-08-16T10:52:39.932Z\",\n \"status\": 2,\n \"productTitle\": \"Bargums synder\",\n \"expireDateUtc\": \"2023-01-27T19:37:15.63Z\",\n \"expectedRedeemDateUtc\": \"2023-01-27T19:37:15.63Z\"\n }\n ],\n \"code\": 101,\n \"message\": \"OK\"\n}", + "headers": { + "content-type": "application/json; charset=utf-8", + "date": "{{now format='yyyy-MM-dd HH:mm:ssZ'}}", + "strict-transport-security": "max-age=15552000" } }, - "uuid" : "1b8c0935-12c7-43c9-9a49-3e591cc079bb", - "persistent" : true, - "priority" : 5, - "insertionIndex" : 23, - "postServeActions" : [ ] -} \ No newline at end of file + "uuid": "1b8c0935-12c7-43c9-9a49-3e591cc079bb", + "persistent": true, + "priority": 5, + "insertionIndex": 23, + "postServeActions": [] +} From 5feea57010865fd4e7007b4fda26ccfb978d1122 Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Thu, 2 Nov 2023 11:51:06 +0100 Subject: [PATCH 02/13] Add new graphql fragments & query & update the schema - Fragments for manifestation with only access data - complexSearchWithPagination query --- src/apps/material/openOrder.graphql | 2 +- src/apps/search-result/search.graphql | 14 + src/components/facet-browser/helper.ts | 2 +- src/core/dbc-gateway/fragments.graphql | 39 +++ .../dbc-gateway/generated/graphql.schema.json | 279 +++++++++++++++++- src/core/dbc-gateway/generated/graphql.tsx | 234 ++++++++++++++- 6 files changed, 561 insertions(+), 9 deletions(-) diff --git a/src/apps/material/openOrder.graphql b/src/apps/material/openOrder.graphql index 309887eb49..e3c2a813fa 100644 --- a/src/apps/material/openOrder.graphql +++ b/src/apps/material/openOrder.graphql @@ -1,5 +1,5 @@ mutation openOrder($input: SubmitOrderInput!) { - submitOrder(input: $input, dryRun: false) { + submitOrder(input: $input, dryRun: false) { status message orderId diff --git a/src/apps/search-result/search.graphql b/src/apps/search-result/search.graphql index b606340d99..001893820b 100644 --- a/src/apps/search-result/search.graphql +++ b/src/apps/search-result/search.graphql @@ -11,3 +11,17 @@ query searchWithPagination( } } } + +query complexSearchWithPagination( + $cql: String!, + $offset: Int!, + $limit: PaginationLimit!, + $filters: ComplexSearchFilters! +) { + complexSearch(cql: $cql, filters: $filters) { + hitcount + works(offset: $offset, limit: $limit) { + ...WorkAccess + } + } +} diff --git a/src/components/facet-browser/helper.ts b/src/components/facet-browser/helper.ts index 385b7c0b9c..2deeb2872c 100644 --- a/src/components/facet-browser/helper.ts +++ b/src/components/facet-browser/helper.ts @@ -130,7 +130,7 @@ export const getFacetFieldTranslation = (name: FacetField) => { case FacetField.WorkTypes: return "facetWorkTypesText"; default: - return invalidSwitchCase(name); + return invalidSwitchCase(name as never); } }; diff --git a/src/core/dbc-gateway/fragments.graphql b/src/core/dbc-gateway/fragments.graphql index edb9a8245f..b7d153dd6b 100644 --- a/src/core/dbc-gateway/fragments.graphql +++ b/src/core/dbc-gateway/fragments.graphql @@ -10,6 +10,38 @@ fragment ManifestationsSimple on Manifestations { } } +fragment ManifestationsAccess on Manifestations { + all { + pid, + identifiers { + type + value + } + access { + __typename + ... on AccessUrl { + origin + url + loginRequired + } + ... on InfomediaService { + id + } + ... on InterLibraryLoan { + loanIsPossible + } + ... on Ereol { + origin + url + canAlwaysBeLoaned + } + ... on DigitalArticleService { + issn + } + } + } +} + fragment ManifestationsSimpleFields on Manifestation { pid genreAndForm @@ -161,6 +193,13 @@ fragment SeriesSimple on Series { readThisWhenever } +fragment WorkAccess on Work { + workId + manifestations { + ...ManifestationsAccess + } +} + fragment WorkSmall on Work { workId titles { diff --git a/src/core/dbc-gateway/generated/graphql.schema.json b/src/core/dbc-gateway/generated/graphql.schema.json index 7550d93c06..554cdf0a90 100644 --- a/src/core/dbc-gateway/generated/graphql.schema.json +++ b/src/core/dbc-gateway/generated/graphql.schema.json @@ -2042,6 +2042,12 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "dk5", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "fictionNonfiction", "description": null, @@ -2089,6 +2095,12 @@ "description": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "year", + "description": null, + "isDeprecated": false, + "deprecationReason": null } ], "possibleTypes": null @@ -2298,6 +2310,150 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "GeneralMaterialType", + "description": null, + "fields": [ + { + "name": "code", + "description": "code for materialType # @TODO - is this a finite list ?? - and where to get it", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "GeneralMaterialTypeCode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "display", + "description": "Ths string to display", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "GeneralMaterialTypeCode", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ARTICLES", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "AUDIO_BOOKS", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BOARD_GAMES", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BOOKS", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "COMICS", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "COMPUTER_GAMES", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "EBOOKS", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FILMS", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "IMAGE_MATERIALS", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MUSIC", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NEWSPAPER_JOURNALS", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OTHER", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PODCASTS", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SHEET_MUSIC", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "TV_SERIES", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, { "kind": "ENUM", "name": "HoldingsStatus", @@ -4654,7 +4810,7 @@ "fields": [ { "name": "general", - "description": "The general type of material of the manifestation based on a grouping of bibliotek.dk material types, e.g. bøger, lydbøger etc. ", + "description": "The general type of material of the manifestation based on a grouping of bibliotek.dk material types, e.g. bøger, lydbøger etc. \n@TODO - this on is deprecated pr. 1/2 '24", "args": [], "type": { "kind": "NON_NULL", @@ -4665,12 +4821,44 @@ "ofType": null } }, + "isDeprecated": true, + "deprecationReason": "Use 'materialTypeGenerel' instead" + }, + { + "name": "materialTypeGeneral", + "description": "jed 1.1 - the general materialtype", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "GeneralMaterialType", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "materialTypeSpecific", + "description": "jed 1.1 - the specific materialtType", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SpecificMaterialType", + "ofType": null + } + }, "isDeprecated": false, "deprecationReason": null }, { "name": "specific", - "description": "The type of material of the manifestation based on bibliotek.dk types", + "description": "The type of material of the manifestation based on bibliotek.dk types\n@TODO - this on is deprecated pr. 1/2 '24", "args": [], "type": { "kind": "NON_NULL", @@ -4681,8 +4869,8 @@ "ofType": null } }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": true, + "deprecationReason": "Use 'materialtTypeSpecific' instead" } ], "inputFields": null, @@ -7721,6 +7909,26 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "dk5", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "fictionNonfiction", "description": null, @@ -7940,6 +8148,26 @@ "defaultValue": null, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "year", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null } ], "interfaces": null, @@ -8473,6 +8701,49 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "SpecificMaterialType", + "description": null, + "fields": [ + { + "name": "code", + "description": "code for materialType", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "display", + "description": "Ths string to display", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "SCALAR", "name": "String", diff --git a/src/core/dbc-gateway/generated/graphql.tsx b/src/core/dbc-gateway/generated/graphql.tsx index f61e654ae1..c55f49c370 100644 --- a/src/core/dbc-gateway/generated/graphql.tsx +++ b/src/core/dbc-gateway/generated/graphql.tsx @@ -330,6 +330,7 @@ export enum FacetField { CanAlwaysBeLoaned = "canAlwaysBeLoaned", ChildrenOrAdults = "childrenOrAdults", Creators = "creators", + Dk5 = "dk5", FictionNonfiction = "fictionNonfiction", FictionalCharacters = "fictionalCharacters", GenreAndForm = "genreAndForm", @@ -337,7 +338,8 @@ export enum FacetField { MaterialTypesGeneral = "materialTypesGeneral", MaterialTypesSpecific = "materialTypesSpecific", Subjects = "subjects", - WorkTypes = "workTypes" + WorkTypes = "workTypes", + Year = "year" } /** The result for a specific facet */ @@ -379,6 +381,32 @@ export enum FictionNonfictionCode { NotSpecified = "NOT_SPECIFIED" } +export type GeneralMaterialType = { + __typename?: "GeneralMaterialType"; + /** code for materialType # @TODO - is this a finite list ?? - and where to get it */ + code: GeneralMaterialTypeCode; + /** Ths string to display */ + display: Scalars["String"]; +}; + +export enum GeneralMaterialTypeCode { + Articles = "ARTICLES", + AudioBooks = "AUDIO_BOOKS", + BoardGames = "BOARD_GAMES", + Books = "BOOKS", + Comics = "COMICS", + ComputerGames = "COMPUTER_GAMES", + Ebooks = "EBOOKS", + Films = "FILMS", + ImageMaterials = "IMAGE_MATERIALS", + Music = "MUSIC", + NewspaperJournals = "NEWSPAPER_JOURNALS", + Other = "OTHER", + Podcasts = "PODCASTS", + SheetMusic = "SHEET_MUSIC", + TvSeries = "TV_SERIES" +} + export enum HoldingsStatus { /** Holding is on loan */ OnLoan = "OnLoan", @@ -700,9 +728,21 @@ export type Manifestations = { export type MaterialType = { __typename?: "MaterialType"; - /** The general type of material of the manifestation based on a grouping of bibliotek.dk material types, e.g. bøger, lydbøger etc. */ + /** + * The general type of material of the manifestation based on a grouping of bibliotek.dk material types, e.g. bøger, lydbøger etc. + * @TODO - this on is deprecated pr. 1/2 '24 + * @deprecated Use 'materialTypeGenerel' instead + */ general: Scalars["String"]; - /** The type of material of the manifestation based on bibliotek.dk types */ + /** jed 1.1 - the general materialtype */ + materialTypeGeneral: GeneralMaterialType; + /** jed 1.1 - the specific materialtType */ + materialTypeSpecific: SpecificMaterialType; + /** + * The type of material of the manifestation based on bibliotek.dk types + * @TODO - this on is deprecated pr. 1/2 '24 + * @deprecated Use 'materialtTypeSpecific' instead + */ specific: Scalars["String"]; }; @@ -1103,6 +1143,7 @@ export type SearchFilters = { childrenOrAdults?: InputMaybe>; creators?: InputMaybe>; department?: InputMaybe>; + dk5?: InputMaybe>; fictionNonfiction?: InputMaybe>; fictionalCharacters?: InputMaybe>; genreAndForm?: InputMaybe>; @@ -1114,6 +1155,7 @@ export type SearchFilters = { subjects?: InputMaybe>; sublocation?: InputMaybe>; workTypes?: InputMaybe>; + year?: InputMaybe>; }; /** The supported fields to query */ @@ -1212,6 +1254,14 @@ export type Shelfmark = { shelfmark: Scalars["String"]; }; +export type SpecificMaterialType = { + __typename?: "SpecificMaterialType"; + /** code for materialType */ + code: Scalars["String"]; + /** Ths string to display */ + display: Scalars["String"]; +}; + export type Subject = { display: Scalars["String"]; /** Language of the subject - contains display and isoCode */ @@ -2988,6 +3038,54 @@ export type SearchWithPaginationQuery = { }; }; +export type ComplexSearchWithPaginationQueryVariables = Exact<{ + cql: Scalars["String"]; + offset: Scalars["Int"]; + limit: Scalars["PaginationLimit"]; + filters: ComplexSearchFilters; +}>; + +export type ComplexSearchWithPaginationQuery = { + __typename?: "Query"; + complexSearch: { + __typename?: "ComplexSearchResponse"; + hitcount: number; + works: Array<{ + __typename?: "Work"; + workId: string; + manifestations: { + __typename?: "Manifestations"; + all: Array<{ + __typename?: "Manifestation"; + pid: string; + identifiers: Array<{ + __typename?: "Identifier"; + type: IdentifierType; + value: string; + }>; + access: Array< + | { + __typename: "AccessUrl"; + origin: string; + url: string; + loginRequired: boolean; + } + | { __typename: "DigitalArticleService"; issn: string } + | { + __typename: "Ereol"; + origin: string; + url: string; + canAlwaysBeLoaned: boolean; + } + | { __typename: "InfomediaService"; id: string } + | { __typename: "InterLibraryLoan"; loanIsPossible: boolean } + >; + }>; + }; + }>; + }; +}; + export type SuggestionsFromQueryStringQueryVariables = Exact<{ q: Scalars["String"]; }>; @@ -3353,6 +3451,36 @@ export type ManifestationsSimpleFragment = { }; }; +export type ManifestationsAccessFragment = { + __typename?: "Manifestations"; + all: Array<{ + __typename?: "Manifestation"; + pid: string; + identifiers: Array<{ + __typename?: "Identifier"; + type: IdentifierType; + value: string; + }>; + access: Array< + | { + __typename: "AccessUrl"; + origin: string; + url: string; + loginRequired: boolean; + } + | { __typename: "DigitalArticleService"; issn: string } + | { + __typename: "Ereol"; + origin: string; + url: string; + canAlwaysBeLoaned: boolean; + } + | { __typename: "InfomediaService"; id: string } + | { __typename: "InterLibraryLoan"; loanIsPossible: boolean } + >; + }>; +}; + export type ManifestationsSimpleFieldsFragment = { __typename?: "Manifestation"; pid: string; @@ -3499,6 +3627,40 @@ export type SeriesSimpleFragment = { } | null; }; +export type WorkAccessFragment = { + __typename?: "Work"; + workId: string; + manifestations: { + __typename?: "Manifestations"; + all: Array<{ + __typename?: "Manifestation"; + pid: string; + identifiers: Array<{ + __typename?: "Identifier"; + type: IdentifierType; + value: string; + }>; + access: Array< + | { + __typename: "AccessUrl"; + origin: string; + url: string; + loginRequired: boolean; + } + | { __typename: "DigitalArticleService"; issn: string } + | { + __typename: "Ereol"; + origin: string; + url: string; + canAlwaysBeLoaned: boolean; + } + | { __typename: "InfomediaService"; id: string } + | { __typename: "InterLibraryLoan"; loanIsPossible: boolean } + >; + }>; + }; +}; + export type WorkSmallFragment = { __typename?: "Work"; workId: string; @@ -4225,6 +4387,47 @@ export const ManifestationReviewFieldsFragmentDoc = ` } } `; +export const ManifestationsAccessFragmentDoc = ` + fragment ManifestationsAccess on Manifestations { + all { + pid + identifiers { + type + value + } + access { + __typename + ... on AccessUrl { + origin + url + loginRequired + } + ... on InfomediaService { + id + } + ... on InterLibraryLoan { + loanIsPossible + } + ... on Ereol { + origin + url + canAlwaysBeLoaned + } + ... on DigitalArticleService { + issn + } + } + } +} + `; +export const WorkAccessFragmentDoc = ` + fragment WorkAccess on Work { + workId + manifestations { + ...ManifestationsAccess + } +} + ${ManifestationsAccessFragmentDoc}`; export const SeriesSimpleFragmentDoc = ` fragment SeriesSimple on Series { title @@ -4634,6 +4837,31 @@ export const useSearchWithPaginationQuery = < ), options ); +export const ComplexSearchWithPaginationDocument = ` + query complexSearchWithPagination($cql: String!, $offset: Int!, $limit: PaginationLimit!, $filters: ComplexSearchFilters!) { + complexSearch(cql: $cql, filters: $filters) { + hitcount + works(offset: $offset, limit: $limit) { + ...WorkAccess + } + } +} + ${WorkAccessFragmentDoc}`; +export const useComplexSearchWithPaginationQuery = < + TData = ComplexSearchWithPaginationQuery, + TError = unknown +>( + variables: ComplexSearchWithPaginationQueryVariables, + options?: UseQueryOptions +) => + useQuery( + ["complexSearchWithPagination", variables], + fetcher< + ComplexSearchWithPaginationQuery, + ComplexSearchWithPaginationQueryVariables + >(ComplexSearchWithPaginationDocument, variables), + options + ); export const SuggestionsFromQueryStringDocument = ` query suggestionsFromQueryString($q: String!) { suggest(q: $q) { From 5c272b2c69107c8dbb52d210e72f7d4d9bd6dccf Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Thu, 2 Nov 2023 11:57:56 +0100 Subject: [PATCH 03/13] Make it possible for LinkButton to recieve an id The LinkButon wraps arount the Link component, and the Link component supports this. --- src/components/Buttons/LinkButton.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Buttons/LinkButton.tsx b/src/components/Buttons/LinkButton.tsx index 872160c3aa..11d0fca590 100644 --- a/src/components/Buttons/LinkButton.tsx +++ b/src/components/Buttons/LinkButton.tsx @@ -20,6 +20,7 @@ export interface LinkButtonProps { url: URL; variant: ButtonVariant; ariaLabelledBy?: string; + id?: string; } const LinkButton: React.FC = ({ @@ -33,7 +34,8 @@ const LinkButton: React.FC = ({ trackClick, url, variant = "filled", - ariaLabelledBy + ariaLabelledBy, + id }) => { return ( = ({ trackClick={trackClick} dataCy={dataCy} ariaLabelledBy={ariaLabelledBy} + id={id} > {children} From 7cab1b3519d758b1643a83b449483265ed36fdaa Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Thu, 2 Nov 2023 12:01:09 +0100 Subject: [PATCH 04/13] Make MaterialButtonLoading accept classNames from parents --- .../material-buttons/generic/MaterialButtonLoading.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/material/material-buttons/generic/MaterialButtonLoading.tsx b/src/components/material/material-buttons/generic/MaterialButtonLoading.tsx index 1045941df2..754bb3f5ba 100644 --- a/src/components/material/material-buttons/generic/MaterialButtonLoading.tsx +++ b/src/components/material/material-buttons/generic/MaterialButtonLoading.tsx @@ -6,9 +6,13 @@ import { Button } from "../../../Buttons/Button"; export interface MaterialButtonLoadingProps { size?: ButtonSize; + classNames?: string; } -const MaterialButtonLoading: FC = ({ size }) => { +const MaterialButtonLoading: FC = ({ + size, + classNames +}) => { const t = useText(); return ( @@ -19,6 +23,7 @@ const MaterialButtonLoading: FC = ({ size }) => { disabled collapsible={false} size={size || "large"} + classNames={classNames || ""} /> ); }; From 6f991c196038524edcb291c5b1571428ea5b542f Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Thu, 2 Nov 2023 12:03:12 +0100 Subject: [PATCH 05/13] Link to ereol material page from reservation details for ereol materials Eg. a user has a reservation for the Bible from the Ereol platform - upon opening the reservation details modal and clicking on the "Go to Ereolen" external link button, they will be redirected to the Bible work page on the Ereol platform. In the case of this access data not being available in the FBI API the user is redirected to the Ereol home page instead. --- .../list/reservation-list.dev.tsx | 2 +- .../modal/reservation-details/helper.ts | 34 +++++++++ .../reservation-details-redirect.tsx | 19 ++--- .../reservation-details.tsx | 76 ++++++++++++++----- 4 files changed, 104 insertions(+), 27 deletions(-) create mode 100644 src/apps/reservation-list/modal/reservation-details/helper.ts diff --git a/src/apps/reservation-list/list/reservation-list.dev.tsx b/src/apps/reservation-list/list/reservation-list.dev.tsx index 4a93383e80..19e98e93b3 100644 --- a/src/apps/reservation-list/list/reservation-list.dev.tsx +++ b/src/apps/reservation-list/list/reservation-list.dev.tsx @@ -256,7 +256,7 @@ const { reservationDetails } = getModalIds(); export const ReservationListDigitalDetailsModal = Template.bind({}); ReservationListDigitalDetailsModal.parameters = { query: { - modal: `${reservationDetails}9788740047905` + modal: `${reservationDetails}9788702319361` } }; diff --git a/src/apps/reservation-list/modal/reservation-details/helper.ts b/src/apps/reservation-list/modal/reservation-details/helper.ts new file mode 100644 index 0000000000..52155061f2 --- /dev/null +++ b/src/apps/reservation-list/modal/reservation-details/helper.ts @@ -0,0 +1,34 @@ +import { ComplexSearchWithPaginationQuery } from "../../../../core/dbc-gateway/generated/graphql"; + +type AccessManifestations = + ComplexSearchWithPaginationQuery["complexSearch"]["works"][0]["manifestations"]["all"]; + +export const findAccessManifestationByIdentifier = ( + manifestations: AccessManifestations, + identifier: string +) => { + return manifestations.filter((manifestation) => + manifestation.identifiers.find( + (id) => id.value.replace(/\D/g, "") === identifier.replace(/\D/g, "") + ) + ); +}; + +export const findEreolAccessLinkFromManifestations = ( + manifestations: AccessManifestations +) => { + const manifestationWithEreolAccess = manifestations.find((manifestation) => { + return manifestation.access.find((access) => { + return access.__typename === "Ereol"; + }); + }); + const ereolAccess = manifestationWithEreolAccess?.access.find( + (access) => access.__typename === "Ereol" + ); + // TODO: Find out why TS doesn't understand that ereolAccess will always exist + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore-next-line + return ereolAccess?.url; +}; + +export default {}; diff --git a/src/apps/reservation-list/modal/reservation-details/reservation-details-redirect.tsx b/src/apps/reservation-list/modal/reservation-details/reservation-details-redirect.tsx index dfe814672a..1ba6f014d1 100644 --- a/src/apps/reservation-list/modal/reservation-details/reservation-details-redirect.tsx +++ b/src/apps/reservation-list/modal/reservation-details/reservation-details-redirect.tsx @@ -1,10 +1,9 @@ import React, { FC } from "react"; import ExternalLinkIcon from "@danskernesdigitalebibliotek/dpl-design-system/build/icons/buttons/icon-btn-external-link.svg"; -import Link from "../../../../components/atoms/links/Link"; import { useText } from "../../../../core/utils/text"; import { MaterialProps } from "../../../loan-list/materials/utils/material-fetch-hoc"; -import { useUrls } from "../../../../core/utils/url"; import { ReservationType } from "../../../../core/utils/types/reservation-type"; +import LinkButton from "../../../../components/Buttons/LinkButton"; export interface ReservationDetailsRedirectProps { reservation: ReservationType; @@ -12,6 +11,7 @@ export interface ReservationDetailsRedirectProps { reservationId: string; className?: string; linkClassNames?: string; + externalLink: URL; } const ReservationDetailsRedirect: FC< @@ -20,28 +20,29 @@ const ReservationDetailsRedirect: FC< reservation, openReservationDeleteModal, className, - linkClassNames + linkClassNames, + externalLink }) => { const t = useText(); - const { ereolenMyPageUrl } = useUrls(); return (
- {t("reservationDetailsDigitalReservationGoToEreolenText")} - +
); }; diff --git a/src/apps/reservation-list/modal/reservation-details/reservation-details.tsx b/src/apps/reservation-list/modal/reservation-details/reservation-details.tsx index 2b0e4249d4..eaeac5e85d 100644 --- a/src/apps/reservation-list/modal/reservation-details/reservation-details.tsx +++ b/src/apps/reservation-list/modal/reservation-details/reservation-details.tsx @@ -1,4 +1,4 @@ -import React, { FC } from "react"; +import React, { FC, useEffect, useState } from "react"; import { ReservationType } from "../../../../core/utils/types/reservation-type"; import fetchMaterial, { MaterialProps @@ -12,6 +12,12 @@ import fetchDigitalMaterial from "../../../loan-list/materials/utils/digital-mat import PhysicalListDetails from "./physical-list-details"; import { useConfig } from "../../../../core/utils/config"; import { isConfigValueOne } from "../../../../components/reservation/helper"; +import MaterialButtonLoading from "../../../../components/material/material-buttons/generic/MaterialButtonLoading"; +import { useComplexSearchWithPaginationQuery } from "../../../../core/dbc-gateway/generated/graphql"; +import { + findAccessManifestationByIdentifier, + findEreolAccessLinkFromManifestations +} from "./helper"; export interface ReservationDetailsProps { reservation: ReservationType; @@ -25,6 +31,7 @@ const ReservationDetails: FC = ({ }) => { const t = useText(); const config = useConfig(); + const [externalUrl, setExternalUrl] = useState(null); const { state, identifier, numberInQueue } = reservation; const { authors, pid, year, title, description, materialType } = material || {}; @@ -38,6 +45,28 @@ const ReservationDetails: FC = ({ isConfigValueOne(allowRemoveReadyReservation)) || state !== readyForPickupState; + const { data: complexSearchData, isLoading: isLoadingComplexSearch } = + useComplexSearchWithPaginationQuery( + { cql: `term.isbn=${identifier}`, offset: 0, limit: 100, filters: {} }, + { enabled: !!identifier } + ); + + useEffect(() => { + if (!complexSearchData || complexSearchData.complexSearch.hitcount === 0) { + return; + } + const matchingManifestations = findAccessManifestationByIdentifier( + complexSearchData.complexSearch.works[0].manifestations.all, + identifier || "" + ); + setExternalUrl( + new URL( + findEreolAccessLinkFromManifestations(matchingManifestations) || + "https://ereolen.dk" + ) + ); + }, [complexSearchData, identifier]); + return (
{material && ( @@ -66,15 +95,24 @@ const ReservationDetails: FC = ({ numberInQueue={numberInQueue} /> )} - {isDigital && reservation.identifier && ( - + {isDigital && reservation.identifier && isLoadingComplexSearch && ( + )} + {isDigital && + reservation.identifier && + !isLoadingComplexSearch && + externalUrl && ( +
+ +
+ )}
{isDigital && } {!isDigital && } @@ -87,14 +125,18 @@ const ReservationDetails: FC = ({ reservation={reservation} /> )} - {isDigital && reservation.identifier && ( - - )} + {isDigital && + reservation.identifier && + !isLoadingComplexSearch && + externalUrl && ( + + )} )}
From 005426d1f57cfc516fe5e0a496312860ffd3e99f Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Thu, 2 Nov 2023 15:33:17 +0100 Subject: [PATCH 06/13] Update reservation-details.test with a new reservation work identifier --- .../modal/reservation-details/reservation-details.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/reservation-list/modal/reservation-details/reservation-details.test.ts b/src/apps/reservation-list/modal/reservation-details/reservation-details.test.ts index ca7b56edbb..94363ad72e 100644 --- a/src/apps/reservation-list/modal/reservation-details/reservation-details.test.ts +++ b/src/apps/reservation-list/modal/reservation-details/reservation-details.test.ts @@ -86,7 +86,7 @@ describe("Reservation details modal test", () => { reservations: [ { productId: "0ddd10d0-d69f-4734-8a27-ac4546f4b912", - identifier: "9788740047905", + identifier: "9788702319361", createdDateUtc: "2022-08-16T10:52:39.932Z", status: 2, productTitle: "Bargums synder", @@ -258,7 +258,7 @@ describe("Reservation details modal test", () => { reservations: [ { productId: "0ddd10d0-d69f-4734-8a27-ac4546f4b912", - identifier: "9788740047905", + identifier: "9788702319361", createdDateUtc: "2022-08-16T12:52:39.932Z", status: 1, productTitle: "Bargums synder", From 369fe96188b1e05088de538ba236ba74a2134584 Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Tue, 7 Nov 2023 09:07:33 +0100 Subject: [PATCH 07/13] Make sure loading button in reservation details modal is placed correct It was missing a wrapping div so it was misaligned. --- .../modal/reservation-details/reservation-details.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/apps/reservation-list/modal/reservation-details/reservation-details.tsx b/src/apps/reservation-list/modal/reservation-details/reservation-details.tsx index bc797b0813..150b6eade5 100644 --- a/src/apps/reservation-list/modal/reservation-details/reservation-details.tsx +++ b/src/apps/reservation-list/modal/reservation-details/reservation-details.tsx @@ -96,7 +96,9 @@ const ReservationDetails: FC = ({ /> )} {isDigital && reservation.identifier && isLoadingComplexSearch && ( - +
+ +
)} {isDigital && reservation.identifier && From 7a6e7dff5da2fc259f4f79e977e9903436698c46 Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Tue, 7 Nov 2023 09:08:31 +0100 Subject: [PATCH 08/13] Make sure "Go to ereol" button has a data-cy prop for Cypress testing --- .../reservation-details/reservation-details-redirect.tsx | 1 + .../modal/reservation-details/reservation-details.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/apps/reservation-list/modal/reservation-details/reservation-details-redirect.tsx b/src/apps/reservation-list/modal/reservation-details/reservation-details-redirect.tsx index 1ba6f014d1..a8cacf5afe 100644 --- a/src/apps/reservation-list/modal/reservation-details/reservation-details-redirect.tsx +++ b/src/apps/reservation-list/modal/reservation-details/reservation-details-redirect.tsx @@ -35,6 +35,7 @@ const ReservationDetailsRedirect: FC< {t("reservationDetailsRemoveDigitalReservationText")} { .eq(0) .should("have.text", "Go to eReolen") .should("have.attr", "href") - // ID 17 2.d.i. link to "ereolen.dk/user/me" - .should("include", "ereolen.dk/user/me"); + // ID 17 2.d.i. link to "ereolen.dk" + .should("include", "ereolen.dk"); cy.get(".modal") .find(".status-label") From 73b7a65204b6449315f1ab549b2c09fee788bdef Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Tue, 7 Nov 2023 10:08:46 +0100 Subject: [PATCH 09/13] Introduce advanced-search-fbi-api.json Cypress fixture & use it In the reservation details test. --- .../advanced-search-fbi-api.json | 125 ++++++++++++++++++ .../reservation-details.test.ts | 6 + 2 files changed, 131 insertions(+) create mode 100644 cypress/fixtures/reservation-details/advanced-search-fbi-api.json diff --git a/cypress/fixtures/reservation-details/advanced-search-fbi-api.json b/cypress/fixtures/reservation-details/advanced-search-fbi-api.json new file mode 100644 index 0000000000..ef567466ca --- /dev/null +++ b/cypress/fixtures/reservation-details/advanced-search-fbi-api.json @@ -0,0 +1,125 @@ +{ + "data": { + "complexSearch": { + "hitcount": 1, + "works": [ + { + "workId": "work-of:870970-basis:22677780", + "manifestations": { + "all": [ + { + "pid": "870970-basis:22677780", + "identifiers": [ + { + "type": "ISBN", + "value": "9788702319361" + }, + { + "type": "ISBN", + "value": "87-00-45994-1" + } + ], + "access": [ + { + "__typename": "Ereol", + "url": "https://ereolen.dk/ting/object/870970-basis:51412656" + } + ] + }, + { + "pid": "870970-basis:27639097", + "identifiers": [ + { + "type": "ISBN", + "value": "9788702075397" + } + ], + "access": [ + { + "__typename": "InterLibraryLoan", + "loanIsPossible": true + } + ] + }, + { + "pid": "870970-basis:29316945", + "identifiers": [ + { + "type": "ISBN", + "value": "9788702114331" + } + ], + "access": [ + { + "__typename": "InterLibraryLoan", + "loanIsPossible": true + } + ] + }, + { + "pid": "870970-basis:51980239", + "identifiers": [ + { + "type": "ISBN", + "value": "9788702173239" + } + ], + "access": [ + { + "__typename": "InterLibraryLoan", + "loanIsPossible": true + } + ] + }, + { + "pid": "870970-basis:52652219", + "identifiers": [ + { + "type": "ISBN", + "value": "9788702204681" + } + ], + "access": [ + { + "__typename": "InterLibraryLoan", + "loanIsPossible": true + } + ] + }, + { + "pid": "870970-basis:54871929", + "identifiers": [ + { + "type": "ISBN", + "value": "9788702272444" + } + ], + "access": [ + { + "__typename": "InterLibraryLoan", + "loanIsPossible": true + } + ] + }, + { + "pid": "870970-basis:61636935", + "identifiers": [ + { + "type": "ISBN", + "value": "9788702319361" + } + ], + "access": [ + { + "__typename": "InterLibraryLoan", + "loanIsPossible": true + } + ] + } + ] + } + } + ] + } + } +} diff --git a/src/apps/reservation-list/modal/reservation-details/reservation-details.test.ts b/src/apps/reservation-list/modal/reservation-details/reservation-details.test.ts index 84ab4d6a55..4333cdd3f3 100644 --- a/src/apps/reservation-list/modal/reservation-details/reservation-details.test.ts +++ b/src/apps/reservation-list/modal/reservation-details/reservation-details.test.ts @@ -57,6 +57,12 @@ describe("Reservation details modal test", () => { operationName: "getManifestationViaMaterialByFaust", fixtureFilePath: "reservation-details/fbi-api.json" }); + + // Intercept graphql advanced search query. + cy.interceptGraphql({ + operationName: "complexSearchWithPaginationWorkAccess", + fixtureFilePath: "reservation-details/advanced-search-fbi-api.json" + }); }); it("It shows digital reservation details modal", () => { From b4be81fd30799f2c0686ed62d3c168483cae45cf Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Tue, 14 Nov 2023 12:20:33 +0100 Subject: [PATCH 10/13] Document findAccessManifestationByIdentifier in reservation modal helper This function compares ISBN identifiers, which can have different formats, some including spaces, and/or dashes, or without them altogether. Because of this, we remove all non-digit characters first before making a comparison. --- .../reservation-list/modal/reservation-details/helper.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/apps/reservation-list/modal/reservation-details/helper.ts b/src/apps/reservation-list/modal/reservation-details/helper.ts index cc8196bcd6..94b44230d1 100644 --- a/src/apps/reservation-list/modal/reservation-details/helper.ts +++ b/src/apps/reservation-list/modal/reservation-details/helper.ts @@ -6,13 +6,14 @@ type AccessManifestations = export const findAccessManifestationByIdentifier = ( manifestations: AccessManifestations, identifier: string -) => { - return manifestations.filter((manifestation) => +) => + manifestations.filter((manifestation) => manifestation.identifiers.find( + // We are comparing ISBNs here, which can have different formats - + // with spaces/dashes, so we remove all non-digits before comparing. (id) => id.value.replace(/\D/g, "") === identifier.replace(/\D/g, "") ) ); -}; export const findEreolAccessLinkFromManifestations = ( manifestations: AccessManifestations From 601716481def6ad2dd9acb585f9276d0127fdba1 Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Wed, 15 Nov 2023 11:26:53 +0100 Subject: [PATCH 11/13] Add ereolenHomepageUrl to the global url props --- src/core/utils/types/global-url-props.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/utils/types/global-url-props.ts b/src/core/utils/types/global-url-props.ts index c2a5b7e250..94f9a79f67 100644 --- a/src/core/utils/types/global-url-props.ts +++ b/src/core/utils/types/global-url-props.ts @@ -12,6 +12,7 @@ interface GlobalUrlEntryPropsInterface { materialBaseUrl: string; fbiBaseUrl: string; authUrl: string; + ereolenHomepageUrl: string; } export default GlobalUrlEntryPropsInterface; From aca07786338c8aff7ecd94fbf75644ef62d03fe2 Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Wed, 15 Nov 2023 11:28:19 +0100 Subject: [PATCH 12/13] Use global ereolenHomepageUrl in reservation details instead of a string Instead of a hard-coded static string, we now use a configurable url in the reservation details component when redirecting user to ereol's home page. --- src/apps/dashboard/dashboard.dev.tsx | 4 ++++ src/apps/dashboard/dashboard.entry.tsx | 1 + src/apps/menu/menu.dev.tsx | 4 ++++ src/apps/patron-page/PatronPage.dev.tsx | 4 ++++ src/apps/reservation-list/list/reservation-list.dev.tsx | 4 ++++ .../modal/reservation-details/reservation-details.tsx | 6 ++++-- 6 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/apps/dashboard/dashboard.dev.tsx b/src/apps/dashboard/dashboard.dev.tsx index c9786a8519..1187ae0ebc 100644 --- a/src/apps/dashboard/dashboard.dev.tsx +++ b/src/apps/dashboard/dashboard.dev.tsx @@ -34,6 +34,10 @@ export default { defaultValue: "/user/me/reservations", control: { type: "text" } }, + ereolenHomepageUrl: { + defaultValue: "https://ereolen.dk/", + control: { type: "text" } + }, yourProfileText: { defaultValue: "Your profile", control: { type: "text" } diff --git a/src/apps/dashboard/dashboard.entry.tsx b/src/apps/dashboard/dashboard.entry.tsx index c3e370ba15..6818472c9f 100644 --- a/src/apps/dashboard/dashboard.entry.tsx +++ b/src/apps/dashboard/dashboard.entry.tsx @@ -19,6 +19,7 @@ export interface DashBoardProps { physicalLoansUrl: string; feesPageUrl: string; reservationsUrl: string; + ereolenHomepageUrl: string; // Config blacklistedPickupBranchesConfig: string; branchesConfig: string; diff --git a/src/apps/menu/menu.dev.tsx b/src/apps/menu/menu.dev.tsx index 157d7b9d06..59972bd9fd 100644 --- a/src/apps/menu/menu.dev.tsx +++ b/src/apps/menu/menu.dev.tsx @@ -144,6 +144,10 @@ export default { defaultValue: "/Signup", control: { type: "text" } }, + ereolenHomepageUrl: { + defaultValue: "https://ereolen.dk/", + control: { type: "text" } + }, thresholdConfig: { defaultValue: '{\n "colorThresholds":{\n "danger":"0",\n "warning":"6"\n }\n }', diff --git a/src/apps/patron-page/PatronPage.dev.tsx b/src/apps/patron-page/PatronPage.dev.tsx index ee779ad039..30fab5d925 100644 --- a/src/apps/patron-page/PatronPage.dev.tsx +++ b/src/apps/patron-page/PatronPage.dev.tsx @@ -46,6 +46,10 @@ export default { "https://images.unsplash.com/photo-1560888126-5c13ad3f9345?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=2371&q=80", // A goat. control: { type: "text" } }, + ereolenHomepageUrl: { + defaultValue: "https://ereolen.dk/", + control: { type: "text" } + }, // Texts patronPageHeaderText: { defaultValue: "Patron profile page", diff --git a/src/apps/reservation-list/list/reservation-list.dev.tsx b/src/apps/reservation-list/list/reservation-list.dev.tsx index 19e98e93b3..62c0962dd9 100644 --- a/src/apps/reservation-list/list/reservation-list.dev.tsx +++ b/src/apps/reservation-list/list/reservation-list.dev.tsx @@ -61,6 +61,10 @@ export default { "https://images.unsplash.com/photo-1571043733612-d5444ff7d4ae?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1335&q=80", control: { type: "text" } }, + ereolenHomepageUrl: { + defaultValue: "https://ereolen.dk/", + control: { type: "text" } + }, // Texts reservationListHeaderText: { defaultValue: "Your reservations", diff --git a/src/apps/reservation-list/modal/reservation-details/reservation-details.tsx b/src/apps/reservation-list/modal/reservation-details/reservation-details.tsx index 150b6eade5..57bb16882f 100644 --- a/src/apps/reservation-list/modal/reservation-details/reservation-details.tsx +++ b/src/apps/reservation-list/modal/reservation-details/reservation-details.tsx @@ -17,6 +17,7 @@ import { findAccessManifestationByIdentifier, findEreolAccessLinkFromManifestations } from "./helper"; +import { useUrls } from "../../../../core/utils/url"; export interface ReservationDetailsProps { reservation: ReservationType; @@ -50,6 +51,7 @@ const ReservationDetails: FC = ({ { cql: `term.isbn=${identifier}`, offset: 0, limit: 100, filters: {} }, { enabled: !!identifier } ); + const { ereolenHomepageUrl } = useUrls(); useEffect(() => { if (!complexSearchData || complexSearchData.complexSearch.hitcount === 0) { @@ -62,10 +64,10 @@ const ReservationDetails: FC = ({ setExternalUrl( new URL( findEreolAccessLinkFromManifestations(matchingManifestations) || - "https://ereolen.dk" + ereolenHomepageUrl ) ); - }, [complexSearchData, identifier]); + }, [complexSearchData, identifier, ereolenHomepageUrl]); return (
From 7d64e205519be256021001b680e22145aaa0d324 Mon Sep 17 00:00:00 2001 From: Adam Antal Date: Wed, 15 Nov 2023 11:29:54 +0100 Subject: [PATCH 13/13] Limit complex search query to 1 result in reservation details component We only use the first one anyways. And limiting it to 100 could affect performance. --- .../modal/reservation-details/reservation-details.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/reservation-list/modal/reservation-details/reservation-details.tsx b/src/apps/reservation-list/modal/reservation-details/reservation-details.tsx index 57bb16882f..2168f479d0 100644 --- a/src/apps/reservation-list/modal/reservation-details/reservation-details.tsx +++ b/src/apps/reservation-list/modal/reservation-details/reservation-details.tsx @@ -48,7 +48,7 @@ const ReservationDetails: FC = ({ const { data: complexSearchData, isLoading: isLoadingComplexSearch } = useComplexSearchWithPaginationWorkAccessQuery( - { cql: `term.isbn=${identifier}`, offset: 0, limit: 100, filters: {} }, + { cql: `term.isbn=${identifier}`, offset: 0, limit: 1, filters: {} }, { enabled: !!identifier } ); const { ereolenHomepageUrl } = useUrls();