FINERACT-1552: Upgrade fineract-client to OpenAPI generator 5.4.0
This commit is contained in:
committed by
Aleksandar Vidakovic
parent
5389276bc7
commit
cf177a0bd4
+5
-5
@@ -50,19 +50,19 @@ buildscript {
|
||||
classpath 'com.bmuschko:gradle-cargo-plugin:2.9.0'
|
||||
classpath 'org.eclipse.persistence:eclipselink:2.7.10'
|
||||
classpath 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6'
|
||||
classpath 'com.google.cloud.tools:jib-layer-filter-extension-gradle:0.1.0'
|
||||
classpath 'com.google.cloud.tools:jib-layer-filter-extension-gradle:0.3.0'
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
|
||||
id "org.barfuin.gradle.taskinfo" version "1.3.1"
|
||||
id "org.barfuin.gradle.taskinfo" version "1.4.0"
|
||||
id 'com.adarshr.test-logger' version '3.2.0'
|
||||
id 'com.diffplug.spotless' version '6.4.0' apply false
|
||||
id 'com.diffplug.spotless' version '6.4.1' apply false
|
||||
id 'org.nosphere.apache.rat' version '0.7.0' apply false
|
||||
id 'com.github.hierynomus.license' version '0.16.1' apply false
|
||||
id 'com.github.jk1.dependency-license-report' version '2.1' apply false
|
||||
id 'org.openapi.generator' version '4.3.1' apply false
|
||||
id 'org.openapi.generator' version '5.4.0' apply false
|
||||
id 'org.zeroturnaround.gradle.jrebel' version '1.1.11' apply false
|
||||
id 'org.springframework.boot' version '2.6.5' apply false
|
||||
id 'net.ltgt.errorprone' version '2.0.2' apply false
|
||||
@@ -74,7 +74,7 @@ plugins {
|
||||
id 'org.asciidoctor.jvm.revealjs' version '3.3.2' apply false
|
||||
id 'org.asciidoctor.jvm.gems' version '3.3.2' apply false
|
||||
id 'org.asciidoctor.kindlegen.base' version '3.2.0' apply false
|
||||
id 'com.google.cloud.tools.jib' version '3.2.0' apply false
|
||||
id 'com.google.cloud.tools.jib' version '3.2.1' apply false
|
||||
id 'fr.brouillard.oss.gradle.jgitver' version '0.10.0-rc03'
|
||||
id 'org.sonarqube' version '3.3'
|
||||
id 'com.github.andygoossens.modernizer' version '1.6.2' apply false
|
||||
|
||||
@@ -84,7 +84,7 @@ task buildTypescriptAngularSdk(type: org.openapitools.generator.gradle.plugin.ta
|
||||
configOptions = [
|
||||
apiModulePrefix: 'fineract',
|
||||
configurationPrefix: 'fineract',
|
||||
ngVersion: '10.0.0',
|
||||
ngVersion: '12.0.0',
|
||||
npmName: 'apache-fineract-client'
|
||||
]
|
||||
dependsOn = [
|
||||
@@ -96,24 +96,12 @@ task buildTypescriptAngularSdk(type: org.openapitools.generator.gradle.plugin.ta
|
||||
// TODO: @vidakovic we could provide even more client libs in different languages (Go, Ruby, Swift etc.)
|
||||
compileJava.dependsOn buildJavaSdk, spotlessJavaApply, buildTypescriptAngularSdk, spotlessMiscApply
|
||||
|
||||
sourceSets {
|
||||
generated {
|
||||
java {
|
||||
srcDir "$buildDir/generated/java/src/main/java"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
java {
|
||||
// keep this at Java 8, not 17; see https://issues.apache.org/jira/browse/FINERACT-1214
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
compileJava {
|
||||
source += sourceSets.generated.java
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
// the generated code in build/generated/java/src/main/java/org/apache/fineract/client/auth/OAuthOkHttpClient.java#L71 currently uses deprecated RequestBody.create(MediaType,String)
|
||||
// TODO FINERACT-1247 why does this not work:
|
||||
@@ -133,4 +121,6 @@ test {
|
||||
}
|
||||
|
||||
// Gradle 7.x asks for explicit dependencies between tasks
|
||||
licenseFormatBuildScripts.dependsOn spotlessGroovyGradle, spotlessJava, spotlessMisc, compileJava, processResources, compileGeneratedJava, compileTestJava, rat, test
|
||||
licenseFormatBuildScripts.dependsOn spotlessGroovyGradle, spotlessJava, spotlessMisc, compileJava, processResources, compileTestJava, rat, test
|
||||
|
||||
sourceSets.main.java.srcDir new File(buildDir, "generated/java/src/main/java")
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
dependencies {
|
||||
// project(':fineract-provider')
|
||||
implementation(
|
||||
'jakarta.annotation:jakarta.annotation-api',
|
||||
'io.swagger:swagger-annotations',
|
||||
'com.squareup.retrofit2:retrofit',
|
||||
'com.squareup.retrofit2:adapter-java8',
|
||||
|
||||
+3
@@ -63,6 +63,7 @@ import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformSer
|
||||
import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||
import org.apache.fineract.infrastructure.core.data.UploadRequest;
|
||||
import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||
import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
|
||||
@@ -291,6 +292,8 @@ public class GLAccountsApiResource {
|
||||
@POST
|
||||
@Path("uploadtemplate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload GL accounts template", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String postGlAccountsTemplate(@FormDataParam("file") InputStream uploadedInputStream,
|
||||
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
|
||||
@FormDataParam("dateFormat") final String dateFormat) {
|
||||
|
||||
+3
@@ -58,6 +58,7 @@ import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookP
|
||||
import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService;
|
||||
import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.core.data.UploadRequest;
|
||||
import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException;
|
||||
import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||
import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||
@@ -283,6 +284,8 @@ public class JournalEntriesApiResource {
|
||||
@POST
|
||||
@Path("uploadtemplate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload journal entries template", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String postJournalEntriesTemplate(@FormDataParam("file") InputStream uploadedInputStream,
|
||||
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
|
||||
@FormDataParam("dateFormat") final String dateFormat) {
|
||||
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* 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.infrastructure.core.data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import javax.ws.rs.core.UriInfo;
|
||||
import org.glassfish.jersey.media.multipart.FormDataBodyPart;
|
||||
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
|
||||
import org.glassfish.jersey.media.multipart.FormDataParam;
|
||||
|
||||
public class UploadRequest {
|
||||
|
||||
@Schema(type = "string", format = "binary")
|
||||
@FormDataParam("file")
|
||||
private InputStream uploadedInputStream;
|
||||
|
||||
@Schema(implementation = File.class, hidden = true)
|
||||
@FormDataParam("file")
|
||||
private File uploadedFile;
|
||||
|
||||
@Schema(implementation = FormDataContentDisposition.class, hidden = true)
|
||||
@FormDataParam("file")
|
||||
private FormDataContentDisposition fileDetail;
|
||||
|
||||
@Schema(implementation = UriInfo.class, hidden = true)
|
||||
@FormDataParam("file")
|
||||
private UriInfo uriInfo;
|
||||
|
||||
@Schema(implementation = UriInfo.class, hidden = true)
|
||||
@FormDataParam("file")
|
||||
private FormDataBodyPart bodyPart;
|
||||
|
||||
@Schema(name = "locale", type = "string", accessMode = Schema.AccessMode.READ_WRITE)
|
||||
@FormDataParam("locale")
|
||||
private String locale;
|
||||
|
||||
@Schema(name = "dateFormat", type = "string", accessMode = Schema.AccessMode.READ_WRITE)
|
||||
@FormDataParam("dateFormat")
|
||||
private String dateFormat;
|
||||
|
||||
public InputStream getUploadedInputStream() {
|
||||
return uploadedInputStream;
|
||||
}
|
||||
|
||||
public void setUploadedInputStream(InputStream uploadedInputStream) {
|
||||
this.uploadedInputStream = uploadedInputStream;
|
||||
}
|
||||
|
||||
public String getLocale() {
|
||||
return locale;
|
||||
}
|
||||
|
||||
public void setLocale(String locale) {
|
||||
this.locale = locale;
|
||||
}
|
||||
|
||||
public String getDateFormat() {
|
||||
return dateFormat;
|
||||
}
|
||||
|
||||
public void setDateFormat(String dateFormat) {
|
||||
this.dateFormat = dateFormat;
|
||||
}
|
||||
}
|
||||
+6
@@ -21,6 +21,9 @@ package org.apache.fineract.infrastructure.creditbureau.api;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.util.Arrays;
|
||||
@@ -44,6 +47,7 @@ import org.apache.fineract.commands.service.CommandWrapperBuilder;
|
||||
import org.apache.fineract.commands.service.PortfolioCommandSourceWritePlatformService;
|
||||
import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.core.data.UploadRequest;
|
||||
import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||
import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||
import org.apache.fineract.infrastructure.creditbureau.data.CreditReportData;
|
||||
@@ -112,6 +116,8 @@ public class CreditBureauIntegrationAPI {
|
||||
@POST
|
||||
@Path("addCreditReport")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload credit report", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String addCreditReport(@FormDataParam("file") final File creditReport, @FormDataParam("file") InputStream uploadedInputStream,
|
||||
@FormDataParam("file") final UriInfo uriInfo, @FormDataParam("file") FormDataContentDisposition fileDetail,
|
||||
@QueryParam("creditBureauId") @Parameter(description = "creditBureauId") final Long creditBureauId) {
|
||||
|
||||
+5
-1
@@ -23,6 +23,7 @@ import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -117,6 +118,8 @@ public class DocumentManagementApiResource {
|
||||
@POST
|
||||
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@RequestBody(description = "Create document", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = DocumentManagementApiResourceSwagger.DocumentUploadRequest.class)) })
|
||||
@Operation(summary = "Create a Document", description = "Note: A document is created using a Multi-part form upload \n" + "\n"
|
||||
+ "Body Parts\n" + "\n" + "name : \n" + "Name or summary of the document\n" + "\n" + "description : \n"
|
||||
+ "Description of the document\n" + "\n" + "file : \n" + "The file to be uploaded\n" + "\n" + "Mandatory Fields : \n"
|
||||
@@ -137,7 +140,6 @@ public class DocumentManagementApiResource {
|
||||
final DocumentCommand documentCommand = new DocumentCommand(null, null, entityType, entityId, name, fileDetails.getFileName(),
|
||||
fileSize, bodyPart.getMediaType().toString(), description, null);
|
||||
final Long documentId = this.documentWritePlatformService.createDocument(documentCommand, inputStream);
|
||||
|
||||
return this.toApiJsonSerializer.serialize(CommandProcessingResult.resourceResult(documentId, null));
|
||||
}
|
||||
|
||||
@@ -145,6 +147,8 @@ public class DocumentManagementApiResource {
|
||||
@Path("{documentId}")
|
||||
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@RequestBody(description = "Update document", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = DocumentManagementApiResourceSwagger.DocumentUploadRequest.class)) })
|
||||
@Operation(summary = "Update a Document", description = "Note: A document is updated using a Multi-part form upload \n" + "Body Parts\n"
|
||||
+ "name\n" + "Name or summary of the document\n" + "description\n" + "Description of the document\n" + "file\n"
|
||||
+ "The file to be uploaded")
|
||||
|
||||
+30
@@ -19,6 +19,8 @@
|
||||
package org.apache.fineract.infrastructure.documentmanagement.api;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.apache.fineract.infrastructure.core.data.UploadRequest;
|
||||
import org.glassfish.jersey.media.multipart.FormDataParam;
|
||||
|
||||
/**
|
||||
* Created by sanyam on 7/8/17.
|
||||
@@ -116,4 +118,32 @@ final class DocumentManagementApiResourceSwagger {
|
||||
public String resourceIdentifier;
|
||||
}
|
||||
|
||||
@Schema(description = "Document upload request")
|
||||
public static final class DocumentUploadRequest extends UploadRequest {
|
||||
|
||||
@Schema(name = "name", type = "string", accessMode = Schema.AccessMode.READ_WRITE)
|
||||
@FormDataParam("name")
|
||||
private String name;
|
||||
|
||||
@Schema(name = "description", type = "string", accessMode = Schema.AccessMode.READ_WRITE)
|
||||
@FormDataParam("description")
|
||||
private String description;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+8
@@ -18,6 +18,9 @@
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.documentmanagement.api;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Base64;
|
||||
@@ -35,6 +38,7 @@ import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.core.data.UploadRequest;
|
||||
import org.apache.fineract.infrastructure.core.domain.Base64EncodedImage;
|
||||
import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||
import org.apache.fineract.infrastructure.documentmanagement.contentrepository.ContentRepositoryUtils;
|
||||
@@ -85,6 +89,8 @@ public class ImagesApiResource {
|
||||
@POST
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@RequestBody(description = "Upload new client image", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String addNewClientImage(@PathParam("entity") final String entityName, @PathParam("entityId") final Long entityId,
|
||||
@HeaderParam("Content-Length") final Long fileSize, @FormDataParam("file") final InputStream inputStream,
|
||||
@FormDataParam("file") final FormDataContentDisposition fileDetails, @FormDataParam("file") final FormDataBodyPart bodyPart) {
|
||||
@@ -173,6 +179,8 @@ public class ImagesApiResource {
|
||||
@PUT
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@RequestBody(description = "Update client image", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String updateClientImage(@PathParam("entity") final String entityName, @PathParam("entityId") final Long entityId,
|
||||
@HeaderParam("Content-Length") final Long fileSize, @FormDataParam("file") final InputStream inputStream,
|
||||
@FormDataParam("file") final FormDataContentDisposition fileDetails, @FormDataParam("file") final FormDataBodyPart bodyPart) {
|
||||
|
||||
+3
@@ -53,6 +53,7 @@ import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookP
|
||||
import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService;
|
||||
import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.core.data.UploadRequest;
|
||||
import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||
import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||
import org.apache.fineract.infrastructure.core.service.SearchParameters;
|
||||
@@ -219,6 +220,8 @@ public class OfficesApiResource {
|
||||
@POST
|
||||
@Path("uploadtemplate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload office template", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String postOfficeTemplate(@FormDataParam("file") InputStream uploadedInputStream,
|
||||
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
|
||||
@FormDataParam("dateFormat") final String dateFormat) {
|
||||
|
||||
+3
@@ -53,6 +53,7 @@ import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookP
|
||||
import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService;
|
||||
import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.core.data.UploadRequest;
|
||||
import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||
import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
|
||||
@@ -203,6 +204,8 @@ public class StaffApiResource {
|
||||
@POST
|
||||
@Path("uploadtemplate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload staff template", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String postTemplate(@FormDataParam("file") InputStream uploadedInputStream,
|
||||
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
|
||||
@FormDataParam("dateFormat") final String dateFormat) {
|
||||
|
||||
+3
@@ -47,6 +47,7 @@ import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookP
|
||||
import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService;
|
||||
import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.core.data.UploadRequest;
|
||||
import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||
import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||
import org.apache.fineract.infrastructure.core.service.Page;
|
||||
@@ -245,6 +246,8 @@ public class AccountsApiResource {
|
||||
@POST
|
||||
@Path("uploadtemplate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload shared accounts template", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String postSharedAccountsTemplate(@FormDataParam("file") InputStream uploadedInputStream,
|
||||
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
|
||||
@FormDataParam("dateFormat") final String dateFormat,
|
||||
|
||||
+3
@@ -56,6 +56,7 @@ import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookP
|
||||
import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService;
|
||||
import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.core.data.UploadRequest;
|
||||
import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException;
|
||||
import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||
import org.apache.fineract.infrastructure.core.serialization.ToApiJsonSerializer;
|
||||
@@ -433,6 +434,8 @@ public class ClientsApiResource {
|
||||
@POST
|
||||
@Path("uploadtemplate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload client template", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String postClientTemplate(@QueryParam("legalFormType") final String legalFormType,
|
||||
@FormDataParam("file") InputStream uploadedInputStream, @FormDataParam("file") FormDataContentDisposition fileDetail,
|
||||
@FormDataParam("locale") final String locale, @FormDataParam("dateFormat") final String dateFormat) {
|
||||
|
||||
+2
-2
@@ -147,7 +147,7 @@ final class ClientsApiResourceSwagger {
|
||||
}
|
||||
|
||||
@Schema(example = "2")
|
||||
public Integer id;
|
||||
public Long id;
|
||||
@Schema(example = "000000002")
|
||||
public String accountNo;
|
||||
public GetClientStatus status;
|
||||
@@ -297,7 +297,7 @@ final class ClientsApiResourceSwagger {
|
||||
@Schema(example = "1")
|
||||
public Integer groupId;
|
||||
@Schema(example = "2")
|
||||
public Integer clientId;
|
||||
public Long clientId;
|
||||
@Schema(example = "2")
|
||||
public Integer resourceId;
|
||||
}
|
||||
|
||||
+3
@@ -62,6 +62,7 @@ import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
|
||||
import org.apache.fineract.infrastructure.core.api.JsonQuery;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.core.data.PaginationParameters;
|
||||
import org.apache.fineract.infrastructure.core.data.UploadRequest;
|
||||
import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException;
|
||||
import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
|
||||
@@ -426,6 +427,8 @@ public class CentersApiResource {
|
||||
@POST
|
||||
@Path("uploadtemplate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload centers template", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String postCentersTemplate(@FormDataParam("file") InputStream uploadedInputStream,
|
||||
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
|
||||
@FormDataParam("dateFormat") final String dateFormat) {
|
||||
|
||||
+3
@@ -61,6 +61,7 @@ import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
|
||||
import org.apache.fineract.infrastructure.core.api.JsonQuery;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.core.data.PaginationParameters;
|
||||
import org.apache.fineract.infrastructure.core.data.UploadRequest;
|
||||
import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException;
|
||||
import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||
import org.apache.fineract.infrastructure.core.serialization.FromJsonHelper;
|
||||
@@ -573,6 +574,8 @@ public class GroupsApiResource {
|
||||
@POST
|
||||
@Path("uploadtemplate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload group template", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String postGroupTemplate(@FormDataParam("file") InputStream uploadedInputStream,
|
||||
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
|
||||
@FormDataParam("dateFormat") final String dateFormat) {
|
||||
|
||||
+5
@@ -67,6 +67,7 @@ import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
|
||||
import org.apache.fineract.infrastructure.core.api.JsonQuery;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||
import org.apache.fineract.infrastructure.core.data.UploadRequest;
|
||||
import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException;
|
||||
import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||
import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||
@@ -1002,6 +1003,8 @@ public class LoansApiResource {
|
||||
@POST
|
||||
@Path("uploadtemplate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload Loan template", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String postLoanTemplate(@FormDataParam("file") InputStream uploadedInputStream,
|
||||
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
|
||||
@FormDataParam("dateFormat") final String dateFormat) {
|
||||
@@ -1013,6 +1016,8 @@ public class LoansApiResource {
|
||||
@POST
|
||||
@Path("repayments/uploadtemplate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload Loan repayments template", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String postLoanRepaymentTemplate(@FormDataParam("file") InputStream uploadedInputStream,
|
||||
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
|
||||
@FormDataParam("dateFormat") final String dateFormat) {
|
||||
|
||||
+6
@@ -18,6 +18,9 @@
|
||||
*/
|
||||
package org.apache.fineract.portfolio.loanaccount.guarantor.api;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import java.io.InputStream;
|
||||
import java.util.Arrays;
|
||||
@@ -49,6 +52,7 @@ import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformSer
|
||||
import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.core.data.EnumOptionData;
|
||||
import org.apache.fineract.infrastructure.core.data.UploadRequest;
|
||||
import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||
import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
|
||||
@@ -241,6 +245,8 @@ public class GuarantorsApiResource {
|
||||
@POST
|
||||
@Path("uploadtemplate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload guarantor template", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String postGuarantorTemplate(@FormDataParam("file") InputStream uploadedInputStream,
|
||||
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
|
||||
@FormDataParam("dateFormat") final String dateFormat, @PathParam("loanId") final Long loanId) {
|
||||
|
||||
+5
@@ -60,6 +60,7 @@ import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
|
||||
import org.apache.fineract.infrastructure.core.api.JsonQuery;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.core.data.PaginationParameters;
|
||||
import org.apache.fineract.infrastructure.core.data.UploadRequest;
|
||||
import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException;
|
||||
import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||
import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||
@@ -454,6 +455,8 @@ public class FixedDepositAccountsApiResource {
|
||||
@POST
|
||||
@Path("uploadtemplate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload fixed deposit template", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String postFixedDepositTemplate(@FormDataParam("file") InputStream uploadedInputStream,
|
||||
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
|
||||
@FormDataParam("dateFormat") final String dateFormat) {
|
||||
@@ -474,6 +477,8 @@ public class FixedDepositAccountsApiResource {
|
||||
@POST
|
||||
@Path("transaction/uploadtemplate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload fixed deposit transaction template", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String postFixedDepositTransactionTemplate(@FormDataParam("file") InputStream uploadedInputStream,
|
||||
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
|
||||
@FormDataParam("dateFormat") final String dateFormat) {
|
||||
|
||||
+5
@@ -59,6 +59,7 @@ import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
|
||||
import org.apache.fineract.infrastructure.core.api.JsonQuery;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.core.data.PaginationParameters;
|
||||
import org.apache.fineract.infrastructure.core.data.UploadRequest;
|
||||
import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException;
|
||||
import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||
import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||
@@ -437,6 +438,8 @@ public class RecurringDepositAccountsApiResource {
|
||||
@POST
|
||||
@Path("uploadtemplate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload recurring deposit template", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String postRecurringDepositTemplate(@FormDataParam("file") InputStream uploadedInputStream,
|
||||
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
|
||||
@FormDataParam("dateFormat") final String dateFormat) {
|
||||
@@ -457,6 +460,8 @@ public class RecurringDepositAccountsApiResource {
|
||||
@POST
|
||||
@Path("transactions/uploadtemplate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload recurring deposit transactions template", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String postRecurringDepositTransactionsTemplate(@FormDataParam("file") InputStream uploadedInputStream,
|
||||
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
|
||||
@FormDataParam("dateFormat") final String dateFormat) {
|
||||
|
||||
+5
@@ -55,6 +55,7 @@ import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookS
|
||||
import org.apache.fineract.infrastructure.core.api.ApiParameterHelper;
|
||||
import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.core.data.UploadRequest;
|
||||
import org.apache.fineract.infrastructure.core.exception.UnrecognizedQueryParamException;
|
||||
import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||
import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||
@@ -529,6 +530,8 @@ public class SavingsAccountsApiResource {
|
||||
@POST
|
||||
@Path("uploadtemplate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload savings template", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String postSavingsTemplate(@FormDataParam("file") InputStream uploadedInputStream,
|
||||
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
|
||||
@FormDataParam("dateFormat") final String dateFormat) {
|
||||
@@ -548,6 +551,8 @@ public class SavingsAccountsApiResource {
|
||||
@POST
|
||||
@Path("transactions/uploadtemplate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload savings transaction template", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String postSavingsTransactionTemplate(@FormDataParam("file") InputStream uploadedInputStream,
|
||||
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
|
||||
@FormDataParam("dateFormat") final String dateFormat) {
|
||||
|
||||
+4
@@ -22,6 +22,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.media.Content;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -40,6 +41,7 @@ import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
import javax.ws.rs.core.UriInfo;
|
||||
import org.apache.fineract.infrastructure.core.data.UploadRequest;
|
||||
import org.apache.fineract.infrastructure.documentmanagement.api.ImagesApiResource;
|
||||
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
|
||||
import org.apache.fineract.portfolio.client.api.ClientApiConstants;
|
||||
@@ -249,6 +251,8 @@ public class SelfClientsApiResource {
|
||||
@Path("{clientId}/images")
|
||||
@Consumes({ MediaType.MULTIPART_FORM_DATA })
|
||||
@Produces({ MediaType.APPLICATION_JSON })
|
||||
@RequestBody(description = "Add new client image", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String addNewClientImage(@PathParam("clientId") final Long clientId, @HeaderParam("Content-Length") final Long fileSize,
|
||||
@FormDataParam("file") final InputStream inputStream, @FormDataParam("file") final FormDataContentDisposition fileDetails,
|
||||
@FormDataParam("file") final FormDataBodyPart bodyPart) {
|
||||
|
||||
+3
@@ -53,6 +53,7 @@ import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookP
|
||||
import org.apache.fineract.infrastructure.bulkimport.service.BulkImportWorkbookService;
|
||||
import org.apache.fineract.infrastructure.core.api.ApiRequestParameterHelper;
|
||||
import org.apache.fineract.infrastructure.core.data.CommandProcessingResult;
|
||||
import org.apache.fineract.infrastructure.core.data.UploadRequest;
|
||||
import org.apache.fineract.infrastructure.core.serialization.ApiRequestJsonSerializationSettings;
|
||||
import org.apache.fineract.infrastructure.core.serialization.DefaultToApiJsonSerializer;
|
||||
import org.apache.fineract.infrastructure.security.service.PlatformSecurityContext;
|
||||
@@ -237,6 +238,8 @@ public class UsersApiResource {
|
||||
@POST
|
||||
@Path("uploadtemplate")
|
||||
@Consumes(MediaType.MULTIPART_FORM_DATA)
|
||||
@RequestBody(description = "Upload users template", content = {
|
||||
@Content(mediaType = MediaType.MULTIPART_FORM_DATA, schema = @Schema(implementation = UploadRequest.class)) })
|
||||
public String postUsersTemplate(@FormDataParam("file") InputStream uploadedInputStream,
|
||||
@FormDataParam("file") FormDataContentDisposition fileDetail, @FormDataParam("locale") final String locale,
|
||||
@FormDataParam("dateFormat") final String dateFormat) {
|
||||
|
||||
@@ -6,5 +6,7 @@
|
||||
/_/ \_\ .__/ \__,_|\___|_| |_|\___| |_| |_|_| |_|\___|_| \__,_|\___|\__|
|
||||
|_|
|
||||
|
||||
${AnsiStyle.FAINT}${AnsiColor.WHITE}version ${application.version}${AnsiColor.BLACK}
|
||||
|
||||
${AnsiStyle.FAINT}${AnsiColor.WHITE}Powered by Spring Boot ${spring-boot.version}${AnsiColor.BLACK}
|
||||
|
||||
|
||||
+3
-4
@@ -55,7 +55,7 @@ public class ClientTest extends IntegrationTest {
|
||||
// TODO activationDate() why String? https://issues.apache.org/jira/browse/FINERACT-1232
|
||||
// TODO why dateFormat and locale required even when no activationDate?!
|
||||
// https://issues.apache.org/jira/browse/FINERACT-1233
|
||||
return (long) ok(fineract().clients.create6(
|
||||
return ok(fineract().clients.create6(
|
||||
new PostClientsRequest().legalFormId(1).officeId(1).fullname("TestClient").dateFormat(dateFormat()).locale("en_US")))
|
||||
.getClientId();
|
||||
}
|
||||
@@ -63,9 +63,8 @@ public class ClientTest extends IntegrationTest {
|
||||
Optional<Long> retrieveFirst() {
|
||||
GetClientsResponse clients = ok(
|
||||
fineract().clients.retrieveAll21(null, null, null, null, null, null, null, null, 0, 1, null, null, false));
|
||||
if (clients.getTotalFilteredRecords() > 0) {
|
||||
// TODO rm long cast, see https://issues.apache.org/jira/browse/FINERACT-1230
|
||||
return Optional.of((long) clients.getPageItems().get(0).getId());
|
||||
if (clients.getTotalFilteredRecords() != null && clients.getTotalFilteredRecords() > 0) {
|
||||
return clients.getPageItems().stream().findFirst().map(item -> item.getId());
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user