# Powder Coating Management System - Project Structure

## Solution Architecture

This solution follows Clean Architecture principles with separation of concerns.

### Projects Overview

```
PowderCoatingApp/
├── src/
│   ├── PowderCoating.Web/                 # ASP.NET Core MVC Web Application
│   ├── PowderCoating.Api/                 # RESTful API for Mobile & Web
│   ├── PowderCoating.Core/                # Domain Entities & Interfaces
│   ├── PowderCoating.Application/         # Business Logic & Services
│   ├── PowderCoating.Infrastructure/      # Data Access & External Services
│   └── PowderCoating.Shared/              # Shared DTOs & Constants
├── tests/
│   ├── PowderCoating.UnitTests/
│   └── PowderCoating.IntegrationTests/
└── docs/
    ├── API_DOCUMENTATION.md
    └── USER_GUIDE.md
```

## Technology Stack

- **Framework:** .NET 10.0
- **Database:** SQL Server
- **ORM:** Entity Framework Core 10.0
- **Authentication:** ASP.NET Core Identity + JWT (for mobile)
- **Real-time:** SignalR
- **AI/ML:** ML.NET + Azure OpenAI/Semantic Kernel
- **Mobile Support:** RESTful API with JWT authentication
- **Caching:** Redis (optional) or In-Memory Cache

## Project Responsibilities

### 1. PowderCoating.Core (Domain Layer)
- Entity models
- Domain interfaces
- Enumerations
- Domain exceptions
- Value objects

### 2. PowderCoating.Application (Application Layer)
- Service interfaces and implementations
- DTOs (Data Transfer Objects)
- Mapping profiles (AutoMapper)
- Validators (FluentValidation)
- Business logic
- AI/ML integration services

### 3. PowderCoating.Infrastructure (Infrastructure Layer)
- DbContext and configurations
- Repository implementations
- External service integrations
- File storage
- Email services
- Caching implementations

### 4. PowderCoating.Web (Presentation - Web)
- MVC Controllers and Views
- ViewModels
- SignalR Hubs
- Static files
- Web-specific middleware

### 5. PowderCoating.Api (Presentation - API)
- API Controllers
- JWT authentication
- Swagger/OpenAPI documentation
- API-specific middleware
- Mobile endpoints

### 6. PowderCoating.Shared
- Common DTOs
- Constants
- Enums
- Helper classes
- Extension methods

## Key Features by Module

### Customer Management
- CRUD operations
- Contact history
- Credit limits
- Custom pricing tiers

### Employee Management
- User profiles
- Roles & permissions
- Time tracking integration
- Performance metrics

### Job Management
- Job creation & tracking
- Status workflow
- Photo attachments
- Customer approval system

### Inventory Management
- Powder inventory
- Material tracking
- Reorder alerts
- Supplier management

### Maintenance Module
- Equipment tracking
- Maintenance schedules
- Service history
- Downtime tracking

### Quoting System
- AI-powered pricing suggestions
- Commercial vs. Non-commercial templates
- Material cost calculations
- Labor estimation
- Quote history & conversion tracking

### Shop Floor Display
- Real-time job board
- Priority queuing
- Employee assignment
- Status updates via SignalR

## Database Schema (High-Level)

### Core Tables
- Users (Identity)
- Customers
- Employees
- Jobs
- JobItems
- Quotes
- QuoteItems
- Inventory
- InventoryTransactions
- Equipment
- MaintenanceRecords
- UserPreferences
- AuditLogs

## Next Steps

1. Create solution and project files
2. Set up dependency injection
3. Configure Entity Framework Core
4. Implement Identity system
5. Create base entities and repositories
6. Set up database migrations
