using Domain.Aggregates.Stores;
using Domain.SeedWork;
using Framework.DataType;
using Resources.Messages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Domain.Aggregates.Products;

public class Product : Entity
{
    public Product()
    {
        ////**********
    }

    private Product(string name, string description, int price, int quantity)
    {
        Name = name;
        Description = description;
        Price = price;
        Quantity = quantity;
    }

    public string Name { get; set; }
    public string Description { get; set; }
    public int Price { get; set; }
    public int Quantity { get; set; }


    public static Product Create(string name, string description, int price, int quantity)
    {
        var store = new Product(
            name: name.Fix() ?? "",
            description: description.Fix() ?? "",
            price: price,
            quantity: quantity);

        return store;
    }

    public void Update(string name, string description, int price, int quantity)
    {
        Name = name.Fix() ?? "";
        Description = description.Fix() ?? "";
        Price = price;
        Quantity = quantity;

        SetUpdateDateTime();
    }
}
