package com.jeesharp.business.modules.finance.application.api;

import com.jeesharp.business.modules.finance.api.MemberInvoiceTitleApi;
import com.jeesharp.business.modules.finance.invoice.application.MemberInvoiceTitleApplicationService;
import com.jeesharp.business.modules.finance.invoice.dto.MemberInvoiceTitleSaveDTO;
import com.jeesharp.business.modules.finance.invoice.vo.MemberInvoiceTitleInfoVO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * {@link MemberInvoiceTitleApi} 实现，委托 {@link MemberInvoiceTitleApplicationService}。
 *
 * @author jeesharp
 * @since 2026-06-13
 */
@Service
@AllArgsConstructor
public class MemberInvoiceTitleApiImpl implements MemberInvoiceTitleApi {

    private final MemberInvoiceTitleApplicationService memberInvoiceTitleApplicationService;

    @Override
    public List<MemberInvoiceTitleInfoVO> listByMember(String memberId) {
        return memberInvoiceTitleApplicationService.listByMember(memberId);
    }

    @Override
    public String create(String memberId, MemberInvoiceTitleSaveDTO dto) {
        return memberInvoiceTitleApplicationService.create(memberId, dto);
    }

    @Override
    public void update(String memberId, MemberInvoiceTitleSaveDTO dto) {
        memberInvoiceTitleApplicationService.update(memberId, dto);
    }

    @Override
    public void delete(String memberId, String id) {
        memberInvoiceTitleApplicationService.delete(memberId, id);
    }

    @Override
    public void setDefault(String memberId, String id) {
        memberInvoiceTitleApplicationService.setDefault(memberId, id);
    }
}
