fix: harden financial transaction boundaries

This commit is contained in:
2026-07-18 15:33:41 +08:00
parent 4af7acbeaa
commit 5836b421d8
19 changed files with 514 additions and 314 deletions

View File

@@ -5,10 +5,12 @@ import {
CreateDateColumn,
ManyToOne,
JoinColumn,
Index,
} from 'typeorm';
import { Room } from './room.entity';
@Entity('room_expenses')
@Index(['importKey'], { unique: true })
export class RoomExpense {
@PrimaryGeneratedColumn()
id: number;
@@ -34,6 +36,9 @@ export class RoomExpense {
@Column({ name: 'recorded_by', nullable: true })
recordedBy: number;
@Column({ name: 'import_key', type: 'varchar', length: 120, nullable: true, unique: true })
importKey: string | null;
@Column({ type: 'varchar', length: 20, default: 'active' })
status: 'active' | 'archived';