Skip to content

Commit

Permalink
fix: pass adviceseeker id to the booking event
Browse files Browse the repository at this point in the history
  • Loading branch information
tkuzynow committed Aug 30, 2023
1 parent e8448af commit 757cb72
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 757cb72

Please sign in to comment.