forked from MergeFi/backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebhook-event.entity.ts
More file actions
45 lines (35 loc) · 960 Bytes
/
Copy pathwebhook-event.entity.ts
File metadata and controls
45 lines (35 loc) · 960 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import {
Column,
CreateDateColumn,
Entity,
PrimaryGeneratedColumn,
} from 'typeorm';
import { WebhookEventStatus } from '../enums';
/** Audit log of every inbound webhook, verified or not, for replay/debugging. */
@Entity('webhook_events')
export class WebhookEvent {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column({ default: 'github' })
provider: string;
@Column()
eventType: string;
@Column({ type: 'varchar', nullable: true, unique: true })
deliveryId: string | null;
@Column({ type: 'jsonb' })
payload: Record<string, unknown>;
@Column({ default: false })
signatureValid: boolean;
@Column({
type: 'enum',
enum: WebhookEventStatus,
default: WebhookEventStatus.RECEIVED,
})
status: WebhookEventStatus;
@Column({ type: 'text', nullable: true })
error: string | null;
@CreateDateColumn()
receivedAt: Date;
@Column({ type: 'timestamptz', nullable: true })
processedAt: Date | null;
}