FINERACT-2169: Refactor document management api and update swagger doc;

This commit is contained in:
viktorpavlenko
2025-03-19 12:26:37 +01:00
committed by Adam Saghy
parent a0ffaa1c0b
commit ac8f62db51
11 changed files with 48 additions and 156 deletions
@@ -18,12 +18,21 @@
*/
package org.apache.fineract.infrastructure.documentmanagement.data;
import java.io.Serial;
import java.io.Serializable;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.fineract.infrastructure.documentmanagement.domain.StorageType;
/**
* Immutable data object representing a user document being managed on the platform.
*/
public class DocumentData {
@Getter
@RequiredArgsConstructor
public class DocumentData implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
private final Long id;
private final String parentEntityType;
@@ -36,57 +45,7 @@ public class DocumentData {
private final String description;
private final Integer storageType;
public DocumentData(final Long id, final String parentEntityType, final Long parentEntityId, final String name, final String fileName,
final Long size, final String type, final String description, final String location, final Integer storageType) {
this.id = id;
this.parentEntityType = parentEntityType;
this.parentEntityId = parentEntityId;
this.name = name;
this.fileName = fileName;
this.size = size;
this.type = type;
this.description = description;
this.location = location;
this.storageType = storageType;
}
public String contentType() {
return this.type;
}
public String fileName() {
return this.fileName;
}
public String fileLocation() {
return this.location;
}
public StorageType storageType() {
return StorageType.fromInt(this.storageType);
}
public String getParentEntityType() {
return this.parentEntityType;
}
public Long getParentEntityId() {
return this.parentEntityId;
}
public Long getId() {
return this.id;
}
public String getName() {
return this.name;
}
public String getDescription() {
return this.description;
}
public Long getSize() {
return this.size;
}
}