using System;

namespace ZuluTradingSampleApp.Trading
{
    /// <summary>
    /// Simple unique request ids generator initialized using system's time
    /// </summary>
    public class UniqueIdGenerator
    {
        private static long requestId = (long)((DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds);
        private static readonly object _lock = new object();

        public static string GetNextUniqueId()
        {
            lock (_lock)
            {
                requestId++;
                return requestId.ToString();
            }
        }
    }
}
