import { RelanceTaskSchema } from '#database/schema'
import { belongsTo } from '@adonisjs/lucid/orm'
import type { BelongsTo } from '@adonisjs/lucid/types/relations'
import Invoice from '#models/invoice'
import PlanStep from '#models/plan_step'

export default class RelanceTask extends RelanceTaskSchema {
  @belongsTo(() => Invoice)
  declare invoice: BelongsTo<typeof Invoice>

  @belongsTo(() => PlanStep, { foreignKey: 'planStepId' })
  declare planStep: BelongsTo<typeof PlanStep>
}
