package com.pan_american.android.ui.financial_module.payment_refund

import android.os.Bundle
import com.pan_american.android.OASystem
import com.pan_american.android.R
import com.pan_american.android.base.BaseActivity
import com.pan_american.android.databinding.ActivityPaymentRefundBinding
import com.pan_american.android.databinding.LayoutTitleBinding
import com.pan_american.android.ui.group_simple_info.GroupSimpleInfoFragment

class PaymentRefundActivity : BaseActivity<ActivityPaymentRefundBinding>() {

    private lateinit var titleBinding: LayoutTitleBinding

    override fun getViewBinding() = ActivityPaymentRefundBinding.inflate(layoutInflater)

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        initTitle()
        initViews()
    }

    override fun initTitle() {
        titleBinding = LayoutTitleBinding.bind(binding.root).apply {
            titleText.text = resources.getString(R.string.payment_refund)

            backButton.setOnClickListener {
                back()
            }
        }
    }

    override fun initViews() {

        val bundle = Bundle().apply {
            putInt("id", OASystem.C_TABLE_PAYMENT_REFUND)
        }

        val groupSimpleInfoFragment = GroupSimpleInfoFragment()
        groupSimpleInfoFragment.arguments = bundle

        supportFragmentManager.beginTransaction().addToBackStack(null)
            .add(binding.paymentRefundFragmentContainer.id, groupSimpleInfoFragment).commit()
    }
}