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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sowell-models",
3
- "version": "1.31.0",
3
+ "version": "1.32.0",
4
4
  "description": "SoWell models",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
package/src/index.ts CHANGED
@@ -25,3 +25,5 @@ export * from './models/Location';
25
25
  export * from './models/Origin';
26
26
  export * from './models/Provider';
27
27
  export * from './models/UnseenIssue';
28
+ export * from './models/Form';
29
+ export * from './models/FormAnswer';
@@ -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
+ }