using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;

namespace Insight.Infrastructure.Entities
{
    [BsonIgnoreExtraElements]
    public class CustomerEntity
    {
        [BsonId, BsonRepresentation(BsonType.ObjectId), JsonPropertyName("id")]
        public string? Id { get; set; }

        [BsonElement("insert")]
        public DateTime? Insert { get; set; }

        [BsonElement("update")]
        public DateTime? Update { get; set; }

        [BsonElement("name"), Required]
        public string? Name { get; set; }

        [BsonElement("tag")]
        public string? Tag { get; set; }

        [BsonIgnoreIfNull, JsonIgnore]
        public List<HostEntity>? Hosts { get; set; }
    }
}