package com.jmb.springfactory.service.productionschedule;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jmb.springfactory.dao.GenericMySQLService;
import com.jmb.springfactory.dao.productionschedule.ProductionScheduleMySQLService;
import com.jmb.springfactory.model.bo.BusinessObjectBase;
import com.jmb.springfactory.model.dto.ProductionScheduleDto;
import com.jmb.springfactory.model.entity.ProductionSchedule;
import com.jmb.springfactory.service.GenericServiceImpl;

@Service
public class ProductionScheduleServiceImpl extends GenericServiceImpl<ProductionSchedule, ProductionScheduleDto,
  BusinessObjectBase, Integer> implements ProductionScheduleService {

  @Autowired
  private ProductionScheduleMySQLService productionScheduleMySQLService;

  @Override
  public GenericMySQLService<ProductionSchedule, Integer> genericDao() {
    return productionScheduleMySQLService;
  }

  @Override
  public Class<? extends ProductionSchedule> getClazz() {
    return ProductionSchedule.class;
  }

  @Override
  public Class<? extends ProductionScheduleDto> getDtoClazz() {
    return ProductionScheduleDto.class;
  }

  @Override
  public Class<? extends BusinessObjectBase> getBoClazz() {
    return BusinessObjectBase.class;
  }

}

@@ -293,32 +293,95 @@
 leMySQLService;%0A
+import com.jmb.springfactory.exceptions.ServiceLayerException;%0A
 import com.jmb.s
@@ -546,16 +546,92 @@
 hedule;%0A
+import com.jmb.springfactory.model.enumeration.ProductionScheduleStateEnum;%0A
 import c
@@ -1438,12 +1438,227 @@
 ass;%0A  %7D
+%0A  %0A  @Override%0A  public ProductionScheduleDto save(ProductionScheduleDto schedule) throws ServiceLayerException %7B%0A    schedule.setState(ProductionScheduleStateEnum.OPEN.name());%0A    return super.save(schedule);%0A  %7D
 %0A%0A%7D%0A

Set schedule status as OPEN when it is created