From 06fca54d2fdc9c3f92a972d2279880a3ef721fbc Mon Sep 17 00:00:00 2001 From: ademclk Date: Tue, 21 Mar 2023 00:13:00 +0300 Subject: [PATCH] Update: Filtering added, relationships revised --- .../CreateFlight/CreateFlightCommand.cs | 4 +- .../CreateFlightCommandHandler.cs | 8 +- .../SearchFlights/SearchFlightQueryHandler.cs | 4 +- .../Flights/CreateFlightRequest.cs | 4 +- Ceyehat.Contracts/Flights/FlightResponse.cs | 4 +- Ceyehat.Domain/FlightAggregate/Flight.cs | 20 +- .../20230320171557_PriceUpdate.Designer.cs | 893 ++++++++++++++++++ .../Migrations/20230320171557_PriceUpdate.cs | 69 ++ .../CeyehatDbContextModelSnapshot.cs | 16 +- .../Configurations/FlightConfigurations.cs | 15 +- .../Repositories/FlightRepository.cs | 21 +- ceyehat/Common/Mapping/FlightMappingConfig.cs | 4 +- .../Requests/Aircrafts/CreateAircraft.http | 12 +- ceyehat/Requests/Airlines/CreateAirline.http | 8 +- ceyehat/Requests/Flights/CreateFlight.http | 22 +- ceyehat/Requests/Prices/CreatePrice.http | 12 +- 16 files changed, 1065 insertions(+), 51 deletions(-) create mode 100644 Ceyehat.Infrastructure/Migrations/20230320171557_PriceUpdate.Designer.cs create mode 100644 Ceyehat.Infrastructure/Migrations/20230320171557_PriceUpdate.cs diff --git a/Ceyehat.Application/Flights/Commands/CreateFlight/CreateFlightCommand.cs b/Ceyehat.Application/Flights/Commands/CreateFlight/CreateFlightCommand.cs index 66cddf0..11e3b52 100644 --- a/Ceyehat.Application/Flights/Commands/CreateFlight/CreateFlightCommand.cs +++ b/Ceyehat.Application/Flights/Commands/CreateFlight/CreateFlightCommand.cs @@ -19,5 +19,7 @@ public record CreateFlightCommand( string? AircraftId, string? DepartureAirportId, string? ArrivalAirportId, - string? PriceId + string? EconomyPriceId, + string? ComfortPriceId, + string? BusinessPriceId ) : IRequest>; \ No newline at end of file diff --git a/Ceyehat.Application/Flights/Commands/CreateFlight/CreateFlightCommandHandler.cs b/Ceyehat.Application/Flights/Commands/CreateFlight/CreateFlightCommandHandler.cs index 420ce7e..2a8d6d1 100644 --- a/Ceyehat.Application/Flights/Commands/CreateFlight/CreateFlightCommandHandler.cs +++ b/Ceyehat.Application/Flights/Commands/CreateFlight/CreateFlightCommandHandler.cs @@ -23,7 +23,9 @@ public async Task> Handle(CreateFlightCommand request, Cancellat var aircraftId = AircraftId.Create(Guid.Parse(request.AircraftId!)); var departureAirportId = AirportId.Create(Guid.Parse(request.DepartureAirportId!)); var arrivalAirportId = AirportId.Create(Guid.Parse(request.ArrivalAirportId!)); - var priceId = PriceId.Create(Guid.Parse(request.PriceId!)); + var ePriceId = PriceId.Create(Guid.Parse(request.EconomyPriceId!)); + var cPriceId = PriceId.Create(Guid.Parse(request.ComfortPriceId!)); + var bPriceId = PriceId.Create(Guid.Parse(request.BusinessPriceId!)); var flight = Flight.Create( request.FlightNumber, @@ -36,7 +38,9 @@ public async Task> Handle(CreateFlightCommand request, Cancellat aircraftId, departureAirportId, arrivalAirportId, - priceId); + ePriceId, + cPriceId, + bPriceId); await _flightRepository.AddFlightAsync(flight); diff --git a/Ceyehat.Application/Flights/Queries/SearchFlights/SearchFlightQueryHandler.cs b/Ceyehat.Application/Flights/Queries/SearchFlights/SearchFlightQueryHandler.cs index dc80ccd..69b6305 100644 --- a/Ceyehat.Application/Flights/Queries/SearchFlights/SearchFlightQueryHandler.cs +++ b/Ceyehat.Application/Flights/Queries/SearchFlights/SearchFlightQueryHandler.cs @@ -24,8 +24,8 @@ public async Task>> Handle(SearchFlightQuery request, Ca var flights = await _flightRepository.SearchFlightsAsync( request.DepartureAirportIataCode!, request.ArrivalAirportIataCode!, - departureDate.ToUniversalTime(), - returnDate.ToUniversalTime(), + departureDate, + returnDate, request.PassengerCount); return flights; diff --git a/Ceyehat.Contracts/Flights/CreateFlightRequest.cs b/Ceyehat.Contracts/Flights/CreateFlightRequest.cs index dfbd106..1f101f1 100644 --- a/Ceyehat.Contracts/Flights/CreateFlightRequest.cs +++ b/Ceyehat.Contracts/Flights/CreateFlightRequest.cs @@ -13,5 +13,7 @@ public record CreateFlightRequest( string? AircraftId, string? DepartureAirportId, string? ArrivalAirportId, - string? PriceId + string? EconomyPriceId, + string? ComfortPriceId, + string? BusinessPriceId ); diff --git a/Ceyehat.Contracts/Flights/FlightResponse.cs b/Ceyehat.Contracts/Flights/FlightResponse.cs index f53f60c..29b3838 100644 --- a/Ceyehat.Contracts/Flights/FlightResponse.cs +++ b/Ceyehat.Contracts/Flights/FlightResponse.cs @@ -16,7 +16,9 @@ public record FlightResponse( string? AircraftId, string? DepartureAirportId, string ArrivalAirportId, - string? PriceId, + string? EconomyPriceId, + string? ComfortPriceId, + string? BusinessPriceId, DateTime CreatedAt, DateTime UpdatedAt ); diff --git a/Ceyehat.Domain/FlightAggregate/Flight.cs b/Ceyehat.Domain/FlightAggregate/Flight.cs index d362ede..501b4ad 100644 --- a/Ceyehat.Domain/FlightAggregate/Flight.cs +++ b/Ceyehat.Domain/FlightAggregate/Flight.cs @@ -20,7 +20,9 @@ public sealed class Flight : AggregateRoot public AircraftId AircraftId { get; private set; } public AirportId DepartureAirportId { get; private set; } public AirportId ArrivalAirportId { get; private set; } - public PriceId PriceId { get; private set; } + public PriceId EconomyPriceId { get; private set; } + public PriceId ComfortPriceId { get; private set; } + public PriceId BusinessPriceId { get; private set; } public DateTime CreatedAt { get; private set; } public DateTime UpdatedAt { get; private set; } @@ -37,7 +39,9 @@ private Flight( AircraftId aircraftId, AirportId departureAirportId, AirportId arrivalAirportId, - PriceId priceId, + PriceId economyPriceId, + PriceId comfortPriceId, + PriceId businessPriceId, DateTime createdAt, DateTime updatedAt) : base(flightId) { @@ -51,7 +55,9 @@ private Flight( AircraftId = aircraftId; DepartureAirportId = departureAirportId; ArrivalAirportId = arrivalAirportId; - PriceId = priceId; + EconomyPriceId = economyPriceId; + ComfortPriceId = comfortPriceId; + BusinessPriceId = businessPriceId; CreatedAt = createdAt; UpdatedAt = updatedAt; } @@ -67,7 +73,9 @@ public static Flight Create( AircraftId aircraftId, AirportId departureAirport, AirportId arrivalAirport, - PriceId priceId) + PriceId economyPriceId, + PriceId comfortPriceId, + PriceId businessPriceId) { return new Flight( FlightId.CreateUnique(), @@ -81,7 +89,9 @@ public static Flight Create( aircraftId, departureAirport, arrivalAirport, - priceId, + economyPriceId, + comfortPriceId, + businessPriceId, DateTime.UtcNow, DateTime.UtcNow); } diff --git a/Ceyehat.Infrastructure/Migrations/20230320171557_PriceUpdate.Designer.cs b/Ceyehat.Infrastructure/Migrations/20230320171557_PriceUpdate.Designer.cs new file mode 100644 index 0000000..60ea38e --- /dev/null +++ b/Ceyehat.Infrastructure/Migrations/20230320171557_PriceUpdate.Designer.cs @@ -0,0 +1,893 @@ +// +using System; +using Ceyehat.Infrastructure.Persistence; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Ceyehat.Infrastructure.Migrations +{ + [DbContext(typeof(CeyehatDbContext))] + [Migration("20230320171557_PriceUpdate")] + partial class PriceUpdate + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Ceyehat.Domain.AircraftAggregate.Aircraft", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("AirlineId") + .HasColumnType("uuid"); + + b.Property("CountryId") + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("FaaRegistration") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("Icao24Code") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("ManufacturerSerialNumber") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("Model") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("RegistrationNumber") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("Aircrafts", (string)null); + }); + + modelBuilder.Entity("Ceyehat.Domain.AirlineAggregate.Airline", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Callsign") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Code") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("IataCode") + .HasMaxLength(16) + .HasColumnType("character varying(16)"); + + b.Property("IcaoCode") + .HasMaxLength(16) + .HasColumnType("character varying(16)"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Website") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.HasKey("Id"); + + b.ToTable("Airlines", (string)null); + }); + + modelBuilder.Entity("Ceyehat.Domain.AirportAggregate.Airport", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CityId") + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("IataCode") + .HasMaxLength(16) + .HasColumnType("character varying(16)"); + + b.Property("IcaoCode") + .HasMaxLength(16) + .HasColumnType("character varying(16)"); + + b.Property("Latitude") + .HasColumnType("float"); + + b.Property("Longitude") + .HasColumnType("float"); + + b.Property("Name") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("TimeZone") + .HasMaxLength(16) + .HasColumnType("character varying(16)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("Airports", (string)null); + }); + + modelBuilder.Entity("Ceyehat.Domain.CityAggregate.City", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CountryId") + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("Cities", (string)null); + }); + + modelBuilder.Entity("Ceyehat.Domain.CountryAggregate.Country", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Currency") + .HasColumnType("integer"); + + b.Property("Iso2") + .HasMaxLength(2) + .HasColumnType("character varying(2)"); + + b.Property("Iso3") + .HasMaxLength(3) + .HasColumnType("character varying(3)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("UnLocode") + .HasMaxLength(16) + .HasColumnType("character varying(16)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("Countries", (string)null); + }); + + modelBuilder.Entity("Ceyehat.Domain.CustomerAggregate.Customer", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("BirthDate") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Name") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("PassengerType") + .HasColumnType("integer"); + + b.Property("PhoneNumber") + .HasMaxLength(16) + .HasColumnType("character varying(16)"); + + b.Property("Surname") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Title") + .HasColumnType("integer"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.ToTable("Customers", (string)null); + }); + + modelBuilder.Entity("Ceyehat.Domain.FlightAggregate.Flight", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ActualArrival") + .HasMaxLength(256) + .HasColumnType("timestamp with time zone"); + + b.Property("ActualDeparture") + .HasMaxLength(256) + .HasColumnType("timestamp with time zone"); + + b.Property("AircraftId") + .HasColumnType("uuid"); + + b.Property("ArrivalAirportId") + .HasColumnType("uuid"); + + b.Property("BusinessPriceId") + .HasColumnType("uuid"); + + b.Property("ComfortPriceId") + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DepartureAirportId") + .HasColumnType("uuid"); + + b.Property("EconomyPriceId") + .HasColumnType("uuid"); + + b.Property("FlightNumber") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("ScheduledArrival") + .HasMaxLength(256) + .HasColumnType("timestamp with time zone"); + + b.Property("ScheduledDeparture") + .HasMaxLength(256) + .HasColumnType("timestamp with time zone"); + + b.Property("Status") + .HasMaxLength(32) + .HasColumnType("integer"); + + b.Property("Type") + .HasMaxLength(32) + .HasColumnType("integer"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("Flights", (string)null); + }); + + modelBuilder.Entity("Ceyehat.Domain.PriceAggregate.Price", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Amount") + .HasColumnType("decimal(18,2)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Currency") + .HasMaxLength(3) + .HasColumnType("integer"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("Prices", (string)null); + }); + + modelBuilder.Entity("Ceyehat.Domain.SeatAggregate.Seat", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("AircraftId") + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("SeatClass") + .HasColumnType("integer"); + + b.Property("SeatNumber") + .HasMaxLength(4) + .HasColumnType("character varying(4)"); + + b.Property("SeatStatus") + .HasColumnType("integer"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("Seats", (string)null); + }); + + modelBuilder.Entity("Ceyehat.Domain.UserAggregate.User", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CustomerId") + .HasColumnType("uuid"); + + b.Property("Email") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("FirstName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("LastName") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("Password") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("Users", (string)null); + }); + + modelBuilder.Entity("Ceyehat.Domain.AircraftAggregate.Aircraft", b => + { + b.OwnsMany("Ceyehat.Domain.FlightAggregate.ValueObjects.FlightId", "FlightIds", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property("Id")); + + b1.Property("AircraftId") + .HasColumnType("uuid"); + + b1.Property("Value") + .HasColumnType("uuid") + .HasColumnName("FlightId"); + + b1.HasKey("Id"); + + b1.HasIndex("AircraftId"); + + b1.ToTable("AircraftFlightIds", (string)null); + + b1.WithOwner() + .HasForeignKey("AircraftId"); + }); + + b.OwnsMany("Ceyehat.Domain.SeatAggregate.ValueObjects.SeatId", "SeatIds", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property("Id")); + + b1.Property("AircraftId") + .HasColumnType("uuid"); + + b1.Property("Value") + .HasColumnType("uuid") + .HasColumnName("SeatId"); + + b1.HasKey("Id"); + + b1.HasIndex("AircraftId"); + + b1.ToTable("AircraftSeatIds", (string)null); + + b1.WithOwner() + .HasForeignKey("AircraftId"); + }); + + b.Navigation("FlightIds"); + + b.Navigation("SeatIds"); + }); + + modelBuilder.Entity("Ceyehat.Domain.AirlineAggregate.Airline", b => + { + b.OwnsMany("Ceyehat.Domain.AircraftAggregate.ValueObjects.AircraftId", "AircraftIds", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property("Id")); + + b1.Property("AirlineId") + .HasColumnType("uuid"); + + b1.Property("Value") + .HasColumnType("uuid") + .HasColumnName("AircraftId"); + + b1.HasKey("Id"); + + b1.HasIndex("AirlineId"); + + b1.ToTable("AirlineAircraftIds", (string)null); + + b1.WithOwner() + .HasForeignKey("AirlineId"); + }); + + b.OwnsOne("Ceyehat.Domain.AirlineAggregate.Entities.AirlineAddress", "AirlineAddress", b1 => + { + b1.Property("Id") + .HasColumnType("uuid"); + + b1.Property("AirlineId") + .HasColumnType("uuid"); + + b1.Property("CityId") + .HasColumnType("uuid"); + + b1.HasKey("Id", "AirlineId"); + + b1.HasIndex("AirlineId") + .IsUnique(); + + b1.ToTable("AirlineAddresses", (string)null); + + b1.WithOwner() + .HasForeignKey("AirlineId"); + }); + + b.Navigation("AircraftIds"); + + b.Navigation("AirlineAddress") + .IsRequired(); + }); + + modelBuilder.Entity("Ceyehat.Domain.AirportAggregate.Airport", b => + { + b.OwnsMany("Ceyehat.Domain.FlightAggregate.ValueObjects.FlightId", "ArrivalFlights", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property("Id")); + + b1.Property("AirportId") + .HasColumnType("uuid"); + + b1.Property("Value") + .HasColumnType("uuid") + .HasColumnName("FlightId"); + + b1.HasKey("Id"); + + b1.HasIndex("AirportId"); + + b1.ToTable("AirportArrivalFlightIds", (string)null); + + b1.WithOwner() + .HasForeignKey("AirportId"); + }); + + b.OwnsMany("Ceyehat.Domain.FlightAggregate.ValueObjects.FlightId", "DepartureFlights", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property("Id")); + + b1.Property("AirportId") + .HasColumnType("uuid"); + + b1.Property("Value") + .HasColumnType("uuid") + .HasColumnName("FlightId"); + + b1.HasKey("Id"); + + b1.HasIndex("AirportId"); + + b1.ToTable("AirportDepartureFlightIds", (string)null); + + b1.WithOwner() + .HasForeignKey("AirportId"); + }); + + b.Navigation("ArrivalFlights"); + + b.Navigation("DepartureFlights"); + }); + + modelBuilder.Entity("Ceyehat.Domain.CityAggregate.City", b => + { + b.OwnsMany("Ceyehat.Domain.CityAggregate.Entities.District", "Districts", b1 => + { + b1.Property("Id") + .HasColumnType("uuid"); + + b1.Property("CityId") + .HasColumnType("uuid"); + + b1.Property("Name") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b1.HasKey("Id"); + + b1.HasIndex("CityId"); + + b1.ToTable("Districts", (string)null); + + b1.WithOwner() + .HasForeignKey("CityId"); + + b1.OwnsMany("Ceyehat.Domain.CityAggregate.Entities.Neighborhood", "Neighborhoods", b2 => + { + b2.Property("Id") + .HasColumnType("uuid"); + + b2.Property("AirlineId") + .HasColumnType("uuid"); + + b2.Property("AirportId") + .HasColumnType("uuid"); + + b2.Property("DistrictId") + .HasColumnType("uuid"); + + b2.Property("Name") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b2.HasKey("Id"); + + b2.HasIndex("DistrictId"); + + b2.ToTable("Neighborhoods", (string)null); + + b2.WithOwner() + .HasForeignKey("DistrictId"); + }); + + b1.Navigation("Neighborhoods"); + }); + + b.Navigation("Districts"); + }); + + modelBuilder.Entity("Ceyehat.Domain.CountryAggregate.Country", b => + { + b.OwnsMany("Ceyehat.Domain.AirlineAggregate.ValueObjects.AirlineId", "AirlineIds", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property("Id")); + + b1.Property("CountryId") + .HasColumnType("uuid"); + + b1.Property("Value") + .HasColumnType("uuid") + .HasColumnName("AirlineId"); + + b1.HasKey("Id"); + + b1.HasIndex("CountryId"); + + b1.ToTable("CountryAirlineIds", (string)null); + + b1.WithOwner() + .HasForeignKey("CountryId"); + }); + + b.OwnsMany("Ceyehat.Domain.CityAggregate.ValueObjects.CityId", "CityIds", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property("Id")); + + b1.Property("CountryId") + .HasColumnType("uuid"); + + b1.Property("Value") + .HasColumnType("uuid") + .HasColumnName("CityId"); + + b1.HasKey("Id"); + + b1.HasIndex("CountryId"); + + b1.ToTable("CountryCityIds", (string)null); + + b1.WithOwner() + .HasForeignKey("CountryId"); + }); + + b.OwnsMany("Ceyehat.Domain.AircraftAggregate.ValueObjects.AircraftId", "AircraftIds", b1 => + { + b1.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property("Id")); + + b1.Property("CountryId") + .HasColumnType("uuid"); + + b1.Property("Value") + .HasColumnType("uuid") + .HasColumnName("AircraftId"); + + b1.HasKey("Id"); + + b1.HasIndex("CountryId"); + + b1.ToTable("CountryAircraftIds", (string)null); + + b1.WithOwner() + .HasForeignKey("CountryId"); + }); + + b.Navigation("AircraftIds"); + + b.Navigation("AirlineIds"); + + b.Navigation("CityIds"); + }); + + modelBuilder.Entity("Ceyehat.Domain.CustomerAggregate.Customer", b => + { + b.OwnsMany("Ceyehat.Domain.CustomerAggregate.Entities.BoardingPass", "BoardingPasses", b1 => + { + b1.Property("Id") + .HasColumnType("uuid"); + + b1.Property("BoardingGate") + .HasMaxLength(8) + .HasColumnType("character varying(8)"); + + b1.Property("BoardingGroup") + .HasMaxLength(2) + .HasColumnType("character varying(2)"); + + b1.Property("BoardingTime") + .HasColumnType("timestamp with time zone"); + + b1.Property("CheckInTime") + .HasColumnType("timestamp with time zone"); + + b1.Property("CustomerId") + .HasColumnType("uuid"); + + b1.HasKey("Id"); + + b1.HasIndex("CustomerId"); + + b1.ToTable("CustomerBoardingPasses", (string)null); + + b1.WithOwner() + .HasForeignKey("CustomerId"); + }); + + b.OwnsMany("Ceyehat.Domain.CustomerAggregate.Entities.Booking", "Bookings", b1 => + { + b1.Property("Id") + .HasColumnType("uuid") + .HasColumnName("BookingId"); + + b1.Property("Currency") + .HasColumnType("integer"); + + b1.Property("CustomerId") + .HasColumnType("uuid"); + + b1.Property("FlightId") + .HasColumnType("uuid") + .HasColumnName("FlightId"); + + b1.Property("PassengerType") + .HasColumnType("integer"); + + b1.Property("Price") + .HasColumnType("real"); + + b1.Property("SeatId") + .HasColumnType("uuid") + .HasColumnName("SeatId"); + + b1.HasKey("Id"); + + b1.HasIndex("CustomerId"); + + b1.ToTable("CustomerBookings", (string)null); + + b1.WithOwner() + .HasForeignKey("CustomerId"); + }); + + b.OwnsMany("Ceyehat.Domain.CustomerAggregate.Entities.FlightTicket", "FlightTickets", b1 => + { + b1.Property("Id") + .HasColumnType("uuid"); + + b1.Property("BoardingPassId") + .HasColumnType("uuid"); + + b1.Property("BookingId") + .HasColumnType("uuid"); + + b1.Property("CustomerId") + .HasColumnType("uuid"); + + b1.HasKey("Id"); + + b1.HasIndex("CustomerId"); + + b1.ToTable("CustomerFlightTickets", (string)null); + + b1.WithOwner() + .HasForeignKey("CustomerId"); + }); + + b.Navigation("BoardingPasses"); + + b.Navigation("Bookings"); + + b.Navigation("FlightTickets"); + }); + + modelBuilder.Entity("Ceyehat.Domain.PriceAggregate.Price", b => + { + b.OwnsOne("Ceyehat.Domain.PriceAggregate.Entities.FlightPricing", "FlightPricing", b1 => + { + b1.Property("Id") + .HasColumnType("uuid"); + + b1.Property("PriceId") + .HasColumnType("uuid"); + + b1.Property("BaseCost") + .HasColumnType("decimal(10,2)"); + + b1.Property("ClassMultiplier") + .HasColumnType("decimal(10,2)"); + + b1.Property("CompetitionMultiplier") + .HasColumnType("decimal(10,2)"); + + b1.Property("DemandMultiplier") + .HasColumnType("decimal(10,2)"); + + b1.Property("LengthMultiplier") + .HasColumnType("decimal(10,2)"); + + b1.Property("MarkupPercentage") + .HasColumnType("decimal(10,2)"); + + b1.Property("SeasonalMultiplier") + .HasColumnType("decimal(10,2)"); + + b1.Property("TotalCost") + .HasColumnType("numeric"); + + b1.HasKey("Id", "PriceId"); + + b1.HasIndex("PriceId") + .IsUnique(); + + b1.ToTable("FlightPricing", (string)null); + + b1.WithOwner() + .HasForeignKey("PriceId"); + }); + + b.Navigation("FlightPricing") + .IsRequired(); + }); + + modelBuilder.Entity("Ceyehat.Domain.UserAggregate.User", b => + { + b.OwnsMany("Ceyehat.Domain.UserAggregate.Entities.Relationship", "Relationships", b1 => + { + b1.Property("Id") + .HasColumnType("uuid"); + + b1.Property("UserId") + .HasColumnType("uuid"); + + b1.Property("CustomerId") + .HasColumnType("uuid"); + + b1.Property("Type") + .HasColumnType("integer"); + + b1.HasKey("Id", "UserId"); + + b1.HasIndex("UserId"); + + b1.ToTable("UserRelationships", (string)null); + + b1.WithOwner() + .HasForeignKey("UserId"); + }); + + b.Navigation("Relationships"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Ceyehat.Infrastructure/Migrations/20230320171557_PriceUpdate.cs b/Ceyehat.Infrastructure/Migrations/20230320171557_PriceUpdate.cs new file mode 100644 index 0000000..f718622 --- /dev/null +++ b/Ceyehat.Infrastructure/Migrations/20230320171557_PriceUpdate.cs @@ -0,0 +1,69 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Ceyehat.Infrastructure.Migrations +{ + /// + public partial class PriceUpdate : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "PriceId", + table: "Flights", + newName: "EconomyPriceId"); + + migrationBuilder.AddColumn( + name: "BusinessPriceId", + table: "Flights", + type: "uuid", + nullable: false, + defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.AddColumn( + name: "ComfortPriceId", + table: "Flights", + type: "uuid", + nullable: false, + defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Customers", + type: "uuid", + nullable: false, + defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), + oldClrType: typeof(Guid), + oldType: "uuid", + oldNullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "BusinessPriceId", + table: "Flights"); + + migrationBuilder.DropColumn( + name: "ComfortPriceId", + table: "Flights"); + + migrationBuilder.RenameColumn( + name: "EconomyPriceId", + table: "Flights", + newName: "PriceId"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Customers", + type: "uuid", + nullable: true, + oldClrType: typeof(Guid), + oldType: "uuid"); + } + } +} diff --git a/Ceyehat.Infrastructure/Migrations/CeyehatDbContextModelSnapshot.cs b/Ceyehat.Infrastructure/Migrations/CeyehatDbContextModelSnapshot.cs index b78ab6c..058dadb 100644 --- a/Ceyehat.Infrastructure/Migrations/CeyehatDbContextModelSnapshot.cs +++ b/Ceyehat.Infrastructure/Migrations/CeyehatDbContextModelSnapshot.cs @@ -17,7 +17,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "7.0.3") + .HasAnnotation("ProductVersion", "7.0.4") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); @@ -239,7 +239,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); - b.Property("UserId") + b.Property("UserId") .HasColumnType("uuid"); b.HasKey("Id"); @@ -266,19 +266,25 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("ArrivalAirportId") .HasColumnType("uuid"); + b.Property("BusinessPriceId") + .HasColumnType("uuid"); + + b.Property("ComfortPriceId") + .HasColumnType("uuid"); + b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("DepartureAirportId") .HasColumnType("uuid"); + b.Property("EconomyPriceId") + .HasColumnType("uuid"); + b.Property("FlightNumber") .HasMaxLength(32) .HasColumnType("character varying(32)"); - b.Property("PriceId") - .HasColumnType("uuid"); - b.Property("ScheduledArrival") .HasMaxLength(256) .HasColumnType("timestamp with time zone"); diff --git a/Ceyehat.Infrastructure/Persistence/Configurations/FlightConfigurations.cs b/Ceyehat.Infrastructure/Persistence/Configurations/FlightConfigurations.cs index f8212a3..12f70f8 100644 --- a/Ceyehat.Infrastructure/Persistence/Configurations/FlightConfigurations.cs +++ b/Ceyehat.Infrastructure/Persistence/Configurations/FlightConfigurations.cs @@ -70,10 +70,23 @@ private void ConfigureFlightsTable(EntityTypeBuilder builder) f => f.Value, value => AirportId.Create(value)); - builder.Property(f => f.PriceId) + builder.Property(f => f.EconomyPriceId) .ValueGeneratedNever() .HasConversion( f => f.Value, value => PriceId.Create(value)); + + builder.Property(f => f.ComfortPriceId) + .ValueGeneratedNever() + .HasConversion( + f => f.Value, + value => PriceId.Create(value)); + + builder.Property(f => f.BusinessPriceId) + .ValueGeneratedNever() + .HasConversion( + f => f.Value, + value => PriceId.Create(value)); + } } \ No newline at end of file diff --git a/Ceyehat.Infrastructure/Persistence/Repositories/FlightRepository.cs b/Ceyehat.Infrastructure/Persistence/Repositories/FlightRepository.cs index f1cf58f..e3e9eca 100644 --- a/Ceyehat.Infrastructure/Persistence/Repositories/FlightRepository.cs +++ b/Ceyehat.Infrastructure/Persistence/Repositories/FlightRepository.cs @@ -28,10 +28,17 @@ public async Task> SearchFlightsAsync( from flight in _dbContext.Flights join aircraft in _dbContext.Aircrafts on flight.AircraftId equals aircraft.Id join airline in _dbContext.Airlines on aircraft.AirlineId equals airline.Id - // join dAirport in _dbContext.Airports on flight.DepartureAirportId equals dAirport.Id - // join aAirport in _dbContext.Airports on flight.ArrivalAirportId equals aAirport.Id - - // TODO: TO FILTER RESULTS WHERE CLAUSE SHOULD BE HERE. + join ecoPrice in _dbContext.Prices on flight.EconomyPriceId equals ecoPrice.Id + join comPrice in _dbContext.Prices on flight.ComfortPriceId equals comPrice.Id + join busPrice in _dbContext.Prices on flight.BusinessPriceId equals busPrice.Id + join dAirport in _dbContext.Airports on flight.DepartureAirportId equals dAirport.Id + join aAirport in _dbContext.Airports on flight.ArrivalAirportId equals aAirport.Id + + where dAirport.IataCode == departureAirportIataCode + && aAirport.IataCode == arrivalAirportIataCode + && flight.ScheduledDeparture.Year == departureDate.Value.Year + && flight.ScheduledDeparture.Month == departureDate.Value.Month + && flight.ScheduledDeparture.Day == departureDate.Value.Day select new FlightDto { @@ -40,9 +47,9 @@ join airline in _dbContext.Airlines on aircraft.AirlineId equals airline.Id AircraftName = aircraft.RegistrationNumber, DepartureHour = flight.ScheduledDeparture, ArrivalHour = flight.ScheduledArrival, - EconomyPrice = 125.10m, - ComfortPrice = 145.20m, - BusinessPrice = 250.30m, + EconomyPrice = ecoPrice.FlightPricing.TotalCost, + ComfortPrice = comPrice.FlightPricing.TotalCost, + BusinessPrice = busPrice.FlightPricing.TotalCost }).ToListAsync(); return flights; diff --git a/ceyehat/Common/Mapping/FlightMappingConfig.cs b/ceyehat/Common/Mapping/FlightMappingConfig.cs index 50b687e..303a57b 100644 --- a/ceyehat/Common/Mapping/FlightMappingConfig.cs +++ b/ceyehat/Common/Mapping/FlightMappingConfig.cs @@ -22,6 +22,8 @@ public void Register(TypeAdapterConfig config) .Map(dest => dest.Type, src => Enum.Parse(typeof(FlightType), src.Type.ToString())) .Map(dest => dest.DepartureAirportId, src => src.DepartureAirportId.Value) .Map(dest => dest.ArrivalAirportId, src => src.ArrivalAirportId.Value) - .Map(dest => dest.PriceId, src => src.PriceId.Value); + .Map(dest => dest.EconomyPriceId, src => src.EconomyPriceId.Value) + .Map(dest => dest.ComfortPriceId, src => src.ComfortPriceId.Value) + .Map(dest => dest.BusinessPriceId, src => src.BusinessPriceId.Value); } } \ No newline at end of file diff --git a/ceyehat/Requests/Aircrafts/CreateAircraft.http b/ceyehat/Requests/Aircrafts/CreateAircraft.http index 68ebf6e..5c8fee0 100644 --- a/ceyehat/Requests/Aircrafts/CreateAircraft.http +++ b/ceyehat/Requests/Aircrafts/CreateAircraft.http @@ -1,14 +1,14 @@ POST http://localhost:5228/api/Aircraft Content-Type: application/json -Authorization: Bearer eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NzQyMGQwMy1lOGIxLTRjOTctOTFkZC01ZTI3Mjk2YmFlNzEiLCJnaXZlbl9uYW1lIjoiR2l0aHViIiwiZmFtaWx5X25hbWUiOiJUZXN0IiwianRpIjoiMjdhMDFhNGItYzU4ZC00MDU5LWE4NzQtNDUxMDk4NWY2YzAxIiwiZXhwIjoxNjc2OTc1OTExLCJpc3MiOiJBZGVtQ0xLIiwiYXVkIjoiQWRlbUNMSyJ9.XfCONz9xAAqtslVaCTo8S8LV9thoQoHnmeyr-0VwZ-DHJcRERybVYkqXQ8XB5wIR6lm9sLnttzgWVD1dYLhMVw +Authorization: Bearer eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NzQyMGQwMy1lOGIxLTRjOTctOTFkZC01ZTI3Mjk2YmFlNzEiLCJnaXZlbl9uYW1lIjoiR2l0aHViIiwiZmFtaWx5X25hbWUiOiJUZXN0IiwianRpIjoiNWYwYzhhYmItNDQwOS00YTgyLWJjZjItMTE3MWRjNzVmODk2IiwiZXhwIjoxNjc5MzM2MjM1LCJpc3MiOiJBZGVtQ0xLIiwiYXVkIjoiQWRlbUNMSyJ9.3JSdhBx4K_178uT0BZ63f-_ZMl2tPZDvQcvwbgX1kg5w4wGa8-NNNFzPk-AyoXOtL8hb4lxF2bjppLfr7XbqPA { - "registrationNumber": "TC-JFE", - "icao24Code": "4BA8C5", - "model": "Boeing 737-8F2", - "manufacturerSerialNumber": "29767", + "registrationNumber": "TC-JGA", + "icao24Code": "4BA8E1", + "model": "BOEING 737 NG / MAX", + "manufacturerSerialNumber": "29785", "faaRegistration": "N1786B", "countryId" : "7afcf68f-2f86-4d20-9f02-72c707b31a29", - "airlineId" : "09f46ed8-ca89-4d8d-ac67-d2fb4b9200b6" + "airlineId" : "9e90cf1e-eb4c-4a63-9a5d-c07bbccaf28d" } \ No newline at end of file diff --git a/ceyehat/Requests/Airlines/CreateAirline.http b/ceyehat/Requests/Airlines/CreateAirline.http index d262ac8..96e5bc3 100644 --- a/ceyehat/Requests/Airlines/CreateAirline.http +++ b/ceyehat/Requests/Airlines/CreateAirline.http @@ -1,14 +1,14 @@ POST http://localhost:5228/api/Airline Content-Type: application/json -Authorization: Bearer eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NzQyMGQwMy1lOGIxLTRjOTctOTFkZC01ZTI3Mjk2YmFlNzEiLCJnaXZlbl9uYW1lIjoiR2l0aHViIiwiZmFtaWx5X25hbWUiOiJUZXN0IiwianRpIjoiZTY2N2U3ZTAtMDM0ZC00M2NjLWE0NDYtMjBhYzRlNWUyMDQyIiwiZXhwIjoxNjc2OTIyMTI3LCJpc3MiOiJBZGVtQ0xLIiwiYXVkIjoiQWRlbUNMSyJ9.or0-17vKc7NeYq_HHihOn0RHozmiIUOc7zfbTsiNpxSNjEEIQ7-nYxW4fPRfMTyQvX2kaeYhbMZmOcK5u0F5eA +Authorization: Bearer eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NzQyMGQwMy1lOGIxLTRjOTctOTFkZC01ZTI3Mjk2YmFlNzEiLCJnaXZlbl9uYW1lIjoiR2l0aHViIiwiZmFtaWx5X25hbWUiOiJUZXN0IiwianRpIjoiNWYwYzhhYmItNDQwOS00YTgyLWJjZjItMTE3MWRjNzVmODk2IiwiZXhwIjoxNjc5MzM2MjM1LCJpc3MiOiJBZGVtQ0xLIiwiYXVkIjoiQWRlbUNMSyJ9.3JSdhBx4K_178uT0BZ63f-_ZMl2tPZDvQcvwbgX1kg5w4wGa8-NNNFzPk-AyoXOtL8hb4lxF2bjppLfr7XbqPA { - "name": "Turkish Airlines", + "name": "Anadolu Jet", "iataCode": "TK", "icaoCode": "THY", - "callsign": "TURKISH", + "callsign": "ANADOLUJET", "code": "235", - "website": "https://www.turkishairlines.com", + "website": "https://www.anadolujet.com/tr", "address": { "cityId": "b936bdcc-5bec-4660-b296-682fb142e5c5" }, diff --git a/ceyehat/Requests/Flights/CreateFlight.http b/ceyehat/Requests/Flights/CreateFlight.http index 338a95d..07c3650 100644 --- a/ceyehat/Requests/Flights/CreateFlight.http +++ b/ceyehat/Requests/Flights/CreateFlight.http @@ -1,17 +1,21 @@ POST http://localhost:5228/api/Flight Content-Type: application/json -Authorization: Bearer eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NzQyMGQwMy1lOGIxLTRjOTctOTFkZC01ZTI3Mjk2YmFlNzEiLCJnaXZlbl9uYW1lIjoiR2l0aHViIiwiZmFtaWx5X25hbWUiOiJUZXN0IiwianRpIjoiYmVjYzRjZTAtZjZjMi00ODMxLTg2ZTAtZTA1Y2E1NzIyN2NmIiwiZXhwIjoxNjc3MDEzNTU5LCJpc3MiOiJBZGVtQ0xLIiwiYXVkIjoiQWRlbUNMSyJ9.rEYlJb_iX9fI9VjuVm1wHjHvtc_iqViAvGVRHgA-83KkIMFwHJ1JHZ4KmI-h12HEvzI7LLG44AXpV6NfCUUBvw +Authorization: Bearer eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NzQyMGQwMy1lOGIxLTRjOTctOTFkZC01ZTI3Mjk2YmFlNzEiLCJnaXZlbl9uYW1lIjoiR2l0aHViIiwiZmFtaWx5X25hbWUiOiJUZXN0IiwianRpIjoiNWYwYzhhYmItNDQwOS00YTgyLWJjZjItMTE3MWRjNzVmODk2IiwiZXhwIjoxNjc5MzM2MjM1LCJpc3MiOiJBZGVtQ0xLIiwiYXVkIjoiQWRlbUNMSyJ9.3JSdhBx4K_178uT0BZ63f-_ZMl2tPZDvQcvwbgX1kg5w4wGa8-NNNFzPk-AyoXOtL8hb4lxF2bjppLfr7XbqPA { - "flightNumber": "AI000002", - "scheduledDeparture": "2023-03-03T16:13:34.240Z", - "scheduledArrival": "2023-03-03T18:13:34.240Z", + "flightNumber": "AI000003", + "scheduledDeparture": "2023-03-24T16:30:34.240Z", + "scheduledArrival": "2023-03-24T17:30:34.240Z", "status": 0, - "type": 0, + "type": 1, "actualDeparture": null, "actualArrival": null, - "aircraftId": "0a3901f2-cf62-441e-9ae8-0d3a9e5059c2", - "departureAirportId": "36c66a4f-dc74-4c70-8823-e02583cfe285", - "arrivalAirportId": "457dc6e0-c585-4025-912c-3101435270ff", - "priceId": "f0b4f0f9-496f-4a9f-a60e-bfc63eb91f04" + "aircraftId": "e182aaa1-130a-4418-a537-f634b104a3df", + "departureAirportId": "457dc6e0-c585-4025-912c-3101435270ff", + "arrivalAirportId": "a5cf68f9-23a3-4385-8bcb-bbd586a4d23b", + "economyPriceId": "4d28ee7e-3c35-490a-a64a-6703a4f0da7b", + "comfortPriceId": "24748793-1d19-400e-92d3-217d171f07dc", + "businessPriceId": "75337c5f-8ae2-4cce-8bc8-3ded8136fb49" } + + diff --git a/ceyehat/Requests/Prices/CreatePrice.http b/ceyehat/Requests/Prices/CreatePrice.http index f2f4f5e..b3621e9 100644 --- a/ceyehat/Requests/Prices/CreatePrice.http +++ b/ceyehat/Requests/Prices/CreatePrice.http @@ -1,6 +1,6 @@ POST http://localhost:5228/api/Price Content-Type: application/json -Authorization: Bearer eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NzQyMGQwMy1lOGIxLTRjOTctOTFkZC01ZTI3Mjk2YmFlNzEiLCJnaXZlbl9uYW1lIjoiR2l0aHViIiwiZmFtaWx5X25hbWUiOiJUZXN0IiwianRpIjoiOTFiOGM2ZjAtZTdmYy00NDY2LWE4MTUtZGQ5ZTI5YzQzOTlkIiwiZXhwIjoxNjc3MDE3NjcwLCJpc3MiOiJBZGVtQ0xLIiwiYXVkIjoiQWRlbUNMSyJ9.vmUUt94iM8tS_y9RSVREd0BsUf3dahjvUd2dXeLnRMz-aqyMlj6IXW5oEbFBAvzlsrUFVTHnLnWRYxlJsK1mgw +Authorization: Bearer eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTUxMiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NzQyMGQwMy1lOGIxLTRjOTctOTFkZC01ZTI3Mjk2YmFlNzEiLCJnaXZlbl9uYW1lIjoiR2l0aHViIiwiZmFtaWx5X25hbWUiOiJUZXN0IiwianRpIjoiNWYwYzhhYmItNDQwOS00YTgyLWJjZjItMTE3MWRjNzVmODk2IiwiZXhwIjoxNjc5MzM2MjM1LCJpc3MiOiJBZGVtQ0xLIiwiYXVkIjoiQWRlbUNMSyJ9.3JSdhBx4K_178uT0BZ63f-_ZMl2tPZDvQcvwbgX1kg5w4wGa8-NNNFzPk-AyoXOtL8hb4lxF2bjppLfr7XbqPA { "amount": 1, @@ -8,10 +8,10 @@ Authorization: Bearer eyJhbGciOiJodHRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW "pricing": { "baseCost": 100, "markupPercentage": 10, - "demandMultiplier": 1, - "competitionMultiplier": 0.9, - "seasonalMultiplier": 1.3, - "lengthMultiplier": 1.5, - "classMultiplier": 1.2 + "demandMultiplier": 0.5, + "competitionMultiplier": 0.85, + "seasonalMultiplier": 1.01, + "lengthMultiplier": 1.05, + "classMultiplier": 1.45 } } \ No newline at end of file