package kz.konturai.parser.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Document(collection = "facebook_leads")
public class FacebookLead {

    @Id
    private String id;

    @Indexed(unique = true)
    @Field("external_comment_id")
    private String externalCommentId;

    @Field("author_name")
    private String authorName;

    @Field("message")
    private String message;

    @Field("timestamp")
    private LocalDateTime timestamp;

    @Field("call_center_customer_id")
    private String callCenterCustomerId;

    @Field("call_center_interaction_id")
    private String callCenterInteractionId;

    @Builder.Default
    @Field("call_center_sync_status")
    private String callCenterSyncStatus = "PENDING";

    @Field("call_center_sync_error")
    private String callCenterSyncError;

    @Field("call_center_synced_at")
    private LocalDateTime callCenterSyncedAt;

    @Builder.Default
    @Field("status")
    private String status = "NEW";
}
