Skip to content

Commit

Permalink
Provide user name to slack message service
Browse files Browse the repository at this point in the history
  • Loading branch information
KjellBerlin committed Sep 23, 2024
1 parent fb2aced commit 389adde
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/main/kotlin/com/carbonara/core/slack/SlackService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class SlackService(
suspend fun handleOrderStatusUpdate(
orderId: String,
slackOrderStatus: String,
messageTimestamp: String
messageTimestamp: String,
userName: String
) {
val orderStatus = mapSlackOrderStatusToOrderStatus(slackOrderStatus)
val order = orderService.updateOrderStatus(
Expand All @@ -28,7 +29,8 @@ class SlackService(
googleMapsLink = order.deliveryAddress.createGoogleMapsLink(),
productNames = order.products.map { it.productName },
timeStamp = messageTimestamp,
orderStatus = orderStatus
orderStatus = orderStatus,
userName = userName
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class SlackDeliveryWebhookController(
slackService.handleOrderStatusUpdate(
orderId = action.value,
slackOrderStatus = action.action_id,
messageTimestamp = slackPayload.message.ts
messageTimestamp = slackPayload.message.ts,
userName = slackPayload.user.username
)
}

Expand Down

0 comments on commit 389adde

Please sign in to comment.