package com.red.circle.wallet.inner.service.bean.impl;

import com.red.circle.wallet.infra.database.rds.service.bean.BeanIncomeExpenditureService;
import com.red.circle.wallet.inner.convertor.BeanIncomeExpenditureInnerConvertor;
import com.red.circle.wallet.inner.model.dto.BeanIncomeExpenditureDTO;
import com.red.circle.wallet.inner.service.bean.BeanIncomeExpenditureClientService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 用户豆子收支.
 *
 * @author pengliang on 2023/12/26
 */
@Service
@RequiredArgsConstructor
public class BeanIncomeExpenditureClientServiceImpl implements BeanIncomeExpenditureClientService {

  private final BeanIncomeExpenditureService beanIncomeExpenditureService;
  private final BeanIncomeExpenditureInnerConvertor beanIncomeExpenditureInnerConvertor;

  @Override
  public void save(BeanIncomeExpenditureDTO dto) {
    beanIncomeExpenditureService.save(
        beanIncomeExpenditureInnerConvertor.toBeanIncomeExpenditure(dto)
    );
  }
}
