Include issuer info in card prepare response
All checks were successful
build-and-deploy / build-deploy (push) Successful in 33s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 33s
This commit is contained in:
@@ -48,7 +48,7 @@ class IssuedCards(
|
||||
@AuthenticationPrincipal principal: MyPrincipal?,
|
||||
@RequestBody request: CardPrepareRequest
|
||||
): CardPrepareResponse {
|
||||
requireIssueActor(propertyId, principal)
|
||||
val actor = requireIssueActor(propertyId, principal)
|
||||
val stay = roomStayRepo.findById(roomStayId).orElseThrow {
|
||||
ResponseStatusException(HttpStatus.NOT_FOUND, "Room stay not found")
|
||||
}
|
||||
@@ -73,7 +73,10 @@ class IssuedCards(
|
||||
key = payload.key,
|
||||
timeData = payload.timeData,
|
||||
issuedAt = issuedAt.toString(),
|
||||
expiresAt = expiresAt.toString()
|
||||
expiresAt = expiresAt.toString(),
|
||||
issuerUserId = actor.id,
|
||||
issuerFirebaseUid = actor.firebaseUid,
|
||||
issuerName = actor.name
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class TemporaryRoomCards(
|
||||
@PathVariable roomId: UUID,
|
||||
@AuthenticationPrincipal principal: MyPrincipal?
|
||||
): CardPrepareResponse {
|
||||
requireIssueActor(propertyId, principal)
|
||||
val actor = requireIssueActor(propertyId, principal)
|
||||
val room = roomRepo.findByIdAndPropertyId(roomId, propertyId)
|
||||
?: throw ResponseStatusException(HttpStatus.NOT_FOUND, "Room not found")
|
||||
|
||||
@@ -59,7 +59,10 @@ class TemporaryRoomCards(
|
||||
key = payload.key,
|
||||
timeData = payload.timeData,
|
||||
issuedAt = issuedAt.toString(),
|
||||
expiresAt = expiresAt.toString()
|
||||
expiresAt = expiresAt.toString(),
|
||||
issuerUserId = actor.id,
|
||||
issuerFirebaseUid = actor.firebaseUid,
|
||||
issuerName = actor.name
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -81,5 +81,8 @@ data class CardPrepareResponse(
|
||||
val key: String,
|
||||
val timeData: String,
|
||||
val issuedAt: String,
|
||||
val expiresAt: String
|
||||
val expiresAt: String,
|
||||
val issuerUserId: UUID? = null,
|
||||
val issuerFirebaseUid: String? = null,
|
||||
val issuerName: String? = null
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user