Implementiere ComplianceService mit 100% Test-Coverage (TC-001–010) #6

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

Ziel

ComplianceService.java mit vollständiger CanG-Quota-Logik implementieren:

public class ComplianceService {
    public boolean canDistribute(Long memberId, BigDecimal requestedGrams);
    public BigDecimal getRemainingDailyQuota(Long memberId);
    public BigDecimal getRemainingMonthlyQuota(Long memberId);
    public boolean isUnder21Restricted(Long memberId);
}

CanG-Limits (ComplianceConstants.java)

  • 25g/Tag (alle Mitglieder)
  • 50g/Monat (Erwachsene ≥21)
  • 30g/Monat (unter 21)
  • 10% THC-Limit-Flag (unter 21)

Test Cases (TC-001–010)

  • TC-001: Daily limit 25g enforcement
  • TC-002: Adult monthly limit 50g
  • TC-003: Under-21 monthly limit 30g
  • TC-004: Partial distribution within limits
  • TC-005: Distribution at exact limit boundary
  • TC-006: Rejection when limit exceeded
  • TC-007: Daily reset at midnight
  • TC-008: Monthly reset on 1st of month
  • TC-009: Multiple distributions same day accumulate correctly
  • TC-010: THC flag for under-21 strains

Akzeptanzkriterien

  • JaCoCo 100% Coverage Gate auf ComplianceService
  • ComplianceConstants.java einzige Quelle für alle Grenzwerte
  • Keine Magic Numbers im Code

Referenz

Test Plan TC-001–010

## Ziel `ComplianceService.java` mit vollständiger CanG-Quota-Logik implementieren: ```java public class ComplianceService { public boolean canDistribute(Long memberId, BigDecimal requestedGrams); public BigDecimal getRemainingDailyQuota(Long memberId); public BigDecimal getRemainingMonthlyQuota(Long memberId); public boolean isUnder21Restricted(Long memberId); } ``` ## CanG-Limits (ComplianceConstants.java) - 25g/Tag (alle Mitglieder) - 50g/Monat (Erwachsene ≥21) - 30g/Monat (unter 21) - 10% THC-Limit-Flag (unter 21) ## Test Cases (TC-001–010) - TC-001: Daily limit 25g enforcement - TC-002: Adult monthly limit 50g - TC-003: Under-21 monthly limit 30g - TC-004: Partial distribution within limits - TC-005: Distribution at exact limit boundary - TC-006: Rejection when limit exceeded - TC-007: Daily reset at midnight - TC-008: Monthly reset on 1st of month - TC-009: Multiple distributions same day accumulate correctly - TC-010: THC flag for under-21 strains ## Akzeptanzkriterien - [ ] JaCoCo 100% Coverage Gate auf `ComplianceService` - [ ] `ComplianceConstants.java` einzige Quelle für alle Grenzwerte - [ ] Keine Magic Numbers im Code ## Referenz [Test Plan TC-001–010](http://truenas.local:30008/pplate/pi_mcps/wiki/CannaManage-08-TestPlan)
pplate added this to the Phase 0 — Foundation (Wochen 1–8) milestone 2026-04-06 11:57:08 +02:00
pplate added the cannamanagefeat labels 2026-04-06 11:57:08 +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#6