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

/**
 * TaxType — tenant-scoped master table.
 *
 * Shared across: Pricing, Quotation, Booking, Invoice modules.
 * Examples: GST (18%), VAT (20%), Service Tax (15%), Tourism Tax (5%)
 *
 * Seeded with defaults on tenant onboarding.
 */
@Entity('tax_types')
@Unique(['tenant_id', 'name'])
export class TaxTypeEntity extends BaseEntity {
  @Column({ type: 'varchar', length: 100 })
  name: string;

  @Column({ type: 'varchar', length: 255 })
  display_name: string;

  @Column({ type: 'decimal', precision: 5, scale: 2, default: 0 })
  default_value: number;

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

  @Column({ type: 'boolean', default: false })
  is_system: boolean;
}
