Add definition for messages from the API

This commit is contained in:
Eli Ribble 2026-05-23 00:56:10 +00:00
parent 5b0d009353
commit 984223c287
No known key found for this signature in database

View file

@ -606,6 +606,40 @@ export class Communication {
}
}
export enum MessageType {
Unknown = 0,
Email = 1,
Mailer = 2,
Text = 3,
}
export interface MessageDTO {
content: string;
created: string;
destination: string;
source: string;
type: number;
}
export class Message {
constructor(
public content: string,
public created: Date,
public destination: string,
public source: string,
public type: MessageType,
) {}
static fromJSON(json: MessageDTO): Message {
return new Message(
json.content,
new Date(json.created),
json.destination,
json.source,
json.type as MessageType,
);
}
}
export interface Pool {
condition: string;
id: number;