import { TripCancellation } from "src/modules/trips/entities/trip-cancellations.entity"
import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm"

@Entity("cancel_reasons")
export class CancelReason {
  @PrimaryGeneratedColumn()
  id: number

  @Column({ type: "varchar", length: 255 })
  name: string

  @Column({ type: "text", nullable: true })
  description: string | null

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

  @Column({ type: "varchar", nullable: true })
  type: string

  @OneToMany(() => TripCancellation, (cancellation) => cancellation.reason)
  cancellations: TripCancellation[]
}
