import { DateTime } from 'luxon'
import { column, computed } from '@ioc:Adonis/Lucid/Orm'
import AppBaseModel from './AppBaseModel'
import Episode from 'App/Models/Episode'
import Series from 'App/Models/Series'

export default class Collection extends AppBaseModel {
    @column({ isPrimary: true })
    public id: number

    @column.dateTime({ autoCreate: true })
    public createdAt: DateTime

    @column.dateTime({ autoCreate: true, autoUpdate: true })
    public updatedAt: DateTime

    @column()
    public userId: number

    @column()
    public seriesId: number

    @column()
    public curEpNum: number

    @column()
    public curEpId: number

    @computed()
    public series?: Series

    @computed()
    public episode?: Episode
}
