namespace RealEstateTransactions.Entities
{
    public class Deal
    {
        public int Id { get; private set; }

        public int Apartment_ID { get; private set; }

        public int Buyer_ID { get; private set; }

        public float Deal_price { get; private set; }

        public DateTime Deal_date { get; private set; }

        public IEnumerable<ServicesDeal> DealServices { get; private set; } = [];

        public static Deal CreateDeal(int id, int apartmentId, int buyerId, float dealPrice,
            DateTime dealDate, IEnumerable<ServicesDeal> dealServices)
        {
            return new Deal
            {
                Id = id,
                Apartment_ID = apartmentId,
                Buyer_ID = buyerId,
                Deal_price = dealPrice,
                Deal_date = dealDate,
                DealServices = dealServices
            };
        }
    }
}