Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #178

Merged
merged 29 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
72864a3
Initialised the Drive Easy integration - car controller working corre…
kubapoke Jan 15, 2025
71833fa
addedd provider customer service
kubapoke Jan 16, 2025
d175e7c
moved more responsibility to the separate services
kubapoke Jan 16, 2025
df8fa95
implemented customer creation logic for DriveEasy
kubapoke Jan 16, 2025
7c052d5
integrated Drive Easy offers into our service
kubapoke Jan 16, 2025
e4b2b62
started integrating rents; changed rental rent id to be a string
kubapoke Jan 16, 2025
55d8c3f
parding string to int to avoid surprises
kubapoke Jan 16, 2025
f8e5e7d
fixed rents not working
kubapoke Jan 16, 2025
d464519
implemented Renting a Drive Easy car
kubapoke Jan 16, 2025
6f4f530
changed the rental id back to int
kubapoke Jan 16, 2025
33c117b
implemented return of Drive Easy rents
kubapoke Jan 16, 2025
2b85b14
Merge pull request #171 from kubapoke/main
MegaRoboNinja Jan 16, 2025
3283b48
Merge pull request #170 from kubapoke/feat/team-api-integration
MegaRoboNinja Jan 16, 2025
a9eca80
Added a response check to handleReturn
MegaRoboNinja Jan 16, 2025
4150547
Added the popup
MegaRoboNinja Jan 16, 2025
f2c7c87
added pagination to Drive Easy offer retrieval
kubapoke Jan 16, 2025
4c77e3c
Merge pull request #172 from kubapoke/fix/front-return-confirmation
kubapoke Jan 16, 2025
e62b316
Merge pull request #173 from kubapoke/fix/drive-easy-pagination
MegaRoboNinja Jan 16, 2025
e0116a0
Fixed the condition in the if-statement checking the response
MegaRoboNinja Jan 16, 2025
ee1bfff
Merge pull request #174 from kubapoke/fix/front-return-confirmation
MegaRoboNinja Jan 16, 2025
b7d8ed3
car search reload fix attempt
kubapoke Jan 16, 2025
308e57f
car search reload fix attempt
kubapoke Jan 16, 2025
937771b
moved web.config to public
kubapoke Jan 16, 2025
aec6444
small naming change if that makes a difference
kubapoke Jan 16, 2025
fd21085
webconfig update
kubapoke Jan 16, 2025
1ba50f1
moved webconfig yet again
kubapoke Jan 16, 2025
6d08f85
Merge pull request #175 from kubapoke/main
kubapoke Jan 16, 2025
bdc78bc
Merge pull request #176 from kubapoke/development
kubapoke Jan 16, 2025
456900e
Merge pull request #177 from kubapoke/fix/reloading
kubapoke Jan 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions car-search/backend/CarSearchAPI/CarSearchAPI/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ALLOWED_ORIGINS=https://example.com,http://localhost:5173
DATABASE_CONNECTION_STRING=Data Source={your_data_source};Initial Catalog=CarSearchLocalDB;Integrated Security=True;Pooling=False;Encrypt=False;Trust Server Certificate=False
JWT_TOKEN_SECRET_KEY=iUHtYkYcb7th6cfFs5l1mFxS2tEVQnsGvIpQx8C1Z3c=
CAR_RENTAL_API_URL=https://localhost:7077
DRIVE_EASY_API_URL=
SENDGRID_API_KEY=
COMPANY_EMAIL=
JWT_CONFIRMATION_TOKEN_SECRET_KEY=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Microsoft.AspNetCore.Mvc;
using System.Security.Claims;
using CarSearchAPI.DTOs.CarRental;
using CarSearchAPI.DTOs.Rents;
using CarSearchAPI.DTOs.Users;
using CarSearchAPI.Models;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace CarSearchAPI.Abstractions
public interface IOfferPageService
{
public GetOfferAmountParametersDto GetGetOfferAmountParameters
(string? brand, string? model, DateTime startDate, DateTime endDate, string? location);
(string? brand, string? model, DateTime startDate, DateTime endDate, string? location, string? email);
public (int page, int pageSize) GetPageAndPageSize(int? providedPage, int? providedPageSize);
public GetOfferListParametersDto GetGetOfferListParameters
(string? brand, string? model, DateTime startDate, DateTime endDate, string? location, string email, int pageSize);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace CarSearchAPI.Abstractions
{
public interface IProviderCustomerService : IProviderService
{
public Task<bool> CheckIfCustomerExistsAsync(HttpClient client, string url, string? customerId);
public Task CreateCustomerAsync(HttpClient client, string url, string? customerId, string? email);
public Task<string> GetCustomerIdAsync(HttpClient client, string url, string? email);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ namespace CarSearchAPI.Abstractions
{
public interface IProviderOfferService : IProviderService
{
public Task<int> GetOfferAmountAsync(HttpClient client, string url);
public Task<List<OfferDto>> GetOfferListAsync(HttpClient client, string url);
public Task<int> GetOfferAmountAsync(HttpClient client, string url, GetOfferAmountParametersDto parameters,
string? customerId);
public Task<List<OfferDto>> GetOfferListAsync(HttpClient client, string url,
GetOfferListParametersDto parameters, string? customerId);
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using System.Security.Claims;
using CarSearchAPI.DTOs.CarSearch;
using CarSearchAPI.DTOs.Rents;

namespace CarSearchAPI.Abstractions
{
public interface IProviderRentService : IProviderService
{
public Task<NewSearchRentDto> CreateNewRentAsync(HttpClient client, string url, StringContent? jsonContent);
public Task<bool> SetRentStatusReadyToReturnAsync(HttpClient client, string url, StringContent? jsonContent);
public Task<NewSearchRentDto> CreateNewRentAsync(HttpClient client, string url, ClaimsPrincipal claimsPrincipal);
public Task<bool> SetRentStatusReadyToReturnAsync(HttpClient client, string url, int rentId);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ public interface IProviderServiceFactory
public IProviderCarService GetProviderCarService(string providerName);
public IProviderOfferService GetProviderOfferService(string providerName);
public IProviderRentService GetProviderRentService(string providerName);
public IProviderCustomerService GetProviderCustomerService(string providerName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public async Task<IActionResult> OfferList(
(int _page, int _pageSize) = _offerPageService.GetPageAndPageSize(page, pageSize);

var offerAmountParametersDto = _offerPageService.GetGetOfferAmountParameters
(brand, model, startDate, endDate, location);
(brand, model, startDate, endDate, location, email);

var offerListParametersDto = _offerPageService.GetGetOfferListParameters
(brand, model, startDate, endDate, location, email, _pageSize);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace CarSearchAPI.DTOs.DriveEasy
{
public class DriveEasyCarDto
{
public int Id { get; set; }
public string Brand { get; set; }
public string Model { get; set; }
public int Year { get; set; }
public string Photo { get; set; }
public string Status { get; set; }
public decimal Price { get; set; }
public DriveEasyLocationDto Location { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace CarSearchAPI.DTOs.DriveEasy
{
public class DriveEasyCustomerCreationParametersDto
{
public string Id { get; set; }
public string Name { get; set; }
public string Surname { get; set; }
public string Email { get; set; }
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace CarSearchAPI.DTOs.DriveEasy
{
public class DriveEasyLocationDto
{
public int Id { get; set; }
public float Latitude { get; set; }
public float Longitude { get; set; }
public string Name { get; set; }
public string Address { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace CarSearchAPI.DTOs.DriveEasy
{
public class DriveEasyOfferDto
{
public string Id { get; set; }
public DriveEasyCarDto Car { get; set; }
public string ClientId { get; set; }
public decimal Price { get; set; }
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace CarSearchAPI.DTOs.DriveEasy
{
public class NewDriveEasyRentDto
{
public string RentId { get; set; }
public DateTime Start { get; set; }
public DateTime End { get; set; }
public string CarBrand { get; set; }
public string CarModel { get; set; }
public int CarYear { get; set; }
public decimal CarPrice { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ public class GetOfferAmountParametersDto
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public string? Location { get; set; }
public string? Email { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace CarSearchAPI.DTOs.CarSearch
namespace CarSearchAPI.DTOs.Rents
{
public class NewSearchRentDto
{
Expand All @@ -8,6 +8,5 @@ public class NewSearchRentDto
public DateTime StartDate { get; set; }
public DateTime EndDate { get; set; }
public int RentalCompanyRentId { get; set; }

}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace CarSearchAPI.Migrations
{
/// <inheritdoc />
public partial class ChangedCarRentalRentIdFromIntToString : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "RentalCompanyRentId",
table: "rents",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(int),
oldType: "int");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<int>(
name: "RentalCompanyRentId",
table: "rents",
type: "int",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)");
}
}
}
Loading