chore: Rename all event keys to uppercase (#7787)

* chore: Rename all event keys to uppercase

* fix: Remove main entity from event builder
This commit is contained in:
Stevche Radevski
2024-06-21 10:41:35 +02:00
committed by GitHub
parent 937a632eb6
commit ee35379e21
22 changed files with 166 additions and 187 deletions

View File

@@ -175,7 +175,7 @@ moduleIntegrationTestRunner<IUserModuleService>({
expect(eventBusSpy).toHaveBeenCalledWith([
expect.objectContaining({
data: { id: "1" },
eventName: UserEvents.invite_updated,
eventName: UserEvents.INVITE_UPDATED,
}),
])
})
@@ -192,7 +192,7 @@ moduleIntegrationTestRunner<IUserModuleService>({
expect(eventBusSpy).toHaveBeenCalledWith([
expect.objectContaining({
data: { id: "1" },
eventName: UserEvents.invite_token_generated,
eventName: UserEvents.INVITE_TOKEN_GENERATED,
}),
])
})
@@ -221,19 +221,19 @@ moduleIntegrationTestRunner<IUserModuleService>({
expect(eventBusSpy).toHaveBeenCalledWith([
expect.objectContaining({
data: { id: "1" },
eventName: UserEvents.invite_created,
eventName: UserEvents.INVITE_CREATED,
}),
expect.objectContaining({
data: { id: "2" },
eventName: UserEvents.invite_created,
eventName: UserEvents.INVITE_CREATED,
}),
expect.objectContaining({
data: { id: "1" },
eventName: UserEvents.invite_token_generated,
eventName: UserEvents.INVITE_TOKEN_GENERATED,
}),
expect.objectContaining({
data: { id: "2" },
eventName: UserEvents.invite_token_generated,
eventName: UserEvents.INVITE_TOKEN_GENERATED,
}),
])
})

View File

@@ -188,7 +188,7 @@ moduleIntegrationTestRunner<IUserModuleService>({
expect(eventBusSpy).toHaveBeenCalledWith([
expect.objectContaining({
data: { id: "1" },
eventName: UserEvents.updated,
eventName: UserEvents.USER_UPDATED,
}),
])
})
@@ -218,11 +218,11 @@ moduleIntegrationTestRunner<IUserModuleService>({
expect(eventBusSpy).toHaveBeenCalledWith([
expect.objectContaining({
data: { id: "1" },
eventName: UserEvents.created,
eventName: UserEvents.USER_CREATED,
}),
expect.objectContaining({
data: { id: "2" },
eventName: UserEvents.created,
eventName: UserEvents.USER_CREATED,
}),
])
})

View File

@@ -115,7 +115,7 @@ export default class UserModuleService
sharedContext.messageAggregator?.saveRawMessageData(
invites.map((invite) => ({
eventName: UserEvents.invite_token_generated,
eventName: UserEvents.INVITE_TOKEN_GENERATED,
source: this.constructor.name,
action: "token_generated",
object: "invite",
@@ -198,7 +198,7 @@ export default class UserModuleService
sharedContext.messageAggregator?.saveRawMessageData(
users.map((user) => ({
eventName: UserEvents.created,
eventName: UserEvents.USER_CREATED,
source: this.constructor.name,
action: CommonEvents.CREATED,
object: "user",
@@ -238,7 +238,7 @@ export default class UserModuleService
sharedContext.messageAggregator?.saveRawMessageData(
updatedUsers.map((user) => ({
eventName: UserEvents.updated,
eventName: UserEvents.USER_UPDATED,
source: this.constructor.name,
action: CommonEvents.UPDATED,
object: "user",
@@ -278,7 +278,7 @@ export default class UserModuleService
sharedContext.messageAggregator?.saveRawMessageData(
invites.map((invite) => ({
eventName: UserEvents.invite_created,
eventName: UserEvents.INVITE_CREATED,
source: this.constructor.name,
action: CommonEvents.CREATED,
object: "invite",
@@ -289,7 +289,7 @@ export default class UserModuleService
sharedContext.messageAggregator?.saveRawMessageData(
invites.map((invite) => ({
eventName: UserEvents.invite_token_generated,
eventName: UserEvents.INVITE_TOKEN_GENERATED,
source: this.constructor.name,
action: "token_generated",
object: "invite",
@@ -360,7 +360,7 @@ export default class UserModuleService
sharedContext.messageAggregator?.saveRawMessageData(
serializedInvites.map((invite) => ({
eventName: UserEvents.invite_updated,
eventName: UserEvents.INVITE_UPDATED,
source: this.constructor.name,
action: CommonEvents.UPDATED,
object: "invite",