Zeyad2003 commented on code in PR #3994: URL: https://github.com/apache/fineract/pull/3994#discussion_r1721819184
########## custom/v3/common/configuration/src/main/java/org/apache/fineract/v3/common/configuration/CommonCacheConfiguration.java: ########## @@ -0,0 +1,57 @@ +/** + * 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.v3.common.configuration; + +import java.time.Duration; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.fineract.infrastructure.core.service.ThreadLocalContextUtil; +import org.apache.fineract.infrastructure.core.service.tenant.TenantDetailsService; +import org.springframework.boot.autoconfigure.cache.RedisCacheManagerBuilderCustomizer; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.cache.RedisCacheConfiguration; +import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.RedisSerializationContext; + +@Slf4j +@EnableCaching +@Configuration +@RequiredArgsConstructor +public class CommonCacheConfiguration { Review Comment: Noted. ########## custom/v3/command/data/src/main/java/org/apache/fineract/v3/command/data/CommandResponse.java: ########## @@ -0,0 +1,48 @@ +/** + * 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.v3.command.data; + +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import java.io.Serial; +import java.io.Serializable; +import java.time.Instant; +import java.util.UUID; +import lombok.Data; +import lombok.experimental.FieldNameConstants; +import lombok.experimental.SuperBuilder; + +@Data +@SuperBuilder +@FieldNameConstants +public class CommandResponse<T> implements Serializable { + + @Serial + private static final long serialVersionUID = 1L; + + private UUID requestId; + private String tenantId; + private Long userId; + private String errorCode; + private String errorMessage; + private Instant createdAt; + + @JsonUnwrapped Review Comment: Yes, I used it to return the same response structure as the upstream API does. It's been removed now. > [!NOTE] > > The difference between responses: > > - **Current Response:** > ```json > { > // other attributes > "data": { > "resourceId": 1 > // data attributes > } > } > ``` > - **The Upstream Response:** > ```json > { > "resourceId": 1 > } > ``` -- 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]
