How dnbhatt1991/courierapp works
CourierApp is a console tool that reads package records from a file or standard input, calculates each package’s discount and discounted cost, sorts the results by cost, and prints formatted rows. The main runtime stages are input selection and parsing, discount/result processing, sorter selection and ordering, and output. The README also documents QuickSorter as the default and BubbleSorter as an option. The graph follows the supplied entry-point and service source; no persistent store or external service is shown.
Main entry points: Program.cs Console entry point · SortService.cs Sort service · SorterFactory.cs Sorter factory · PackageDiscountCalculator.cs Discount calculator
Components 11
Input
- File or stdin
- Console entry point
CourierApp/Program.cs - Package
CourierApp/Models/Package.cs
Discount Processing
- Sort service
CourierApp/Services/SortService.cs - Discount calculator
CourierApp/Services/PackageDiscountCalculator.cs - Package result
CourierApp/Models/PackageResult.cs
Sorting
- Sorter factory
CourierApp/Services/SorterFactory.cs - Quick sorter
CourierApp/Services/QuickSorter.cs - Bubble sorter
CourierApp/Services/BubbleSorter.cs
Other components
- CLI user
- Console output
Connections 12
- CLI user → Console entry point: runs with args
- Console entry point → File or stdin: reads lines
- Console entry point → Package: parses records
- Console entry point → Sorter factory: selects sorter
- Sorter factory → Quick sorter: resolves default
- Sorter factory → Bubble sorter: resolves option
- Console entry point → Sort service: processes packages
- Sort service → Discount calculator: calculates discount
- Discount calculator → Package: reads package fields
- Sort service → Package result: creates results
- Sort service → Quick sorter: sorts by cost
- Console entry point → Console output: prints results