using AutoMapper;
using Lada.Framework.Data.Domains.Premises;
using Lada.Framework.Infrastructures.Services;
using Ladaer.BackEnd.Infrastructures.DTO.Items.Premises;
using Ladaer.BackEnd.Infrastructures.DTO.Models.Premises;
using Ladaer.BackEnd.Infrastructures.DTO.Results.Premises;

namespace Ladaer.BackEnd.Infrastructures.DTO.Profiles
{
    public static class PremiseMappingExtensions
    {
        // === Premise ===
        public static PremiseItem ToItem(this Premise entity)
        {
            return entity.MapTo<Premise, PremiseItem>();
        }

        public static Premise ToEntity(this PremiseModel model)
        {
            return model.MapTo<PremiseModel, Premise>();
        }

        // === PremiseFinancial ===
        public static PremiseFinancialDetail ToDetail(this PremiseFinancial entity)
        {
            return entity.MapTo<PremiseFinancial, PremiseFinancialDetail>();
        }

        public static PremiseFinancial ToEntity(this PremiseFinancialModel model)
        {
            return model.MapTo<PremiseFinancialModel, PremiseFinancial>();
        }

        // === PremiseContact ===
        public static PremiseContactDetail ToDetail(this PremiseContact entity)
        {
            return entity.MapTo<PremiseContact, PremiseContactDetail>();
        }

        public static PremiseContactItem ToItem(this PremiseContact entity)
        {
            return entity.MapTo<PremiseContact, PremiseContactItem>();
        }

        public static PremiseContact ToEntity(this PremiseContactModel model)
        {
            return model.MapTo<PremiseContactModel, PremiseContact>();
        }

        // === PremiseScore ===
        public static PremiseScoreDetail ToDetail(this PremiseScore entity)
        {
            return entity.MapTo<PremiseScore, PremiseScoreDetail>();
        }

        public static PremiseScoreItem ToItem(this PremiseScore entity)
        {
            return entity.MapTo<PremiseScore, PremiseScoreItem>();
        }

        // === PremiseScoringCriteria ===
        public static PremiseScoringCriteriaItem ToItem(this PremiseScoringCriteria entity)
        {
            return entity.MapTo<PremiseScoringCriteria, PremiseScoringCriteriaItem>();
        }

        public static PremiseScoringCriteria ToEntity(this PremiseScoringCriteriaModel model)
        {
            return model.MapTo<PremiseScoringCriteriaModel, PremiseScoringCriteria>();
        }

        public static PremiseScoringCriteriaModel ToModel(this PremiseScoringCriteria entity)
        {
            return entity.MapTo<PremiseScoringCriteria, PremiseScoringCriteriaModel>();
        }

        // === PremiseScoringOption ===
        public static PremiseScoringOptionItem ToItem(this PremiseScoringOption entity)
        {
            return entity.MapTo<PremiseScoringOption, PremiseScoringOptionItem>();
        }

        public static PremiseScoringOption ToEntity(this PremiseScoringOptionModel model)
        {
            return model.MapTo<PremiseScoringOptionModel, PremiseScoringOption>();
        }

        public static PremiseScoringOptionModel ToModel(this PremiseScoringOption entity)
        {
            return entity.MapTo<PremiseScoringOption, PremiseScoringOptionModel>();
        }
    }
}
