parameters:
    d2_billing.age_list.monthly:
        - 0
        - 30
        - 60
        - 90
        - 120
    d2_billing.age_list.daily:
        - 0
        - 14
        - 28
        - 48
        - 56
        - 70
    d2_billing.age_list:
        - 0
        - 30
        - 60
        - 90
        - 120
    # digital representation of the month that financial year end occurs
    # 1 for january, 2 for february, etc.
    d2_billing.fin_year_end:    2

services:
    d2_credit_card_manager:
        class:          D2\BillingBundle\DependencyInjection\Services\CreditCardManager
        arguments:      [@service_container, @mailer, @templating, @doctrine.orm.entity_manager]

    d2_provisioning_manager:
        class:          D2\BillingBundle\DependencyInjection\Services\ProvisioningManager
        arguments:      [@doctrine.orm.entity_manager, @service_container]

    # With Selected Extensions
    d2_billing_bundle.account_with_selected.extension:
        class:          D2\BillingBundle\Services\AccountsWithSelectedExtension
        arguments:      [@doctrine, @service_container]
        tags:
            - { name: d2.with_selected, alias: account_list }
            - { name: d2.with_selected, alias: account }

    d2_billing_bundle.invoices.with_selected.extension:
        class:          D2\BillingBundle\DependencyInjection\Services\InvoiceWithSelectedExtension
        arguments:      [@doctrine, @service_container]
        tags:
            - { name: d2.with_selected, alias: invoice_list }

    d2_billing_bundle.quotes.with_selected.extension:
        class:          D2\BillingBundle\DependencyInjection\Services\QuoteWithSelectedExtension
        arguments:      [@doctrine, @service_container]
        tags:
            - { name: d2.with_selected, alias: quote_list }
            
    d2_billing_bundle.credit_limits.with_selected.extension:
        class:          D2\BillingBundle\DependencyInjection\Services\CreditLimitsWithSelectedExtension
        arguments:      [@doctrine, @service_container]
        tags:
            - { name: d2.with_selected, alias: creditlimits_list }
            
    d2_billing_bundle.discounts.with_selected.extension:
        class:          D2\BillingBundle\DependencyInjection\Services\DiscountsWithSelectedExtension
        arguments:      [@doctrine, @service_container]
        tags:
            - { name: d2.with_selected, alias: discounts_list }
            
    d2_billing_bundle.credit_notes.with_selected.extension:
        class:          D2\BillingBundle\DependencyInjection\Services\CreditNoteWithSelectedExtension
        arguments:      [@doctrine, @service_container]
        tags:
            - { name: d2.with_selected, alias: credit_note_list }
            
    d2_billing_bundle.debit_notes.with_selected.extension:
        class:          D2\BillingBundle\DependencyInjection\Services\DebitNoteWithSelectedExtension
        arguments:      [@doctrine, @service_container]
        tags:
            - { name: d2.with_selected, alias: debit_note_list }
            
    d2_billing_bundle.payments1.with_selected.extension:
        class:          D2\BillingBundle\DependencyInjection\Services\PaymentsWithSelectedExtension1
        arguments:      [@doctrine, @service_container,@security.context, @d2_account_document_manager]
        tags:
            - { name: d2.with_selected, alias: payments_list1 }
            - { name: d2.with_selected, alias: payment1 }
            
    d2_billing_bundle.payments2.with_selected.extension:
        class:          D2\BillingBundle\DependencyInjection\Services\PaymentsWithSelectedExtension2
        arguments:      [@doctrine, @service_container,@security.context, @d2_account_document_manager]
        tags:
            - { name: d2.with_selected, alias: payments_list2 }
            - { name: d2.with_selected, alias: payment2 }
            
    d2_billing_bundle.payments3.with_selected.extension:
        class:          D2\BillingBundle\DependencyInjection\Services\PaymentsWithSelectedExtension3
        arguments:      [@doctrine, @service_container, @security.context]
        tags:
            - { name: d2.with_selected, alias: payments_list3 }
            - { name: d2.with_selected, alias: payment3 }

    d2_billing_bundle.with_selected.extension:
        class:          D2\BillingBundle\DependencyInjection\Services\RefundWithSelectedExtension
        arguments:      [@doctrine, @service_container, @d2_refund_status_manager]
        tags:
            - { name: d2.with_selected, alias: refunditem_list }

    d2_billing_bundle.document_with_selected.extension:
        class:          D2\BillingBundle\DependencyInjection\Services\AccountDocumentsWithSelectedExtension
        arguments:      [@doctrine, @service_container,@security.context, @d2_account_document_manager, @d2_config_manager]
        tags:
            - { name: d2.with_selected, alias: documentitem_list }

    d2_billing_bundle.sales_item_category.with_selected.extension:
        class:           D2\BillingBundle\DependencyInjection\Services\SalesItemCategoryWithSelectedExtension
        arguments:      [@doctrine, @service_container]
        tags:
            - { name: d2.with_selected, alias: salesitemcat_list }

    d2_document_provider:
        class:          D2\BillingBundle\DocumentProvider
        arguments:      [@service_container]
    
    d2_billing.reports_provider:
        class:          D2\BillingBundle\TransactionProvider

    d2_billing.pricing_provider:
        class:          D2\BillingBundle\PricingProvider
        arguments:      [@service_container]
    
    d2_account_document_manager:
        class:          D2\BillingBundle\DependencyInjection\Services\AccountDocumentManager
        arguments:      [@service_container]
    
    d2_invoice_manager:
        class:          D2\BillingBundle\DependencyInjection\Services\InvoiceManager
        arguments:      [@session, @doctrine.orm.entity_manager, @serializer]
    
    d2_invoice_utils:
        class:          D2\BillingBundle\DependencyInjection\Services\InvoiceUtils
        arguments:      [@service_container, @doctrine.orm.entity_manager]

    d2_quote_manager:
        class:          D2\BillingBundle\DependencyInjection\Services\QuoteManager
        arguments:      [@session, @doctrine.orm.entity_manager, @serializer]

    d2_credit_note_manager:
        class:          D2\BillingBundle\DependencyInjection\Services\CreditNoteManager
        arguments:      [@session, @doctrine.orm.entity_manager, @serializer]

    d2_debit_note_manager:
        class:          D2\BillingBundle\DependencyInjection\Services\DebitNoteManager
        arguments:      [@session, @doctrine.orm.entity_manager, @serializer]

    d2_system_emails:
        class:          D2\BillingBundle\DependencyInjection\Services\SystemEmailManager
        arguments:      [@service_container]

    d2_document_manager:
        class:          D2\BillingBundle\DependencyInjection\Services\DocumentManager
        arguments:      [@doctrine, @knp_paginator, @service_container]
        tags:
            - { name: document_manager} 

    d2_transaction_manager:
        class:          D2\BillingBundle\DependencyInjection\Services\TransactionManager
        arguments:      [@service_container]

    d2_report_manager:
        class:          D2\BillingBundle\DependencyInjection\Services\ReportManager
        arguments:      [@service_container]

    # Account Form Types
    d2_billing_bundle.type.email_recipient:
        class: D2\BillingBundle\Form\Type\EmailRecipientType
        tags:
            - { name: form.type, alias: email_recipient }

    # Sales Form Types
    d2_billing_bundle.type.sales_item_code_selector:
        class: D2\BillingBundle\Form\Type\SalesItemCodeSelectorType
        arguments: ["@doctrine.orm.entity_manager"]
        tags:
            - { name: form.type, alias: sales_item_code_selector }

    # Refund status manager
    d2_refund_status_manager:
        class: 					D2\BillingBundle\DependencyInjection\Services\RefundStatusManager
        arguments:              [@doctrine, @security.context, @twig, @d2_document_provider]
        tags:
            - { name: mark_as_paid_manager }

    # Event Listeners
    d2_billing_bundle.event_listeners.new_document_item_listener:
        class: 					D2\BillingBundle\DependencyInjection\EventListeners\NewDocumentItemListener
        tags:
          - { name: doctrine.event_listener, event: onFlush }

    d2_billing_bundle.event_listeners.accounts_transaction_listener:
        class:  D2\BillingBundle\DependencyInjection\EventListeners\AccountsTransactionListener
        arguments: [@d2_billing.reports_provider, @d2_transaction_manager]
        tags:
            - {name: doctrine.event_listener, event: prePersist }
            - {name: doctrine.event_listener, event: onFlush }
            
    d2_billing_bundle.twig.billing_extension:
        class:          D2\BillingBundle\Twig\BillingTwigExtension
        arguments:      [@doctrine.orm.entity_manager, @service_container]
        tags:
            - { name: twig.extension }

