package com.supplier.service.impl;

import com.supplier.mapper.SupplierReleaseMapper;
import com.supplier.model.SupplierRelease;
import com.supplier.model.SupplierReleaseDay;
import com.supplier.model.SupplierReleasePlay;
import com.supplier.service.SupplierReleaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

@Service
public class SupplierReleaseServiceImpl implements SupplierReleaseService {

    @Autowired
    private SupplierReleaseMapper supplierReleaseMapper;

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void addRelease(SupplierRelease supplierRelease) {
        supplierReleaseMapper.addRelease(supplierRelease);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void addReleaseDay(SupplierReleaseDay supplierReleaseDay) {
        supplierReleaseMapper.addReleaseDay(supplierReleaseDay);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void addReleasePlay(SupplierReleasePlay supplierReleasePlay) {
        supplierReleaseMapper.addReleasePlay(supplierReleasePlay);
    }

    @Override
    public List<SupplierRelease> getSupplierRelease(SupplierRelease supplierRelease) {
        return supplierReleaseMapper.getSupplierRelease(supplierRelease);
    }

    @Override
    public List<SupplierReleaseDay> getSupplierReleaseDay(String uuid) {
        return supplierReleaseMapper.getSupplierReleaseDay(uuid);
    }

    @Override
    public List<SupplierReleasePlay> getSupplierReleasePlay(String uuid) {
        return supplierReleaseMapper.getSupplierReleasePlay(uuid);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updateSupplierRelease(SupplierRelease supplierRelease) {
        supplierReleaseMapper.updateSupplierRelease(supplierRelease);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void addPrivateType(SupplierRelease supplierRelease) {
        supplierReleaseMapper.addPrivateType(supplierRelease);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void updatePrivateType(SupplierRelease supplierRelease) {
        supplierReleaseMapper.updatePrivateType(supplierRelease);
    }
}
