@grouparoo/core
Version:
The Grouparoo Core
46 lines (37 loc) • 892 B
text/typescript
import { Table, Column, AllowNull } from "sequelize-typescript";
import { CommonModel } from "../classes/commonModel";
import { APIData } from "../modules/apiData";
({ tableName: "notifications", paranoid: false })
export class Notification extends CommonModel<Notification> {
idPrefix() {
return "not";
}
(false)
from: string;
(false)
subject: string;
(false)
body: string;
cta: string;
ctaLink: string;
readAt: Date;
async apiData() {
return {
id: this.id,
from: this.from,
subject: this.subject,
body: this.body,
cta: this.cta,
ctaLink: this.ctaLink,
createdAt: APIData.formatDate(this.createdAt),
updatedAt: APIData.formatDate(this.updatedAt),
readAt: APIData.formatDate(this.readAt),
};
}
}