@russ-b/nestjs-common-tools
Version:
NestJS utility tools
67 lines • 2.94 kB
JavaScript
;
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.OutboxEvent = void 0;
const typeorm_1 = require("typeorm");
const enums_1 = require("../enums");
let OutboxEvent = class OutboxEvent {
};
exports.OutboxEvent = OutboxEvent;
__decorate([
(0, typeorm_1.PrimaryColumn)('uuid', { default: () => 'uuidv7()' }),
__metadata("design:type", String)
], OutboxEvent.prototype, "id", void 0);
__decorate([
(0, typeorm_1.Index)(),
(0, typeorm_1.Column)({ name: 'event_type', type: 'varchar', length: 100, nullable: false }),
__metadata("design:type", String)
], OutboxEvent.prototype, "eventType", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'jsonb', nullable: false }),
__metadata("design:type", Object)
], OutboxEvent.prototype, "payload", void 0);
__decorate([
(0, typeorm_1.Column)({
type: 'enum',
enum: enums_1.OutboxEventStatus,
default: enums_1.OutboxEventStatus.PENDING,
}),
__metadata("design:type", String)
], OutboxEvent.prototype, "status", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'retry_count', type: 'int', default: 0 }),
__metadata("design:type", Number)
], OutboxEvent.prototype, "retryCount", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'last_error', type: 'text', nullable: true }),
__metadata("design:type", Object)
], OutboxEvent.prototype, "lastError", void 0);
__decorate([
(0, typeorm_1.CreateDateColumn)({ type: 'timestamptz', name: 'created_at' }),
__metadata("design:type", Date)
], OutboxEvent.prototype, "createdAt", void 0);
__decorate([
(0, typeorm_1.Index)(),
(0, typeorm_1.Column)({
type: 'timestamptz',
name: 'processing_started_at',
nullable: true,
}),
__metadata("design:type", Object)
], OutboxEvent.prototype, "processingStartedAt", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'timestamptz', name: 'processed_at', nullable: true }),
__metadata("design:type", Object)
], OutboxEvent.prototype, "processedAt", void 0);
exports.OutboxEvent = OutboxEvent = __decorate([
(0, typeorm_1.Entity)()
], OutboxEvent);
//# sourceMappingURL=outbox-event.entity.js.map