Skip to content

Commit

Permalink
Merge pull request Onlineberatung#68 from Onlineberatung/OB-5247-stor…
Browse files Browse the repository at this point in the history
…e-tenant-id-in-events

fix: store tenant id in metadata to enable filtering by tenant id
  • Loading branch information
tkuzynow authored Sep 18, 2023
2 parents 6aae5f7 + 7f66acb commit b779e5d
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 2 deletions.
13 changes: 13 additions & 0 deletions api/statisticsservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@ components:
receiverId:
type: string
description: receiving user id of the message (taken from session). Can be null for groupchat.
tenantId:
type: integer
format: int64
description: The id of the tenant
example: 1

StartVideoCallStatisticsEventMessage:
type: object
Expand All @@ -253,6 +258,10 @@ components:
type: string
description: The uuid of the video call
example: 123e4567-e89b-12d3-a456-556642440000
tenantId:
type: integer
format: int64
description: The id of the tenant

StopVideoCallStatisticsEventMessage:
type: object
Expand Down Expand Up @@ -402,6 +411,10 @@ components:
type: integer
adviceSeekerId:
type: string
tenantId:
type: integer
format: int64
description: The id of the tenant

BookingRescheduledStatisticsEventMessage:
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ private BookingCreatedMetaData buildMetaData(BookingCreatedStatisticsEventMessag
.bookingId(eventMessage.getBookingId())
.currentBookingId(eventMessage.getBookingId())
.adviceSeekerId(eventMessage.getAdviceSeekerId())
.tenantId(eventMessage.getTenantId())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ public void receiveMessage(CreateMessageStatisticsEventMessage eventMessage) {
}

private CreateMessageMetaData buildMetaData(CreateMessageStatisticsEventMessage eventMessage) {
return CreateMessageMetaData.builder().receiverId(eventMessage.getReceiverId()).hasAttachment(eventMessage.getHasAttachment()).build();
return CreateMessageMetaData.builder()
.receiverId(eventMessage.getReceiverId())
.hasAttachment(eventMessage.getHasAttachment())
.tenantId(eventMessage.getTenantId())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public void receiveMessage(StartVideoCallStatisticsEventMessage eventMessage) {
private StartVideoCallMetaData buildMetaData(StartVideoCallStatisticsEventMessage eventMessage) {
return StartVideoCallMetaData.builder()
.videoCallUuid(eventMessage.getVideoCallUuid())
.tenantId(eventMessage.getTenantId())
.duration(0)
.timestampStop(null)
.status(VideoCallStatus.ONGOING)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class BookingCreatedMetaData implements AdviceSeekerAwareMetaData {
private String uid;
private Integer bookingId;
private Integer currentBookingId;

private String adviceSeekerId;
private Long tenantId;

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ public class CreateMessageMetaData {
private boolean hasAttachment;
private String receiverId;

private Long tenantId;

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ public class StartVideoCallMetaData implements AdviceSeekerAwareMetaData {
private VideoCallStatus status;
private String adviceSeekerId;

private Long tenantId;

}

0 comments on commit b779e5d

Please sign in to comment.