Skip to content

Arkadii Ushakov - #12

Open
arkadyushakov wants to merge 6 commits into
MewsSystems:mainfrom
arkadyushakov:feature/reservations-improvements-arkadii
Open

Arkadii Ushakov#12
arkadyushakov wants to merge 6 commits into
MewsSystems:mainfrom
arkadyushakov:feature/reservations-improvements-arkadii

Conversation

@arkadyushakov

Copy link
Copy Markdown

Arkadii Ushakov

This PR implements reservation validation, double-booking prevention and basic staff access.
It adds overlap detection for reservations, a simple access code-based authentication, and an endpoint for retrieving today's and future reservations with guest details.
The focus was on delivering correct and maintainable functionality within the time constraints.

Task Status

  • RE-001: Completed - implemented reservation validation rules + unit tests
  • RE-002: Completed - implemented conflict detection to prevent double booking + integration tests
  • RE-003: Partially completed - implemented backend authentication and get reservations endpoint, UI kept minimal due to time limitations

Task Report

I worked within the 3-hour time constraint and focused on completing three tasks end-to-end.

Most of the time was spent on RE-001 and RE-002, ensuring validation logic and overlap detection were correct and covered with tests. RE-003 was implemented with a focus on backend functionality (authentication and reservations endpoint), while keeping the UI minimal.

Notes

Tried to keep the scope under control and stay pragmatic, also tried to avoid overengineering or making large architectural changes, focusing instead on delivering a clean and consistent solution within the existing structure.
I also tried to avoid changes that could trigger cascading fixes across the codebase because of given the time constraints.

Copilot AI review requested due to automatic review settings April 2, 2026 23:46
@arkadyushakov arkadyushakov changed the title Feature/reservations improvements arkadii Arkadii Ushakov Apr 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements reservation validation, double-booking prevention, and basic staff access features for the hotel reservation system. It adds backend validation logic, conflict detection to prevent overlapping reservations, a simple access code-based authentication mechanism, and a staff dashboard for viewing upcoming reservations.

Changes:

  • Implemented reservation validation rules (date ranges, duration limits) with comprehensive unit tests
  • Added conflict detection logic to prevent double-booking with integration tests
  • Created staff authentication via access codes and a staff dashboard for viewing reservations
  • Refactored toast notification hooks to prevent stale closure issues

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
api/Validators/ New validation classes for rooms, reservations, and email addresses with comprehensive unit tests
api/Repositories/ Added conflict detection method, improved error messages, and fixed date/time handling
api/Controllers/ Enhanced request handling with better error responses and authentication checks
api/Program.cs Changed database connection from Singleton to Scoped for better resource management
api/Models/ Made Guest.Name nullable to accommodate flexible guest records
ui/src/utils/toasts.tsx Refactored toast hooks to accept message as function parameter instead of constructor parameter
ui/src/staff/ New StaffPage component for viewing upcoming reservations
ui/src/reservations/ Updated to use new toast API and send dates in proper format
ui/src/LandingPage.tsx Implemented login functionality with staff access code

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread api/Controllers/StaffController.cs Outdated
Comment thread api/Repositories/ReservationRepository.cs Outdated
Comment thread api/Repositories/ReservationRepository.cs
Comment thread ui/src/staff/StaffPage.tsx Outdated
Comment on lines +3 to +9
type Reservation = {
id: string;
roomNumber: string;
guestEmail: string;
start: string;
end: string;
};

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Property name case mismatch: The C# API returns Reservation objects with PascalCase property names (Id, RoomNumber, GuestEmail, Start, End), but the TypeScript type expects camelCase property names (id, roomNumber, guestEmail, start, end). This will cause the properties to be undefined at runtime. Either the API should be configured to use camelCase serialization, or the TypeScript types should use PascalCase to match the JSON response.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings April 3, 2026 08:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{
public InvalidRoomNumber(string invalidRoomNumber)
: base($"The value ${invalidRoomNumber} is not a valid") { }
: base($"The value {invalidRoomNumber} is not a valid") { }

Copilot AI Apr 3, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message is incomplete and grammatically incorrect. It should end with "valid room number" or similar phrase instead of just "is not a valid".

Suggested change
: base($"The value {invalidRoomNumber} is not a valid") { }
: base($"The value {invalidRoomNumber} is not a valid room number") { }

Copilot uses AI. Check for mistakes.
using Microsoft.Data.Sqlite;
using Repositories;

namespace Tests.Integration.Repositories;

Copilot AI Apr 3, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The namespace declaration is inconsistent with other test files in the same project. Other test files use Reservations.Tests.Unit.Validators but this integration test uses Tests.Integration.Repositories. For consistency and to match the project structure, this should be Reservations.Tests.Integration.Repositories.

Suggested change
namespace Tests.Integration.Repositories;
namespace Reservations.Tests.Integration.Repositories;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants