Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,18 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
.hasAnyAuthority(ALL_FUNCTIONS, ALL_FUNCTIONS_READ, "READ_WORKING_DAYS")
.requestMatchers(API_MATCHER.matcher(HttpMethod.PUT, "/api/*/workingdays"))
.hasAnyAuthority(ALL_FUNCTIONS, ALL_FUNCTIONS_WRITE, "UPDATE_WORKING_DAYS")
// field configuration
.requestMatchers(API_MATCHER.matcher(HttpMethod.GET, "/api/*/fieldconfiguration/*"))
.hasAnyAuthority(ALL_FUNCTIONS, ALL_FUNCTIONS_READ, "READ_ADDRESS")
// client address (template before wildcard for specificity)
.requestMatchers(API_MATCHER.matcher(HttpMethod.GET, "/api/*/client/addresses/template"))
.hasAnyAuthority(ALL_FUNCTIONS, ALL_FUNCTIONS_READ, "READ_ADDRESS")
.requestMatchers(API_MATCHER.matcher(HttpMethod.GET, "/api/*/client/*/addresses"))
.hasAnyAuthority(ALL_FUNCTIONS, ALL_FUNCTIONS_READ, "READ_ADDRESS")
.requestMatchers(API_MATCHER.matcher(HttpMethod.POST, "/api/*/client/*/addresses"))
.hasAnyAuthority(ALL_FUNCTIONS, ALL_FUNCTIONS_WRITE, "CREATE_ADDRESS")
.requestMatchers(API_MATCHER.matcher(HttpMethod.PUT, "/api/*/client/*/addresses"))
.hasAnyAuthority(ALL_FUNCTIONS, ALL_FUNCTIONS_WRITE, "UPDATE_ADDRESS")
// interest rate chart slabs (before charts for specificity)
.requestMatchers(API_MATCHER.matcher(HttpMethod.GET, "/api/*/interestratecharts/*/chartslabs"))
.hasAnyAuthority(ALL_FUNCTIONS, ALL_FUNCTIONS_READ, "READ_CHARTSLAB")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@
import jakarta.ws.rs.core.MediaType;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
import org.apache.fineract.portfolio.address.data.FieldConfigurationData;
import org.apache.fineract.portfolio.address.service.FieldConfigurationReadPlatformService;
import org.apache.fineract.portfolio.address.service.FieldConfigurationReadService;
import org.springframework.stereotype.Component;

@Path("/v1/fieldconfiguration/{entity}")
Expand All @@ -39,18 +38,15 @@
+ "wherein various entities and subentities can be related.\n" + "Also it gives the user an ability to enable/disable fields,\n"
+ "add regular expression for validation")
@RequiredArgsConstructor
@Produces({ MediaType.APPLICATION_JSON })
public class EntityFieldConfigurationApiResource {

private static final String RESOURCE_NAME_FOR_PERMISSIONS = "Address";
private final PlatformSecurityContext context;
private final FieldConfigurationReadPlatformService readPlatformServicefld;
private final FieldConfigurationReadService fieldConfigurationReadService;

@GET
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Retrieves the Entity Field Configuration", description = "It retrieves all the Entity Field Configuration")
public List<FieldConfigurationData> getAddresses(@PathParam("entity") @Parameter(description = "entity") final String entityname) {
this.context.authenticatedUser().validateHasReadPermission(RESOURCE_NAME_FOR_PERMISSIONS);
return this.readPlatformServicefld.retrieveFieldConfiguration(entityname);
return this.fieldConfigurationReadService.retrieveFieldConfiguration(entityname);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* 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.address.command;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.fineract.command.core.Command;
import org.apache.fineract.portfolio.client.data.ClientAddressCreateRequest;

@Data
@EqualsAndHashCode(callSuper = true)
public class ClientAddressCreateCommand extends Command<ClientAddressCreateRequest> {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* 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.address.command;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.fineract.command.core.Command;
import org.apache.fineract.portfolio.client.data.ClientAddressUpdateRequest;

@Data
@EqualsAndHashCode(callSuper = true)
public class ClientAddressUpdateCommand extends Command<ClientAddressUpdateRequest> {}
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,19 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.fineract.portfolio.client.api;
package org.apache.fineract.portfolio.address.data;

import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serial;
import java.io.Serializable;
import lombok.Builder;
import lombok.Data;

/**
* Created by Chirag Gupta on 01/12/18.
*/
@SuppressWarnings({ "MemberName" })
final class ClientAddressApiResourcesSwagger {

private ClientAddressApiResourcesSwagger() {}

@Schema(description = "PostClientClientIdAddressesResponse")
public static final class PostClientClientIdAddressesResponse {

private PostClientClientIdAddressesResponse() {}

@Schema(example = "15")
public Long resourceId;
}

@Schema(description = "PutClientClientIdAddressesResponse")
public static final class PutClientClientIdAddressesResponse {
@Data
@Builder
public class ClientAddressCreateResponse implements Serializable {

private PutClientClientIdAddressesResponse() {}
@Serial
private static final long serialVersionUID = 1L;

@Schema(example = "67")
public Long resourceId;
}
private Long resourceId;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* 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.address.data;

import java.io.Serial;
import java.io.Serializable;
import lombok.Builder;
import lombok.Data;

@Data
@Builder
public class ClientAddressUpdateResponse implements Serializable {

@Serial
private static final long serialVersionUID = 1L;

private Long resourceId;
}
Loading
Loading