1
0
Fork 0
mirror of https://github.com/s-frick/effigenix.git synced 2026-03-28 10:29:35 +01:00
effigenix/backend
Sebastian Frick 87123df2e4 refactor: EntityDraft-Pattern auf Customer, Article und ProductCategory anwenden
- CustomerDraft / CustomerUpdateDraft eingeführt
- ArticleDraft / ArticleUpdateDraft eingeführt
- ProductCategoryDraft / ProductCategoryUpdateDraft eingeführt
- Customer.create() nimmt jetzt CustomerDraft, gibt Result zurück
- Customer.update(CustomerUpdateDraft) ersetzt 4× updateXxx(VO)
- Article.create() nimmt jetzt ArticleDraft statt VOs
- Article.update(ArticleUpdateDraft) ersetzt rename() + changeCategory()
- ProductCategory.create() nimmt jetzt ProductCategoryDraft, gibt Result zurück
- ProductCategory.update(ProductCategoryUpdateDraft) ersetzt rename() + updateDescription()
- Use Cases bauen Draft aus Command, kein VO-Wissen im Application Layer
- CreateCustomerCommand / UpdateCustomerCommand: int → Integer für paymentDueDays
- CLAUDE.md: EntityDraft-Pattern-Dokumentation ergänzt
2026-02-18 11:56:33 +01:00
..
docs refactor: EntityDraft-Pattern auf Customer, Article und ProductCategory anwenden 2026-02-18 11:56:33 +01:00
src refactor: EntityDraft-Pattern auf Customer, Article und ProductCategory anwenden 2026-02-18 11:56:33 +01:00
.factorypath refactor: restructure repository with separate backend and frontend directories 2026-02-17 22:08:51 +01:00
CLAUDE.md refactor: restructure repository with separate backend and frontend directories 2026-02-17 22:08:51 +01:00
INTEGRATION_TESTS_SUMMARY.md refactor: restructure repository with separate backend and frontend directories 2026-02-17 22:08:51 +01:00
pom.xml refactor: restructure repository with separate backend and frontend directories 2026-02-17 22:08:51 +01:00
README.md refactor: restructure repository with separate backend and frontend directories 2026-02-17 22:08:51 +01:00
TEST_FILES_INDEX.md refactor: restructure repository with separate backend and frontend directories 2026-02-17 22:08:51 +01:00
TEST_SUMMARY.md refactor: restructure repository with separate backend and frontend directories 2026-02-17 22:08:51 +01:00
TESTING_GUIDE.md refactor: restructure repository with separate backend and frontend directories 2026-02-17 22:08:51 +01:00
TODO.md refactor: restructure repository with separate backend and frontend directories 2026-02-17 22:08:51 +01:00
UNIT_TESTS_README.md refactor: restructure repository with separate backend and frontend directories 2026-02-17 22:08:51 +01:00

Effigenix Fleischerei ERP

ERP-System für Fleischereien mit HACCP-Compliance, GoBD-konform, Mehrfilialen-Support.

Architektur

Domain-Driven Design + Clean Architecture + Java 21 + Spring Boot

┌─────────────────────────────────────────────────────┐
│  Presentation (REST Controllers)                     │
└─────────────────────────────────────────────────────┘
                         ↓
┌─────────────────────────────────────────────────────┐
│  Application Layer (Use Cases)                       │
│  - Transaction Script for Generic Subdomains        │
│  - Rich Domain Model for Core Domains               │
└─────────────────────────────────────────────────────┘
                         ↓
┌─────────────────────────────────────────────────────┐
│  Domain Layer (DDD Tactical Patterns)                │
│  - Aggregates, Entities, Value Objects              │
│  - Domain Events, Repositories                      │
└─────────────────────────────────────────────────────┘
                         ↓
┌─────────────────────────────────────────────────────┐
│  Infrastructure Layer                                │
│  - Spring, JPA, PostgreSQL, JWT, REST               │
└─────────────────────────────────────────────────────┘

Bounded Contexts (11)

Core Domains (7)

  • Production Management - Rezeptverwaltung, Chargenproduktion
  • Quality Management - HACCP-Compliance, Temperaturüberwachung
  • Inventory Management - Bestandsführung, Lagerverwaltung
  • Procurement - Einkauf, Wareneingang, Lieferanten
  • Sales - Auftragserfassung, Rechnungsstellung, Kunden

Supporting Domains (3)

  • Labeling - Etikettendruck mit HACCP-Daten
  • Filiales - Mehrfilialen-Verwaltung

Generic Subdomains (3)

  • User Management - Authentifizierung, Autorisierung, Rollen
  • Reporting - Standard-Reports
  • Notifications - E-Mail/SMS-Benachrichtigungen

Tech Stack

  • Java 21 (Records, Sealed Interfaces, Pattern Matching)
  • Spring Boot 3.2 (Spring Security 6, Spring Data JPA 3)
  • PostgreSQL 15+ (Produktiv-DB)
  • JWT (Stateless Authentication)
  • Flyway (Schema Migrations)
  • Maven (Build Tool)

Getting Started

Prerequisites

  • Java 21+
  • Maven 3.9+
  • PostgreSQL 15+
  • Docker (optional, für PostgreSQL)

Database Setup

# PostgreSQL mit Docker
docker run --name effigenix-postgres \
  -e POSTGRES_DB=effigenix \
  -e POSTGRES_USER=effigenix \
  -e POSTGRES_PASSWORD=effigenix \
  -p 5432:5432 \
  -d postgres:15

Build & Run

# Build
mvn clean install

# Run
mvn spring-boot:run

# Run with specific profile
mvn spring-boot:run -Dspring-boot.run.profiles=dev

API Documentation

Nach dem Start verfügbar unter:

Project Structure

src/main/java/com/effigenix/
├── domain/              # Domain Layer (keine Framework-Dependencies!)
│   └── usermanagement/
│       ├── User.java
│       ├── Role.java
│       ├── UserId.java
│       └── UserRepository.java
├── application/         # Application Layer (Use Cases)
│   └── usermanagement/
│       ├── CreateUser.java
│       ├── AuthenticateUser.java
│       └── dto/
├── infrastructure/      # Infrastructure Layer
│   ├── persistence/
│   ├── security/
│   ├── web/
│   └── audit/
└── shared/              # Shared Kernel
    ├── security/        # AuthorizationPort, Action
    └── common/          # Result, ApplicationError

src/main/resources/
└── db/migration/        # Flyway Migrations

User Management (Generic Subdomain)

Vordefinierte Rollen

Rolle Permissions Zielgruppe
ADMIN Alle Systemadministrator
PRODUCTION_MANAGER RECIPE_, BATCH_, PRODUCTION_ORDER_* Leiter Produktion
PRODUCTION_WORKER RECIPE_READ, BATCH_* Produktionsmitarbeiter
QUALITY_MANAGER HACCP_, TEMPERATURE_LOG_ Qualitätsbeauftragter
QUALITY_INSPECTOR TEMPERATURE_LOG_, GOODS_INSPECTION_ QM-Mitarbeiter
PROCUREMENT_MANAGER PURCHASE_ORDER_, SUPPLIER_ Einkaufsleiter
WAREHOUSE_WORKER STOCK_, INVENTORY_COUNT_ Lagermitarbeiter
SALES_MANAGER ORDER_, INVOICE_, CUSTOMER_* Verkaufsleiter
SALES_STAFF ORDER_READ/WRITE, CUSTOMER_READ Verkaufsmitarbeiter

AuthorizationPort (für andere BCs)

// Typsichere, fachliche Authorization - kein direkter Zugriff auf User/Roles!
public interface AuthorizationPort {
    boolean can(Action action);
    void assertCan(Action action);
    boolean can(Action action, ResourceId resource);
    void assertCan(Action action, ResourceId resource);
    ActorId currentActor();
    Optional<BranchId> currentBranch();
}

// Beispiel: Production BC
public class CreateRecipe {
    private final AuthorizationPort authPort;

    public Result<ApplicationError, RecipeDTO> execute(CreateRecipeCommand cmd) {
        authPort.assertCan(ProductionAction.RECIPE_WRITE);
        // Business logic...
    }
}

Testing

# Unit Tests
mvn test

# Integration Tests
mvn verify

# Test Coverage
mvn clean verify jacoco:report

License

Proprietary - Effigenix GmbH

Contact

  • Project Lead: sebi@effigenix.com
  • Architecture: DDD + Clean Architecture
  • Documentation: /docs/mvp/