Skip to content

feature: add hotel management system#263

Merged
komalharshita merged 7 commits into
komalharshita:mainfrom
Chirantan112:feature/hotel-management
Jun 1, 2026
Merged

feature: add hotel management system#263
komalharshita merged 7 commits into
komalharshita:mainfrom
Chirantan112:feature/hotel-management

Conversation

@Chirantan112

@Chirantan112 Chirantan112 commented May 18, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR implements the Python-based Hotel Management System Starter as proposed in issue #204. It provides a structured, medium-difficulty learning project for the starter_code library, focusing on real-world logic like room inventory management and guest data validation.

Related Issue

Closes #204

Type of Change

  • Feature — adds a new educational project to the starter_code library
  • Documentation — includes structured learning goals and a step-by-step roadmap
  • Style — clean, PEP8 compliant code formatting

What Was Changed

File Change made
starter_code/hotel_management.py Implementation of a 40-room management system with tiered pricing, booking validation, and search filters.

Key Features Implemented

  • Interactive CLI Interface: A command-line menu system for easy navigation and user interaction.
  • Dynamic Room Inventory: Automatically initializes 40 rooms across Standard, Deluxe, and Suite tiers.
  • State Management: Utilizes nested dictionaries to track availability and guest details in real-time.
  • Validation Logic: * Validates 10-digit phone numbers for guest registration.
    • Restricts bookings to a maximum of 30 days to prevent business logic errors.
  • Filter Engine: Users can search for available rooms specifically by their category type.

How to Test This PR

  1. Navigate to the directory: cd starter_code
  2. Run the script: python hotel_management.py
  3. Verify Business Rules:
    • Test Case 1: Attempt to book a room with an 8-digit phone number (Expected: Error).
    • Test Case 2: Attempt to book a room for 31+ days (Expected: Blocked).
    • Test Case 3: Verify the total bill calculation accurately reflects the nightly rate for the selected category.

Self-Review Checklist

  • I have read CONTRIBUTING.md and followed all guidelines.
  • My code follows the repository's structured comment format (Header, Goals, Roadmap).
  • I have tested the script locally in PowerShell on Windows.
  • I have run flake8 . locally and fixed any linting errors.
  • I have removed all unnecessary print() debug statements.

Notes for Reviewer

This PR successfully fulfills the requirements outlined in the project proposal (#204). The code is modular and follows the educational style of the existing grade_manager.py to ensure consistency for new contributors.

@vercel

vercel Bot commented May 18, 2026

Copy link
Copy Markdown

@Chirantan112 is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot 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.

Thank you for submitting your first pull request to DevPath.

Before review:

  • Complete the PR template fully
  • Ensure all tests pass
  • Link your PR to an issue
  • Keep changes scoped to the issue

A maintainer will review your contribution soon.

@komalharshita

Copy link
Copy Markdown
Owner

@Chirantan112 ensure that all checks pass before merging

komalharshita
komalharshita previously approved these changes May 19, 2026

@komalharshita komalharshita left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Good contribution overall. The Hotel Management System project is a useful addition to DevPath and fits well within the repository’s educational/project-learning goals.

The project structure, roadmap, features, and starter code organization are all well scoped for beginners/intermediate learners practicing data management and application logic concepts.

The PR is clean, properly linked to the issue, and avoids unrelated modifications.

Minor future suggestion: slightly clarify the intended implementation type (CLI/web/GUI) in the description and ensure the starter template remains beginner-friendly rather than overly complete.

Approved for merge.

@Chirantan112

Copy link
Copy Markdown
Contributor Author

Hi @komalharshita, thank you for the approval! I noticed that the CI checks were failing due to a universal bug in tests/test_basic.py (the test_health_check is missing a required argument).

I have raised Issue #344 to document this and submitted PR #345 to fix it. Once the test fix is merged, the checks for this project will pass. I've also updated the project description to clarify that this is a CLI-based implementation as suggested!

Updated the project header in hotel_management.py to explicitly state that this is a CLI (Command Line Interface) implementation. This addresses the maintainer's feedback regarding clarity for beginner/intermediate learners.
@Chirantan112

Copy link
Copy Markdown
Contributor Author

Hi @komalharshita, I've updated the file header and description to clarify this is a CLI implementation as suggested. Thank you for the approval!"

Replaced all occurrences of the ₹ symbol with 'Rs.' throughout hotel_management.py. 

This change ensures the code is compatible with standard ASCII/UTF-8 encoding used by GitHub Actions and various terminal environments, preventing potential build failures or display errors during automated testing.
@Chirantan112

Copy link
Copy Markdown
Contributor Author

Hi @komalharshita, sorry for the confusion! My recent push dismissed your previous approval. Could you please take a quick look and re-approve if everything looks good?"

@komalharshita komalharshita left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for the contribution — this is a genuinely solid beginner-to-intermediate CLI project idea, and I appreciate the effort put into:

  • documentation
  • learning goals
  • validation handling
  • menu structure
  • feature completeness

The project is educationally valuable and much more complete than many basic starter submissions.

However, before this can be merged into DevPath’s curated starter-project dataset, there are several important improvements needed.

Main concerns

  • The file formatting/style is currently inconsistent and needs cleanup before merge.
  • The room state is stored using index-based lists ([type, price, status, guest]), which becomes difficult to maintain and read. A dictionary/object-based structure would be much cleaner and more extensible.
  • The project relies heavily on mutable global state, which makes scaling/testing harder.
  • There is no persistence layer, so all bookings disappear after restart — this should either be documented clearly or improved.
  • UI/input handling and business logic are tightly coupled throughout the file.
  • No automated tests or sample validation flows are included.

Requested improvements

  • Clean and format the entire file consistently
  • Replace list-based room structures with dictionaries
  • Improve code organization/readability
  • Add notes about persistence limitations
  • Optionally include sample test flows or usage examples

The project concept itself is good, but the implementation needs another refinement pass before merge consideration.

… documentation

### Summary
Refactored the core data structure and enhanced project documentation to meet DevPath maintainer standards.

### Changes
* **Data Structure:** Replaced index-based list structures with nested dictionaries for better data clarity and maintainability.
* **Code Quality:** Updated all room management functions to use key-based access (e.g., `details["status"]`) instead of fragile index numbers.
* **Documentation:** * Added notes regarding in-memory persistence limitations.
    * Updated "Learning Goals" to reflect the shift to dictionary-based state management.
* **Validation:** Included a Manual Validation Flow (test cases) at the bottom of the script for easier reviewer verification.
@Chirantan112

Copy link
Copy Markdown
Contributor Author

Refactor Complete: Dictionary-Based Implementation

I have updated the project based on the feedback to ensure better code quality and alignment with DevPath standards.

Key Updates:

  • Data Structure: Migrated from list-based room storage to nested dictionaries. This removes reliance on index numbers and improves data clarity.
  • Key-Based Access: All functions (booking, searching, and viewing details) now use descriptive keys (e.g., ["status"], ["type"]) for more robust logic.
  • Documentation: * Added a persistence disclaimer to the roadmap and system shutdown message.
    • Included a Manual Validation Flow at the bottom of the script for easier verification.
  • Clean Code: Standardized formatting and removed redundant comments/logic.

Ready for a re-review!

- Registered the Hotel Management System in the central projects directory.
- Assigned unique ID 9 to maintain sequence on this branch.
- Linked to the newly refactored starter_code/hotel_management.py.
@github-actions github-actions Bot added the data label May 27, 2026
@Chirantan112

Copy link
Copy Markdown
Contributor Author

Hi @komalharshita have been waiting for a long time. Please merge my pr.

@komalharshita komalharshita merged commit 135c34f into komalharshita:main Jun 1, 2026
7 of 8 checks passed
@komalharshita

Copy link
Copy Markdown
Owner

Approved for merge!

@komalharshita komalharshita added gssoc:approved and removed need review Further information is requested labels Jun 1, 2026
@Chirantan112 Chirantan112 deleted the feature/hotel-management branch June 1, 2026 17:50
@Chirantan112 Chirantan112 restored the feature/hotel-management branch June 1, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Project]: Add Python-based Hotel Management System Starter

2 participants