<?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 https://www.springframework.org/schema/aop/spring-aop.xsd">

    <aop:aspectj-autoproxy proxy-target-class="true"/>

    <bean id="billingItemDao" class="com.armedia.acm.services.billing.dao.BillingItemDao"/>
    
    <bean id="billingInvoiceDao" class="com.armedia.acm.services.billing.dao.BillingInvoiceDao"/>

    <bean id="billingEventPublisher" class="com.armedia.acm.services.billing.model.BillingEventPublisher"/>

    <bean id="billingService" class="com.armedia.acm.services.billing.service.impl.BillingServiceImpl">
        <property name="billingItemDao" ref="billingItemDao"/>
        <property name="billingInvoiceDao" ref="billingInvoiceDao"/>
        <property name="billingEventPublisher" ref="billingEventPublisher"/>
        <property name="billingInvoiceBusinessRule" ref="billingInvoiceBusinessRule"/>
    </bean>

    <bean id="touchNetService" class="com.armedia.acm.services.billing.service.impl.TouchNetService" scope="refresh">
        <aop:scoped-proxy/>
        <property name="applicationConfig" ref="applicationProperties"/>
        <property name="billingItemDao" ref="billingItemDao"/>
    </bean>
    <bean id="billingInvoiceBusinessRule" class="com.armedia.acm.services.billing.rules.BillingInvoiceBusinessRule"
          parent="simpleStatelessSingleObjectRuleManager">
        <property name="ruleSpreadsheetFilename" value="drools-billing-invoice-rules.xlsx"/>
    </bean>

    <bean id="billingItemToSolrTransformer" class="com.armedia.acm.services.billing.transformer.BillingItemToSolrTransformer">
        <property name="billingItemDao" ref="billingItemDao"/>
        <property name="userDao" ref="userJpaDao"/>
    </bean>

    <bean id="billingInvoiceToSolrTransformer" class="com.armedia.acm.services.billing.transformer.BillingInvoiceToSolrTransformer">
        <property name="billingInvoiceDao" ref="billingInvoiceDao"/>
        <property name="userDao" ref="userJpaDao"/>
    </bean>

    <bean id="billingAcmTaskActivitiEventHandler" class="com.armedia.acm.services.billing.listener.BillingAcmTaskActivitiEventHandler">
        <property name="acmTimesheetDao" ref="acmTimesheetDao"/>
        <property name="acmCostsheetDao" ref="acmCostsheetDao"/>
        <property name="billingService" ref="billingService"/>
        <property name="timesheetService" ref="timesheetService"/>
        <property name="timesheetConfig" ref="timesheetConfig"/>
        <property name="costsheetConfig" ref="costsheetConfig"/>
    </bean>

    <bean id="timesheetBillingListener"
        class="com.armedia.acm.services.billing.listener.TimesheetBillingListener">
        <property name="acmTimesheetDao" ref="acmTimesheetDao"/>
        <property name="billingService" ref="billingService"/>
        <property name="timesheetService" ref="timesheetService"/>
        <property name="timesheetConfig" ref="timesheetConfig"/>
    </bean>

    <bean id="costsheetBillingListener"
        class="com.armedia.acm.services.billing.listener.CostsheetBillingListener">
        <property name="acmCostsheetDao" ref="acmCostsheetDao"/>
        <property name="billingService" ref="billingService"/>
        <property name="costsheetConfig" ref="costsheetConfig"/>
    </bean>
</beans>