Skip to content

Kakfa Related Changes in Payload#6

Merged
Shubham4026 merged 1 commit into
mainfrom
dev-release
May 12, 2026
Merged

Kakfa Related Changes in Payload#6
Shubham4026 merged 1 commit into
mainfrom
dev-release

Conversation

@Shubham4026
Copy link
Copy Markdown
Collaborator

No description provided.

@Shubham4026 Shubham4026 merged commit d0d30d3 into main May 12, 2026
1 check passed
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces comprehensive documentation for Kafka event schemas and their mapping to the Central DB, alongside a new survey template CSV. The ResponseService was updated to include context information and response data in Kafka events. Review feedback correctly identified missing responseId fields in the RESPONSE_STARTED and RESPONSE_SUBMITTED event payloads, which are necessary for consistency with the documentation. Additionally, the reviewer suggested refining the terminology from 'partial' to 'snapshot' when describing responseData in the documentation to better reflect that the full current state is sent.

Comment on lines +122 to +123
contextType: saved.contextType,
contextId: saved.contextId,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The responseId is missing from the data payload for the RESPONSE_STARTED event. To maintain consistency with the documentation in KAFKA_EVENTS.md (line 207) and other response events like RESPONSE_UPDATED, it should be included in the data object.

Suggested change
contextType: saved.contextType,
contextId: saved.contextId,
responseId: saved.responseId,
contextType: saved.contextType,
contextId: saved.contextId,

Comment on lines +425 to +426
contextType: saved.contextType,
contextId: saved.contextId,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The responseId is missing from the data payload for the RESPONSE_SUBMITTED event. This contradicts the documentation in KAFKA_EVENTS.md (line 263). Including it ensures consistency across all response events.

Suggested change
contextType: saved.contextType,
contextId: saved.contextId,
responseId: saved.responseId,
contextType: saved.contextType,
contextId: saved.contextId,

Comment thread KAFKA_EVENTS.md
```

> `respondentId` is **not included** in this event — look up the existing row by `responseId` to get it.
> `responseData` here is **partial** — only fields answered so far. Always check `status` before using it for reporting.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Describing responseData as "partial" in the RESPONSE_UPDATED event is slightly misleading. Since the service merges updates and sends the full current state of the response data, it is more accurate to describe it as a "snapshot" or "current state". This clarifies that the consumer receives the full set of answers collected so far, rather than just a delta of the changes.

Suggested change
> `responseData` here is **partial** — only fields answered so far. Always check `status` before using it for reporting.
> `responseData` here is a **snapshot** of all fields answered so far. Always check `status` before using it for reporting.

Comment thread KAFKA_CONSUMER_MAPPING.md
| Kafka Event | Action |
|---|---|
| `RESPONSE_STARTED` | **INSERT** — SurveyTrackingID, SurveyID, TenantID, TargetRoleUserId, Context, ContextId, Status = `in_progress`, CreatedAt, SurveySummary = `null` |
| `RESPONSE_UPDATED` | **UPDATE** — Status, Context, ContextId, SurveySummary = partial responseData, UpdatedAt |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The term "partial" here should be updated to "snapshot" or "current state" to match the actual behavior of the producer, which sends the full merged state of the response data in the RESPONSE_UPDATED event.

Suggested change
| `RESPONSE_UPDATED` | **UPDATE** — Status, Context, ContextId, SurveySummary = partial responseData, UpdatedAt |
| `RESPONSE_UPDATED` | **UPDATE** — Status, Context, ContextId, SurveySummary = snapshot responseData, UpdatedAt |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant