4.6 KiB
4.6 KiB
Reservation System Development Guide
This guide helps developers understand how to implement, update, and maintain the ticket reservation system. It summarizes changes from commits and provides step-by-step actions, grouped by feature area. https://github.com/MehrdadShirvani/AlibabaClone-Frontend/commits/develop/
Fixes and Missing Things from Session 08
Authentication & Protected Routes
- Store
showLoginModalstate inauthStoreand adjust navbar - Add
ProtectedRoutecomponent - Adjust main
Appto route authenticated pages through protection layer - Add session persistence in
authStoreto store token more persistently
Profile and User Info Enhancements
- Fix and align
birthDatetypes inPersonDto,transportationSearchResult, andListOfTravelers
Agent
- Add
topUpDtoand its method inagent.ts - Add optional config parameter to
request()inagent.ts
Branching
- Create the feature/themes branch based on develop
🎨 Theming and UI Styling
- Install and import
preline - Add theme colors and global styles (index.css)
- Add
ThemeSwitcherand integrate it into the navbar - If you decide to do this part after implementing pages, make sure to add theme support to the following components:
transportationCard,transportationSearchForm,ReviewAndConfirm- All modals:
LoginModal,RegisterModal,SelectFromPeopleModal - Profile section:
ProfilePage,ProfileSummary,PersonalInformation,AccountInfo,PersonalAccountInfo,BankAccountDetails,MyTravels,MyTransactions,ListOfTravelers - Reservation views and components
Merge
- Create a PR and merge the current branch with develop
Branching
- Create the feature/ticket-reservation branch based on develop
Backend Agent Methods
- Add
createTicketOrderDtoandcreateTravelerTicketDto - Add
transportationSeatDto - Add related methods in
TicketOrderand add it to agent
Reservation Process & Step Management
- Implement
useReservationStoreusingzustandto manage reservation state - Create step-based routing using
ReservationLayout - Add routing for reservation steps in
App.tsx - Add
StepIndicatorcomponent to show step progress visually - Add
stepGuardlogic to prevent accessing future steps prematurely - Add logic to skip back only if previous steps are completed
- Create
TravelerFormto gather passenger info, with the possibility to load data from the related people of the account. - Create
TravelerDetailsFormto gather passengers info withTravelerFormintegration - Create
ReviewAndConfirmpage to review selections - Create
PaymentFormfor transaction process - Create
TicketIssuedpage for confirmation - Add validation to show error if
seatIdis missing
Seat Selection
- Add DTO:
export interface transportationSeatDto{
id : number,
vehicleId : number,
row : number,
column : number,
isVIP : boolean,
isAvailable : boolean,
description : string | null,
isReserved : boolean,
genderId : number | null
}
- Add
getSeats()method toagent.ts - Add
SeatGridSelectorcomponent for graphical seat layout inTravelerDetailFormand integrate it with traveler list, only for Buses - Modify
transportationCardto integrate with seat selection - Add
SeatOnlyGridSeatMapfor simpler seat-only display
Coupon Integration
- Add
couponValidationRequestDtoanddiscountDto - Add
validateCoupon()method toagent.ts - Update
useReservationStoreto includecouponCode - Ensure
createTicketOrderDtousescouponCodeinstead ofcouponId - Connect coupon validation flow in
ReviewAndConfirm
Search, Filter, and Sort Functionality
- Add filters (company) and sorting (time or price) UI to
SearchResultPage - Add company logo support in result cards and filters
- Add
previous/next daybuttons for time navigation - Add remaining capacity check to transportation cards
- Add refund policy info display
- Implement showing seat map in
TransportaionCardusingReadOnlySeatMap
📎 Notes
- Ensure you run a full theme test after UI changes.
- Test step transitions with various invalid scenarios.
- Confirm persistent session and coupon behavior across refreshes.
- Validate all filters, sort, and search navigation works.
- Test seat selection and proper rendering of rotated layouts.
Merge
- Create a PR and merge the current branch with develop