package cn.novalon.gym.manage.member.service;

import cn.novalon.gym.manage.member.entity.MemberCardRecord;
import org.springframework.data.domain.Pageable;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * 会员卡记录服务接口
 * 
 * @author 付嘉
 * @date 2026-05-27
 */
public interface IMemberCardRecordService {
    
    Mono<MemberCardRecord> findById(Long id);
    
    Flux<MemberCardRecord> findByMemberId(Long memberId, Pageable pageable);
    
    Flux<MemberCardRecord> findActiveCardsByMemberId(Long memberId);
    
    Mono<MemberCardRecord> insertActiveRecord(MemberCardRecord record);
    
    Mono<Integer> deductUsage(Long recordId, Integer deductTimes, Double deductAmount);
    
    Mono<Integer> renewCard(Long recordId, Integer addTimes, Double addAmount, java.time.LocalDateTime newExpireTime);
    
    Mono<Integer> updateStatus(Long recordId, String status);
    
    Mono<MemberCardRecord> validateCountCard(Long recordId, Integer requiredTimes);
    
    Mono<MemberCardRecord> validateStoredCard(Long recordId, Double requiredAmount);
    
    Flux<MemberCardRecord> findExpiredCards();
}
