diff options
author | MCMXC <16797721+mcmxcdev@users.noreply.github.com> | 2024-02-10 18:19:14 -0700 |
---|---|---|
committer | Vijay A <vraravam@users.noreply.github.com> | 2024-02-13 06:59:44 +0530 |
commit | 7584d2d7a7110aef0331ebfa178b2295842c59fa (patch) | |
tree | 900cd71237e6231b57936fcce77ff229cd459041 /app/Models/Service.ts | |
parent | upgrade recipes submodule (diff) | |
download | ferdium-server-7584d2d7a7110aef0331ebfa178b2295842c59fa.tar.gz ferdium-server-7584d2d7a7110aef0331ebfa178b2295842c59fa.tar.zst ferdium-server-7584d2d7a7110aef0331ebfa178b2295842c59fa.zip |
refactor: project maintenance
- work in progress
Diffstat (limited to 'app/Models/Service.ts')
-rw-r--r-- | app/Models/Service.ts | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/app/Models/Service.ts b/app/Models/Service.ts index af1a8e1..0cd2afb 100644 --- a/app/Models/Service.ts +++ b/app/Models/Service.ts | |||
@@ -1,40 +1,41 @@ | |||
1 | import { DateTime } from 'luxon'; | 1 | import { DateTime } from 'luxon' |
2 | import { BaseModel, column, HasOne, hasOne } from '@ioc:Adonis/Lucid/Orm'; | 2 | import { BaseModel, column, hasOne } from '@adonisjs/lucid/orm' |
3 | import User from './User'; | 3 | import User from './User.js' |
4 | import type { HasOne } from '@adonisjs/lucid/types/relations' | ||
4 | 5 | ||
5 | export default class Service extends BaseModel { | 6 | export default class Service extends BaseModel { |
6 | @column({ isPrimary: true }) | 7 | @column({ isPrimary: true }) |
7 | public id: number; | 8 | public id: number |
8 | 9 | ||
9 | @hasOne(() => User, { | 10 | @hasOne(() => User, { |
10 | foreignKey: 'userId', | 11 | foreignKey: 'userId', |
11 | }) | 12 | }) |
12 | public user: HasOne<typeof User>; | 13 | public user: HasOne<typeof User> |
13 | 14 | ||
14 | @column({ | 15 | @column({ |
15 | columnName: 'userId', | 16 | columnName: 'userId', |
16 | }) | 17 | }) |
17 | public userId: number; | 18 | public userId: number |
18 | 19 | ||
19 | @column({ | 20 | @column({ |
20 | columnName: 'serviceId', | 21 | columnName: 'serviceId', |
21 | }) | 22 | }) |
22 | public serviceId: string; | 23 | public serviceId: string |
23 | 24 | ||
24 | @column() | 25 | @column() |
25 | public name: string; | 26 | public name: string |
26 | 27 | ||
27 | @column({ | 28 | @column({ |
28 | columnName: 'recipeId', | 29 | columnName: 'recipeId', |
29 | }) | 30 | }) |
30 | public recipeId: string; | 31 | public recipeId: string |
31 | 32 | ||
32 | @column() | 33 | @column() |
33 | public settings: string; | 34 | public settings: string |
34 | 35 | ||
35 | @column.dateTime({ autoCreate: true }) | 36 | @column.dateTime({ autoCreate: true }) |
36 | public createdAt: DateTime; | 37 | public createdAt: DateTime |
37 | 38 | ||
38 | @column.dateTime({ autoCreate: true, autoUpdate: true }) | 39 | @column.dateTime({ autoCreate: true, autoUpdate: true }) |
39 | public updatedAt: DateTime; | 40 | public updatedAt: DateTime |
40 | } | 41 | } |