ATC_SIMPLE/BACKEND/app/models/scenario.ts

53 lines
1.0 KiB
TypeScript

import { BaseModel, belongsTo, column } from '@adonisjs/lucid/orm'
import type { BelongsTo } from '@adonisjs/lucid/types/relations'
import { DateTime } from 'luxon'
import Brand from './brand.js'
import Category from './category.js'
export default class Scenario extends BaseModel {
@column({ isPrimary: true })
declare id: number
@column()
declare title: string
@column()
declare body: string
@column()
declare timeout: number
@column()
declare isReboot: boolean
@column.dateTime({ autoCreate: true })
declare createdAt: DateTime
@column.dateTime({ autoCreate: true, autoUpdate: true })
declare updatedAt: DateTime
@column()
declare send_result: boolean
@column()
declare sendResult: boolean
@column()
declare brandId: number
@belongsTo(() => Brand)
declare brand: BelongsTo<typeof Brand>
@column()
declare categoryId: number
@belongsTo(() => Category)
declare category: BelongsTo<typeof Category>
@column()
declare note: string
@column()
declare series: string
}