using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace WarehouseAppSHIPS.Models
{
    public class OutboundTransaction
    {
        [Key]
        public int Id { get; set; }
        public DateTime TransactionDate { get; set; } = DateTime.Now;

        [ForeignKey("Material")]
        public int MaterialId { get; set; }
        public virtual Material? Material { get; set; }

        public int Qty { get; set; }

        // Siapa dari lapangan / pihak eksternal yang mengambil
        [Required, MaxLength(100)]
        public string TakenBy { get; set; } = string.Empty;

        [MaxLength(255)]
        public string? Remarks { get; set; }

        // Karyawan gudang yang menyerahkan barang
        [ForeignKey("Issuer")]
        public int IssuerId { get; set; }
        public virtual AppUser? Issuer { get; set; }
    }
}