import { IsDate, IsUrl } from "class-validator"; import Resource from "../Resource"; import { Expose, Type } from "class-transformer"; import UserNotification from "./UserNotification"; import User from "./User"; export default class Notification extends Resource { @Expose() public uid?: string; @Expose() public message!: string; @Expose() @IsUrl() public redirection_url!: string; @Expose() @IsDate() public created_at: Date | null = null; @Expose() @IsDate() public updated_at: Date | null = null; @Expose() @Type(() => User) public user?: User[]; @Expose() @Type(() => UserNotification) public userNotification?: UserNotification; }