Last change
on this file was 43c9090, checked in by macagaso <gasoskamarija@…>, 5 weeks ago |
Updated version
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | package finki.it.terapijamkbackend.spring.entities;
|
---|
2 |
|
---|
3 | import com.fasterxml.jackson.annotation.JsonIgnore;
|
---|
4 | import jakarta.persistence.*;
|
---|
5 | import lombok.*;
|
---|
6 | import java.time.LocalDateTime;
|
---|
7 |
|
---|
8 | @Getter
|
---|
9 | @Setter
|
---|
10 | @EqualsAndHashCode
|
---|
11 | @NoArgsConstructor
|
---|
12 | @Entity(name = "Appointment")
|
---|
13 | @Table(name="appointments")
|
---|
14 | public class Appointment {
|
---|
15 |
|
---|
16 | @SequenceGenerator(
|
---|
17 | name="appointment_sequence",
|
---|
18 | sequenceName = "appointment_sequence",
|
---|
19 | allocationSize = 1
|
---|
20 | )
|
---|
21 | @Id
|
---|
22 | @GeneratedValue(
|
---|
23 | strategy=GenerationType.SEQUENCE,
|
---|
24 | generator = "appointment_sequence"
|
---|
25 | )
|
---|
26 | private Long id;
|
---|
27 |
|
---|
28 | @ManyToOne(fetch = FetchType.LAZY)
|
---|
29 | @JoinColumn(name="request_id", referencedColumnName = "id")
|
---|
30 | @JsonIgnore
|
---|
31 | private Request request;
|
---|
32 |
|
---|
33 | private LocalDateTime term;
|
---|
34 |
|
---|
35 | @Enumerated(EnumType.STRING)
|
---|
36 | private APPOINTMENT_STATUS status;
|
---|
37 |
|
---|
38 | public Appointment(LocalDateTime term){
|
---|
39 | this.term=term;
|
---|
40 | this.status=APPOINTMENT_STATUS.FREE;
|
---|
41 | }
|
---|
42 |
|
---|
43 | public void assignRequest(Request request){
|
---|
44 | this.request=request;
|
---|
45 | this.status=APPOINTMENT_STATUS.RESERVED;
|
---|
46 | }
|
---|
47 |
|
---|
48 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.