EVENT API GUIDE

BFF SERVICE

The BFF service is a microservice that acts as a bridge between the client and backend services. It provides a unified API for the client to interact with multiple backend services, simplifying the communication process and improving performance.

Architectural Design Credit and Contact Information

The architectural design of this microservice is credited to.
For inquiries, feedback, or further information regarding the architecture, please direct your communication to:

Email:

We encourage open communication and welcome any questions or discussions related to the architectural aspects of this microservice.

Documentation Scope

Welcome to the official documentation for the BFF Service Event Listeners. This guide details the Kafka-based event listeners responsible for reacting to ElasticSearch index events. It describes listener responsibilities, the topics they subscribe to, and expected payloads.

Intended Audience
This documentation is intended for developers, architects, and system administrators involved in the design, implementation, and maintenance of the BFF Service. It assumes familiarity with microservices architecture, the Kafka messaging system, and ElasticSearch.

Overview
Each ElasticSearch index operation (create, update, delete) emits a corresponding event to Kafka. These events are consumed by listeners responsible for executing aggregate functions to ensure index- and system-level consistency.

Kafka Event Listeners

Kafka Event Listener: tutorprofile-created

Event Topic: elastic-index-tutorhub_tutorprofile-created

When a tutorprofile is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the publicTutorProfileViewAggregateData function to enrich and store the final document in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: tutorprofile-updated

Event Topic: elastic-index-tutorhub_tutorprofile-updated

When a tutorprofile is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the publicTutorProfileViewAggregateData function to update the enriched document in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: tutorprofile-deleted

Event Topic: elastic-index-tutorhub>_tutorprofile-deleted

When a tutorprofile is deleted in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the publicTutorProfileViewAggregateData function to handle removal or cleanup in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: user-created

Event Topic: elastic-index-user-created

When a user is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the tutorUserInfoRePublicTutorProfileView function to update dependent documents in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: user-updated

Event Topic: elastic-index-tutorhub>_user-updated

When a user is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the tutorUserInfoRePublicTutorProfileView function to re-enrich dependent data in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: user-deleted

Event Topic: elastic-index-tutorhub>_user-deleted

When a user is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the tutorUserInfoRePublicTutorProfileView function to handle dependent data cleanup or updates.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: coursepack-created

Event Topic: elastic-index-coursepack-created

When a coursepack is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the coursePacksRePublicTutorProfileView function to update dependent documents in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: coursepack-updated

Event Topic: elastic-index-tutorhub>_coursepack-updated

When a coursepack is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the coursePacksRePublicTutorProfileView function to re-enrich dependent data in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: coursepack-deleted

Event Topic: elastic-index-tutorhub>_coursepack-deleted

When a coursepack is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the coursePacksRePublicTutorProfileView function to handle dependent data cleanup or updates.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: coursepack-created

Event Topic: elastic-index-tutorhub_coursepack-created

When a coursepack is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the publicCoursePackViewAggregateData function to enrich and store the final document in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: coursepack-updated

Event Topic: elastic-index-tutorhub_coursepack-updated

When a coursepack is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the publicCoursePackViewAggregateData function to update the enriched document in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: coursepack-deleted

Event Topic: elastic-index-tutorhub>_coursepack-deleted

When a coursepack is deleted in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the publicCoursePackViewAggregateData function to handle removal or cleanup in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: tutorprofile-created

Event Topic: elastic-index-tutorprofile-created

When a tutorprofile is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the tutorProfileRePublicCoursePackView function to update dependent documents in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: tutorprofile-updated

Event Topic: elastic-index-tutorhub>_tutorprofile-updated

When a tutorprofile is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the tutorProfileRePublicCoursePackView function to re-enrich dependent data in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: tutorprofile-deleted

Event Topic: elastic-index-tutorhub>_tutorprofile-deleted

When a tutorprofile is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the tutorProfileRePublicCoursePackView function to handle dependent data cleanup or updates.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: coursecategory-created

Event Topic: elastic-index-coursecategory-created

When a coursecategory is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the categoryInfoRePublicCoursePackView function to update dependent documents in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: coursecategory-updated

Event Topic: elastic-index-tutorhub>_coursecategory-updated

When a coursecategory is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the categoryInfoRePublicCoursePackView function to re-enrich dependent data in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: coursecategory-deleted

Event Topic: elastic-index-tutorhub>_coursecategory-deleted

When a coursecategory is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the categoryInfoRePublicCoursePackView function to handle dependent data cleanup or updates.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: adminissue-created

Event Topic: elastic-index-tutorhub_adminissue-created

When a adminissue is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the issueReportStatusChangedViewAggregateData function to enrich and store the final document in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: adminissue-updated

Event Topic: elastic-index-tutorhub_adminissue-updated

When a adminissue is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the issueReportStatusChangedViewAggregateData function to update the enriched document in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: adminissue-deleted

Event Topic: elastic-index-tutorhub>_adminissue-deleted

When a adminissue is deleted in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the issueReportStatusChangedViewAggregateData function to handle removal or cleanup in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: user-created

Event Topic: elastic-index-user-created

When a user is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the reporterUserReIssueReportStatusChangedView function to update dependent documents in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: user-updated

Event Topic: elastic-index-tutorhub>_user-updated

When a user is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the reporterUserReIssueReportStatusChangedView function to re-enrich dependent data in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: user-deleted

Event Topic: elastic-index-tutorhub>_user-deleted

When a user is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the reporterUserReIssueReportStatusChangedView function to handle dependent data cleanup or updates.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: coursepack-created

Event Topic: elastic-index-coursepack-created

When a coursepack is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the relatedCoursePackReIssueReportStatusChangedView function to update dependent documents in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: coursepack-updated

Event Topic: elastic-index-tutorhub>_coursepack-updated

When a coursepack is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the relatedCoursePackReIssueReportStatusChangedView function to re-enrich dependent data in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: coursepack-deleted

Event Topic: elastic-index-tutorhub>_coursepack-deleted

When a coursepack is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the relatedCoursePackReIssueReportStatusChangedView function to handle dependent data cleanup or updates.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: adminmoderationaction-created

Event Topic: elastic-index-tutorhub_adminmoderationaction-created

When a adminmoderationaction is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the contentModerationActionViewAggregateData function to enrich and store the final document in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: adminmoderationaction-updated

Event Topic: elastic-index-tutorhub_adminmoderationaction-updated

When a adminmoderationaction is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the contentModerationActionViewAggregateData function to update the enriched document in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: adminmoderationaction-deleted

Event Topic: elastic-index-tutorhub>_adminmoderationaction-deleted

When a adminmoderationaction is deleted in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the contentModerationActionViewAggregateData function to handle removal or cleanup in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: user-created

Event Topic: elastic-index-user-created

When a user is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the adminUserReContentModerationActionView function to update dependent documents in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: user-updated

Event Topic: elastic-index-tutorhub>_user-updated

When a user is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the adminUserReContentModerationActionView function to re-enrich dependent data in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: user-deleted

Event Topic: elastic-index-tutorhub>_user-deleted

When a user is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the adminUserReContentModerationActionView function to handle dependent data cleanup or updates.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: coursepack-created

Event Topic: elastic-index-coursepack-created

When a coursepack is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the targetCoursePackReContentModerationActionView function to update dependent documents in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: coursepack-updated

Event Topic: elastic-index-tutorhub>_coursepack-updated

When a coursepack is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the targetCoursePackReContentModerationActionView function to re-enrich dependent data in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: coursepack-deleted

Event Topic: elastic-index-tutorhub>_coursepack-deleted

When a coursepack is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the targetCoursePackReContentModerationActionView function to handle dependent data cleanup or updates.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: tutorprofile-created

Event Topic: elastic-index-tutorprofile-created

When a tutorprofile is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the targetTutorProfileReContentModerationActionView function to update dependent documents in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: tutorprofile-updated

Event Topic: elastic-index-tutorhub>_tutorprofile-updated

When a tutorprofile is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the targetTutorProfileReContentModerationActionView function to re-enrich dependent data in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: tutorprofile-deleted

Event Topic: elastic-index-tutorhub>_tutorprofile-deleted

When a tutorprofile is deleted from the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the targetTutorProfileReContentModerationActionView function to handle dependent data cleanup or updates.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: enrollment-created

Event Topic: elastic-index-tutorhub_enrollment-created

When a enrollment is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the adminDashboardStatsViewAggregateData function to enrich and store the final document in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: enrollment-updated

Event Topic: elastic-index-tutorhub_enrollment-updated

When a enrollment is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the adminDashboardStatsViewAggregateData function to update the enriched document in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: enrollment-deleted

Event Topic: elastic-index-tutorhub>_enrollment-deleted

When a enrollment is deleted in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the adminDashboardStatsViewAggregateData function to handle removal or cleanup in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: coursecategory-created

Event Topic: elastic-index-tutorhub_coursecategory-created

When a coursecategory is created in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the publicCourseCategoryViewAggregateData function to enrich and store the final document in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: coursecategory-updated

Event Topic: elastic-index-tutorhub_coursecategory-updated

When a coursecategory is updated in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the publicCourseCategoryViewAggregateData function to update the enriched document in the related index.

Expected Payload:

{
  "id": "String"
}

Kafka Event Listener: coursecategory-deleted

Event Topic: elastic-index-tutorhub>_coursecategory-deleted

When a coursecategory is deleted in the ElasticSearch index, this listener is triggered. It parses the event payload, extracts the entity ID, and invokes the publicCourseCategoryViewAggregateData function to handle removal or cleanup in the related index.

Expected Payload:

{
  "id": "String"
}