Subversion Repositories SmartDukaan

Rev

Rev 34387 | Rev 34443 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
34387 vikas.jang 1
package com.spice.profitmandi.dao.entity.catalog;
2
 
3
import javax.persistence.*;
4
import java.math.BigDecimal;
5
import java.time.LocalDate;
6
import java.time.LocalDateTime;
7
 
8
@Entity
9
@Table(name = "fofo.liquidation_products")
10
 
11
public class Liquidation {
12
 
13
    @Id
14
    @GeneratedValue(strategy = GenerationType.IDENTITY)
15
    @Column(name = "id")
16
    private int id;
17
 
34405 vikas.jang 18
    @Column(name = "restricted")
19
    private Boolean restricted;
34387 vikas.jang 20
 
21
    @Column(name = "catalog_id")
22
    private Integer catalogId;
23
 
24
    @Column(name = "start_date")
25
    private LocalDate startDate;
26
 
27
    @Column(name = "end_date")
28
    private LocalDate endDate;
29
 
30
    @Column(name = "price", precision = 10, scale = 2)
31
    private BigDecimal price;
32
 
33
    @Enumerated(EnumType.STRING)
34
    private Status status = Status.inactive;
35
 
36
    @Column(name = "created_by", precision = 10, scale = 2)
37
    private Integer createdBy;
38
 
39
    @Column(name = "created_at", updatable = false)
40
    private LocalDateTime createdAt;
41
 
42
    @Column(name = "updated_at")
43
    private LocalDateTime updatedAt;
44
 
45
    public enum Status {
46
        active,
47
        inactive,
48
        closed
49
    }
50
 
51
    @PrePersist
52
    protected void onCreate() {
53
        this.createdAt = LocalDateTime.now();
54
        this.updatedAt = LocalDateTime.now();
55
    }
56
 
57
    @PreUpdate
58
    protected void onUpdate() {
59
        this.updatedAt = LocalDateTime.now();
60
    }
61
 
62
    public int getId() {
63
        return id;
64
    }
65
 
66
    public void setId(int id) {
67
        this.id = id;
68
    }
69
 
34405 vikas.jang 70
    public Boolean getRestricted() {
71
        return restricted;
34387 vikas.jang 72
    }
73
 
34405 vikas.jang 74
    public void setRestricted(Boolean restricted) {
75
        this.restricted = restricted;
34387 vikas.jang 76
    }
77
 
78
    public Integer getCatalogId() {
79
        return catalogId;
80
    }
81
 
82
    public void setCatalogId(Integer catalogId) {
83
        this.catalogId = catalogId;
84
    }
85
 
86
    public LocalDate getStartDate() {
87
        return startDate;
88
    }
89
 
90
    public void setStartDate(LocalDate startDate) {
91
        this.startDate = startDate;
92
    }
93
 
94
    public LocalDate getEndDate() {
95
        return endDate;
96
    }
97
 
98
    public void setEndDate(LocalDate endDate) {
99
        this.endDate = endDate;
100
    }
101
 
102
    public BigDecimal getPrice() {
103
        return price;
104
    }
105
 
106
    public void setPrice(BigDecimal price) {
107
        this.price = price;
108
    }
109
 
110
    public Status getStatus() {
111
        return status;
112
    }
113
 
114
    public void setStatus(Status status) {
115
        this.status = status;
116
    }
117
 
118
    public Integer getCreatedBy() {
119
        return createdBy;
120
    }
121
 
122
    public void setCreatedBy(Integer createdBy) {
123
        this.createdBy = createdBy;
124
    }
125
 
126
    public LocalDateTime getCreatedAt() {
127
        return createdAt;
128
    }
129
 
130
    public void setCreatedAt(LocalDateTime createdAt) {
131
        this.createdAt = createdAt;
132
    }
133
 
134
    public LocalDateTime getUpdatedAt() {
135
        return updatedAt;
136
    }
137
 
138
    public void setUpdatedAt(LocalDateTime updatedAt) {
139
        this.updatedAt = updatedAt;
140
    }
141
 
142
    @Override
143
    public String toString() {
144
        return "Liquidation{" +
34405 vikas.jang 145
            "id=" + id +
146
            ", restricted=" + restricted +
147
            ", catalogId=" + catalogId +
148
            ", startDate=" + startDate +
149
            ", endDate=" + endDate +
150
            ", price=" + price +
151
            ", status=" + status +
152
            ", createdBy=" + createdBy +
153
            ", createdAt=" + createdAt +
154
            ", updatedAt=" + updatedAt +
155
        '}';
34387 vikas.jang 156
    }
157
}