Compare commits
No commits in common. "54c1a482b462558d0bba9795e2859c79e019850c" and "d0a53379dbf23fef6b18cf3759812989961cb6b8" have entirely different histories.
54c1a482b4
...
d0a53379db
|
|
@ -113,14 +113,17 @@ public class DokumentServiceImpl implements DokumentService {
|
||||||
public Auftragsbestaetigung erstelleAuftragsbestaetigung(String angebotsNummer) {
|
public Auftragsbestaetigung erstelleAuftragsbestaetigung(String angebotsNummer) {
|
||||||
Angebot angebot = ladeAngebot(angebotsNummer);
|
Angebot angebot = ladeAngebot(angebotsNummer);
|
||||||
|
|
||||||
// Duplikat-Check zuerst (PH-DP-05 / MT-DP-06): wenn bereits eine AB existiert,
|
// Doppelte AB zuerst (PH-DP-05 / MT-DP-06): wenn bereits eine AB für
|
||||||
// ist das Angebot zwangsläufig UEBERFUEHRT und beide Prüfungen würden anschlagen.
|
// dieses Angebot existiert, ist das Angebot zwangsläufig UEBERFUEHRT
|
||||||
// Die Spec verlangt in diesem Szenario explizit DuplicateDocumentException.
|
// und die Status-Prüfung würde ebenfalls anschlagen. Die Spec verlangt
|
||||||
|
// in diesem Szenario eindeutig DuplicateDocumentException, deshalb
|
||||||
|
// muss diese Prüfung vor dem allgemeinen Status-Check stehen.
|
||||||
if (repository.existsFolgedokument(angebotsNummer)) {
|
if (repository.existsFolgedokument(angebotsNummer)) {
|
||||||
throw new DuplicateDocumentException(angebotsNummer);
|
throw new DuplicateDocumentException(angebotsNummer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allgemeiner Status-Check (PH-DP-04): greift bei anderen Nicht-OFFEN-Zuständen.
|
// Allgemeine Status-Prüfung (PH-DP-04): blockiert auch andere
|
||||||
|
// Nicht-OFFEN-Zustände (z. B. ABGELEHNT, falls künftig ergänzt).
|
||||||
if (angebot.getStatus() != DokumentStatus.OFFEN) {
|
if (angebot.getStatus() != DokumentStatus.OFFEN) {
|
||||||
throw new IllegalStateException(
|
throw new IllegalStateException(
|
||||||
"Angebot " + angebotsNummer + " ist nicht mehr OFFEN (Status: " +
|
"Angebot " + angebotsNummer + " ist nicht mehr OFFEN (Status: " +
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue