using BeWo.Data.Entities;

using BS.Shared.DataContracts;

namespace BeWo.Service.DCEntityMapper
{
    public class SettlementInvoiceDC_SettlementInvoice : AbstractIDCEntityMapper<SettlementInvoice, SettlementInvoiceDC>
    {
        public override SettlementInvoiceDC MergeWithDC(SettlementInvoice pEntity, SettlementInvoiceDC pDataContract)
        {
            pDataContract.Claim = pEntity.Claim;
            pDataContract.AmountAdvancedPayments = pEntity.AmountAdvancedPayments;
            pDataContract.AmountRateFactor = pEntity.AmountRateFactor;
            pDataContract.AmountBillableTotal = pEntity.AmountBillableTotal;
            pDataContract.RecordedBillableFLSNotBillableCustomerAbsent = pEntity.RecordedBillableFLSNotBillableCustomerAbsent;
            pDataContract.RecordedBillableFLSNotBillableOutOfApprovedSpan = pEntity.RecordedBillableFLSNotBillableOutOfApprovedSpan;
            pDataContract.RecordedBillableFLSNetto = pEntity.RecordedBillableFLSNetto;
            pDataContract.ApprovedFLS = pEntity.ApprovedFLS;

            // pDataContract.InvoiceBase = pEntity.InvoiceBase;
            return pDataContract;
        }

        public override SettlementInvoice MergeWithEntity(SettlementInvoiceDC pDataContract, SettlementInvoice pEntity)
        {
            pEntity.Claim = pDataContract.Claim;
            pEntity.AmountAdvancedPayments = pDataContract.AmountAdvancedPayments;
            pEntity.AmountRateFactor = pDataContract.AmountRateFactor;
            pEntity.AmountBillableTotal = pDataContract.AmountBillableTotal;
            pEntity.RecordedBillableFLSNotBillableCustomerAbsent = pDataContract.RecordedBillableFLSNotBillableCustomerAbsent;
            pEntity.RecordedBillableFLSNotBillableOutOfApprovedSpan = pDataContract.RecordedBillableFLSNotBillableOutOfApprovedSpan;
            pEntity.RecordedBillableFLSNetto = pDataContract.RecordedBillableFLSNetto;
            pEntity.ApprovedFLS = pDataContract.ApprovedFLS;

            // pEntity.InvoiceBase = pDataContract.InvoiceBase;
            return pEntity;
        }

        protected override bool AreDCAndEntityEqual(SettlementInvoiceDC pDataContract, SettlementInvoice pEntity)
        {
            return true;
        }
    }
}