from rest_framework import serializers


class LeadSubmitSerializer(serializers.Serializer):
    form_id = serializers.IntegerField()
    data = serializers.DictField()
    source_url = serializers.URLField(required=False, allow_blank=True, default="")
    # 蜂蜜陷阱反垃圾注册字段：正常用户不会看到/填写该字段，机器人填写则视为垃圾提交。
    # 无需接入极验/腾讯云等第三方验证码服务即可降低自动化垃圾提交，详见设计文档 §2.15。
    website = serializers.CharField(required=False, allow_blank=True, default="")


class LeadDeletionRequestSerializer(serializers.Serializer):
    """PIPL 数据删除权：发起申请时仅需提交联系邮箱。"""

    contact = serializers.EmailField()


class LeadDeletionConfirmSerializer(serializers.Serializer):
    """PIPL 数据删除权：确认时提交邮件中的 token。"""

    token = serializers.UUIDField()
