FS-PRD-001: Product Functions¶
| Property | Value |
|---|---|
| ID | FS-PRD-001 |
| Version | 1.0 |
| Corresponding URS | URS-PRD-001 |
| Status | Draft |
| Author | |
| Approved By | |
| Date |
Architecture Reference¶
Functional Specifications¶
FS-PRD-001.1: Product CRUD Operations¶
Covers URS: URS-PRD-001.1
Input Specification (Create):
| Parameter | Type | Constraints | Required |
|---|---|---|---|
| ArticleNumber | string | Unique, max 50 chars | Yes |
| DisplayName | string | Max 100 chars | Yes |
| Creator | string | Max 30 chars | Yes |
Output Specification:
| Field | Type | Description |
|---|---|---|
| Uid | long | Auto-generated product UID |
| ArticleNumber | string | Product identifier |
| DisplayName | string | Display name |
| Timestamp | datetime | Creation timestamp |
| Crc | long | Integrity checksum |
Error Handling:
| Error Condition | Response | HTTP Status |
|---|---|---|
| Duplicate article number | "Article number already exists" | 409 |
| Missing required fields | Validation error | 400 |
| Product not found (GET/PUT/DELETE) | "Product not found" | 404 |
Business Rules: - Article number must be unique across all products - CRC calculated via two-phase insert (ADR-003)
FS-PRD-001.2: Version Management¶
Covers URS: URS-PRD-001.2
Input Specification (Create Version):
| Parameter | Type | Constraints | Required |
|---|---|---|---|
| ProductUid | long | Must reference existing product | Yes |
| VersionNumber | string | Max 50 chars | No |
| IsReleased | bool | Default: false | No |
| IsFavorite | bool | Default: false | No |
| FactorySetupUid | long? | References setup configuration | No |
| Creator | string | Max 30 chars | Yes |
Output Specification:
| Field | Type | Description |
|---|---|---|
| Uid | long | Auto-generated version UID |
| ProductUid | long | Parent product |
| IsReleased | bool | Release flag |
| IsFavorite | bool | Favorite flag |
| FactorySetupUid | long? | Factory setup reference |
Business Rules: - Version is always associated with exactly one product - Release flag indicates version is approved for production use - Factory setup references a specific parameter configuration
FS-PRD-001.3: Product and Version Search¶
Covers URS: URS-PRD-001.3
Input Specification:
| Parameter | Type | Constraints | Required |
|---|---|---|---|
| SearchTerm | string | Partial match on article number | No |
| ProductUid | long | For version listing | Conditional |
Output Specification: List of ProductDto with nested VersionDto arrays.
FS-PRD-001.4: Bulk Operations¶
Covers URS: URS-PRD-001.4
Business Rules: - All items in a bulk operation are processed within a single transaction - If any item fails validation, the entire batch is rejected - Returns list of created/updated UIDs on success
FS-PRD-001.5: Cascading Delete¶
Covers URS: URS-PRD-001.5
Functional Description: Deletion cascades through the entity hierarchy. Runtime sequence: see arc42/06 s6.2 (transaction scope).
Cascade Order: 1. Delete all parameter mappings for all versions (15+ parameter types) 2. Delete all parameter setups for all versions 3. Delete all versions 4. Delete the product
Business Rules: - All deletions within a single Unit of Work transaction - Rollback if any deletion fails - Changelog entries created for each deleted entity
Error Handling:
| Error Condition | Response | HTTP Status |
|---|---|---|
| Product not found | "Product not found" | 404 |
| Transaction failure | Rollback all changes, return error | 500 |
CQRS Handler Mapping¶
| FS Item | Command/Query | Handler |
|---|---|---|
| FS-PRD-001.1 | CreateProductCommand | CreateProductHandler |
| FS-PRD-001.2 | CreateVersionCommand / SetFactorySetupCommand | CreateVersionHandler / SetFactorySetupHandler |
| FS-PRD-001.3 | GetProductByIdQuery / SearchProductsQuery | GetProductByIdHandler / SearchProductsHandler |
| FS-PRD-001.4 | BulkCreateProductsCommand | BulkCreateProductsHandler |
| FS-PRD-001.5 | DeleteProductWithAllVersionsCommand | DeleteProductWithAllVersionsHandler |