An open API service indexing awesome lists of open source software.

https://github.com/soufian-khennousse/tool2go

Rental system focusing on validation, error handling, and clean service architecture.
https://github.com/soufian-khennousse/tool2go

booking-system clean-architecture cli-tool console-application csharp design-patterns dotnet object-oriented-programming validation xml-serialization

Last synced: 28 days ago
JSON representation

Rental system focusing on validation, error handling, and clean service architecture.

Awesome Lists containing this project

README

          

# πŸš€ Tool2Go – A Modular Tool Rental System (C#/.NET 8)
**Enterprise-style CLI application with XML persistence, booking logic, validation rules, and a clean service-oriented architecture.**

Tool2Go is a fully functional **tool rental management system** developed in **C#/.NET 8**, focusing on clean architecture, robust input handling, domain-driven design, and real-world business logic.
It simulates the full lifecycle of renting professional tools β€” including customers, bookings, categories, availability logic, validation, and cost calculations.

This project demonstrates:

- 🧩 **Deep understanding of domain modeling**
- πŸ› οΈ **Clean service-layer architecture**
- πŸ“¦ **XML-based persistence** (serialization/deserialization)
- 🧹 **Input parsing, validation & error handling**
- πŸ”„ **Complex booking workflows with date validation**
- πŸ”Ž **Debugging & edge-case handling** (temporary reservations, availability checks, etc.)
- ♻️ **Extendable design for future UI or DB upgrades**

---

## 🧱 Architecture Overview

The system follows a **layered architecture** designed for maintainability:

```text
Program.cs (Entry point / Menu control)
β”œβ”€β”€ Services
β”‚ β”œβ”€β”€ CustomerService
β”‚ β”œβ”€β”€ BookingService
β”‚ β”œβ”€β”€ ToolService
β”‚ └── CategoryService
β”œβ”€β”€ Models
β”‚ β”œβ”€β”€ Customer
β”‚ β”œβ”€β”€ Booking / BookingPos
β”‚ β”œβ”€β”€ ToolType / ToolInstance
β”‚ └── ToolCategory
└── Persistence
└── XML Serialization (Utils)
```

### πŸ” Highlights
- **Services contain all business logic** β†’ no logic in `Program.cs`
- **Models contain only state + simple calculations**
- **Centralized InputHelper** ensures all input is validated & abortable
- **XMLSerializer abstraction** allows future upgrade to JSON/SQL

---

## 🧩 Key Features

### βœ” Smart Booking Workflow
The booking system guides the user step-by-step:

1. Select customer
2. Enter start & end date
3. System checks availability for each tool type
4. User can book multiple tools at once
5. Age restrictions enforced (21+ for insured tools)
6. Temporary reservations prevent double-booking in same session
7. Full summary screen before saving

---

### βœ” Temporary Reservations (Advanced Feature)
To prevent inconsistent availability:

- tools selected during the booking session are **temporarily reserved**
- ensures correct availability calculation
- prevents multi-adding the same tool type incorrectly

---

### βœ” Robust Input Handling (Industrial-grade)
Every input uses the **InputHelper**, providing:

- Centralized parsing
- Abort options at any point
- Retry on invalid input
- β€œPress Enter to keep previous value” when editing
- Consistency across all services

This simulates real enterprise CLI tooling where input reliability is critical.

---

### βœ” Cancelable Operations
All user-facing actions support:

- Cancel before saving
- Confirmation before deletion
- Clear error prompts
- Retry loops without throwing exceptions

---

### βœ” XML Persistence
All data is stored using XML serialization:

- Tools
- Tool instances
- Categories
- Customers
- Bookings
- Nested booking positions

Ensured through:

- a consistent schema
- safe loading
- future-proof structure for migrations