using Meezi.Core.Enums;

namespace Meezi.Core.Entities;

/// <summary>Cash register session (باز / بسته کردن صندوق) for a branch.</summary>
public class Shift : TenantEntity
{
    public string BranchId { get; set; } = string.Empty;
    public string OpenedByUserId { get; set; } = string.Empty;
    public string? ClosedByUserId { get; set; }
    public DateTime OpenedAt { get; set; }
    public DateTime? ClosedAt { get; set; }
    public decimal OpeningCash { get; set; }
    public decimal? ClosingCash { get; set; }
    public decimal ExpectedCash { get; set; }
    public decimal? Discrepancy { get; set; }
    public ShiftStatus Status { get; set; } = ShiftStatus.Open;

    public Cafe Cafe { get; set; } = null!;
    public Branch Branch { get; set; } = null!;
    public Employee OpenedBy { get; set; } = null!;
    public Employee? ClosedBy { get; set; }
    public ICollection<CashTransaction> Transactions { get; set; } = [];
}
