2025-04-08 16:01:10 +02:00
|
|
|
import type { z } from "zod";
|
|
|
|
|
import { ReportSchema } from "../../schemas/extensions/reports.ts";
|
|
|
|
|
import type { JSONObject } from "../../types.ts";
|
|
|
|
|
import { Entity } from "../entity.ts";
|
|
|
|
|
|
|
|
|
|
export class Report extends Entity {
|
2025-05-23 17:29:27 +02:00
|
|
|
public static override name = "pub.versia:reports/Report";
|
2025-04-08 16:01:10 +02:00
|
|
|
|
2025-05-23 17:29:27 +02:00
|
|
|
public constructor(public override data: z.infer<typeof ReportSchema>) {
|
2025-04-08 16:01:10 +02:00
|
|
|
super(data);
|
|
|
|
|
}
|
|
|
|
|
|
2025-05-23 17:29:27 +02:00
|
|
|
public static override fromJSON(json: JSONObject): Promise<Report> {
|
2025-04-08 16:01:10 +02:00
|
|
|
return ReportSchema.parseAsync(json).then((u) => new Report(u));
|
|
|
|
|
}
|
|
|
|
|
}
|