refactor: clean session08 notes
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# Session 8
|
|
||||||
Profile + some fixes to database
|
# 🛠️ Task Checklist
|
||||||
|
|
||||||
## Fixes
|
## Fixes
|
||||||
- [ ] Check for missing `.ValueGeneratedOnAdd()` in all entity configurations in ```Infrastructure/Configurations```.
|
- [ ] Check for missing `.ValueGeneratedOnAdd()` in all entity configurations in ```Infrastructure/Configurations```.
|
||||||
@@ -19,7 +19,7 @@ Profile + some fixes to database
|
|||||||
|
|
||||||
- [ ] Add data in `Seat`, `Person`, `TicketOrder`, `Transaction`, `Ticket` for test. It is recommended to write python code for generating data for Seat table, according to the data already stored in Transportation and related Vehicle data. There is also a [SeatGenerator](https://github.com/TheOrderOfPhoenix/ASP.NET/blob/main/ProjectOrientedSessions/Session08/SeatGenerator.py) in this repository, as well.
|
- [ ] Add data in `Seat`, `Person`, `TicketOrder`, `Transaction`, `Ticket` for test. It is recommended to write python code for generating data for Seat table, according to the data already stored in Transportation and related Vehicle data. There is also a [SeatGenerator](https://github.com/TheOrderOfPhoenix/ASP.NET/blob/main/ProjectOrientedSessions/Session08/SeatGenerator.py) in this repository, as well.
|
||||||
|
|
||||||
- [ ] Fix claim extraction (`sub` → standardize JWT claim mapping). (`IUserContext` implmentation)
|
- [ ] Fix claim extraction (`sub` → standardize JWT claim mapping). (`IUserContext` implementation)
|
||||||
|
|
||||||
First, create an interface in Application layer:
|
First, create an interface in Application layer:
|
||||||
```csharp
|
```csharp
|
||||||
@@ -187,10 +187,10 @@ You can also find another version of this DTO in [Here](https://github.com/Mehrd
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: You should add neccessary interfaces and implement them
|
Note: You should add necessary interfaces and implement them
|
||||||
|
|
||||||
- [ ] Implement:
|
- [ ] Implement:
|
||||||
- [ ] Edit Email (with validation): `EditEmailDto`, service method, and controller endpoint.
|
- [ ] Edit Email (with validation): `EditEmailDto`, service method, and controller endpoint.
|
||||||
```csharp
|
```csharp
|
||||||
public class EditEmailDto
|
public class EditEmailDto
|
||||||
{
|
{
|
||||||
@@ -198,7 +198,7 @@ You can also find another version of this DTO in [Here](https://github.com/Mehrd
|
|||||||
public string NewEmail { get; set; }
|
public string NewEmail { get; set; }
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
- [ ] Edit Password: `EditPasswordDto`, service and controller.
|
- [ ] Edit Password: `EditPasswordDto`, service and controller.
|
||||||
```csharp
|
```csharp
|
||||||
public class EditPasswordDto
|
public class EditPasswordDto
|
||||||
{
|
{
|
||||||
@@ -213,7 +213,7 @@ You can also find another version of this DTO in [Here](https://github.com/Mehrd
|
|||||||
public string ConfirmNewPassword { get; set; }
|
public string ConfirmNewPassword { get; set; }
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
- [ ] Edit Person Info: `PersonDto`, and endpoint to upsert personal data.
|
- [ ] Edit Person Info: `PersonDto`, and endpoint to `upsert` personal data.
|
||||||
```csharp
|
```csharp
|
||||||
public class PersonDto
|
public class PersonDto
|
||||||
{
|
{
|
||||||
@@ -240,7 +240,7 @@ You can also find another version of this DTO in [Here](https://github.com/Mehrd
|
|||||||
public DateTime BirthDate { get; set; }
|
public DateTime BirthDate { get; set; }
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
- [ ] Edit BankAccountDetail: `UpsertBankAccountDetailDto` and relevant logic.
|
- [ ] Edit `BankAccountDetail`: `UpsertBankAccountDetailDto` and relevant logic.
|
||||||
```csharp
|
```csharp
|
||||||
public class UpsertBankAccountDto
|
public class UpsertBankAccountDto
|
||||||
{
|
{
|
||||||
@@ -258,7 +258,6 @@ You can also find another version of this DTO in [Here](https://github.com/Mehrd
|
|||||||
```
|
```
|
||||||
|
|
||||||
- [ ] Add mapping for all Dtos and check related properties like `CreatorAccountId`.
|
- [ ] Add mapping for all Dtos and check related properties like `CreatorAccountId`.
|
||||||
|
|
||||||
|
|
||||||
## ✅ List of Travelers
|
## ✅ List of Travelers
|
||||||
|
|
||||||
@@ -334,6 +333,7 @@ public async Task<Result<long>> UpsertPersonAsync(long accountId, PersonDto dto)
|
|||||||
return Result<long>.Success(person.Id);
|
return Result<long>.Success(person.Id);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
[HttpPost("account-person")]
|
[HttpPost("account-person")]
|
||||||
public async Task<IActionResult> UpsertAccountPerson([FromBody] PersonDto dto)
|
public async Task<IActionResult> UpsertAccountPerson([FromBody] PersonDto dto)
|
||||||
@@ -536,7 +536,7 @@ public async Task<Result<long>> TopUpAsync(long accountId, TopUpDto dto)
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Postman
|
## Postman
|
||||||
Considering that all endpoints in `AccountController` require Authorization, You need to test your api in **Postman**.
|
Considering that all endpoints in `AccountController` require Authorization, You need to test your API in **Postman**.
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
<img src="https://upload.wikimedia.org/wikipedia/commons/c/c2/Postman_%28software%29.png" width="60%">
|
<img src="https://upload.wikimedia.org/wikipedia/commons/c/c2/Postman_%28software%29.png" width="60%">
|
||||||
@@ -544,7 +544,17 @@ Considering that all endpoints in `AccountController` require Authorization, You
|
|||||||
Postman is a client which lets the user test api professionally.
|
Postman is a client which lets the user test api professionally.
|
||||||
You can download it in [this link](https://www.postman.com/downloads/) and get started with it using [this video](https://www.youtube.com/watch?v=wEOLZq-7DYs&pp=0gcJCfwAo7VqN5tD)
|
You can download it in [this link](https://www.postman.com/downloads/) and get started with it using [this video](https://www.youtube.com/watch?v=wEOLZq-7DYs&pp=0gcJCfwAo7VqN5tD)
|
||||||
|
|
||||||
|
# 🧠 Hints & Notes
|
||||||
## Notes:
|
|
||||||
- Check the codes as they're put here before **debugging**, you can check them with the repositories.
|
- Check the codes as they're put here before **debugging**, you can check them with the repositories.
|
||||||
- Complete the task step by step in each endpoint to preserve the principals of *Clean Architecture*.
|
- Complete the task step by step in each endpoint to preserve the principals of *Clean Architecture*.
|
||||||
|
|
||||||
|
# 🙌 Acknowledgements
|
||||||
|
|
||||||
|
- ChatGPT for snippet refinement and explanations
|
||||||
|
# 🔍 References
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# ✅ Frontend Profile Page Implementation Checklist
|
|
||||||
|
# 🛠️ Task Checklist
|
||||||
|
|
||||||
## ⚙️ Tooling & Fixes
|
## ⚙️ Tooling & Fixes
|
||||||
- [ ] Install and configure `react-hook-form`
|
- [ ] Install and configure `react-hook-form`
|
||||||
@@ -231,3 +232,16 @@ export interface TicketOrderSummaryDto {
|
|||||||
```
|
```
|
||||||
|
|
||||||
- [ ] Implement `MyTravels` page. Note that this page can be similarly implemented by a card.
|
- [ ] Implement `MyTravels` page. Note that this page can be similarly implemented by a card.
|
||||||
|
|
||||||
|
|
||||||
|
# 🧠 Hints & Notes
|
||||||
|
# 🙌 Acknowledgements
|
||||||
|
|
||||||
|
- ChatGPT for snippet refinement and explanations
|
||||||
|
# 🔍 References
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user