package com.caliverse.admin.dynamodb.domain.doc;

import com.caliverse.admin.global.common.constants.DynamoDBConstants;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbAttribute;
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;

@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@DynamoDbBean
public class MailDoc extends DynamoDBDocBase {
    private String mailAttrib;
    @Setter
    private long ttl;

    public String getAttribFieldName() {
        return DynamoDBConstants.ATTRIB_MAIL;
    }

    @DynamoDbAttribute(DynamoDBConstants.ATTRIB_MAIL)
    @JsonProperty(DynamoDBConstants.ATTRIB_MAIL)
    public String getAttribValue() {
        return mailAttrib;
    }

    @DynamoDbAttribute("TTL")
    @JsonProperty("TTL")
    public long getTtl() {
        return ttl;
    }

    public void setAttribValue(String value) {
        this.mailAttrib = value;
    }
}

