Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
37738 vikas 1
package com.spice.profitmandi.dao.entity.user;
2
 
3
import javax.persistence.Column;
4
import javax.persistence.Entity;
5
import javax.persistence.GeneratedValue;
6
import javax.persistence.GenerationType;
7
import javax.persistence.Id;
8
import javax.persistence.Table;
9
import javax.persistence.UniqueConstraint;
10
import java.time.LocalDateTime;
11
 
12
/**
13
 * One answer an agent recorded on the first-call checklist.
14
 *
15
 * <p>Unique per (lead, question), so re-opening the checklist updates the answer rather than
16
 * stacking a second one — the point is what the retailer said, not how many times it was typed.
17
 *
18
 * <p>Every answer type lands in the same text column. A checklist is read back as prose, and giving
19
 * numbers their own column would buy nothing while costing a migration each time a type is added.
20
 */
21
@Entity
22
@Table(name = "user.lead_call_answer",
23
        uniqueConstraints = {@UniqueConstraint(columnNames = {"lead_id", "question_id"})})
24
public class LeadCallAnswer {
25
 
26
    @Id
27
    @GeneratedValue(strategy = GenerationType.IDENTITY)
28
    @Column(name = "id", unique = true, updatable = false)
29
    private int id;
30
 
31
    @Column(name = "lead_id")
32
    private int leadId;
33
 
34
    /** The call it was taken on — what makes this a record of the conversation, not a form fill. */
35
    @Column(name = "lead_call_id")
36
    private Integer leadCallId;
37
 
38
    @Column(name = "question_id")
39
    private int questionId;
40
 
41
    @Column(name = "auth_id")
42
    private int authId;
43
 
44
    @Column(name = "answer")
45
    private String answer;
46
 
47
    /**
48
     * Points this answer earned, snapshotted from the question when it was recorded. Stored rather
49
     * than recomputed so that re-pricing a question later cannot silently rewrite a lead's score.
50
     */
51
    @Column(name = "points_awarded")
52
    private int pointsAwarded;
53
 
54
    @Column(name = "created_timestamp")
55
    private LocalDateTime createdTimestamp;
56
 
57
    public int getId() { return id; }
58
    public void setId(int id) { this.id = id; }
59
 
60
    public int getLeadId() { return leadId; }
61
    public void setLeadId(int leadId) { this.leadId = leadId; }
62
 
63
    public Integer getLeadCallId() { return leadCallId; }
64
    public void setLeadCallId(Integer leadCallId) { this.leadCallId = leadCallId; }
65
 
66
    public int getQuestionId() { return questionId; }
67
    public void setQuestionId(int questionId) { this.questionId = questionId; }
68
 
69
    public int getAuthId() { return authId; }
70
    public void setAuthId(int authId) { this.authId = authId; }
71
 
72
    public String getAnswer() { return answer; }
73
    public void setAnswer(String answer) { this.answer = answer; }
74
 
75
    public int getPointsAwarded() { return pointsAwarded; }
76
    public void setPointsAwarded(int pointsAwarded) { this.pointsAwarded = pointsAwarded; }
77
 
78
    public LocalDateTime getCreatedTimestamp() { return createdTimestamp; }
79
    public void setCreatedTimestamp(LocalDateTime createdTimestamp) { this.createdTimestamp = createdTimestamp; }
80
}