Add booking SSE stream and emit on updates
All checks were successful
build-and-deploy / build-deploy (push) Successful in 32s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 32s
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.android.trisolarisserver.controller
|
||||
|
||||
import com.android.trisolarisserver.component.BookingEvents
|
||||
import com.android.trisolarisserver.component.PropertyAccess
|
||||
import com.android.trisolarisserver.controller.dto.ChargeCreateRequest
|
||||
import com.android.trisolarisserver.controller.dto.ChargeResponse
|
||||
@@ -29,7 +30,8 @@ class Charges(
|
||||
private val propertyAccess: PropertyAccess,
|
||||
private val bookingRepo: BookingRepo,
|
||||
private val chargeRepo: ChargeRepo,
|
||||
private val appUserRepo: AppUserRepo
|
||||
private val appUserRepo: AppUserRepo,
|
||||
private val bookingEvents: BookingEvents
|
||||
) {
|
||||
|
||||
@PostMapping
|
||||
@@ -65,7 +67,9 @@ class Charges(
|
||||
occurredAt = occurredAt,
|
||||
createdBy = createdBy
|
||||
)
|
||||
return chargeRepo.save(charge).toResponse()
|
||||
val saved = chargeRepo.save(charge).toResponse()
|
||||
bookingEvents.emit(propertyId, bookingId)
|
||||
return saved
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
|
||||
Reference in New Issue
Block a user