package com.caliverse.admin.dynamodb.repository;

import com.caliverse.admin.domain.entity.Mail;
import com.caliverse.admin.domain.entity.SEARCHTYPE;
import com.caliverse.admin.domain.entity.metadata.MetaSystemMailData;
import com.caliverse.admin.dynamodb.domain.doc.MailDoc;
import com.caliverse.admin.dynamodb.domain.doc.MailJsonDoc;
import com.caliverse.admin.dynamodb.dto.PageResult;
import com.caliverse.admin.dynamodb.entity.MailItem;
import software.amazon.awssdk.enhanced.dynamodb.Key;
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;

import java.util.List;
import java.util.Map;

public interface MailJsonRepository extends DynamoDBRepository<MailJsonDoc> {
    void insertRecvSystemMail(String userGuid, String nickname, List<MailItem> mailItems, MetaSystemMailData systemMailData, List<String> arguments);
    void insertSentMail(Mail mail);
    List<MailJsonDoc> getMailList(String type, String userGuid, String sortKeyPrefix);
    PageResult<MailJsonDoc> getMailListWithPaging(
            SEARCHTYPE type,
            String userGuid,
            String sortKeyPrefix,
            Map<String, AttributeValue> exclusiveStartKey
    );
    void deleteMail(Key key);
    void deleteMailItem(Key key, Integer itemId, double count, double newCount);
}
