dev add lawcase logic
Test Workflow / test (push) Successful in 4s

This commit is contained in:
vladp
2026-04-06 14:51:00 +07:00
parent 5f063354e6
commit 077902f4ab
14 changed files with 559 additions and 1 deletions
@@ -2,6 +2,12 @@ package ru.soune.nocopy.entity.complaint;
import jakarta.persistence.*;
import lombok.*;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import ru.soune.nocopy.entity.user.User;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Entity
@AllArgsConstructor
@@ -14,4 +20,45 @@ public class LawCase {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id", nullable = false)
@ToString.Exclude
private User user;
@Column(name = "name")
private String name;
@Column(length = 500, name = "description")
private String description;
@Column(name = "amount")
private BigDecimal amount;
@Column(name = "priority")
@Enumerated(EnumType.STRING)
private LawCasePriority priority;
@Column(name = "type")
@Enumerated(EnumType.STRING)
private LawCaseType type = LawCaseType.ACTIVE;
@CreatedDate
@Column(name = "created_at", updatable = false)
private LocalDateTime createdAt;
@LastModifiedDate
@Column(name = "updated_at")
private LocalDateTime updatedAt;
@Column(name = "lawyer")
private String lawyer;
@PrePersist
public void prePersist() {
if (this.createdAt == null) {
this.createdAt = LocalDateTime.now();
}
this.updatedAt = LocalDateTime.now();
}
}