web: report spam from my calls, reports on Blocked numbers
Users report an outside call that rang them: the spam check's line when it said medium or high, else a reason they type. Admins block or dismiss each report on Blocked numbers, and the Dashboard counts them. Migration 0015 adds spam_reports.
This commit is contained in:
1 parent
2bc7d5cde5
commit
a75113b6ac
16 files changed
+5212
-24
No files matched your search
@@ -17,8 +17,27 @@ export const BlockedCreateSchema = z.object({
|
||||
return z.NEVER;
|
||||
}
|
||||
}),
|
||||
reason: z.string().trim().max(100).nullable().optional(),
|
||||
reason: z.string().trim().max(200).nullable().optional(),
|
||||
});
|
||||
export type BlockedCreate = z.input<typeof BlockedCreateSchema>;
|
||||
|
||||
export type BlockedDto = { id: string; number: string; reason: string | null; createdAt: string };
|
||||
|
||||
/**
|
||||
* A user's "Report spam" on a call that rang them (05 §4). The reason is the spam check's line
|
||||
* when it flagged the call, else what the user typed. An admin blocks or dismisses it.
|
||||
*/
|
||||
export const SpamReportCreateSchema = z.object({
|
||||
callId: z.uuid(),
|
||||
reason: z.string().trim().min(1, 'Say why').max(200),
|
||||
});
|
||||
export type SpamReportCreate = z.input<typeof SpamReportCreateSchema>;
|
||||
|
||||
export type SpamReportDto = {
|
||||
id: string;
|
||||
number: string;
|
||||
reason: string;
|
||||
/** The reporter's display name; null once their account is gone. */
|
||||
reportedBy: string | null;
|
||||
createdAt: string;
|
||||
};
|
||||
Reference in new issue
Block a user