import { decimalConverter } from 'App/Helpers/db'
import { DateTime } from 'luxon'
import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'
import Decimal from 'decimal.js'

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

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

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

    @column.date()
    public date: DateTime

    @column()
    public userId: number

    @column({ ...decimalConverter })
    public reward: Decimal
}
