dev add rest for company, add link for users , update reg users
Test Workflow / test (push) Successful in 2s
Test Workflow / test (push) Successful in 2s
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package ru.soune.nocopy.entity.company;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.*;
|
||||
import org.springframework.data.annotation.CreatedDate;
|
||||
import ru.soune.nocopy.entity.user.User;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Getter @Setter
|
||||
@Table(name = "company")
|
||||
public class Company {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.UUID)
|
||||
private String id;
|
||||
|
||||
@Column(name = "company_name")
|
||||
private String companyName;
|
||||
|
||||
@Column(name = "address")
|
||||
private String address;
|
||||
|
||||
@Column(name = "phone")
|
||||
private String phone;
|
||||
|
||||
@CreatedDate
|
||||
@Column(name = "register_date", updatable = false, nullable = false)
|
||||
private LocalDateTime registerDate = LocalDateTime.now();
|
||||
|
||||
@Column(name = "update_date")
|
||||
private LocalDateTime updateDate;
|
||||
|
||||
@Size(max = 1024)
|
||||
@Column(name = "email", length = 1024)
|
||||
private String email;
|
||||
|
||||
@OneToMany(mappedBy = "company")
|
||||
@JsonIgnore
|
||||
@ToString.Exclude
|
||||
private List<User> users = new ArrayList<>();
|
||||
}
|
||||
Reference in New Issue
Block a user