using MediatR;
using System;

namespace Sledgemapper.Api.Commands
{
    public abstract class BaseCommand<T> : IRequest<T>
    {
        public double Timestamp { get; private set; }
        public string SessionName { get; private set; }
        public Guid SessionId { get; private set; }
        public Guid Campaign { get; private set; }
        public string UserId { get; private set; }

        public BaseCommand(string sessionName, string userId)
        {
            Timestamp = DateTimeOffset.Now.ToUnixTimeMilliseconds();
            SessionName = sessionName;
            UserId = userId;
        }

        public BaseCommand(string campaign, string sessionName, string userId)
        {
            Timestamp = DateTimeOffset.Now.ToUnixTimeMilliseconds();
            SessionName = sessionName;
            Campaign = new Guid(campaign);
            UserId = userId;
        }

        public BaseCommand(Guid campaign, Guid sessionId, string userId)
        {
            Timestamp = DateTimeOffset.Now.ToUnixTimeMilliseconds();
            SessionId = sessionId;
            Campaign = campaign;
            UserId = userId;
        }
    }
}
