Subversion Repositories SmartDukaan

Rev

Rev 37268 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
37211 amit 1
package com.spice.profitmandi.dao.entity.catalog;
2
 
3
import javax.persistence.*;
4
import java.time.LocalDateTime;
5
 
37640 amit 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
 */
37211 amit 14
@Entity
15
@Table(name = "catalog.model_hot_deal")
16
public class ModelHotDeal {
17
 
18
    @Id
19
    @Column
20
    @GeneratedValue(strategy = GenerationType.IDENTITY)
21
    private int id;
22
 
23
    @Column(name = "catalog_item_id")
24
    private int catalogItemId;
25
 
37640 amit 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
     */
36
    @Column(name = "oem_brand")
37
    private String oemBrand;
37211 amit 38
 
37640 amit 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
     */
47
    @Column(name = "oem_catalog_id")
48
    private Integer oemCatalogId;
37211 amit 49
 
37244 amit 50
    @Column(name = "warranty_months")
51
    private int warrantyMonths;
52
 
53
    @Column(name = "item_condition")
54
    @Enumerated(EnumType.STRING)
55
    private HotDealCondition itemCondition;
56
 
37268 amit 57
    /** true = device unused/sealed ("Fresh"); replaces the old inverted "activated" term. */
58
    @Column(name = "fresh")
59
    private boolean fresh;
37244 amit 60
 
61
    @Column(name = "finance_mapping")
62
    private boolean financeMapping;
63
 
64
    @Column(name = "affordability")
65
    private boolean affordability;
66
 
37211 amit 67
    @Column(name = "created_on")
68
    private LocalDateTime createdOn;
69
 
70
    @Column(name = "created_by")
71
    private String createdBy;
72
 
73
    @Column(name = "modified_on")
74
    private LocalDateTime modifiedOn;
75
 
76
    @Column(name = "modified_by")
77
    private String modifiedBy;
78
 
79
    @Transient
80
    private String catalogDescription;
81
 
82
    public int getId() {
83
        return id;
84
    }
85
 
86
    public void setId(int id) {
87
        this.id = id;
88
    }
89
 
90
    public int getCatalogItemId() {
91
        return catalogItemId;
92
    }
93
 
94
    public void setCatalogItemId(int catalogItemId) {
95
        this.catalogItemId = catalogItemId;
96
    }
97
 
37640 amit 98
    public String getOemBrand() {
99
        return oemBrand;
37211 amit 100
    }
101
 
37640 amit 102
    public void setOemBrand(String oemBrand) {
103
        this.oemBrand = oemBrand;
37211 amit 104
    }
105
 
37640 amit 106
    public Integer getOemCatalogId() {
107
        return oemCatalogId;
37211 amit 108
    }
109
 
37640 amit 110
    public void setOemCatalogId(Integer oemCatalogId) {
111
        this.oemCatalogId = oemCatalogId;
37211 amit 112
    }
113
 
37640 amit 114
    /** Description of the mapped OEM model, filled in for the admin table only. */
115
    @Transient
116
    private String oemCatalogDescription;
117
 
118
    public String getOemCatalogDescription() {
119
        return oemCatalogDescription;
120
    }
121
 
122
    public void setOemCatalogDescription(String oemCatalogDescription) {
123
        this.oemCatalogDescription = oemCatalogDescription;
124
    }
125
 
37211 amit 126
    public LocalDateTime getCreatedOn() {
127
        return createdOn;
128
    }
129
 
130
    public void setCreatedOn(LocalDateTime createdOn) {
131
        this.createdOn = createdOn;
132
    }
133
 
134
    public String getCreatedBy() {
135
        return createdBy;
136
    }
137
 
138
    public void setCreatedBy(String createdBy) {
139
        this.createdBy = createdBy;
140
    }
141
 
142
    public LocalDateTime getModifiedOn() {
143
        return modifiedOn;
144
    }
145
 
146
    public void setModifiedOn(LocalDateTime modifiedOn) {
147
        this.modifiedOn = modifiedOn;
148
    }
149
 
150
    public String getModifiedBy() {
151
        return modifiedBy;
152
    }
153
 
154
    public void setModifiedBy(String modifiedBy) {
155
        this.modifiedBy = modifiedBy;
156
    }
157
 
158
    public String getCatalogDescription() {
159
        return catalogDescription;
160
    }
161
 
162
    public void setCatalogDescription(String catalogDescription) {
163
        this.catalogDescription = catalogDescription;
164
    }
165
 
37244 amit 166
    public int getWarrantyMonths() {
167
        return warrantyMonths;
168
    }
169
 
170
    public void setWarrantyMonths(int warrantyMonths) {
171
        this.warrantyMonths = warrantyMonths;
172
    }
173
 
174
    public HotDealCondition getItemCondition() {
175
        return itemCondition;
176
    }
177
 
178
    public void setItemCondition(HotDealCondition itemCondition) {
179
        this.itemCondition = itemCondition;
180
    }
181
 
37268 amit 182
    public boolean isFresh() {
183
        return fresh;
37244 amit 184
    }
185
 
37268 amit 186
    public void setFresh(boolean fresh) {
187
        this.fresh = fresh;
37244 amit 188
    }
189
 
190
    public boolean isFinanceMapping() {
191
        return financeMapping;
192
    }
193
 
194
    public void setFinanceMapping(boolean financeMapping) {
195
        this.financeMapping = financeMapping;
196
    }
197
 
198
    public boolean isAffordability() {
199
        return affordability;
200
    }
201
 
202
    public void setAffordability(boolean affordability) {
203
        this.affordability = affordability;
204
    }
37211 amit 205
}