using System;
using System.Collections.Generic;
using SepehrFlightApiSampleClient.Refund.InMemoryDatabase.PendingRequests.Model;

namespace SepehrFlightApiSampleClient.Refund.InMemoryDatabase.PendingRequests.Repository
{
    public class PendingRequestRepository
    {
        private static List<PendingRequest> _pendingRequests = new List<PendingRequest>();

        public static void Add(PendingRequest pendingRequest)
        {
            _pendingRequests.Add(pendingRequest);
        }

        public static IReadOnlyCollection<PendingRequest> GetAll()
        {
            return _pendingRequests;
        }

        public static void Remove(Guid trackingCode)
        {
            _pendingRequests.RemoveAll(r => r.SupplierTrackingCode == trackingCode);
        }
    }
}
