-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathobjects.ts
More file actions
24 lines (22 loc) · 858 Bytes
/
objects.ts
File metadata and controls
24 lines (22 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import type {
CommonEventDefinition,
CommonEventDefinitionPublisherSchemaType,
ConsumerMessageMetadataType,
} from '@message-queue-toolkit/schemas'
/**
* Status of the outbox entry.
* - CREATED - entry was created and is waiting to be processed to publish actual event
* - ACKED - entry was picked up by outbox job and is being processed
* - SUCCESS - entry was successfully processed, event was published
* - FAILED - entry processing failed, it will be retried
*/
export type OutboxEntryStatus = 'CREATED' | 'ACKED' | 'SUCCESS' | 'FAILED'
export type OutboxEntry<SupportedEvent extends CommonEventDefinition> = {
id: string
event: CommonEventDefinitionPublisherSchemaType<SupportedEvent>
precedingMessageMetadata?: Partial<ConsumerMessageMetadataType>
status: OutboxEntryStatus
created: Date
updated?: Date
retryCount: number
}