public async Task SeedAsync()
        {
            IEnumerable <DonorDTO> donors = await donorService.GetAllAsync();

            if (donors.Any())
            {
                return;
            }

            var random = new Random();

            var bloodTypes = new List <BloodTypeDTO>
            {
                new BloodTypeDTO("A", "-"),
                new BloodTypeDTO("B", "-"),
                new BloodTypeDTO("AB", "-"),
                new BloodTypeDTO("O", "-"),
                new BloodTypeDTO("A", "+"),
                new BloodTypeDTO("B", "+"),
                new BloodTypeDTO("AB", "+"),
                new BloodTypeDTO("O", "+")
            };

            foreach (var bloodType in bloodTypes)
            {
                await bloodTypeService.AddAsync(bloodType);
            }

            for (var i = 0; i < 10; i++)
            {
                var pesel        = $"{i}1234567890";
                var password     = pesel;
                var name         = $"{GetOrdinalString(i)} Donor";
                var bloodTypeDto = bloodTypes[random.Next(bloodTypes.Count)];
                var mail         = $"donor{i}@wp.pl";

                await donorService.RegisterAsync(pesel, name, bloodTypeDto, mail, pesel, password);


                pesel    = $"{i}0987654321";
                password = pesel;
                name     = $"{GetOrdinalString(i)} Personnel";

                await personnelService.RegisterAsync(pesel, password, name);
            }

            List <string> donorPesels     = (await donorService.GetAllAsync()).Select(x => x.Pesel).ToList();
            List <string> personnelPesels = (await personnelService.GetAllAsync()).Select(x => x.Pesel).ToList();

            for (var i = 0; i < 250; i++)
            {
                var volume         = random.Next(500, 1250); //VERY generous :P
                var donorPesel     = donorPesels[random.Next(donorPesels.Count)];
                var personnelPesel = personnelPesels[random.Next(personnelPesels.Count)];

                await bloodDonationService.AddBloodDonationAsync(DateTime.Now, volume, donorPesel, personnelPesel);
            }
        }
        public async Task <IActionResult> NewDonor([FromBody] RegisterDonor registerDonor)
        {
            if (registerDonor == null)
            {
                return(BadRequest("New donor can't be null"));
            }

            var password = registerDonor.Pesel;

            try
            {
                await donorService.RegisterAsync(registerDonor.Pesel, registerDonor.Name, registerDonor.BloodType,
                                                 registerDonor.Mail, registerDonor.Phone, password);
            }
            catch (UserAlreadyExistsException e)
            {
                return(StatusCode(409, e.Message));
            }
            return(Created($"personnel/donor/{registerDonor.Pesel}", Json(registerDonor)));
        }