Scope register and refresh to verified JWT identity (req.did). Persist devices under userId::deviceId, reject client-supplied userId, and dedupe FCM tokens per user.
15 lines
428 B
TypeScript
15 lines
428 B
TypeScript
export interface Device {
|
|
/** Internal row id used for persistence updates. */
|
|
id: string;
|
|
/** Authenticated user DID (from verified JWT). */
|
|
userId: string;
|
|
/** Client-provided stable physical device identity. */
|
|
deviceId: string;
|
|
fcmToken: string;
|
|
platform: "ios" | "android" | "web";
|
|
createdAt: Date;
|
|
updatedAt: Date;
|
|
/** Epoch ms; set only after a successful push send. */
|
|
lastNotifiedAt?: number;
|
|
}
|