Skip to content

Commit

Permalink
add ANNOUNCEMENT_SAFETY_MESSAGE
Browse files Browse the repository at this point in the history
  • Loading branch information
Behzad-rabiei committed Feb 21, 2024
1 parent 0a2abf3 commit 412f3d6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@togethercrew.dev/tc-messagebroker",
"version": "0.0.44",
"version": "0.0.45",
"description": "a service that include common things that need in every microservies ",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions src/enums/event.enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ enum AnalyzerEvent {

const ServerEvent = {
UPDATE_GUILD: 'UPDATE_GUILD',
ANNOUNCEMENT_SAFETY_MESSAGE: 'ANNOUNCEMENT_SAFETY_MESSAGE'
};

const DiscordBotEvent = {
Expand Down
11 changes: 9 additions & 2 deletions src/saga/choreography.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
DISCORD_UPDATE_CHANNELS_TRANSACTIONS,
TWITTER_REFRESH_TRANSACTIONS,
ANNOUNCEMENT_SEND_MESSAGE_TO_USER_TRANSACTIONS,
ANNOUNCEMENT_SEND_MESSAGE_TO_CHANNEL_TRANSACTIONS
ANNOUNCEMENT_SEND_MESSAGE_TO_CHANNEL_TRANSACTIONS,
ANNOUNCEMENT_SAFETY_MESSAGE_TRANSACTIONS
} from './transaction';

/* define the DISCORD_UPDATE_CHANNELS choreography */
Expand Down Expand Up @@ -40,6 +41,11 @@ const ANNOUNCEMENT_SEND_MESSAGE_TO_CHANNEL: IChoreography = {
transactions: ANNOUNCEMENT_SEND_MESSAGE_TO_CHANNEL_TRANSACTIONS
}

const ANNOUNCEMENT_SAFETY_MESSAGE: IChoreography = {
name: 'ANNOUNCEMENT_SAFETY_MESSAGE',
transactions: ANNOUNCEMENT_SAFETY_MESSAGE_TRANSACTIONS
}

/* all available Choreographies, will grow overtime */
export const ChoreographyDict = {
DISCORD_UPDATE_CHANNELS,
Expand All @@ -51,6 +57,7 @@ export const ChoreographyDict = {

// Announcement
ANNOUNCEMENT_SEND_MESSAGE_TO_USER,
ANNOUNCEMENT_SEND_MESSAGE_TO_CHANNEL
ANNOUNCEMENT_SEND_MESSAGE_TO_CHANNEL,
ANNOUNCEMENT_SAFETY_MESSAGE

} as const;
9 changes: 9 additions & 0 deletions src/saga/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,13 @@ export const ANNOUNCEMENT_SEND_MESSAGE_TO_CHANNEL_TRANSACTIONS: ITransaction[] =
order: 1,
...DEFAULT_TRANSACTION_PROPERTY,
}
]

export const ANNOUNCEMENT_SAFETY_MESSAGE_TRANSACTIONS: ITransaction[] = [
{
queue: Queue.SERVER_API,
event: Event.SERVER_API.ANNOUNCEMENT_SAFETY_MESSAGE,
order: 1,
...DEFAULT_TRANSACTION_PROPERTY,
}
]

0 comments on commit 412f3d6

Please sign in to comment.