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

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbAttribute;
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbPartitionKey;
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbSortKey;

@Data
@NoArgsConstructor
@DynamoDbBean
public abstract class DynamoDBDocBase {
    private String PK;  // Partition Key
    private String SK;  // Sort Key
    @JsonProperty("DocType")
    private String docType;
    @JsonProperty("CreatedDateTime")
    private String createdDateTime;
    @JsonProperty("UpdatedDateTime")
    private String updatedDateTime;
    @JsonProperty("DeletedDateTime")
    private String deletedDateTime;
    @JsonProperty("RestoredDateTime")
    private String restoredDateTime;

    @DynamoDbPartitionKey
    @DynamoDbAttribute("PK")
    public String getPK() {
        return PK;
    }

    @DynamoDbSortKey
    @DynamoDbAttribute("SK")
    public String getSK() {
        return SK;
    }

    @DynamoDbAttribute("DocType")
    public String getDocType() {
        return docType;
    }

    @DynamoDbAttribute("CreatedDateTime")
    public String getCreatedDateTime() {
        return createdDateTime;
    }

    @DynamoDbAttribute("UpdatedDateTime")
    public String getUpdatedDateTime() {
        return updatedDateTime;
    }

    @DynamoDbAttribute("DeletedDateTime")
    public String getDeletedDateTime() {
        return deletedDateTime;
    }

    @DynamoDbAttribute("RestoredDateTime")
    public String getRestoredDateTime() {
        return restoredDateTime;
    }
}
