﻿using System;

namespace Domain.Model.Components
{
    public class ComponentModel : IzichizitAggregateRoot
    {
        /// <summary>
        /// The name of the Component.
        /// </summary>
        public string Name { get; private set; }

        /// <summary>
        /// The namespace of the Component.
        /// </summary>
        public string Namespace { get; private set; }

        /// <summary>
        /// The template as provided by the client.
        /// </summary>
        public string Template { get; private set; }

        /// <summary>
        /// The version of the Component.
        /// </summary>
        public VersionModel Version { get; private set; }

        // For the ORM
        protected ComponentModel() { }

        public ComponentModel(Guid resourceId, string name, string @namespace, string template,
            VersionModel version) : base(resourceId)
        {
            Name = name;
            Namespace = @namespace;
            Template = template;
            Version = version;
        }

        public void SetVersion(VersionModel version)
        {
            Version = version;
        }
    }
}
