Subversion Repositories SmartDukaan

Rev

Rev 34405 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 34405 Rev 34443
Line 1... Line 1...
1
package com.spice.profitmandi.dao.entity.catalog;
1
package com.spice.profitmandi.dao.entity.catalog;
2
 
2
 
-
 
3
import com.spice.profitmandi.common.model.ProfitMandiConstants;
-
 
4
 
3
import javax.persistence.*;
5
import javax.persistence.*;
4
import java.math.BigDecimal;
6
import java.math.BigDecimal;
5
import java.time.LocalDate;
7
import java.time.LocalDate;
6
import java.time.LocalDateTime;
8
import java.time.LocalDateTime;
7
 
9
 
Line 20... Line 22...
20
 
22
 
21
    @Column(name = "catalog_id")
23
    @Column(name = "catalog_id")
22
    private Integer catalogId;
24
    private Integer catalogId;
23
 
25
 
24
    @Column(name = "start_date")
26
    @Column(name = "start_date")
25
    private LocalDate startDate;
27
    private LocalDateTime startDate;
26
 
28
 
27
    @Column(name = "end_date")
29
    @Column(name = "end_date")
28
    private LocalDate endDate;
30
    private LocalDateTime endDate;
29
 
31
 
30
    @Column(name = "price", precision = 10, scale = 2)
32
    @Column(name = "price", precision = 10, scale = 2)
31
    private BigDecimal price;
33
    private float price;
-
 
34
 
-
 
35
    @Column(name = "quantity")
-
 
36
    private int quantity;
32
 
37
 
33
    @Enumerated(EnumType.STRING)
38
    @Enumerated(EnumType.STRING)
34
    private Status status = Status.inactive;
39
    private ProfitMandiConstants.LIQUIDATION_ENUM status = ProfitMandiConstants.LIQUIDATION_ENUM.INACTIVE;
35
 
40
 
36
    @Column(name = "created_by", precision = 10, scale = 2)
41
    @Column(name = "created_by")
37
    private Integer createdBy;
42
    private Integer createdBy;
38
 
43
 
39
    @Column(name = "created_at", updatable = false)
44
    @Column(name = "created_at", updatable = false)
40
    private LocalDateTime createdAt;
45
    private LocalDateTime createdAt;
41
 
46
 
42
    @Column(name = "updated_at")
47
    @Column(name = "updated_at")
43
    private LocalDateTime updatedAt;
48
    private LocalDateTime updatedAt;
44
 
49
 
45
    public enum Status {
-
 
46
        active,
-
 
47
        inactive,
-
 
48
        closed
-
 
49
    }
-
 
50
 
-
 
51
    @PrePersist
50
    @PrePersist
52
    protected void onCreate() {
51
    protected void onCreate() {
53
        this.createdAt = LocalDateTime.now();
52
        this.createdAt = LocalDateTime.now();
54
        this.updatedAt = LocalDateTime.now();
53
        this.updatedAt = LocalDateTime.now();
55
    }
54
    }
Line 81... Line 80...
81
 
80
 
82
    public void setCatalogId(Integer catalogId) {
81
    public void setCatalogId(Integer catalogId) {
83
        this.catalogId = catalogId;
82
        this.catalogId = catalogId;
84
    }
83
    }
85
 
84
 
86
    public LocalDate getStartDate() {
85
    public LocalDateTime getStartDate() {
87
        return startDate;
86
        return startDate;
88
    }
87
    }
89
 
88
 
90
    public void setStartDate(LocalDate startDate) {
89
    public void setStartDate(LocalDateTime startDate) {
91
        this.startDate = startDate;
90
        this.startDate = startDate;
92
    }
91
    }
93
 
92
 
94
    public LocalDate getEndDate() {
93
    public LocalDateTime getEndDate() {
95
        return endDate;
94
        return endDate;
96
    }
95
    }
97
 
96
 
98
    public void setEndDate(LocalDate endDate) {
97
    public void setEndDate(LocalDateTime endDate) {
99
        this.endDate = endDate;
98
        this.endDate = endDate;
100
    }
99
    }
101
 
100
 
102
    public BigDecimal getPrice() {
101
    public float getPrice() {
103
        return price;
102
        return price;
104
    }
103
    }
105
 
104
 
106
    public void setPrice(BigDecimal price) {
105
    public void setPrice(float price) {
107
        this.price = price;
106
        this.price = price;
108
    }
107
    }
109
 
108
 
110
    public Status getStatus() {
109
    public int getQuantity() {
-
 
110
        return quantity;
-
 
111
    }
-
 
112
 
-
 
113
    public void setQuantity(int quantity) {
-
 
114
        this.quantity = quantity;
-
 
115
    }
-
 
116
 
-
 
117
    public ProfitMandiConstants.LIQUIDATION_ENUM getStatus() {
111
        return status;
118
        return status;
112
    }
119
    }
113
 
120
 
114
    public void setStatus(Status status) {
121
    public void setStatus(ProfitMandiConstants.LIQUIDATION_ENUM status) {
115
        this.status = status;
122
        this.status = status;
116
    }
123
    }
117
 
124
 
118
    public Integer getCreatedBy() {
125
    public Integer getCreatedBy() {
119
        return createdBy;
126
        return createdBy;