Design a system to automate the handling of incoming parcels at the package distribution center. This system must categorize parcels for processing by various departments according to their weight and value.
The system should follow these current business rules for parcel distribution:
- Parcels weighing up to 1 kg are directed to the "Mail" department.
- Parcels weighing up to 10 kg are directed to the "Regular" department.
- Parcels weighing over 10 kg are directed to the "Heavy" department.
Any parcel valued over €1,000 must receive approval from the "Insurance" department before processing by the relevant weight-based department.
| Requirement | Status | Implementation Details |
|---|---|---|
Parse XML file (Container_68465468.xml) |
IMPLEMENTED | Full XML parsing service with container/parcel/recipient/address mapping |
| Functional application | IMPLEMENTED | Complete .NET 8 Web API with Clean Architecture |
| Unit tests | IMPLEMENTED | Comprehensive xUnit tests with FluentAssertions |
| Presentation/Demo | IMPLEMENTED | Web API with Swagger UI and comprehensive testing guides |
| Requirement | Status | Implementation |
|---|---|---|
| Parcels ≤ 1kg → Mail department | IMPLEMENTED | Department { Name = "Mail", MinWeight = 0, MaxWeight = 1 } |
| Parcels ≤ 10kg → Regular department | IMPLEMENTED | Department { Name = "Regular", MinWeight = 1, MaxWeight = 10 } |
| Parcels > 10kg → Heavy department | IMPLEMENTED | Department { Name = "Heavy", MinWeight = 10, MaxWeight = decimal.MaxValue } |
*** EXCEEDS REQUIREMENTS:**
- Dynamic department management via API endpoints
- Configurable weight ranges per department
- Active/Inactive department status
- Processing rule associations
| Requirement | Status | Implementation |
|---|---|---|
| Parcels > €1,000 → Insurance approval | IMPLEMENTED | HighValueThreshold = 1000m in ProcessingRule |
| Insurance department integration | IMPLEMENTED | RequiresInsuranceApproval flag and processing notes |
*** EXCEEDS REQUIREMENTS:**
- Configurable threshold per processing rule
- Detailed processing notes for insurance requirements
- Multiple processing rules support
| Requirement | Status | Implementation |
|---|---|---|
| Customizable business rules | IMPLEMENTED | Full ProcessingRule and Department CRUD APIs |
| Different customer needs | IMPLEMENTED | Multiple processing rules with different thresholds |
- .NET 8 Web API (not console app as mentioned in README)
- Clean Architecture with proper layer separation:
Parca.Domain/- Domain entities and business logicParca.Application/- Application services, DTOs, interfaces, validatorsParca.Infrastructure/- Data access, external servicesParca.Api/- Web API controllersParca.UnitTests/- Unit tests
- CQRS Pattern with MediatR for commands and queries
- Entity Framework Core with SQLite database
- Repository Pattern with Unit of Work
- FluentValidation for input validation
- Database Migrations with Entity Framework
- Container entity with parcels collection
- Parcel entity with weight, value, and recipient
- Department entity with configurable weight ranges
- ProcessingRule entity with high-value thresholds
- ParcelProcessingResult entity for tracking processing outcomes
- Recipient and Address entities for delivery information
- XmlParserService - Parses Container_68465468.xml format
- ParcelProcessingService - Core business logic for parcel routing
- Repository implementations for all entities
- Database migrations with Entity Framework
POST /api/parcelprocessing/process-container- Process container XML file
GET /api/Department- Get all departments with summaryGET /api/Department/{id}- Get department by IDGET /api/Department/byname/{name}- Get department by nameGET /api/Department/active- Get active departments onlyGET /api/Department/byprocessingrule/{id}- Get departments by processing rulePOST /api/Department- Create new departmentPUT /api/Department/{id}- Update departmentDELETE /api/Department/{id}- Delete departmentPATCH /api/Department/{id}/activate- Activate departmentPATCH /api/Department/{id}/deactivate- Deactivate department
GET /api/ProcessingRule- Get all processing rulesGET /api/ProcessingRule/{id}- Get processing rule by IDGET /api/ProcessingRule/byname/{name}- Get processing rule by nameGET /api/ProcessingRule/active- Get active processing rules onlyPOST /api/ProcessingRule- Create new processing rulePUT /api/ProcessingRule/{id}- Update processing ruleDELETE /api/ProcessingRule/{id}- Delete processing rulePATCH /api/ProcessingRule/{id}/activate- Activate processing rulePATCH /api/ProcessingRule/{id}/deactivate- Deactivate processing rule
- Unit Tests: Comprehensive test coverage for:
- Command and Query handlers
- Service layer logic
- Validation rules
- XML parsing
- Test Data Factory: Centralized test data creation (
DepartmentTestDataFactory) - Integration Testing: API endpoint testing
- Test Frameworks: xUnit with FluentAssertions and NSubstitute
- Overview A modern Angular 17+ frontend application for the Parca Management System, providing a comprehensive web interface for managing departments, processing rules, parcel processing, and approval workflows.
- Architecture & Technology Stack
- Core Technologies
- Angular 17+ - Modern standalone components architecture
- TypeScript - Strict type safety and enhanced development experience
- RxJS - Reactive programming for API calls and state management
- SCSS - Advanced styling with variables and mixins
- Angular Router - Client-side routing and navigation
- Project Structure
Parca.App/
├── README.md # Comprehensive documentation
├── API_ENDPOINTS.md # API reference guide
├── setup.bat / setup.sh # Setup scripts for Windows/Linux
├── package.json # Enhanced with useful scripts
├── src/
│ ├── styles.scss # Global styling system
│ ├── main.ts # Bootstrap with HTTP client
│ ├── environments/ # Development & production configs
│ └── app/
│ ├── app.component.ts # Main app component
│ ├── app.routes.ts # Routing configuration
│ ├── core/ # Core services & models
│ │ ├── models/ # TypeScript interfaces
│ │ │ ├── department.model.ts
│ │ │ ├── processing-rule.model.ts
│ │ │ └── parcel-processing.model.ts
│ │ └── services/
│ │ └── api.service.ts # Complete API integration
│ ├── features/ # Feature modules
│ │ ├── home/ # Dashboard/welcome page
│ │ ├── departments/ # Department management
│ │ ├── processing-rules/ # Processing rules management
│ │ └── parcel-processing/ # Parcel processing
│ └── shared/
│ └── components/
│ └── navbar/ # Navigation component
- View all departments with summary statistics
- Create new departments with validation
- Edit existing departments (modal-based)
- Activate/deactivate departments
- Delete departments with confirmation
- Integration with processing rules
- View all processing rules with status
- Create new processing rules
- Edit existing rules (modal-based)
- Activate/deactivate rules
- Delete rules with confirmation
- High-value threshold configuration
- XML file upload with validation
- Processing rule selection
- Real-time processing status
- Detailed results display
- Error handling and user feedback
- Responsive design
- Loading states and spinners
- Form validation
- Error and success messages
- Modal dialogs
- Consistent styling system
- Professional navigation
The application will be available at: http://localhost:4200
The app is pre-configured to connect to your Parca.Api:
- Development:
https://localhost:7142 - Production: Update
src/environments/environment.ts
npm start # Development server
npm run build # Production build
npm run build:prod # Production build (optimized)
npm test # Run unit tests
npm run start:dev # Development with dev config- Production-ready enterprise application instead of a simple console app
- Full database persistence with Entity Framework migrations
- Comprehensive API for all business operations
- Dynamic configuration through database instead of static config files
- Professional architecture with Clean Architecture and CQRS patterns
- Extensive testing with proper test coverage
- Frontend Implementation with Angular
- Complete documentation for development and testing
The system is highly adaptable for:
- Adding/removing departments through API
- Configuring different weight ranges per department
- Setting custom high-value thresholds per processing rule
- Supporting multiple customer configurations
- Enabling/disabling departments and processing rules
Despite not implementing the specific licensing features mentioned in the README, the system is well-suited for software productization through:
- Multi-tenant support via processing rules
- Dynamic configuration without code changes
- Scalable architecture ready for enterprise deployment
- Comprehensive API for integration with other systems
The implementation demonstrates a professional, enterprise-grade solution that goes far beyond the basic requirements, providing a solid foundation for a commercial parcel processing system.