public async Task CheckStanAktualnyAfterPrzyjecie() { // Arrange var client = _factory.CreateClient(); var apiCaller = new PrzyjecieApiCaller(client); var tokens = await Authenticate(client).ConfigureAwait(false); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", tokens.Token); var magazynId = await new MagazynApiCaller(client).DodajMagazyn(MagazynObjectMother.GetMagazyn()); var produktId = await new ProduktApiCaller(client).DodajProdukt(ProduktObjectMother.GetProdukt(magazynId)); var przyjecieModel = new PrzyjecieCreateModel { MagazynId = magazynId, Data = DateTime.Now, Pozycje = new List <PrzyjeciePozycjaDokumentuCreateModel> { new PrzyjeciePozycjaDokumentuCreateModel { ProduktId = produktId, CenaNetto = 1M, Ilosc = 10, StawkaVat = StawkaVat.DwadziesciaTrzyProcent } } }; await apiCaller.Przyjmij(przyjecieModel); var stany = await new StanAktualnyApiCaller(client).GetStanAktualny(magazynId); Assert.That(stany, Has.Count.EqualTo(1)); }
public PrzyjmijCommand(Guid przedsiebiorstwoId, PrzyjecieCreateModel model) { Model = model; PrzedsiebiorstwoId = przedsiebiorstwoId; }
public Task <Guid> Przyjmij(PrzyjecieCreateModel model) { return(HttpClient.Post <Guid>("przyjecie/Przyjmij", model)); }
public async Task <IActionResult> Przyjmij(PrzyjecieCreateModel model) { var id = await Mediator.Send(new PrzyjmijCommand(PrzedsiebiorstwoId, model)); return(Ok(id)); }