using SewerStammGen.Shared.Contracts;
using SewerStammGen.Shared.Domain;
using SewerStammGen.WPF.Interface.Navigator;
using SewerStammGen.WPF.ViewModel.State;
using Shared.Contracts;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SewerStammGen.WPF.Commands
{
    class SchachtAddCommand : AsyncCommandBase
    {
        private readonly IActualState actualState;
        private readonly IRenavigator renavigator;
        

        public SchachtAddCommand(IActualState actualState, IRenavigator renavigator)
        {
            this.actualState = actualState;
            this.renavigator = renavigator;
        }

        public override async Task ExecuteAsync(object? parameter)
        {
            Schacht newSchacht = new Schacht()
            {
                Projekt = new Projekt() { Id = actualState.ProjektID },
            };
            actualState.SetSchacht(newSchacht);
            renavigator.Renavigate();
        }
    }
}
