﻿using System.Collections.Generic;
using NuClear.ValidationRules.Querying.Host.Properties;
using NuClear.ValidationRules.Storage.Identitites.EntityTypes;
using NuClear.ValidationRules.Storage.Model.Messages;

namespace NuClear.ValidationRules.Querying.Host.Composition.ProjectRules
{
    public sealed class OrderPositionCostPerClickMustBeSpecifiedMessageComposer : IMessageComposer
    {
        public MessageTypeCode MessageType => MessageTypeCode.OrderPositionCostPerClickMustBeSpecified;

        public MessageComposerResult Compose(NamedReference[] references, IReadOnlyDictionary<string, string> extra)
        {
            var orderReference = references.Get(EntityType.Order);
            var orderPositionReference = references.Get(EntityType.OrderPosition);
            var categoryReference = references.Get(EntityType.Category);

            return new MessageComposerResult(
                orderReference,
                Resources.OrderPositionCostPerClickMustBeSpecified,
                orderPositionReference,
                categoryReference);
        }
    }
}
