import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, Index, } from 'typeorm'; @Entity({ schema: 'core', name: 'currencies' }) @Index('idx_currencies_code', ['code'], { unique: true }) @Index('idx_currencies_active', ['active']) export class Currency { @PrimaryGeneratedColumn('uuid') id: string; @Column({ type: 'varchar', length: 3, nullable: false, unique: true }) code: string; @Column({ type: 'varchar', length: 100, nullable: false }) name: string; @Column({ type: 'varchar', length: 10, nullable: false }) symbol: string; @Column({ type: 'integer', nullable: false, default: 2, name: 'decimals' }) decimals: number; @Column({ type: 'decimal', precision: 12, scale: 6, nullable: true, default: 0.01, }) rounding: number; @Column({ type: 'boolean', nullable: false, default: true }) active: boolean; // Audit fields @CreateDateColumn({ name: 'created_at', type: 'timestamp' }) createdAt: Date; }