Remove domain models and services related to Abteilung, AbteilungsRegelService, and Bewerb: cleanup unnecessary entities, validation logic, and tests across backend modules.
This commit is contained in:
+14
@@ -123,6 +123,20 @@ class BillingController(
|
||||
.body(pdf)
|
||||
}
|
||||
|
||||
@GetMapping("/veranstaltungen/{veranstaltungId}/offene-posten")
|
||||
fun getOffenePosten(@PathVariable veranstaltungId: String): ResponseEntity<List<KontoDto>> {
|
||||
val uuid = try { Uuid.parse(veranstaltungId) } catch (_: Exception) { return ResponseEntity.badRequest().build() }
|
||||
val konten = kontoService.getOffenePosten(uuid)
|
||||
return ResponseEntity.ok(konten.map { it.toDto() })
|
||||
}
|
||||
|
||||
@GetMapping("/veranstaltungen/{veranstaltungId}/konten")
|
||||
fun getKontenFuerVeranstaltung(@PathVariable veranstaltungId: String): ResponseEntity<List<KontoDto>> {
|
||||
val uuid = try { Uuid.parse(veranstaltungId) } catch (_: Exception) { return ResponseEntity.badRequest().build() }
|
||||
val konten = kontoService.getKontenFuerVeranstaltung(uuid)
|
||||
return ResponseEntity.ok(konten.map { it.toDto() })
|
||||
}
|
||||
|
||||
private fun TeilnehmerKonto.toDto() = KontoDto(
|
||||
kontoId = kontoId.toString(),
|
||||
veranstaltungId = veranstaltungId.toString(),
|
||||
|
||||
+6
@@ -88,4 +88,10 @@ class TeilnehmerKontoService(
|
||||
kontoRepository.findByVeranstaltung(veranstaltungId)
|
||||
}
|
||||
}
|
||||
|
||||
fun getOffenePosten(veranstaltungId: Uuid): List<TeilnehmerKonto> {
|
||||
return transaction {
|
||||
kontoRepository.findOffenePosten(veranstaltungId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
@@ -10,6 +10,7 @@ import at.mocode.billing.domain.repository.TeilnehmerKontoRepository
|
||||
import org.jetbrains.exposed.v1.core.ResultRow
|
||||
import org.jetbrains.exposed.v1.core.and
|
||||
import org.jetbrains.exposed.v1.core.eq
|
||||
import org.jetbrains.exposed.v1.core.less
|
||||
import org.jetbrains.exposed.v1.datetime.CurrentTimestamp
|
||||
import org.jetbrains.exposed.v1.jdbc.insert
|
||||
import org.jetbrains.exposed.v1.jdbc.selectAll
|
||||
@@ -44,6 +45,13 @@ class ExposedTeilnehmerKontoRepository : TeilnehmerKontoRepository {
|
||||
.map { it.toModel() }
|
||||
}
|
||||
|
||||
override fun findOffenePosten(veranstaltungId: Uuid): List<TeilnehmerKonto> {
|
||||
return TeilnehmerKontoTable
|
||||
.selectAll()
|
||||
.where { (TeilnehmerKontoTable.veranstaltungId eq veranstaltungId) and (TeilnehmerKontoTable.saldoCent less 0) }
|
||||
.map { it.toModel() }
|
||||
}
|
||||
|
||||
override fun save(konto: TeilnehmerKonto): TeilnehmerKonto {
|
||||
val existing = findById(konto.kontoId)
|
||||
if (existing == null) {
|
||||
|
||||
Reference in New Issue
Block a user