feat(services-counter): capture, match, list and edit event leads
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
1 parent
b75d636886
commit
48507979bd
20 files changed
+1183
-1
No files matched your search
+58
@@ -0,0 +1,58 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.utils.SnowflakeIdWorker;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "event_lead", uniqueConstraints = {
|
||||
@UniqueConstraint(columnNames = {"uuid"}),
|
||||
@UniqueConstraint(columnNames = {"event_uuid", "lead_uuid"})
|
||||
})
|
||||
public class EventLead {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Column(updatable = false)
|
||||
private long uuid = SnowflakeIdWorker.getUUID();
|
||||
|
||||
private long companyId;
|
||||
|
||||
@Column(name = "event_uuid")
|
||||
private long eventUuid;
|
||||
|
||||
@Column(name = "lead_uuid")
|
||||
private long leadUuid;
|
||||
|
||||
|
||||
@Column(name = "salesperson_user_id")
|
||||
private Long salespersonUserId;
|
||||
|
||||
private String leadType;
|
||||
|
||||
private String temperature;
|
||||
|
||||
private String status;
|
||||
|
||||
@Column(name = "next_follow_up_date")
|
||||
private LocalDate nextFollowUpDate;
|
||||
|
||||
private String notes;
|
||||
|
||||
private String capturedBy;
|
||||
|
||||
@Column(updatable = false)
|
||||
private LocalDateTime capturedAt = LocalDateTime.now();
|
||||
|
||||
private String updatedBy;
|
||||
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.data.domain.Persistable;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "event_lead_interest", uniqueConstraints = @UniqueConstraint(columnNames = {"event_lead_id", "interest_id"}))
|
||||
public class EventLeadInterest implements Persistable<EventLeadInterestId> {
|
||||
@EmbeddedId
|
||||
private EventLeadInterestId id;
|
||||
|
||||
private long companyId;
|
||||
|
||||
/** Rows are only inserted (a set is replaced by a bulk delete first), so saveAll persists without a SELECT per row. */
|
||||
@Override
|
||||
@Transient
|
||||
public boolean isNew() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Embeddable
|
||||
public class EventLeadInterestId implements Serializable {
|
||||
|
||||
@Column(name = "event_lead_id")
|
||||
private long eventLeadId;
|
||||
|
||||
@Column(name = "interest_id")
|
||||
private long interestId;
|
||||
|
||||
public EventLeadInterestId() {}
|
||||
|
||||
public EventLeadInterestId(long eventLeadId, long interestId) {
|
||||
this.eventLeadId = eventLeadId;
|
||||
this.interestId = interestId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof EventLeadInterestId)) return false;
|
||||
EventLeadInterestId that = (EventLeadInterestId) o;
|
||||
return eventLeadId == that.eventLeadId && interestId == that.interestId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(eventLeadId, interestId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.solvway.services.counter.model;
|
||||
|
||||
import com.solvway.core.utils.SnowflakeIdWorker;
|
||||
import jakarta.persistence.*;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "`lead`", uniqueConstraints = @UniqueConstraint(columnNames = {"uuid"}))
|
||||
public class Lead {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Column(updatable = false)
|
||||
private long uuid = SnowflakeIdWorker.getUUID();
|
||||
|
||||
private long companyId;
|
||||
|
||||
private String name;
|
||||
|
||||
@Column(name = "mobile_e164")
|
||||
private String mobileE164;
|
||||
|
||||
private String emailNormalised;
|
||||
|
||||
private String companyName;
|
||||
|
||||
private String jobTitle;
|
||||
|
||||
private String notes;
|
||||
|
||||
private String createdBy;
|
||||
|
||||
@Column(updatable = false)
|
||||
private LocalDateTime createdAt = LocalDateTime.now();
|
||||
|
||||
private String updatedBy;
|
||||
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
Reference in new issue
Block a user