import { ImportDraftSchema } from '#database/schema'
import { belongsTo } from '@adonisjs/lucid/orm'
import type { BelongsTo } from '@adonisjs/lucid/types/relations'
import ImportBatch from '#models/import_batch'
import Invoice from '#models/invoice'

export default class ImportDraft extends ImportDraftSchema {
  @belongsTo(() => ImportBatch, { foreignKey: 'batchId' })
  declare batch: BelongsTo<typeof ImportBatch>

  @belongsTo(() => Invoice, { foreignKey: 'invoiceId' })
  declare invoice: BelongsTo<typeof Invoice>
}
