VictorPavfurious commented on code in PR #4347: URL: https://github.com/apache/fineract/pull/4347#discussion_r1961644060
########## fineract-rates/src/main/java/org/apache/fineract/portfolio/floatingrates/data/FloatingRateIndividualResponse.java: ########## @@ -0,0 +1,46 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.fineract.portfolio.floatingrates.data; + +import java.io.Serial; +import java.time.OffsetDateTime; +import java.util.List; + +public class FloatingRateIndividualResponse extends FloatingRateResponse { + + @Serial + private static final long serialVersionUID = 1L; + + private List<FloatingRatePeriodResponse> ratePeriods; + + public FloatingRateIndividualResponse(Long id, String name, Boolean isBaseLendingRate, Boolean isActive, String createdBy, + OffsetDateTime createdOn, String modifiedBy, OffsetDateTime modifiedOn, List<FloatingRatePeriodResponse> ratePeriods) { + + super(id, name, isBaseLendingRate, isActive, createdBy, createdOn, modifiedBy, modifiedOn); + this.ratePeriods = ratePeriods; + } + + public List<FloatingRatePeriodResponse> getRatePeriods() { + return ratePeriods; Review Comment: Why didn't you use Lombok here for getters/setters? ########## fineract-rates/src/main/java/org/apache/fineract/portfolio/floatingrates/api/FloatingRatesApiResource.java: ########## @@ -27,16 +27,9 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.responses.ApiResponses; import io.swagger.v3.oas.annotations.tags.Tag; -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.POST; -import jakarta.ws.rs.PUT; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.PathParam; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.Context; +import jakarta.validation.Valid; +import jakarta.ws.rs.*; Review Comment: Please, try to use setting like "import like single class" ########## fineract-rates/src/main/java/org/apache/fineract/portfolio/floatingrates/api/FloatingRatesApiResource.java: ########## @@ -79,11 +73,10 @@ public class FloatingRatesApiResource { @RequestBody(required = true, content = @Content(schema = @Schema(implementation = FloatingRatesApiResourceSwagger.PostFloatingRatesRequest.class))) @ApiResponses({ @ApiResponse(responseCode = "200", description = "OK", content = @Content(schema = @Schema(implementation = FloatingRatesApiResourceSwagger.PostFloatingRatesResponse.class))) }) - public String createFloatingRate(@Parameter(hidden = true) final String apiRequestBodyAsJson) { - - final CommandWrapper commandRequest = new CommandWrapperBuilder().createFloatingRate().withJson(apiRequestBodyAsJson).build(); - final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest); - return this.toApiJsonSerializer.serialize(result); + public CommandProcessingResult createFloatingRate(@Parameter(hidden = true) final @Valid FloatingRateRequest floatingRateRequest) { Review Comment: final @Valid ?? Do you use jakarta annotations somewhere ? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
