Files
lingxi-web/telegram-gateway/src/database/entities/tg-webhook-delivery.entity.ts
T
wmq 06112602ec feat(gateway): include production Telegram user gateway
Version the NestJS TDLib gateway with Docker deployment, migrations, automated tests and platform integration documentation while excluding all account sessions, credentials, runtime databases and backups.
2026-08-01 18:38:20 +08:00

57 lines
1023 B
TypeScript

import {
Entity,
PrimaryGeneratedColumn,
Column,
CreateDateColumn,
UpdateDateColumn,
Index,
} from 'typeorm';
export enum DeliveryStatus {
PENDING = 'pending',
SUCCESS = 'success',
FAILED = 'failed',
RETRYING = 'retrying',
DEAD_LETTER = 'dead_letter',
}
@Entity('tg_webhook_deliveries')
export class TgWebhookDelivery {
@PrimaryGeneratedColumn('uuid')
id: string;
@Index()
@Column()
subscriptionId: string;
@Column({ length: 1000 })
url: string;
@Column({ type: 'simple-json' })
payload: Record<string, unknown>;
@Column({
type: 'varchar', length: 50,
default: DeliveryStatus.PENDING,
})
status: DeliveryStatus;
@Column({ type: 'int', nullable: true })
responseCode: number;
@Column({ type: 'text', nullable: true })
responseBody: string;
@Column({ type: 'int', default: 0 })
attempt: number;
@Column({ type: 'text', nullable: true })
errorMessage: string;
@CreateDateColumn()
createdAt: Date;
@UpdateDateColumn()
updatedAt: Date;
}