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:
@@ -1,3 +1,7 @@
|
||||
@file:OptIn(ExperimentalWasmDsl::class)
|
||||
|
||||
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
|
||||
|
||||
plugins {
|
||||
alias(libs.plugins.kotlinMultiplatform)
|
||||
alias(libs.plugins.kotlinSerialization)
|
||||
@@ -8,19 +12,24 @@ kotlin {
|
||||
js(IR) {
|
||||
browser()
|
||||
}
|
||||
wasmJs {
|
||||
browser()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
dependencies {
|
||||
implementation(projects.core.coreDomain)
|
||||
implementation(projects.core.coreUtils)
|
||||
implementation(libs.kotlinx.datetime)
|
||||
}
|
||||
commonMain.dependencies {
|
||||
implementation(projects.core.coreDomain)
|
||||
implementation(projects.core.coreUtils)
|
||||
implementation(libs.kotlinx.datetime)
|
||||
}
|
||||
val commonTest by getting {
|
||||
dependencies {
|
||||
implementation(kotlin("test"))
|
||||
}
|
||||
|
||||
commonTest.dependencies {
|
||||
implementation(kotlin("test"))
|
||||
}
|
||||
|
||||
jvmTest.dependencies {
|
||||
implementation(projects.platform.platformTesting)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -14,6 +14,7 @@ interface TeilnehmerKontoRepository {
|
||||
fun findByVeranstaltungAndPerson(veranstaltungId: Uuid, personId: Uuid): TeilnehmerKonto?
|
||||
fun findById(kontoId: Uuid): TeilnehmerKonto?
|
||||
fun findByVeranstaltung(veranstaltungId: Uuid): List<TeilnehmerKonto>
|
||||
fun findOffenePosten(veranstaltungId: Uuid): List<TeilnehmerKonto>
|
||||
fun save(konto: TeilnehmerKonto): TeilnehmerKonto
|
||||
fun updateSaldo(kontoId: Uuid, saldoCent: Long): Long
|
||||
}
|
||||
|
||||
+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