Ignore:
Timestamp:
03/13/23 00:58:07 (20 months ago)
Author:
Gjoko Kostadinov <gjoko.kostadinov@…>
Branches:
master
Children:
9050790
Parents:
2b0a4db
Message:

Add admin page initial work.

Location:
src/main/java/edu/gjoko/schedlr/entity
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/edu/gjoko/schedlr/entity/Appointment.java

    r2b0a4db r46fd0c7  
    55import lombok.NoArgsConstructor;
    66import lombok.Setter;
     7import org.springframework.data.annotation.LastModifiedDate;
     8import org.springframework.data.jpa.domain.support.AuditingEntityListener;
    79
    810import javax.persistence.*;
     
    1012
    1113@Entity
     14@EntityListeners(AuditingEntityListener.class)
    1215@Table(name = "appointment")
    1316@Getter
     
    3134
    3235    @Column(name = "created")
     36    @LastModifiedDate
    3337    private LocalDateTime created;
    3438
    3539    @Column(name = "modified")
     40    @LastModifiedDate
    3641    private LocalDateTime modified;
    3742}
  • src/main/java/edu/gjoko/schedlr/entity/Business.java

    r2b0a4db r46fd0c7  
    22
    33import com.fasterxml.jackson.annotation.JsonManagedReference;
     4import com.fasterxml.jackson.annotation.JsonProperty;
    45import lombok.AllArgsConstructor;
    56import lombok.Getter;
    67import lombok.NoArgsConstructor;
    78import lombok.Setter;
     9import org.springframework.data.annotation.CreatedDate;
     10import org.springframework.data.annotation.LastModifiedDate;
     11import org.springframework.data.jpa.domain.support.AuditingEntityListener;
    812
    913import javax.persistence.*;
     
    1216
    1317@Entity
     18@EntityListeners(AuditingEntityListener.class)
    1419@Table(name = "business")
    1520@Getter
     
    2328    private Long id;
    2429
    25     @Column(name = "name")
    26     private String name;
     30    @Column(name = "company_name")
     31    private String companyName;
    2732
    2833    @OneToOne
    2934    @JoinColumn(name = "business_type_id", referencedColumnName = "id")
     35    @JsonProperty("businessType")
    3036    private BusinessType businessType;
    3137
    32     @Column(name = "opening_time")
    33     private LocalDateTime openingTime;
    34 
    35     @Column(name = "closing_time")
    36     private LocalDateTime closingTime;
    37 
    38     @ManyToOne
     38    @ManyToOne(cascade = CascadeType.PERSIST)
    3939    @JoinColumn(name = "owner_id", referencedColumnName = "id", nullable = false)
     40    @JsonProperty("owner")
    4041    private Stakeholder owner;
    4142
    42     @OneToMany(mappedBy = "business")
     43    @OneToMany(mappedBy = "business", cascade = CascadeType.PERSIST)
    4344    @JsonManagedReference
    4445    private List<Service> services;
    4546
     47    @Column(name = "business_status")
     48    @Enumerated(EnumType.STRING)
     49    private BusinessStatus businessStatus;
     50
    4651    @Column(name = "created")
     52    @CreatedDate
    4753    private LocalDateTime created;
    4854
    4955    @Column(name = "modified")
     56    @LastModifiedDate
    5057    private LocalDateTime modified;
    5158
  • src/main/java/edu/gjoko/schedlr/entity/Service.java

    r2b0a4db r46fd0c7  
    1111
    1212import javax.persistence.*;
    13 import java.sql.Timestamp;
    1413import java.time.LocalDateTime;
    1514
     
    2726    private Long id;
    2827
    29     @Column(name = "name")
    30     private String name;
    31 
    3228    @Column(name = "duration")
    3329    private Integer duration;
    3430
    35     @Column(name = "price")
    36     private Float price;
    37 
    38     @OneToOne
     31    @OneToOne(cascade = CascadeType.MERGE)
    3932    @JoinColumn(name = "service_type_id", referencedColumnName = "id")
    4033    private ServiceType serviceType;
    4134
    4235    @ManyToOne
    43     @JoinColumn(name="business_fk")
     36    @JoinColumn(name = "business_fk")
    4437    @JsonBackReference
    4538    private Business business;
Note: See TracChangeset for help on using the changeset viewer.