<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">

    <bean id="startWorkflowEventsForTimesheet" class="java.util.ArrayList">
        <constructor-arg>
            <list>
                <value>com.armedia.acm.timesheet.submit</value>
            </list>
        </constructor-arg>
    </bean>

    <bean id="acmTimesheetDao" class="com.armedia.acm.services.timesheet.dao.AcmTimesheetDao"/>
    <bean id="acmTimeDao" class="com.armedia.acm.services.timesheet.dao.AcmTimeDao"/>

    <bean id="timesheetService" class="com.armedia.acm.services.timesheet.service.TimesheetServiceImpl">
        <property name="configuration" ref="timesheetConfig"/>
        <property name="acmTimesheetDao" ref="acmTimesheetDao"/>
        <property name="submissionStatusesMap">
            <map>
                <entry key="Save" value="DRAFT"/>
                <entry key="SaveFinal" value="FINAL"/>
                <entry key="Submit" value="IN_APPROVAL"/>
            </map>
        </property>
        <property name="executeSolrQuery" ref="executeSolrQuery"/>
        <property name="startWorkflowEvents" ref="startWorkflowEventsForTimesheet"/>
        <property name="pipelineManager" ref="timesheetPipelineManager"/>
    </bean>

    <bean id="timesheetEventPublisher" class="com.armedia.acm.services.timesheet.service.TimesheetEventPublisher"/>

    <bean id="timesheetAssociatedEventPublisher" class="com.armedia.acm.services.timesheet.service.TimesheetAssociatedEventPublisher"/>

    <bean id="timesheetWorkflowListener" class="com.armedia.acm.services.timesheet.service.TimesheetWorkflowListener">
        <property name="fileWorkflowBusinessRule" ref="fileWorkflowBusinessRule"/>
        <property name="taskDao" ref="acmTaskDao"/>
        <property name="timesheetConfig" ref="timesheetConfig"/>
    </bean>

    <bean id="timesheetHistoryEventListener" class="com.armedia.acm.services.timesheet.service.TimesheetHistoryEventListener">
        <property name="acmDataService" ref="acmDataService"/>
        <property name="timesheetAssociatedEventPublisher" ref="timesheetAssociatedEventPublisher"/>
    </bean>

    <bean id="timesheetToSolrTransformer" class="com.armedia.acm.services.timesheet.service.TimesheetToSolrTransformer">
        <property name="acmTimesheetDao" ref="acmTimesheetDao"/>
    </bean>

    <bean id="acmTimesheetPlugin" class="com.armedia.acm.pluginmanager.model.AcmPlugin">
        <property name="pluginName" value="Time Tracking Service Plugin"/>
        <property name="configurationPropertyService" ref="configurationPropertyService"/>
        <property name="pluginConfig" ref="timesheetConfig"/>
    </bean>

    <bean id="timesheetConfigurationService" class="com.armedia.acm.services.timesheet.service.TimesheetConfigurationService">
        <property name="objectConverter" ref="objectConverter"/>
        <property name="configurationPropertyService" ref="configurationPropertyService"/>
        <property name="timesheetConfig" ref="timesheetConfig"/>
        <property name="timesheetChargeRolesConfig" ref="timesheetChargeRolesConfig"/>
        <property name="lookupDao" ref="lookupDao"/>
    </bean>

    <bean id="timesheetConfig" class="com.armedia.acm.services.timesheet.model.TimesheetConfig" scope="refresh">
        <aop:scoped-proxy/>
    </bean>

    <bean id="timesheetChargeRolesConfig" class="com.armedia.acm.services.timesheet.model.TimesheetChargeRolesConfig" scope="refresh">
        <aop:scoped-proxy/>
    </bean>

    <bean id="acmTimeToSolrTransformer" class="com.armedia.acm.services.timesheet.service.AcmTimeToSolrTransformer">
        <property name="acmTimeDao" ref="acmTimeDao"/>
    </bean>

</beans>
