package com.rj.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.rj.entity.LbDeductionAmount;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Map;

public interface ILbDeductionAmountService extends IService<LbDeductionAmount> {

    Map<String, Object> add(LbDeductionAmount entity);

    Map<String, Object> update(LbDeductionAmount entity);

    Map<String, Object> deleteById(String id);

    Map<String, Object> pageQuery(Integer current,
                                  Integer size,
                                  String tenantId,
                                  String userName,
                                  String userPhone,
                                  String createTimeStart,
                                  String createTimeEnd);

    /**
     * 根据自然语言文本调用大模型解析为 {@link LbDeductionAmount} 并落库。
     */
    Map<String, Object> parseFromTextByLlmAndSave(String tenantId, String text);

    /**
     * 按租户、报表日期汇总抵扣金额：key 为 user_name（trim），value 为同日 create_time 记录的 dikou_amt 之和。
     */
    Map<String, BigDecimal> sumDikouAmtByUserNameForReportDate(String tenantId, LocalDate reportDate);
}
