import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';

@Entity('feature_costs')
@Index('idx_credit_type', ['credit_type'])
@Index('idx_active', ['is_active'])
export class FeatureCost {
  @PrimaryGeneratedColumn({ type: 'bigint', unsigned: true })
  id: number;

  @Column({ length: 50, unique: true })
  feature_key: string;

  @Column({ type: 'enum', enum: ['job', 'database', 'ai'] })
  credit_type: 'job' | 'database' | 'ai';

  @Column({ type: 'int' })
  cost_credits: number;

  @Column({ default: true })
  is_active: boolean;
}
