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

import com.jeesharp.business.modules.member.api.MemberPointsApi;
import com.jeesharp.business.modules.member.application.MemberPointsApplicationService;
import com.jeesharp.business.modules.member.dto.MemberPointsDeductDTO;
import com.jeesharp.business.modules.member.dto.MemberPointsGrantDTO;
import com.jeesharp.business.modules.member.dto.MemberPointsGrantResultDTO;
import com.jeesharp.business.modules.member.dto.MemberPointsRevokeDTO;
import com.jeesharp.business.modules.member.dto.MemberPointsTrialDTO;
import com.jeesharp.business.modules.member.dto.MemberPointsTrialResultDTO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * {@link MemberPointsApi} 实现，委托 {@link MemberPointsApplicationService}。
 *
 * @author jeesharp
 * @since 2026-06-23
 */
@Service
@AllArgsConstructor
public class MemberPointsApiImpl implements MemberPointsApi {

    private final MemberPointsApplicationService memberPointsApplicationService;

    @Override
    public MemberPointsTrialResultDTO trial(MemberPointsTrialDTO dto) {
        return memberPointsApplicationService.trial(dto);
    }

    @Override
    public MemberPointsGrantResultDTO grant(MemberPointsGrantDTO dto) {
        return memberPointsApplicationService.grant(dto);
    }

    @Override
    public MemberPointsGrantResultDTO deduct(MemberPointsDeductDTO dto) {
        return memberPointsApplicationService.deduct(dto);
    }

    @Override
    public void revoke(MemberPointsRevokeDTO dto) {
        memberPointsApplicationService.revoke(dto);
    }

    @Override
    public MemberPointsGrantResultDTO grantRegisterPoints(String memberId) {
        return memberPointsApplicationService.grantRegisterPoints(memberId);
    }
}
