using Furion.JsonSerialization;
using YBEE.EQM.Core;

namespace YBEE.EQM.Application;

public class NceePlanMapper : IRegister
{
    public void Register(TypeAdapterConfig config)
    {
        config.ForType<NceePlan, NceePlanOutput>().Map(d => d.Config, s => JSON.Deserialize<NceePlanConfig>(s.Config, null));
        config.ForType<AddNceePlanInput, NceePlan>().Map(d => d.Config, s => JSON.Serialize(s.Config, null));
        config.ForType<UpdateNceePlanInput, NceePlan>().Map(d => d.Config, s => JSON.Serialize(s.Config, null));
    }
}
