Skip to content

Conversation

@budaidev
Copy link
Contributor

Description

Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per our guidelines
  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
  • Create/update unit or integration tests for verifying the changes made.
  • Follow our coding conventions.
  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
  • This PR must not be a "code dump". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.

Your assigned reviewer(s) will follow our guidelines for code reviews.

@budaidev budaidev marked this pull request as ready for review January 20, 2026 00:42

@Override
public List<LoanOriginatorData> retrieveAll() {
throw new UnsupportedOperationException("Not implemented yet - see PS-2950");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This magic string "Not implemented yet - see PS-2950" can be extracted to a constant

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove internal story id.

@adamsaghy
Copy link
Contributor

Please fix compilation errors:

/home/runner/work/fineract/fineract/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanRepaymentStepDef.java:148: error: cannot find symbol
        GetUsersUserIdResponse user = ok(() -> fineractClient.users().retrieveOne31(createdUserId));
                                                                     ^
  symbol:   method retrieveOne31(Long)
  location: interface UsersApi
/home/runner/work/fineract/fineract/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/loan/LoanRepaymentStepDef.java:203: error: cannot find symbol
        GetUsersUserIdResponse user = ok(() -> fineractClient.users().retrieveOne31(createdUserId));

/home/runner/work/fineract/fineract/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/common/BatchApiStepDef.java:555: error: cannot find symbol
        GetUsersUserIdResponse user = fineractFeignClient.users().retrieveOne31(createdUserId);
                                                                 ^
  symbol:   method retrieveOne31(Long)
  location: interface UsersApi
/home/runner/work/fineract/fineract/fineract-e2e-tests-core/src/test/java/org/apache/fineract/test/stepdef/common/UserStepDef.java:71: error: cannot find symbol
        PostUsersResponse createUserResponse = ok(() -> fineractClient.users().create15(postUsersRequest));
                                                                              ^
  symbol:   method create15(PostUsersRequest)
  location: interface UsersApi

"doc": "Code value ID for originator type (MERCHANT, BROKER, AFFILIATE, PLATFORM)",
"type": [
"null",
"long"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use CodeValueDataV1 instead please.

"doc": "Code value ID for channel type (ONLINE, IN_STORE, API, AGGREGATOR)",
"type": [
"null",
"long"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use CodeValueDataV1 instead please.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning originators as part of fetch Loan details API is missing.

@budaidev budaidev force-pushed the FINERACT-2418/loan-origination-api-skeleton branch 2 times, most recently from 22624e3 to 5b65f9a Compare January 20, 2026 12:47
Copy link
Contributor

@Aman-Mittal Aman-Mittal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address review comments as these changes will increase technical debt later on.

return this;
}

public CommandWrapperBuilder createLoanOriginator() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintaining constants of CREATE, UPDATE, DELETE, LOAN_ORIGINATOR and /loan-originators/ may be more maintainable

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the current pattern of the file, I am not sure we should change it.

@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Create a new loan originator", description = "Creates a new loan originator record. Requires CREATE_LOAN_ORIGINATOR permission.")
@ApiResponses({ @ApiResponse(responseCode = "200", description = "OK"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need of @ApiResponses
from java 8 + we can simply use multiple ApiResponse Annotation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "List all loan originators", description = "Retrieves all loan originator records. Requires READ_LOAN_ORIGINATOR permission.")
@ApiResponses({ @ApiResponse(responseCode = "200", description = "OK"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@Consumes({ MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_JSON })
@Operation(summary = "Retrieve a loan originator by ID", description = "Retrieves a loan originator by its internal ID. Requires READ_LOAN_ORIGINATOR permission.")
@ApiResponses({ @ApiResponse(responseCode = "200", description = "OK"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


public List<PostLoansRequestChargeData> charges;

@Schema(description = "Optional array of originators to associate with this loan. "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of concatenation we can use
"""
Optional array of originators to associate with this loan
Each entry can reference an existing originator by 'id' or 'externalId'.
If the global config 'enable_originator_creation_during_loan_application' is enabled,
non-existing originators will be auto-created using the provided details (name, typeId, channelTypeId).
""""

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@budaidev budaidev force-pushed the FINERACT-2418/loan-origination-api-skeleton branch from 5b65f9a to e58d5da Compare January 21, 2026 08:30
@adamsaghy adamsaghy merged commit 1d12c13 into apache:develop Jan 21, 2026
35 checks passed
@adamsaghy adamsaghy deleted the FINERACT-2418/loan-origination-api-skeleton branch January 21, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants