main
3027248 2026-06-29 10:46:44 +02:00
parent d73359ffc2
commit 576220c381
7 changed files with 63 additions and 41 deletions

View File

@ -98,7 +98,6 @@ public abstract class Dokument {
return String.format("%s{nummer='%s', kundenId=%d, datum=%s, status=%s}", return String.format("%s{nummer='%s', kundenId=%d, datum=%s, status=%s}",
getClass().getSimpleName(), dokumentNummer, kundenId, datum, status); getClass().getSimpleName(), dokumentNummer, kundenId, datum, status);
} }
}
// === Alias-Methoden für GUI-Kompatibilität === // === Alias-Methoden für GUI-Kompatibilität ===
@ -129,3 +128,4 @@ public abstract class Dokument {
case RECHNUNG -> "Rechnung"; case RECHNUNG -> "Rechnung";
}; };
} }
}

View File

@ -71,7 +71,6 @@ public class DokumentPosition {
"einzelpreisNetto=%s, mwstSatz=%s}", "einzelpreisNetto=%s, mwstSatz=%s}",
produktId, bezeichnungSnapshot, menge, einzelpreisNettoSnapshot, mwstSatzSnapshot); produktId, bezeichnungSnapshot, menge, einzelpreisNettoSnapshot, mwstSatzSnapshot);
} }
}
// === Alias-Methoden für GUI-Kompatibilität === // === Alias-Methoden für GUI-Kompatibilität ===
@ -91,3 +90,4 @@ public class DokumentPosition {
/** Alias für getNettoGesamt() GUI-Kompatibilität. */ /** Alias für getNettoGesamt() GUI-Kompatibilität. */
public BigDecimal getSumme() { return getNettoGesamt(); } public BigDecimal getSumme() { return getNettoGesamt(); }
}

View File

@ -74,7 +74,6 @@ public interface DokumentRepository {
* @return die höchste laufende Nummer oder 0 wenn noch keine existiert * @return die höchste laufende Nummer oder 0 wenn noch keine existiert
*/ */
int findMaxLaufendeNummer(String praefix, int jahr); int findMaxLaufendeNummer(String praefix, int jahr);
}
/** /**
* Gibt alle gespeicherten Dokumente zurück (für die Listenansicht in der GUI). * Gibt alle gespeicherten Dokumente zurück (für die Listenansicht in der GUI).
@ -91,3 +90,4 @@ public interface DokumentRepository {
* @return true wenn gelöscht, false wenn nicht gefunden * @return true wenn gelöscht, false wenn nicht gefunden
*/ */
boolean delete(String nummer); boolean delete(String nummer);
}

View File

@ -94,7 +94,6 @@ public class InMemoryDokumentRepository implements DokumentRepository {
public void clear() { public void clear() {
store.clear(); store.clear();
} }
}
@Override @Override
public List<Dokument> findAll() { public List<Dokument> findAll() {
@ -105,3 +104,4 @@ public class InMemoryDokumentRepository implements DokumentRepository {
public boolean delete(String nummer) { public boolean delete(String nummer) {
return store.remove(nummer) != null; return store.remove(nummer) != null;
} }
}

View File

@ -337,6 +337,8 @@ public class ProduktPanel extends JPanel {
public java.util.Optional<de.hsmannheim.faktura.dokumente.domain.Dokument> findByNummer(String n) { return java.util.Optional.empty(); } public java.util.Optional<de.hsmannheim.faktura.dokumente.domain.Dokument> findByNummer(String n) { return java.util.Optional.empty(); }
public List<de.hsmannheim.faktura.dokumente.domain.Dokument> findByKunde(long id) { return List.of(); } public List<de.hsmannheim.faktura.dokumente.domain.Dokument> findByKunde(long id) { return List.of(); }
public boolean existsFolgedokument(String q) { return false; } public boolean existsFolgedokument(String q) { return false; }
public List<de.hsmannheim.faktura.dokumente.domain.Dokument> findAll() { return List.of(); }
public boolean delete(String n) { return false; }
}; };
} }
} }

View File

@ -34,6 +34,8 @@ public class ProductPerformanceTest {
@Override public java.util.Optional<de.hsmannheim.faktura.dokumente.domain.Dokument> findByNummer(String n) { return java.util.Optional.empty(); } @Override public java.util.Optional<de.hsmannheim.faktura.dokumente.domain.Dokument> findByNummer(String n) { return java.util.Optional.empty(); }
@Override public List<de.hsmannheim.faktura.dokumente.domain.Dokument> findByKunde(long id) { return java.util.List.of(); } @Override public List<de.hsmannheim.faktura.dokumente.domain.Dokument> findByKunde(long id) { return java.util.List.of(); }
@Override public boolean existsFolgedokument(String q) { return false; } @Override public boolean existsFolgedokument(String q) { return false; }
@Override public List<de.hsmannheim.faktura.dokumente.domain.Dokument> findAll() { return java.util.List.of(); }
@Override public boolean delete(String n) { return false; }
}; };
ProductService service = new ProductService(repo, dummyDocRepo); ProductService service = new ProductService(repo, dummyDocRepo);

View File

@ -68,6 +68,16 @@ public class ProductServiceTest {
public boolean existsFolgedokument(String quellDokumentNummer) { public boolean existsFolgedokument(String quellDokumentNummer) {
throw new UnsupportedOperationException("Unimplemented method 'existsFolgedokument'"); throw new UnsupportedOperationException("Unimplemented method 'existsFolgedokument'");
} }
@Override
public List<Dokument> findAll() {
throw new UnsupportedOperationException("Unimplemented method 'findAll'");
}
@Override
public boolean delete(String nummer) {
throw new UnsupportedOperationException("Unimplemented method 'delete'");
}
}; };
productService = new ProductService(productRepository, dokumentRepository); productService = new ProductService(productRepository, dokumentRepository);
@ -205,6 +215,14 @@ public class ProductServiceTest {
public boolean existsFolgedokument(String quellDokumentNummer) { public boolean existsFolgedokument(String quellDokumentNummer) {
throw new UnsupportedOperationException("Unimplemented method 'existsFolgedokument'"); throw new UnsupportedOperationException("Unimplemented method 'existsFolgedokument'");
} }
@Override
public List<Dokument> findAll() {
throw new UnsupportedOperationException("Unimplemented method 'findAll'");
}
@Override
public boolean delete(String nummer) {
throw new UnsupportedOperationException("Unimplemented method 'delete'");
}
}; };
ProductService serviceWithSperre = new ProductService(productRepository, mockRepo); ProductService serviceWithSperre = new ProductService(productRepository, mockRepo);