feat(billing): implement support for Tagesabschluss and Buchung cancellations
- Added `Tagesabschluss` entity and repository to handle daily cash closing logic. - Introduced cancellation logic for `Buchung`, enabling creation of offsetting entries. - Extended schema definitions with `TagesabschlussTable` and nullable `storniertBuchungId` in `BuchungTable`. - Updated services to support `Tagesabschluss` creation and `Buchung` cancellation. - Implemented tests for `TagesabschlussService` and cancellation functionality. - Updated documentation to reflect completed roadmap items related to cash management.
This commit is contained in:
+18
-1
@@ -36,7 +36,24 @@ data class Buchung constructor(
|
||||
val typ: BuchungsTyp,
|
||||
val verwendungszweck: String,
|
||||
@Serializable(with = InstantSerializer::class)
|
||||
val gebuchtAm: Instant = Clock.System.now()
|
||||
val gebuchtAm: Instant = Clock.System.now(),
|
||||
val storniertBuchungId: Uuid? = null // Referenz auf die ursprüngliche Buchung, falls dies ein Storno ist
|
||||
)
|
||||
|
||||
/**
|
||||
* Repräsentiert einen Kassa-Tagesabschluss.
|
||||
*/
|
||||
@Serializable
|
||||
data class Tagesabschluss(
|
||||
val tagesabschlussId: Uuid = Uuid.random(),
|
||||
val veranstaltungId: Uuid,
|
||||
val abgeschlossenAm: Instant = Clock.System.now(),
|
||||
val abgeschlossenVon: String,
|
||||
val summeBarCent: Long,
|
||||
val summeKarteCent: Long,
|
||||
val summeGutschriftCent: Long,
|
||||
val anzahlBuchungen: Int,
|
||||
val bemerkungen: String? = null
|
||||
)
|
||||
|
||||
@Serializable
|
||||
|
||||
+16
@@ -3,7 +3,9 @@
|
||||
package at.mocode.billing.domain.repository
|
||||
|
||||
import at.mocode.billing.domain.model.Buchung
|
||||
import at.mocode.billing.domain.model.Tagesabschluss
|
||||
import at.mocode.billing.domain.model.TeilnehmerKonto
|
||||
import kotlin.time.Instant
|
||||
import kotlin.uuid.ExperimentalUuidApi
|
||||
import kotlin.uuid.Uuid
|
||||
|
||||
@@ -24,5 +26,19 @@ interface TeilnehmerKontoRepository {
|
||||
*/
|
||||
interface BuchungRepository {
|
||||
fun findByKonto(kontoId: Uuid): List<Buchung>
|
||||
fun findById(buchungId: Uuid): Buchung?
|
||||
fun findByVeranstaltungAndZeitraum(
|
||||
veranstaltungId: Uuid,
|
||||
von: Instant,
|
||||
bis: Instant
|
||||
): List<Buchung>
|
||||
fun save(buchung: Buchung): Buchung
|
||||
}
|
||||
|
||||
/**
|
||||
* Repository für den Zugriff auf Tagesabschlüsse.
|
||||
*/
|
||||
interface TagesabschlussRepository {
|
||||
fun findByVeranstaltung(veranstaltungId: Uuid): List<Tagesabschluss>
|
||||
fun save(abschluss: Tagesabschluss): Tagesabschluss
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user