Return communication database rows from communication API
This is a pretty big refactor of how communication works to start moving us in the direction we want to go long-term. This adds the new communication row and migrates existing reports to add rows for communication. There's also a bunch of automatic fixes from the new linter. I should have added them separately, but whatever.
This commit is contained in:
parent
a6ce0b7e67
commit
a82732a49c
41 changed files with 365 additions and 220 deletions
|
|
@ -523,22 +523,22 @@ export class PublicReportWater extends PublicReport {
|
|||
export interface CommunicationDTO {
|
||||
created: string;
|
||||
id: string;
|
||||
public_report?: string;
|
||||
source: string;
|
||||
type: string;
|
||||
}
|
||||
export class Communication {
|
||||
constructor(
|
||||
public created: Date,
|
||||
public id: string,
|
||||
public source: string,
|
||||
public type: string,
|
||||
public public_report?: string,
|
||||
) {}
|
||||
static fromJSON(json: CommunicationDTO): Communication {
|
||||
return new Communication(
|
||||
new Date(json.created),
|
||||
json.id,
|
||||
json.source,
|
||||
json.type,
|
||||
json.public_report,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue