diff --git a/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala b/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala index b6480ea91c..d86701486f 100644 --- a/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala +++ b/obp-api/src/main/scala/code/api/ResourceDocs1_4_0/SwaggerDefinitionsJSON.scala @@ -4226,7 +4226,6 @@ object SwaggerDefinitionsJSON { status = ConsentStatus.INITIATED.toString, api_standard = "Berlin Group", api_version = "v1.3", - jwt = "eyJhbGciOiJIUzI1NiJ9.eyJlbnRpdGxlbWVudHMiOltdLCJjcmVhdGVkQnlVc2VySWQiOiIiLCJzdWIiOiJmY2YzNDZkMi0xNTNiLTQ0MzAtOWE4Zi1mMzU3Njg1MzM5ODciLCJhdWQiOiIyNjY0NjUwYy04MDkwLTQ4MWUtOGJkOC0wM2E5MmY5Yzg3ZWEiLCJuYmYiOjE3MzAzNzMyNzEsImFjY2VzcyI6eyJhY2NvdW50cyI6W3siaWJhbiI6IlJTMzUyNjAwMDU2MDEwMDE2MTEzNzkifV19LCJpc3MiOiJodHRwczovLzEyNy4wLjAuMTo4MDgwIiwiZXhwIjoxNzMwOTM3NjAwLCJpYXQiOjE3MzAzNzMyNzEsImp0aSI6ImQzM2Y3NDYzLWVlNDktNGU4YS04YTkyLTYxMzhkYzE4M2QxNiIsInZpZXdzIjpbeyJiYW5rX2lkIjoibmxia2IiLCJhY2NvdW50X2lkIjoiOTUzODkyOTctNDVjNC00MGViLTllZmQtMzMxYmExOTQzZGE0Iiwidmlld19pZCI6IlJlYWRBY2NvdW50c0Jlcmxpbkdyb3VwIn1dfQ.SXE4W34596lrSXqZrA8cvQs_fvhjWYilU8VDpXZ3C3Y", jwt_payload = SwaggerDefinitionsJsonUtil.jwtPayload, ) val consentsJsonV510 = ConsentsJsonV510(List(allConsentJsonV510)) diff --git a/obp-api/src/main/scala/code/api/v4_0_0/APIMethods400.scala b/obp-api/src/main/scala/code/api/v4_0_0/APIMethods400.scala index 5d274d09a1..4d5dee831d 100644 --- a/obp-api/src/main/scala/code/api/v4_0_0/APIMethods400.scala +++ b/obp-api/src/main/scala/code/api/v4_0_0/APIMethods400.scala @@ -12499,10 +12499,22 @@ object APIMethods400 extends RestHelper with APIMethods400 { // Convert LocalDate to Date zoneId: ZoneId = ZoneId.systemDefault() firstCurrentMonthDate: Date = Date.from(firstDayOfMonth.atStartOfDay(zoneId).toInstant) - lastCurrentMonthDate: Date = Date.from(lastDayOfMonth.atStartOfDay(zoneId).toInstant) + // Adjust to include 23:59:59.999 + lastCurrentMonthDate: Date = Date.from( + lastDayOfMonth + .atTime(23, 59, 59, 999000000) + .atZone(zoneId) + .toInstant + ) firstCurrentYearDate: Date = Date.from(firstDayOfYear.atStartOfDay(zoneId).toInstant) - lastCurrentYearDate: Date = Date.from(lastDayOfYear.atStartOfDay(zoneId).toInstant) + // Adjust to include 23:59:59.999 + lastCurrentYearDate: Date = Date.from( + lastDayOfYear + .atTime(23, 59, 59, 999000000) + .atZone(zoneId) + .toInstant + ) defaultFromDate: Date = theEpochTime defaultToDate: Date = APIUtil.ToDateInFuture diff --git a/obp-api/src/main/scala/code/api/v5_1_0/APIMethods510.scala b/obp-api/src/main/scala/code/api/v5_1_0/APIMethods510.scala index 384c569775..3534aa3af2 100644 --- a/obp-api/src/main/scala/code/api/v5_1_0/APIMethods510.scala +++ b/obp-api/src/main/scala/code/api/v5_1_0/APIMethods510.scala @@ -3601,10 +3601,22 @@ trait APIMethods510 { // Convert LocalDate to Date zoneId: ZoneId = ZoneId.systemDefault() firstCurrentMonthDate: Date = Date.from(firstDayOfMonth.atStartOfDay(zoneId).toInstant) - lastCurrentMonthDate: Date = Date.from(lastDayOfMonth.atStartOfDay(zoneId).toInstant) + // Adjust to include 23:59:59.999 + lastCurrentMonthDate: Date = Date.from( + lastDayOfMonth + .atTime(23, 59, 59, 999000000) + .atZone(zoneId) + .toInstant + ) firstCurrentYearDate: Date = Date.from(firstDayOfYear.atStartOfDay(zoneId).toInstant) - lastCurrentYearDate: Date = Date.from(lastDayOfYear.atStartOfDay(zoneId).toInstant) + // Adjust to include 23:59:59.999 + lastCurrentYearDate: Date = Date.from( + lastDayOfYear + .atTime(23, 59, 59, 999000000) + .atZone(zoneId) + .toInstant + ) defaultFromDate: Date = theEpochTime defaultToDate: Date = APIUtil.ToDateInFuture diff --git a/obp-api/src/main/scala/code/api/v5_1_0/JSONFactory5.1.0.scala b/obp-api/src/main/scala/code/api/v5_1_0/JSONFactory5.1.0.scala index 07b2d1ef8a..0a6da1e685 100644 --- a/obp-api/src/main/scala/code/api/v5_1_0/JSONFactory5.1.0.scala +++ b/obp-api/src/main/scala/code/api/v5_1_0/JSONFactory5.1.0.scala @@ -145,7 +145,6 @@ case class AllConsentJsonV510(consent_reference_id: String, status: String, last_action_date: String, last_usage_date: String, - jwt: String, jwt_payload: Box[ConsentJWT], api_standard: String, api_version: String, @@ -889,7 +888,6 @@ object JSONFactory510 extends CustomJsonFormats { status = c.status, last_action_date = if (c.lastActionDate != null) new SimpleDateFormat(DateWithDay).format(c.lastActionDate) else null, last_usage_date = if (c.usesSoFarTodayCounterUpdatedAt != null) new SimpleDateFormat(DateWithSeconds).format(c.usesSoFarTodayCounterUpdatedAt) else null, - jwt = c.jsonWebToken, jwt_payload = jwtPayload, api_standard = c.apiStandard, api_version = c.apiVersion diff --git a/obp-api/src/test/scala/code/api/v5_1_0/CounterpartyLimitTest.scala b/obp-api/src/test/scala/code/api/v5_1_0/CounterpartyLimitTest.scala index 6033c5d51c..6f78fbe235 100644 --- a/obp-api/src/test/scala/code/api/v5_1_0/CounterpartyLimitTest.scala +++ b/obp-api/src/test/scala/code/api/v5_1_0/CounterpartyLimitTest.scala @@ -392,7 +392,7 @@ class CounterpartyLimitTest extends V510ServerSetup { response4.body.extract[ErrorMessage].message contains(CounterpartyLimitValidationError) shouldBe (true) response4.body.extract[ErrorMessage].message contains("max_number_of_transactions") shouldBe(true) - val requestLimitStatus = (v5_1_0_Request / "banks" / bankId / "accounts" / accountId / "views" / ownerView /"counterparties" / counterparty.counterpartyId /"limit-status").POST <@ (user1) + val requestLimitStatus = (v5_1_0_Request / "banks" / bankId / "accounts" / accountId / "views" / ownerView /"counterparties" / counterparty.counterpartyId /"limit-status").GET <@ (user1) val responseLimitStatus = makeGetRequest(requestLimitStatus) responseLimitStatus.code shouldBe (200) responseLimitStatus.body.extract[CounterpartyLimitStatusV510].status.currency_status shouldBe("EUR")