Implementiere AbstractTenantEntity @MappedSuperclass #4

Open
opened 2026-04-06 11:56:41 +02:00 by pplate · 0 comments
Owner

Ziel

Basis-Klasse für Multi-Tenancy auf allen JPA-Entities:

@MappedSuperclass
public abstract class AbstractTenantEntity {
    @Id @GeneratedValue
    private Long id;
    
    @Column(nullable = false)
    private String tenantId;
    
    // Audit fields
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
}

Akzeptanzkriterien

  • Alle 8 JPA-Entities erben von AbstractTenantEntity
  • tenantId auf KEINER Entity überschreibbar (Sicherheit)
  • @PrePersist / @PreUpdate für Audit-Timestamps
  • Unit-Tests für Tenant-Isolation: kein Cross-Tenant-Leak

Referenz

Architecture Doc — 8-Entity ERD

## Ziel Basis-Klasse für Multi-Tenancy auf allen JPA-Entities: ```java @MappedSuperclass public abstract class AbstractTenantEntity { @Id @GeneratedValue private Long id; @Column(nullable = false) private String tenantId; // Audit fields private LocalDateTime createdAt; private LocalDateTime updatedAt; } ``` ## Akzeptanzkriterien - [ ] Alle 8 JPA-Entities erben von `AbstractTenantEntity` - [ ] `tenantId` auf KEINER Entity überschreibbar (Sicherheit) - [ ] `@PrePersist` / `@PreUpdate` für Audit-Timestamps - [ ] Unit-Tests für Tenant-Isolation: kein Cross-Tenant-Leak ## Referenz [Architecture Doc](http://truenas.local:30008/pplate/pi_mcps/wiki/CannaManage-03-Architecture) — 8-Entity ERD
pplate added this to the Phase 0 — Foundation (Wochen 1–8) milestone 2026-04-06 11:56:41 +02:00
pplate added the cannamanagefeat labels 2026-04-06 11:56:41 +02:00
pplate added this to the CannaManage — B2B SaaS für Cannabis Social Clubs project 2026-04-06 12:30:02 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: pplate/pi_mcps#4