Files
no-copy/src/main/java/ru/soune/nocopy/dto/complaint/LawCaseResponse.java
T

45 lines
1.3 KiB
Java
Raw Normal View History

2026-04-06 14:51:00 +07:00
package ru.soune.nocopy.dto.complaint;
import lombok.Builder;
import lombok.Data;
import ru.soune.nocopy.entity.complaint.LawCase;
import ru.soune.nocopy.entity.complaint.LawCasePriority;
import ru.soune.nocopy.entity.complaint.LawCaseType;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
@Data
@Builder
public class LawCaseResponse {
private Long id;
private String name;
private String description;
private BigDecimal amount;
private LawCasePriority priority;
private LawCaseType type;
private String lawyer;
private LocalDateTime createdAt;
private LocalDateTime updatedAt;
private int pageNumber;
private int pageSize;
private long totalElements;
private int totalPages;
private List<LawCaseResponse> content;
public static LawCaseResponse fromEntity(LawCase lawCase) {
return LawCaseResponse.builder()
.id(lawCase.getId())
.name(lawCase.getName())
.description(lawCase.getDescription())
.amount(lawCase.getAmount())
.priority(lawCase.getPriority())
.type(lawCase.getType())
.lawyer(lawCase.getLawyer())
.createdAt(lawCase.getCreatedAt())
.updatedAt(lawCase.getUpdatedAt())
.build();
}
}