Files
corrosion-admin-panel/backend-nest/src/entities/payment-order.entity.ts
Vantz Stockwell d20493d533
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
feat: Complete NestJS backend scaffold — 22 modules, 39 entities, WebSocket gateway
Full backend rewrite from Rust/Axum to NestJS/TypeScript.
- 22 feature modules (auth, servers, wipes, maps, plugins, players, console,
  chat, team, notifications, settings, schedules, analytics, alerts, status,
  store, webstore, admin, setup, migration, users, licenses)
- 39 TypeORM entities matching PostgreSQL schema (12 migrations)
- Common infrastructure: JWT/RBAC guards, decorators, exception filter
- NATS service with pub/sub/request-reply
- Socket.IO WebSocket gateway with NATS bridge
- Docker: NestJS Dockerfile + updated docker-compose.yml
- Zero compile errors (npx tsc --noEmit clean)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 21:29:25 -05:00

59 lines
1.7 KiB
TypeScript

import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn, Check } from 'typeorm';
import { Module } from './module.entity';
import { License } from './license.entity';
@Entity('payment_orders')
@Check(`"status" IN ('pending', 'completed', 'failed', 'refunded')`)
export class PaymentOrder {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column({ type: 'varchar', length: 255, unique: true })
order_id: string;
@Column({ type: 'uuid', nullable: true })
module_id: string | null;
@Column({ type: 'uuid', nullable: true })
webstore_subscription_id: string | null;
@Column({ type: 'uuid' })
license_id: string;
@Column({ type: 'decimal', precision: 10, scale: 2 })
amount: number;
@Column({ type: 'varchar', length: 3, default: 'USD' })
currency: string;
@Column({ type: 'varchar', length: 50 })
status: string;
@Column({ type: 'varchar', length: 255, nullable: true })
transaction_id: string | null;
@Column({ type: 'varchar', length: 255, nullable: true })
payer_email: string | null;
@Column({ type: 'timestamptz', default: () => 'NOW()' })
created_at: Date;
@Column({ type: 'timestamptz', nullable: true })
completed_at: Date | null;
@Column({ type: 'jsonb', nullable: true })
metadata: Record<string, any> | null;
@ManyToOne(() => Module, { onDelete: 'SET NULL', nullable: true })
@JoinColumn({ name: 'module_id' })
module: Module | null;
@ManyToOne(() => License, { onDelete: 'CASCADE' })
@JoinColumn({ name: 'license_id' })
license: License;
@ManyToOne(() => License, { onDelete: 'SET NULL', nullable: true })
@JoinColumn({ name: 'webstore_subscription_id' })
webstore_subscription: License | null;
}