using System;
using System.ComponentModel.DataAnnotations;
namespace GestionIntegral.Api.Dtos.Contables
{
    public class CreateNotaDto
    {
        [Required(ErrorMessage = "El tipo de destino es obligatorio ('Distribuidores' o 'Canillas').")]
        [RegularExpression("^(Distribuidores|Canillas)$", ErrorMessage = "Destino debe ser 'Distribuidores' o 'Canillas'.")]
        public string Destino { get; set; } = string.Empty;

        [Required(ErrorMessage = "El destinatario es obligatorio.")]
        [Range(1, int.MaxValue)]
        public int IdDestino { get; set; }

        [StringLength(50)]
        public string? Referencia { get; set; }

        [Required(ErrorMessage = "El tipo de nota es obligatorio ('Debito' o 'Credito').")]
        [RegularExpression("^(Debito|Credito)$", ErrorMessage = "Tipo debe ser 'Debito' o 'Credito'.")]
        public string Tipo { get; set; } = string.Empty;

        [Required]
        public DateTime Fecha { get; set; }

        [Required, Range(0.01, (double)decimal.MaxValue, ErrorMessage = "El monto debe ser mayor a cero.")]
        public decimal Monto { get; set; }

        [StringLength(250)]
        public string? Observaciones { get; set; }

        [Required]
        public int IdEmpresa { get; set; }
    }
}