using System;
using System.ComponentModel.DataAnnotations;

namespace DutyManager.Web
{
    public class LocationViewModel
    {
        public int Identifier { get; set; }
        
        public string Name { get; set; }
        
        [Display(Name = "Max number of bookings")]
        public int MaxBookings { get; set; }

        public static implicit operator LocationViewModel(Core.Models.Location location)
        {
            return new LocationViewModel {
                Name = location.Name
            };
        }

        public static implicit operator Core.Models.Location(LocationViewModel locationVM)
        {
            return new Core.Models.Location {
                Name = locationVM.Name
            };
        }
    }
}