Done ticket GEPAFINBE-6139

This commit is contained in:
rajesh
2025-10-13 21:50:26 +05:30
parent 2bf9fe368c
commit 38515ed38b
42 changed files with 561 additions and 150 deletions

View File

@@ -15,26 +15,27 @@ public class S3PathConfig {
@Autowired
S3ConfigRepository s3ConfigRepository;
public String generateDocumentPath(DocumentSourceTypeEnum type, Long callId, Long applicationId,Long amendmentId) {
public String generateDocumentPath(DocumentSourceTypeEnum type, Long callId, Long applicationId,Long amendmentId,Long communicationId) {
S3ConfigEntity config = getDocumentPath(type);
return config.getParentFolder() + "/" + buildS3Path(config.getPath(), callId, applicationId,amendmentId);
return config.getParentFolder() + "/" + buildS3Path(config.getPath(), callId, applicationId,amendmentId,communicationId);
}
public String generateDocumentPathForOther(DocOtherSourceTypeEnum type, Long callId, Long applicationId,Long amendmentId) {
public String generateDocumentPathForOther(DocOtherSourceTypeEnum type, Long callId, Long applicationId,Long amendmentId,Long communicationId) {
S3ConfigEntity config = getDocumentPathForOther(type);
return config.getParentFolder() + "/" + buildS3Path(config.getPath(), callId, applicationId,amendmentId);
return config.getParentFolder() + "/" + buildS3Path(config.getPath(), callId, applicationId,amendmentId,communicationId);
}
public String generateDocumentPathForDelegationAndSignedDocument(DocOtherSourceTypeEnum type) {
S3ConfigEntity config = getDocumentPathForOther(type);
return config.getParentFolder() + "/" + config.getPath();
}
private String buildS3Path(String pathTemplate, Long callId, Long applicationId, Long amendmentId) {
private String buildS3Path(String pathTemplate, Long callId, Long applicationId, Long amendmentId,Long communicationId) {
return pathTemplate
.replace("{call_id}", callId != null && callId != 0L ? "call_" + callId : "")
.replace("{application_id}", applicationId != null && applicationId != 0L ? "application_" + applicationId : "")
.replace("{amendment_id}", amendmentId != null && amendmentId != 0L ? "amendment_" + amendmentId : "");
.replace("{amendment_id}", amendmentId != null && amendmentId != 0L ? "amendment_" + amendmentId : "")
.replace("{communication_id}", communicationId != null && communicationId != 0L ? "communication_" + communicationId : "");
}
private S3ConfigEntity getDocumentPath(DocumentSourceTypeEnum type) {