@@ -2,49 +2,45 @@ import { ResponseData } from "../networking/NetworkResponse";
22import Event from "./Event" ;
33import MinutesItem from "./MinutesItem" ;
44import { Model } from "./Model" ;
5- import { DocumentReference } from "@ firebase/firestore" ;
5+ import { DocumentReference } from "firebase/firestore" ;
66
77export default class EventMinutesItem implements Model {
8- id ? : string ;
8+ id : string ;
99 decision ?: string ;
10- event_ref ? : string ;
10+ event_ref : string ;
1111 event ?: Event ;
1212 external_source_id ?: string ;
13- index ? : number ;
14- minutes_item_ref ? : string ;
13+ index : number ;
14+ minutes_item_ref : string ;
1515 minutes_item ?: MinutesItem ;
1616
1717 constructor ( jsonData : ResponseData ) {
18- if ( jsonData [ "id" ] ) {
19- this . id = jsonData [ "id" ] ;
20- }
18+ this . id = jsonData [ "id" ] ;
2119
2220 if ( jsonData [ "decision" ] ) {
2321 this . decision = jsonData [ "decision" ] ;
2422 }
2523
26- if ( jsonData [ "event_ref" ] ) {
27- if ( jsonData [ "event_ref" ] instanceof DocumentReference ) {
28- this . event_ref = jsonData [ "event_ref" ] . id ;
29- } else if ( typeof jsonData [ "event_ref" ] === "object" ) {
30- this . event = new Event ( jsonData [ "event_ref" ] ) ;
31- }
32- }
24+ this . event_ref = jsonData [ "event_ref" ] . id ;
3325
26+ if (
27+ typeof jsonData [ "event_ref" ] === "object" &&
28+ ! ( jsonData [ "event_ref" ] instanceof DocumentReference )
29+ ) {
30+ this . event = new Event ( jsonData [ "event_ref" ] ) ;
31+ }
3432 if ( jsonData [ "external_source_id" ] ) {
3533 this . external_source_id = jsonData [ "external_source_id" ] ;
3634 }
3735
38- if ( jsonData [ "index" ] ) {
39- this . index = jsonData [ "index" ] ;
40- }
36+ this . index = jsonData [ "index" ] ;
4137
42- if ( jsonData [ "minutes_item_ref" ] ) {
43- if ( jsonData [ "minutes_item_ref" ] instanceof DocumentReference ) {
44- this . minutes_item_ref = jsonData [ "minutes_item_ref" ] . id ;
45- } else if ( typeof jsonData [ "minutes_item_ref" ] === "object" ) {
46- this . minutes_item = new MinutesItem ( jsonData [ "minutes_item_ref" ] ) ;
47- }
38+ this . minutes_item_ref = jsonData [ "minutes_item_ref" ] . id ;
39+ if (
40+ typeof jsonData [ "minutes_item_ref" ] === "object" &&
41+ ! ( jsonData [ "minutes_item_ref" ] instanceof DocumentReference )
42+ ) {
43+ this . minutes_item = new MinutesItem ( jsonData [ "minutes_item_ref" ] ) ;
4844 }
4945 }
5046}
0 commit comments