Subversion Repositories SmartDukaan

Rev

Rev 37268 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37268 Rev 37640
Line 1... Line 1...
1
package com.spice.profitmandi.dao.entity.catalog;
1
package com.spice.profitmandi.dao.entity.catalog;
2
 
2
 
3
import javax.persistence.*;
3
import javax.persistence.*;
4
import java.time.LocalDate;
-
 
5
import java.time.LocalDateTime;
4
import java.time.LocalDateTime;
6
 
5
 
-
 
6
/**
-
 
7
 * Per-SKU hot deal attributes, one row per catalog.
-
 
8
 *
-
 
9
 * <p>This table no longer decides <em>whether</em> a SKU is a hot deal - brand membership
-
 
10
 * does that ({@code catalog.brand = 'Hot Deal'}). What survives here is the data a brand
-
 
11
 * row cannot carry: the five partner-facing pill attributes, which differ per SKU, and
-
 
12
 * {@code oemBrand}, the brand the SKU held before the move.
-
 
13
 */
7
@Entity
14
@Entity
8
@Table(name = "catalog.model_hot_deal")
15
@Table(name = "catalog.model_hot_deal")
9
public class ModelHotDeal {
16
public class ModelHotDeal {
10
 
17
 
11
    @Id
18
    @Id
12
    @Column
19
    @Column
13
    @GeneratedValue(strategy = GenerationType.IDENTITY)
20
    @GeneratedValue(strategy = GenerationType.IDENTITY)
14
    private int id;
21
    private int id;
15
 
22
 
16
    @Column(name = "brand_id")
-
 
17
    private int brandId;
-
 
18
 
-
 
19
    @Column(name = "catalog_item_id")
23
    @Column(name = "catalog_item_id")
20
    private int catalogItemId;
24
    private int catalogItemId;
21
 
25
 
-
 
26
    /**
-
 
27
     * The brand this SKU carried before it moved to "Hot Deal". Sole source of the Solr
-
 
28
     * field {@code oem_brand_s}, which drives the brand chips inside the hot-deal
-
 
29
     * listing. Set once by the migration; not user-editable.
-
 
30
     *
-
 
31
     * <p>Deliberately kept out of Solr's {@code brand_ss}: that field is multi-valued and
-
 
32
     * feeds {@code SolrService.brandExclusionFq}, so an OEM value there would hide the SKU
-
 
33
     * from a partner blocked on that OEM. Channel and non-channel stock are different
-
 
34
     * brands, so the block must not follow the SKU across the move.
-
 
35
     */
22
    @Column(name = "start_date")
36
    @Column(name = "oem_brand")
23
    private LocalDate startDate;
37
    private String oemBrand;
24
 
38
 
-
 
39
    /**
-
 
40
     * The same model's catalog entry under its OEM brand, where one exists - the
-
 
41
     * channel-stock counterpart of this non-channel SKU.
-
 
42
     *
-
 
43
     * <p>Optional and never inferred: many hot-deal models have no channel twin, and a
-
 
44
     * wrong mapping is worse than none, so it is set only by an explicit choice in the
-
 
45
     * admin, from an autosuggest scoped to {@link #oemBrand}.
-
 
46
     */
25
    @Column(name = "end_date")
47
    @Column(name = "oem_catalog_id")
26
    private LocalDate endDate;
48
    private Integer oemCatalogId;
27
 
49
 
28
    @Column(name = "warranty_months")
50
    @Column(name = "warranty_months")
29
    private int warrantyMonths;
51
    private int warrantyMonths;
30
 
52
 
31
    @Column(name = "item_condition")
53
    @Column(name = "item_condition")
Line 55... Line 77...
55
    private String modifiedBy;
77
    private String modifiedBy;
56
 
78
 
57
    @Transient
79
    @Transient
58
    private String catalogDescription;
80
    private String catalogDescription;
59
 
81
 
60
    @Transient
-
 
61
    private String status;
-
 
62
 
-
 
63
    @Transient
-
 
64
    private String brandName;
-
 
65
 
-
 
66
    public int getId() {
82
    public int getId() {
67
        return id;
83
        return id;
68
    }
84
    }
69
 
85
 
70
    public void setId(int id) {
86
    public void setId(int id) {
71
        this.id = id;
87
        this.id = id;
72
    }
88
    }
73
 
89
 
74
    public int getBrandId() {
-
 
75
        return brandId;
-
 
76
    }
-
 
77
 
-
 
78
    public void setBrandId(int brandId) {
-
 
79
        this.brandId = brandId;
-
 
80
    }
-
 
81
 
-
 
82
    public int getCatalogItemId() {
90
    public int getCatalogItemId() {
83
        return catalogItemId;
91
        return catalogItemId;
84
    }
92
    }
85
 
93
 
86
    public void setCatalogItemId(int catalogItemId) {
94
    public void setCatalogItemId(int catalogItemId) {
87
        this.catalogItemId = catalogItemId;
95
        this.catalogItemId = catalogItemId;
88
    }
96
    }
89
 
97
 
90
    public LocalDate getStartDate() {
98
    public String getOemBrand() {
91
        return startDate;
99
        return oemBrand;
-
 
100
    }
-
 
101
 
-
 
102
    public void setOemBrand(String oemBrand) {
-
 
103
        this.oemBrand = oemBrand;
92
    }
104
    }
93
 
105
 
94
    public void setStartDate(LocalDate startDate) {
106
    public Integer getOemCatalogId() {
95
        this.startDate = startDate;
107
        return oemCatalogId;
96
    }
108
    }
97
 
109
 
98
    public LocalDate getEndDate() {
110
    public void setOemCatalogId(Integer oemCatalogId) {
99
        return endDate;
111
        this.oemCatalogId = oemCatalogId;
100
    }
112
    }
101
 
113
 
-
 
114
    /** Description of the mapped OEM model, filled in for the admin table only. */
-
 
115
    @Transient
-
 
116
    private String oemCatalogDescription;
-
 
117
 
102
    public void setEndDate(LocalDate endDate) {
118
    public String getOemCatalogDescription() {
103
        this.endDate = endDate;
119
        return oemCatalogDescription;
-
 
120
    }
-
 
121
 
-
 
122
    public void setOemCatalogDescription(String oemCatalogDescription) {
-
 
123
        this.oemCatalogDescription = oemCatalogDescription;
104
    }
124
    }
105
 
125
 
106
    public LocalDateTime getCreatedOn() {
126
    public LocalDateTime getCreatedOn() {
107
        return createdOn;
127
        return createdOn;
108
    }
128
    }
Line 141... Line 161...
141
 
161
 
142
    public void setCatalogDescription(String catalogDescription) {
162
    public void setCatalogDescription(String catalogDescription) {
143
        this.catalogDescription = catalogDescription;
163
        this.catalogDescription = catalogDescription;
144
    }
164
    }
145
 
165
 
146
    public String getStatus() {
-
 
147
        return status;
-
 
148
    }
-
 
149
 
-
 
150
    public void setStatus(String status) {
-
 
151
        this.status = status;
-
 
152
    }
-
 
153
 
-
 
154
    public String getBrandName() {
-
 
155
        return brandName;
-
 
156
    }
-
 
157
 
-
 
158
    public void setBrandName(String brandName) {
-
 
159
        this.brandName = brandName;
-
 
160
    }
-
 
161
 
-
 
162
    public int getWarrantyMonths() {
166
    public int getWarrantyMonths() {
163
        return warrantyMonths;
167
        return warrantyMonths;
164
    }
168
    }
165
 
169
 
166
    public void setWarrantyMonths(int warrantyMonths) {
170
    public void setWarrantyMonths(int warrantyMonths) {