Subversion Repositories SmartDukaan

Rev

Blame | Last modification | View Log | RSS feed

package com.spice.profitmandi.dao.entity.user;

import javax.persistence.*;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * A request to schedule a visit / telephonic follow-up for a lead.
 * Created when lead-management picks an assignee but no upcoming beat is
 * available for that assignee — instead of failing, lead-mgmt fires a
 * request to the assignee's hierarchy. The head (any level up) sees it
 * inside the Plan-a-Beat window and either:
 * - Schedules it onto a beat-day (writes a LeadRoute, status -> SCHEDULED)
 * - Reassigns to a different downline sales user
 * - Rejects with a reason
 * <p>
 * Kept separate from beat_deferred_visit on purpose — the deferred entity
 * is about a planned visit that DID NOT HAPPEN; this is about a visit that
 * isn't yet on any beat at all.
 * <p>
 * status: PENDING | SCHEDULED | REJECTED | CANCELLED
 * communicationType: VISIT | TELEPHONIC
 */
@Entity
@Table(name = "user.lead_visit_request")
public class LeadVisitRequest {

        @Id
        @Column(name = "id", unique = true, updatable = false)
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private int id;

        @Column(name = "lead_id")
        private int leadId;

        @Column(name = "assignee_auth_id")
        private int assigneeAuthId;

        @Column(name = "requested_by_auth_id")
        private int requestedByAuthId;

        @Column(name = "communication_type")
        private String communicationType;

        @Column(name = "nearest_store_id")
        private Integer nearestStoreId;

        @Column(name = "requested_date")
        private LocalDate requestedDate;

        @Column(name = "reason")
        private String reason;

        @Column(name = "status")
        private String status;

        @Column(name = "reject_reason")
        private String rejectReason;

        @Column(name = "action_by_auth_id")
        private Integer actionByAuthId;

        @Column(name = "action_timestamp")
        private LocalDateTime actionTimestamp;

        @Column(name = "beat_id")
        private Integer beatId;

        @Column(name = "schedule_date")
        private LocalDate scheduleDate;

        @Column(name = "created_timestamp")
        private LocalDateTime createdTimestamp;

        @Column(name = "updated_timestamp")
        private LocalDateTime updatedTimestamp;

        public int getId() {
                return id;
        }

        public void setId(int id) {
                this.id = id;
        }

        public int getLeadId() {
                return leadId;
        }

        public void setLeadId(int leadId) {
                this.leadId = leadId;
        }

        public int getAssigneeAuthId() {
                return assigneeAuthId;
        }

        public void setAssigneeAuthId(int assigneeAuthId) {
                this.assigneeAuthId = assigneeAuthId;
        }

        public int getRequestedByAuthId() {
                return requestedByAuthId;
        }

        public void setRequestedByAuthId(int requestedByAuthId) {
                this.requestedByAuthId = requestedByAuthId;
        }

        public String getCommunicationType() {
                return communicationType;
        }

        public void setCommunicationType(String communicationType) {
                this.communicationType = communicationType;
        }

        public Integer getNearestStoreId() {
                return nearestStoreId;
        }

        public void setNearestStoreId(Integer nearestStoreId) {
                this.nearestStoreId = nearestStoreId;
        }

        public LocalDate getRequestedDate() {
                return requestedDate;
        }

        public void setRequestedDate(LocalDate requestedDate) {
                this.requestedDate = requestedDate;
        }

        public String getReason() {
                return reason;
        }

        public void setReason(String reason) {
                this.reason = reason;
        }

        public String getStatus() {
                return status;
        }

        public void setStatus(String status) {
                this.status = status;
        }

        public String getRejectReason() {
                return rejectReason;
        }

        public void setRejectReason(String rejectReason) {
                this.rejectReason = rejectReason;
        }

        public Integer getActionByAuthId() {
                return actionByAuthId;
        }

        public void setActionByAuthId(Integer actionByAuthId) {
                this.actionByAuthId = actionByAuthId;
        }

        public LocalDateTime getActionTimestamp() {
                return actionTimestamp;
        }

        public void setActionTimestamp(LocalDateTime actionTimestamp) {
                this.actionTimestamp = actionTimestamp;
        }

        public Integer getBeatId() {
                return beatId;
        }

        public void setBeatId(Integer beatId) {
                this.beatId = beatId;
        }

        public LocalDate getScheduleDate() {
                return scheduleDate;
        }

        public void setScheduleDate(LocalDate scheduleDate) {
                this.scheduleDate = scheduleDate;
        }

        public LocalDateTime getCreatedTimestamp() {
                return createdTimestamp;
        }

        public void setCreatedTimestamp(LocalDateTime createdTimestamp) {
                this.createdTimestamp = createdTimestamp;
        }

        public LocalDateTime getUpdatedTimestamp() {
                return updatedTimestamp;
        }

        public void setUpdatedTimestamp(LocalDateTime updatedTimestamp) {
                this.updatedTimestamp = updatedTimestamp;
        }
}