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 long violationId; private List 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()) .violationId(lawCase.getViolationId()) .build(); } }