Exemple #1
0
        public async Task Accept(string rentalId, double price)
        {
            var rental = await _eventRepository.GetByIdAsync(new RentalId(rentalId));

            rental.Accept(price);
            await _eventRepository.SaveAsync(rental);
        }
        public async Task CreateInvoice(string customerId, string rentalId)
        {
            Invoice invoice = new Invoice(new InvoiceId(), new CustomerId(customerId));

            invoice.SetRental(new RentalId(rentalId));

            await _eventRepository.SaveAsync(invoice);

            await _customerRepository.AddInvoice(customerId, invoice.Id.ToString());
        }
 public async Task CreateCustomerAsync(string customerId, string email, string address, string postalCode, string residence)
 {
     Customer customer = new Customer(new CustomerId(customerId), email, address, postalCode, residence);
     await _eventRepository.SaveAsync(customer);
 }
 public async Task CreateShip(string shipId, string customerId, string shipName)
 {
     Ship ship = new Ship(new ShipId(shipId), new CustomerId(customerId), shipName);
     await _eventRepository.SaveAsync(ship);
 }