Skip to content

Commit

Permalink
Merge pull request #113 from Onlineberatung/ob-5247-extended-statistics
Browse files Browse the repository at this point in the history
fix: pass adviceseeker id to the booking event
  • Loading branch information
tkuzynow authored Aug 31, 2023
2 parents e8448af + 757cb72 commit 672d592
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions services/statisticsservice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ components:
type: string
bookingId:
type: integer
adviceSeekerId:
type: string

BookingRescheduledStatisticsEventMessage:
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,21 @@ public EventType getEventType() {
/** {@inheritDoc} */
@Override
public Optional<String> getPayload() {

var bookingCreatedStatisticsEventMessage =
new BookingCreatedStatisticsEventMessage()
.eventType(EVENT_TYPE)
.userId(consultantId)
.userRole(com.vi.appointmentservice.statisticsservice.generated.web.model.UserRole.CONSULTANT)
.userRole(
com.vi.appointmentservice.statisticsservice.generated.web.model.UserRole.CONSULTANT)
.timestamp(CustomOffsetDateTime.nowInUtc())
.type(payload.getType())
.title(payload.getTitle())
.startTime(toIsoTime(payload.getStartTime().toLocalDateTime()))
.endTime(toIsoTime(payload.getEndTime().toLocalDateTime()))
.uid(payload.getUid())
.bookingId(payload.getBookingId()
);
.bookingId(payload.getBookingId())
.adviceSeekerId(payload.getMetadata().getUser());

try {
return Optional.of(OBJECT_MAPPER.writeValueAsString(bookingCreatedStatisticsEventMessage));
Expand Down

0 comments on commit 672d592

Please sign in to comment.