Files
corrosion-admin-panel/backend-nest/src/entities/host-billing-record.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

32 lines
807 B
TypeScript

import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn, Unique } from 'typeorm';
import { Host } from './host.entity';
@Entity('host_billing_records')
@Unique(['host_id', 'billing_month'])
export class HostBillingRecord {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column({ type: 'uuid' })
host_id: string;
@Column({ type: 'date' })
billing_month: Date;
@Column({ type: 'integer' })
active_license_count: number;
@Column({ type: 'decimal', precision: 10, scale: 2 })
wholesale_rate_usd: number;
@Column({ type: 'decimal', precision: 10, scale: 2 })
total_amount_usd: number;
@Column({ type: 'timestamptz', default: () => 'NOW()' })
generated_at: Date;
@ManyToOne(() => Host, { onDelete: 'CASCADE' })
@JoinColumn({ name: 'host_id' })
host: Host;
}