This project implements a service management system for a car rental fleet. It determines whether cars in the fleet need servicing based on their engine and battery types. The system is designed to be extensible, allowing for easy addition of new car models and service criteria.
- Support for multiple car models with different engine and battery combinations
- Extensible design for easy addition of new car models and service criteria
- Utilizes Factory and Strategy patterns for flexible object creation and behavior
- Implemented in TypeScript for strong typing and better developer experience
rental_fleet/
├── src/
│ ├── models/
│ │ ├── Car.ts
│ │ ├── engine/
│ │ │ ├── Engine.ts
│ │ │ ├── CapuletEngine.ts
│ │ │ ├── WilloughbyEngine.ts
│ │ │ └── SternmanEngine.ts
│ │ └── battery/
│ │ ├── Battery.ts
│ │ ├── SpindlerBattery.ts
│ │ └── NubbinBattery.ts
│ │ └── tire/
│ │ ├── Tire.ts
│ │ ├── CarriganTire.ts
│ │ └── OctoprimeTire.ts
│ ├── services/
│ │ └── CarService.ts
│ ├── factories/
│ │ └── CarFactory.ts
│ └── main.ts
├── package.json
└── tsconfig.json
- Deno installation guide
-
Clone the repository:
git clone cd ts-rental-fleet-management -
Run the example:
deno task start
This will run the example in main.ts, which demonstrates the creation and service checking of different car models.
- If needed, create new engine or battery classes in the respective folders.
- Add a new method to
CarFactoryinsrc/factories/CarFactory.tsfor the new car model. - Update
src/main.tsto demonstrate the new car model.
deno task test
This program was developed as a part of the Forage - Lyft Backend Engineering Virtual Job Simulation.
