sowell-models 1.31.0 → 1.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/models/Form/index.ts +13 -0
- package/src/models/FormAnswer/index.ts +29 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Attr, Model } from 'spraypaint'
|
|
2
|
+
import { ApplicationRecord } from '../ApplicationRecord'
|
|
3
|
+
|
|
4
|
+
export interface IForm {
|
|
5
|
+
id?: string
|
|
6
|
+
name?: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@Model()
|
|
10
|
+
export class SPForm extends ApplicationRecord implements IForm {
|
|
11
|
+
static jsonapiType = 'forms'
|
|
12
|
+
@Attr() name!: string
|
|
13
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Attr, BelongsTo, Model } from 'spraypaint'
|
|
2
|
+
import { ApplicationRecord } from '../ApplicationRecord'
|
|
3
|
+
import { IUser, SPUserItem } from '../User'
|
|
4
|
+
import { IForm, SPForm } from '../Form'
|
|
5
|
+
|
|
6
|
+
export interface IFormAnswerData {
|
|
7
|
+
data: any[]
|
|
8
|
+
agency?: string
|
|
9
|
+
residence?: string
|
|
10
|
+
place?: string
|
|
11
|
+
spot?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface IFormAnswer {
|
|
15
|
+
id?: string
|
|
16
|
+
createdAt?: string
|
|
17
|
+
answers?: IFormAnswerData
|
|
18
|
+
author?: IUser
|
|
19
|
+
form?: IForm
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@Model()
|
|
23
|
+
export class SPFormAnswer extends ApplicationRecord implements IFormAnswer {
|
|
24
|
+
static jsonapiType = 'form_answers'
|
|
25
|
+
@Attr() createdAt!: string
|
|
26
|
+
@Attr() answers!: IFormAnswerData
|
|
27
|
+
@BelongsTo() author!: SPUserItem
|
|
28
|
+
@BelongsTo() form!: SPForm
|
|
29
|
+
}
|