import { DateTime } from 'luxon'
import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'

export enum PropertyType {
    String = 'string',
    Date = 'date',
    Number = 'number',
    Boolean = 'boolean',
    Object = 'object',
    File = 'file',
    TimeRange = 'time_range',
    Range = 'range'
}

export default class Property 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()
    public name: string

    @column()
    public value: string

    @column()
    public remark: string

    @column()
    public type: PropertyType
}
