import { BaseModel, column, belongsTo } from '@adonisjs/lucid/orm'
import type { BelongsTo } from '@adonisjs/lucid/types/relations'
import User from '#models/user'

export default class UserPref extends BaseModel {
  static table = 'user_pref'
  static incrementing = false

  @column({ isPrimary: true })
  declare id: string

  @column()
  declare userId: string

  @column()
  declare profileVisibility: 'public' | 'private'

  @column()
  declare displayName: string | null

  @column()
  declare country: string | null

  @column()
  declare locale: string

  @belongsTo(() => User)
  declare user: BelongsTo<typeof User>
}
