import { Entity, Column, Index } from 'typeorm';
import { BaseEntity } from '../database/base.entity';

/**
 * Agent Cost — tenant-scoped markup rule.
 *
 * One named percentage, assigned from any trip source.
 * The assignment itself lives on trip_sources.agent_cost_id.
 * A quote must copy the percentage at save time; this row is not
 * the historical price.
 */
@Entity('agent_costs')
@Index(['tenant_id', 'is_deleted'])
export class AgentCostEntity extends BaseEntity {
  @Column({ type: 'varchar', length: 255 })
  name: string;

  /** Percent uplift on the DMC floor. Greater than 0. Not a rupee amount. */
  @Column({ type: 'decimal', precision: 6, scale: 2 })
  percentage: string;

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