{"title":"EFL TaskFlow Socket.IO API","source":"@efl/shared eventRegistry","namespace":"/","path":"/socket.io","clientOptions":{"path":"/socket.io","withCredentials":true,"transports":["websocket"],"reconnectionDelay":1000,"reconnectionDelayMax":10000},"sections":[{"id":"introduction","title":"Introduction","status":"available","blocks":[{"kind":"p","text":"EFL TaskFlow pushes realtime updates over Socket.IO. All writes go through the REST API (see /api/docs); the socket is a fan-out channel that tells clients what changed. PostgreSQL is always the source of truth."},{"kind":"p","text":"Every event name, payload and acknowledgment on this page is generated from the typed registry in @efl/shared (packages/shared/src/realtime). The same data is available as JSON at /api/socket-docs-json. Sections marked \"Planned\" describe the agreed design and are not implemented yet."}]},{"id":"connection","title":"Connection","status":"available","blocks":[{"kind":"table","head":["Setting","Value"],"rows":[["URL","Same origin as the web app (dev: NEXT_PUBLIC_SOCKET_URL = http://localhost:4000)"],["Path","/socket.io"],["Transport","websocket only — long-polling is not supported on Vercel Functions"],["Credentials","withCredentials: true (the HttpOnly auth cookie travels with the handshake)"],["Namespace","/ (default)"]]},{"kind":"p","text":"The web app connects with exactly these options (SOCKET_CLIENT_OPTIONS from @efl/shared):"},{"kind":"code","block":{"code":"import { SOCKET_CLIENT_OPTIONS, type ClientToServerEvents, type ServerToClientEvents } from '@efl/shared';\nimport { io, type Socket } from 'socket.io-client';\n\n// Production: same origin (no URL). Dev: NEXT_PUBLIC_SOCKET_URL=http://localhost:4000\nconst socket: Socket<ServerToClientEvents, ClientToServerEvents> = io(\n  process.env.NEXT_PUBLIC_SOCKET_URL || undefined,\n  { ...SOCKET_CLIENT_OPTIONS }, // copy: the client mutates its options, the constant is frozen\n);\n\n// SOCKET_CLIENT_OPTIONS =\n//   {\n//     \"path\": \"/socket.io\",\n//     \"withCredentials\": true,\n//     \"transports\": [\n//       \"websocket\"\n//     ],\n//     \"reconnectionDelay\": 1000,\n//     \"reconnectionDelayMax\": 10000\n//   }\n\nsocket.on('connect', () => console.log('connected', socket.id));\nsocket.on('connect_error', (err) => console.warn('connect_error', err.message)); // retried automatically\nsocket.on('disconnect', (reason) => {\n  if (reason === 'io server disconnect') socket.connect(); // server closed it: no automatic retry\n});","lang":"ts","title":"Creating a connection"}},{"kind":"list","items":["connect — handshake succeeded; socket.id is set.","connect_error — handshake rejected or server unreachable; err.message describes it. The client retries automatically.","disconnect(reason) — \"io server disconnect\" (server closed it, no auto-retry: call socket.connect()), \"io client disconnect\" (you called disconnect()), \"transport close\" / \"ping timeout\" (network or Vercel function max duration reached — auto-retry)."]}]},{"id":"authentication","title":"Authentication","status":"available","blocks":[{"kind":"p","text":"Every connection must be authenticated. The handshake reads the HttpOnly efl_at access-token cookie set by POST /api/v1/auth/login (sent automatically with withCredentials: true). Tools without cookies may pass the access token as auth.token. auth.locale (en | vi | ja | zh) sets the language of ack error messages; default: the handshake Accept-Language. On success the server joins the socket to user:{userId}."},{"kind":"list","items":["Missing, invalid or expired token → connect_error with err.message === \"UNAUTHENTICATED\" (err.data.code is the same). Nothing else is sent.","The access token lives 15 minutes; an already-connected socket stays connected after it expires. Only a new handshake (reconnect) checks it again.","On UNAUTHENTICATED: call POST /api/v1/auth/refresh once, then socket.connect(). If refresh fails, send the user to the sign-in page."]}]},{"id":"namespaces","title":"Namespaces","status":"available","blocks":[{"kind":"p","text":"Only the default namespace \"/\" is used. Scoping is done with rooms, not namespaces."}]},{"id":"rooms","title":"Rooms","status":"available","blocks":[{"kind":"table","head":["Room","Purpose","Who joins","How"],"rows":[["user:{userId}","Personal events: notifications, and task events for tasks assigned to the user (current or previous assignee)","The authenticated user","Joined automatically by the server on connect"],["workspace:{workspaceId}","Workspace-wide events (projects, members)","Workspace members","Joined automatically for every membership on connect"],["project:{projectId}","Task and comment events","Users with an effective role on the project","Client emits subscription.join; the server checks access first"]]},{"kind":"p","text":"Clients can never join an arbitrary room: the server validates every join. Creating a workspace or accepting an invitation adds your sockets to the workspace room right away; being removed (or leaving) takes them out of the workspace room and all its project rooms, and deleting a project empties its room — across all instances via the Redis adapter."}]},{"id":"acknowledgments","title":"Acknowledgments","status":"available","blocks":[{"kind":"p","text":"Every client→server event is acknowledged with the same contract. Clients wait at most ACK_TIMEOUT_MS (5000 ms)."},{"kind":"code","block":{"code":"type Ack<T> =\n  | { success: true; data: T; error: null; requestId: string }\n  | { success: false; data: null; error: { code: ErrorCode; message: string }; requestId: string };","lang":"ts","title":"packages/shared/src/realtime/acknowledgments/common.ack.ts"}}]},{"id":"errors","title":"Error handling","status":"available","blocks":[{"kind":"p","text":"Error codes are shared with the REST API:"},{"kind":"list","items":["VALIDATION_ERROR","UNAUTHENTICATED","FORBIDDEN","NOT_FOUND","CONFLICT","VERSION_CONFLICT","PROJECT_ARCHIVED","OWNERSHIP_TRANSFER_REQUIRED","DEPENDENCY_CYCLE","RATE_LIMITED","INTERNAL_ERROR"]},{"kind":"list","items":["Invalid payload → ack with VALIDATION_ERROR and the failing fields in error.message.","Unexpected server error → ack with INTERNAL_ERROR; details are logged server-side only.","No ack within the timeout → emitWithAck rejects; treat as a transient failure and retry or refetch."]}]},{"id":"reconnection","title":"Reconnection & sync","status":"available","blocks":[{"kind":"p","text":"The client reconnects automatically with exponential backoff (1 s → 10 s). On Vercel, connections are also closed when a function reaches its max duration, so reconnects are routine."},{"kind":"list","items":["Missed events are never replayed. After every reconnect (each connect except the first of a socket) the web invalidates all active TanStack Query caches once — the refetch is authoritative — and re-joins the open project rooms (subscription.join on connect). Workspace and user rooms are re-joined by the server on connect.","Every server event carries an eventId; the web drops ids it has already seen (the resync can overlap with live events) and skips its own echoes by causationId. Task events also carry entity.version: an older version than the cached one is ignored.","Signing out, signing in and registering drop the socket (resetSocket) so the next connection handshakes with the new user’s cookie and never receives the previous user’s events.","While disconnected for more than ~2 s the app header shows a small \"Reconnecting…\" indicator; it hides on connect.","workspace.deleted and project.member.updated (effectiveRole null) are followed by the server removing your sockets from the affected rooms; the web navigates away with a toast if you were inside."]}]},{"id":"authorization","title":"Authorization","status":"available","blocks":[{"kind":"p","text":"Room access uses the same permission rules as the REST API (effectiveProjectRole from @efl/shared). subscription.join answers NOT_FOUND both for a project that does not exist and for one you cannot see. Workspace events (project.*, member.*) go to every workspace member; private projects are announced too, but their details stay behind the REST API."}]},{"id":"redis-adapter","title":"Redis adapter","status":"available","blocks":[{"kind":"p","text":"The API can run as many instances (Vercel scales functions horizontally). @socket.io/redis-adapter relays every room broadcast through Redis Pub/Sub so a socket connected to instance A receives events emitted on instance B."},{"kind":"list","items":["Configured with REDIS_URL (Docker Redis in dev, Upstash in production).","Redis only carries transient messages — nothing is stored. Mutations are committed to PostgreSQL before events are emitted.","No delivery guarantee: a client offline at emit time misses the event and resyncs by refetching."]}]}],"events":[{"id":"event-system-ping","name":"system.ping","direction":"client-to-server","category":"system","summary":"Round-trip health check over the socket connection","description":"Sends the client clock to the server and receives the server clock plus the id of the API instance that handled it. Useful to measure latency and to verify that the connection reaches a live instance.","namespace":"/","rooms":[],"authorization":"Any connected socket.","handledBy":"RealtimeGateway.handlePing (server-web/src/modules/realtime/presentation/realtime.gateway.ts)","frontendBehavior":"Display latency in developer tools; no UI state changes.","related":[],"payloadSchema":{"type":"object","properties":{"clientTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"Client clock when the ping was sent (ISO 8601)"}},"required":["clientTime"]},"ackSchema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"serverTime":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"Server clock when the ping was handled (ISO 8601)"},"instanceId":{"type":"string","description":"Random id of the API instance that handled the ping (changes on restart)"}},"required":["serverTime","instanceId"],"additionalProperties":false},"error":{"type":"null"},"requestId":{"type":"string"}},"required":["success","data","error","requestId"],"additionalProperties":false},{"type":"object","properties":{"success":{"type":"boolean","const":false},"data":{"type":"null"},"error":{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_ERROR","UNAUTHENTICATED","FORBIDDEN","NOT_FOUND","CONFLICT","VERSION_CONFLICT","PROJECT_ARCHIVED","OWNERSHIP_TRANSFER_REQUIRED","DEPENDENCY_CYCLE","RATE_LIMITED","INTERNAL_ERROR"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"requestId":{"type":"string"}},"required":["success","data","error","requestId"],"additionalProperties":false}]},"examplePayload":{"clientTime":"2026-11-15T09:00:00.000Z"},"exampleAck":{"success":true,"data":{"serverTime":"2026-11-15T09:00:00.012Z","instanceId":"a1b2c3d4"},"error":null,"requestId":"0193a1f2-7c3e-7d40-9b1a-2f4c5e6d7a8b"},"example":"import { ACK_TIMEOUT_MS } from '@efl/shared';\nimport { getSocket } from '@/shared/lib/socket';\n\nconst socket = getSocket();\n\ntry {\n  const ack = await socket\n    .timeout(ACK_TIMEOUT_MS)\n    .emitWithAck('system.ping', {\n      \"clientTime\": \"2026-11-15T09:00:00.000Z\"\n    });\n\n  if (!ack.success) {\n    // ack.error.code is one of the shared ERROR_CODES\n    console.error(ack.error.code, ack.error.message, ack.requestId);\n  } else {\n    console.log(ack.data);\n  }\n} catch {\n  // No acknowledgment within ACK_TIMEOUT_MS (connection lost or server overloaded).\n}"},{"id":"event-subscription-join","name":"subscription.join","direction":"client-to-server","category":"subscription","summary":"Start receiving events of one project","description":"Joins the room `project:{id}` so task and comment events of that project reach this socket. Call it when a project page mounts and again after every reconnect (rooms are not restored automatically). Fails with NOT_FOUND when the caller has no effective role on the project — the same answer as for a project that does not exist.","namespace":"/","rooms":[],"authorization":"Any effective project role (LEAD, MEMBER, VIEWER).","handledBy":"RealtimeGateway.handleJoin (server-web/src/modules/realtime/presentation/realtime.gateway.ts)","frontendBehavior":"Join in the project layout effect; leave on unmount. On NOT_FOUND, show the not-found page.","related":["subscription.leave"],"payloadSchema":{"type":"object","properties":{"scope":{"type":"string","const":"project","description":"Only project rooms are joined explicitly; user/workspace rooms are automatic"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Project id"}},"required":["scope","id"]},"ackSchema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"object","properties":{"room":{"type":"string","description":"Joined room, e.g. project:{id}"}},"required":["room"],"additionalProperties":false},"error":{"type":"null"},"requestId":{"type":"string"}},"required":["success","data","error","requestId"],"additionalProperties":false},{"type":"object","properties":{"success":{"type":"boolean","const":false},"data":{"type":"null"},"error":{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_ERROR","UNAUTHENTICATED","FORBIDDEN","NOT_FOUND","CONFLICT","VERSION_CONFLICT","PROJECT_ARCHIVED","OWNERSHIP_TRANSFER_REQUIRED","DEPENDENCY_CYCLE","RATE_LIMITED","INTERNAL_ERROR"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"requestId":{"type":"string"}},"required":["success","data","error","requestId"],"additionalProperties":false}]},"examplePayload":{"scope":"project","id":"0193a1f2-0000-7000-8000-0000000000a1"},"exampleAck":{"success":true,"data":{"room":"project:0193a1f2-0000-7000-8000-0000000000a1"},"error":null,"requestId":"0193a1f2-7c3e-7d40-9b1a-2f4c5e6d7a8b"},"example":"import { ACK_TIMEOUT_MS } from '@efl/shared';\nimport { getSocket } from '@/shared/lib/socket';\n\nconst socket = getSocket();\n\ntry {\n  const ack = await socket\n    .timeout(ACK_TIMEOUT_MS)\n    .emitWithAck('subscription.join', {\n      \"scope\": \"project\",\n      \"id\": \"0193a1f2-0000-7000-8000-0000000000a1\"\n    });\n\n  if (!ack.success) {\n    // ack.error.code is one of the shared ERROR_CODES\n    console.error(ack.error.code, ack.error.message, ack.requestId);\n  } else {\n    console.log(ack.data);\n  }\n} catch {\n  // No acknowledgment within ACK_TIMEOUT_MS (connection lost or server overloaded).\n}"},{"id":"event-subscription-leave","name":"subscription.leave","direction":"client-to-server","category":"subscription","summary":"Stop receiving events of one project","description":"Leaves the room `project:{id}`. Always succeeds, also when the socket was not in the room.","namespace":"/","rooms":["project:{projectId}"],"authorization":"Any connected socket.","handledBy":"RealtimeGateway.handleLeave (server-web/src/modules/realtime/presentation/realtime.gateway.ts)","frontendBehavior":"Call from the cleanup of the effect that joined.","related":["subscription.join"],"payloadSchema":{"type":"object","properties":{"scope":{"type":"string","const":"project","description":"Only project rooms are joined explicitly; user/workspace rooms are automatic"},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"Project id"}},"required":["scope","id"]},"ackSchema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","const":true},"data":{"type":"null"},"error":{"type":"null"},"requestId":{"type":"string"}},"required":["success","data","error","requestId"],"additionalProperties":false},{"type":"object","properties":{"success":{"type":"boolean","const":false},"data":{"type":"null"},"error":{"type":"object","properties":{"code":{"type":"string","enum":["VALIDATION_ERROR","UNAUTHENTICATED","FORBIDDEN","NOT_FOUND","CONFLICT","VERSION_CONFLICT","PROJECT_ARCHIVED","OWNERSHIP_TRANSFER_REQUIRED","DEPENDENCY_CYCLE","RATE_LIMITED","INTERNAL_ERROR"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"requestId":{"type":"string"}},"required":["success","data","error","requestId"],"additionalProperties":false}]},"examplePayload":{"scope":"project","id":"0193a1f2-0000-7000-8000-0000000000a1"},"exampleAck":{"success":true,"data":null,"error":null,"requestId":"0193a1f2-7c3e-7d40-9b1a-2f4c5e6d7a8b"},"example":"import { ACK_TIMEOUT_MS } from '@efl/shared';\nimport { getSocket } from '@/shared/lib/socket';\n\nconst socket = getSocket();\n\ntry {\n  const ack = await socket\n    .timeout(ACK_TIMEOUT_MS)\n    .emitWithAck('subscription.leave', {\n      \"scope\": \"project\",\n      \"id\": \"0193a1f2-0000-7000-8000-0000000000a1\"\n    });\n\n  if (!ack.success) {\n    // ack.error.code is one of the shared ERROR_CODES\n    console.error(ack.error.code, ack.error.message, ack.requestId);\n  } else {\n    console.log(ack.data);\n  }\n} catch {\n  // No acknowledgment within ACK_TIMEOUT_MS (connection lost or server overloaded).\n}"},{"id":"event-project-updated","name":"project.updated","direction":"server-to-client","category":"project","summary":"A project was created, edited, archived or unarchived","description":"Sent to the whole workspace after any project change, including creation. `myRole`, `progress` and `taskCount` are omitted because they depend on the viewer — refetch the project or the list to get them.","namespace":"/","rooms":["workspace:{workspaceId}"],"authorization":"Workspace members. Private projects are also announced; the REST API still hides them from users without access.","handledBy":"ProjectsService → RealtimePublisher (server-web/src/modules/projects)","frontendBehavior":"Invalidate the workspace project list and that project; skip when causationId is your own pending mutation.","related":["project.deleted"],"payloadSchema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7, dedupe key — drop events already seen"},"event":{"type":"string"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"User who caused it; null for system jobs"},"causationId":{"description":"X-Client-Mutation-Id of the originating request, to skip your own echo","type":["string","null"]},"scope":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","task","comment","project","member","notification"]},"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","id"]},"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["PLANNED","ACTIVE","ON_HOLD","COMPLETED","ARCHIVED"]},"visibility":{"type":"string","enum":["WORKSPACE","PRIVATE"]},"color":{"anyOf":[{"type":"string","enum":["gray","primary","secondary","accent","success","warning","danger"]},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"owner":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"avatarUrl":{"type":["string","null"]}},"required":["id","name","email","avatarUrl"]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"progress":{"type":"number","minimum":0,"maximum":1},"taskCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","workspaceId","key","name","description","status","visibility","color","startDate","endDate","owner","archivedAt","createdAt","updatedAt","progress","taskCount"]}},"required":["eventId","event","occurredAt","actorId","causationId","scope","entity","data"]},"examplePayload":{"eventId":"0193a1f2-7c3e-7d40-9b1a-000000000e01","event":"project.updated","occurredAt":"2026-11-16T09:00:00.000Z","actorId":"0193a1f2-0000-7000-8000-0000000000b1","causationId":"m-42","scope":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001"},"entity":{"type":"project","id":"0193a1f2-0000-7000-8000-0000000000a1"},"data":{"id":"0193a1f2-0000-7000-8000-0000000000a1","workspaceId":"0193a1f2-0000-7000-8000-000000000001","key":"WEB","name":"Website redesign","description":null,"status":"ACTIVE","visibility":"WORKSPACE","color":null,"startDate":"2026-11-01","endDate":null,"owner":{"id":"0193a1f2-0000-7000-8000-0000000000b1","name":"Alice Nguyen","email":"alice@efl.dev","avatarUrl":null},"archivedAt":null,"createdAt":"2026-11-01T08:00:00.000Z","updatedAt":"2026-11-16T09:00:00.000Z","progress":0.4,"taskCount":10}},"example":"import type { ServerToClientEvents } from '@efl/shared';\nimport { useEffect } from 'react';\nimport { getSocket } from '@/shared/lib/socket';\n\nuseEffect(() => {\n  const socket = getSocket();\n  const handler: ServerToClientEvents['project.updated'] = (payload) => {\n    // Invalidate the workspace project list and that project; skip when causationId is your own pending mutation.\n  };\n  socket.on('project.updated', handler);\n  return () => {\n    socket.off('project.updated', handler); // always clean up listeners\n  };\n}, []);"},{"id":"event-project-deleted","name":"project.deleted","direction":"server-to-client","category":"project","summary":"A project was deleted","description":"Sent to the workspace after a project and all its tasks were deleted. Sockets in `project:{id}` are removed from that room.","namespace":"/","rooms":["workspace:{workspaceId}"],"authorization":"Workspace members.","handledBy":"ProjectsService → RealtimePublisher (server-web/src/modules/projects)","frontendBehavior":"Remove it from caches; if it is open, navigate to the workspace home with a toast.","related":["project.updated"],"payloadSchema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7, dedupe key — drop events already seen"},"event":{"type":"string"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"User who caused it; null for system jobs"},"causationId":{"description":"X-Client-Mutation-Id of the originating request, to skip your own echo","type":["string","null"]},"scope":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","task","comment","project","member","notification"]},"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","id"]},"data":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["projectId"]}},"required":["eventId","event","occurredAt","actorId","causationId","scope","entity","data"]},"examplePayload":{"eventId":"0193a1f2-7c3e-7d40-9b1a-000000000e01","event":"project.deleted","occurredAt":"2026-11-16T09:00:00.000Z","actorId":"0193a1f2-0000-7000-8000-0000000000b1","causationId":"m-42","scope":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001"},"entity":{"type":"project","id":"0193a1f2-0000-7000-8000-0000000000a1"},"data":{"projectId":"0193a1f2-0000-7000-8000-0000000000a1"}},"example":"import type { ServerToClientEvents } from '@efl/shared';\nimport { useEffect } from 'react';\nimport { getSocket } from '@/shared/lib/socket';\n\nuseEffect(() => {\n  const socket = getSocket();\n  const handler: ServerToClientEvents['project.deleted'] = (payload) => {\n    // Remove it from caches; if it is open, navigate to the workspace home with a toast.\n  };\n  socket.on('project.deleted', handler);\n  return () => {\n    socket.off('project.deleted', handler); // always clean up listeners\n  };\n}, []);"},{"id":"event-member-joined","name":"member.joined","direction":"server-to-client","category":"member","summary":"Someone joined the workspace or their role changed","description":"Sent when an invitation is accepted, and when a member’s workspace role changes (same payload, new role) — a transfer of ownership sends one for each of the two members.","namespace":"/","rooms":["workspace:{workspaceId}"],"authorization":"Workspace members.","handledBy":"InvitationsService / WorkspacesService → RealtimePublisher (server-web/src/modules/workspaces)","frontendBehavior":"Invalidate the member list; if it is you (role change), invalidate the workspace so permissions refresh.","related":["member.removed"],"payloadSchema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7, dedupe key — drop events already seen"},"event":{"type":"string"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"User who caused it; null for system jobs"},"causationId":{"description":"X-Client-Mutation-Id of the originating request, to skip your own echo","type":["string","null"]},"scope":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","task","comment","project","member","notification"]},"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","id"]},"data":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"avatarUrl":{"type":["string","null"]}},"required":["id","name","email","avatarUrl"]},"role":{"type":"string","enum":["OWNER","ADMIN","MEMBER","VIEWER"]}},"required":["user","role"]}},"required":["eventId","event","occurredAt","actorId","causationId","scope","entity","data"]},"examplePayload":{"eventId":"0193a1f2-7c3e-7d40-9b1a-000000000e01","event":"member.joined","occurredAt":"2026-11-16T09:00:00.000Z","actorId":"0193a1f2-0000-7000-8000-0000000000b1","causationId":"m-42","scope":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001"},"entity":{"type":"member","id":"0193a1f2-0000-7000-8000-0000000000b2"},"data":{"user":{"id":"0193a1f2-0000-7000-8000-0000000000b2","name":"Bob Tran","email":"bob@efl.dev","avatarUrl":null},"role":"MEMBER"}},"example":"import type { ServerToClientEvents } from '@efl/shared';\nimport { useEffect } from 'react';\nimport { getSocket } from '@/shared/lib/socket';\n\nuseEffect(() => {\n  const socket = getSocket();\n  const handler: ServerToClientEvents['member.joined'] = (payload) => {\n    // Invalidate the member list; if it is you (role change), invalidate the workspace so permissions refresh.\n  };\n  socket.on('member.joined', handler);\n  return () => {\n    socket.off('member.joined', handler); // always clean up listeners\n  };\n}, []);"},{"id":"event-member-removed","name":"member.removed","direction":"server-to-client","category":"member","summary":"Someone left or was removed from the workspace","description":"Sent to the workspace (the removed user included) right before their sockets are taken out of the workspace and project rooms (BR-W4). Their open tasks in this workspace are unassigned.","namespace":"/","rooms":["workspace:{workspaceId}"],"authorization":"Workspace members.","handledBy":"WorkspacesService → RealtimePublisher (server-web/src/modules/workspaces)","frontendBehavior":"Invalidate the member list. If userId is you: drop the workspace from caches and go to /home with a toast.","related":["member.joined"],"payloadSchema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7, dedupe key — drop events already seen"},"event":{"type":"string"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"User who caused it; null for system jobs"},"causationId":{"description":"X-Client-Mutation-Id of the originating request, to skip your own echo","type":["string","null"]},"scope":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","task","comment","project","member","notification"]},"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","id"]},"data":{"type":"object","properties":{"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reason":{"type":"string","enum":["removed","left"],"description":"Removed by an admin, or left on their own"}},"required":["userId","reason"]}},"required":["eventId","event","occurredAt","actorId","causationId","scope","entity","data"]},"examplePayload":{"eventId":"0193a1f2-7c3e-7d40-9b1a-000000000e01","event":"member.removed","occurredAt":"2026-11-16T09:00:00.000Z","actorId":"0193a1f2-0000-7000-8000-0000000000b1","causationId":"m-42","scope":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001"},"entity":{"type":"member","id":"0193a1f2-0000-7000-8000-0000000000b2"},"data":{"userId":"0193a1f2-0000-7000-8000-0000000000b2","reason":"removed"}},"example":"import type { ServerToClientEvents } from '@efl/shared';\nimport { useEffect } from 'react';\nimport { getSocket } from '@/shared/lib/socket';\n\nuseEffect(() => {\n  const socket = getSocket();\n  const handler: ServerToClientEvents['member.removed'] = (payload) => {\n    // Invalidate the member list. If userId is you: drop the workspace from caches and go to /home with a toast.\n  };\n  socket.on('member.removed', handler);\n  return () => {\n    socket.off('member.removed', handler); // always clean up listeners\n  };\n}, []);"},{"id":"event-workspace-deleted","name":"workspace.deleted","direction":"server-to-client","category":"workspace","summary":"The workspace was deleted","description":"Sent to the workspace right after it and everything in it were deleted (BR-W5). All sockets are then removed from the workspace room and from every project room of that workspace.","namespace":"/","rooms":["workspace:{workspaceId}"],"authorization":"Workspace members.","handledBy":"WorkspacesService → RealtimePublisher (server-web/src/modules/workspaces)","frontendBehavior":"Drop the workspace from caches; if you are inside it (and did not delete it yourself), go to /home with a toast.","related":["member.removed","project.deleted"],"payloadSchema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7, dedupe key — drop events already seen"},"event":{"type":"string"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"User who caused it; null for system jobs"},"causationId":{"description":"X-Client-Mutation-Id of the originating request, to skip your own echo","type":["string","null"]},"scope":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","task","comment","project","member","notification"]},"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","id"]},"data":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]}},"required":["eventId","event","occurredAt","actorId","causationId","scope","entity","data"]},"examplePayload":{"eventId":"0193a1f2-7c3e-7d40-9b1a-000000000e01","event":"workspace.deleted","occurredAt":"2026-11-16T09:00:00.000Z","actorId":"0193a1f2-0000-7000-8000-0000000000b1","causationId":"m-42","scope":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001"},"entity":{"type":"workspace","id":"0193a1f2-0000-7000-8000-000000000001"},"data":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001"}},"example":"import type { ServerToClientEvents } from '@efl/shared';\nimport { useEffect } from 'react';\nimport { getSocket } from '@/shared/lib/socket';\n\nuseEffect(() => {\n  const socket = getSocket();\n  const handler: ServerToClientEvents['workspace.deleted'] = (payload) => {\n    // Drop the workspace from caches; if you are inside it (and did not delete it yourself), go to /home with a toast.\n  };\n  socket.on('workspace.deleted', handler);\n  return () => {\n    socket.off('workspace.deleted', handler); // always clean up listeners\n  };\n}, []);"},{"id":"event-project-member-updated","name":"project.member.updated","direction":"server-to-client","category":"project","summary":"A project member was added, changed role or removed","description":"`role` is the explicit project role (null = removed); `effectiveRole` is what the user can do now (OWNER/ADMIN lead every project, WORKSPACE-visibility projects are open to all members). When `effectiveRole` is null the user’s sockets are taken out of `project:{projectId}` right after.","namespace":"/","rooms":["project:{projectId}","user:{userId}"],"authorization":"Users in the project room, and the affected user.","handledBy":"ProjectsService → RealtimePublisher (server-web/src/modules/projects)","frontendBehavior":"Invalidate the project members list. If userId is you: refetch the project and the project list (your permissions changed); when effectiveRole is null and the project is open, go to the workspace home with a toast.","related":["project.updated","member.removed"],"payloadSchema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7, dedupe key — drop events already seen"},"event":{"type":"string"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"User who caused it; null for system jobs"},"causationId":{"description":"X-Client-Mutation-Id of the originating request, to skip your own echo","type":["string","null"]},"scope":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","task","comment","project","member","notification"]},"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","id"]},"data":{"type":"object","properties":{"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"role":{"anyOf":[{"type":"string","enum":["LEAD","MEMBER","VIEWER"]},{"type":"null"}]},"effectiveRole":{"anyOf":[{"type":"string","enum":["LEAD","MEMBER","VIEWER"]},{"type":"null"}]}},"required":["projectId","userId","role","effectiveRole"]}},"required":["eventId","event","occurredAt","actorId","causationId","scope","entity","data"]},"examplePayload":{"eventId":"0193a1f2-7c3e-7d40-9b1a-000000000e01","event":"project.member.updated","occurredAt":"2026-11-16T09:00:00.000Z","actorId":"0193a1f2-0000-7000-8000-0000000000b1","causationId":"m-42","scope":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001","projectId":"0193a1f2-0000-7000-8000-0000000000a1"},"entity":{"type":"member","id":"0193a1f2-0000-7000-8000-0000000000b2"},"data":{"projectId":"0193a1f2-0000-7000-8000-0000000000a1","userId":"0193a1f2-0000-7000-8000-0000000000b2","role":"MEMBER","effectiveRole":"MEMBER"}},"example":"import type { ServerToClientEvents } from '@efl/shared';\nimport { useEffect } from 'react';\nimport { getSocket } from '@/shared/lib/socket';\n\nuseEffect(() => {\n  const socket = getSocket();\n  const handler: ServerToClientEvents['project.member.updated'] = (payload) => {\n    // Invalidate the project members list. If userId is you: refetch the project and the project list (your permissions changed); when effectiveRole is null and the project is open, go to the workspace home with a toast.\n  };\n  socket.on('project.member.updated', handler);\n  return () => {\n    socket.off('project.member.updated', handler); // always clean up listeners\n  };\n}, []);"},{"id":"event-task-created","name":"task.created","direction":"server-to-client","category":"task","summary":"A task or subtask was created","description":"Carries the full task as the API returns it. Subtasks have `parentTaskId` set — update the parent counters instead of adding a card.","namespace":"/","rooms":["project:{projectId}","user:{assigneeId}","user:{previousAssigneeId}"],"authorization":"Sockets that joined the project room (any effective project role).","handledBy":"TasksService → RealtimePublisher (server-web/src/modules/tasks)","frontendBehavior":"Insert into the task list cache (skip if causationId is your own pending mutation); for a subtask refresh the parent.","related":["task.updated","task.deleted"],"payloadSchema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7, dedupe key — drop events already seen"},"event":{"type":"string"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"User who caused it; null for system jobs"},"causationId":{"description":"X-Client-Mutation-Id of the originating request, to skip your own echo","type":["string","null"]},"scope":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","task","comment","project","member","notification"]},"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","id"]},"data":{"type":"object","properties":{"task":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["TODO","IN_PROGRESS","IN_REVIEW","DONE","CANCELLED"]},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH","URGENT"]},"assignee":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"avatarUrl":{"type":["string","null"]}},"required":["id","name","email","avatarUrl"]},{"type":"null"}]},"reporter":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"avatarUrl":{"type":["string","null"]}},"required":["id","name","email","avatarUrl"]},"parentTaskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"scheduledDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"estimatedHours":{"type":["number","null"]},"actualHours":{"type":["number","null"]},"position":{"type":"string"},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"recurrence":{"anyOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["DAILY","WEEKDAYS","WEEKLY","MONTHLY"]},"interval":{"type":"integer","minimum":1,"maximum":99},"weekdays":{"maxItems":7,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"monthDay":{"type":"integer","minimum":1,"maximum":31},"until":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]}},"required":["frequency","interval"]},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"color":{"type":"string","enum":["gray","primary","secondary","accent","success","warning","danger"]}},"required":["id","name","color"]}},"isOverdue":{"type":"boolean"},"subtaskCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"subtaskDoneCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"commentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"attachmentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blockedByOpenCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","workspaceId","key","number","title","description","status","priority","assignee","reporter","parentTaskId","startDate","dueDate","scheduledDate","estimatedHours","actualHours","position","completedAt","recurrence","version","labels","isOverdue","subtaskCount","subtaskDoneCount","commentCount","attachmentCount","blockedByOpenCount","createdAt","updatedAt"]}},"required":["task"]}},"required":["eventId","event","occurredAt","actorId","causationId","scope","entity","data"]},"examplePayload":{"eventId":"0193a1f2-7c3e-7d40-9b1a-000000000e01","event":"task.created","occurredAt":"2026-11-16T09:00:00.000Z","actorId":"0193a1f2-0000-7000-8000-0000000000b1","causationId":"m-42","scope":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001","projectId":"0193a1f2-0000-7000-8000-0000000000a1"},"entity":{"type":"task","id":"0193a1f2-0000-7000-8000-0000000000c1","version":4},"data":{"task":{"id":"0193a1f2-0000-7000-8000-0000000000c1","projectId":"0193a1f2-0000-7000-8000-0000000000a1","workspaceId":"0193a1f2-0000-7000-8000-000000000001","key":"WEB-12","number":12,"title":"Drag & drop between columns","description":null,"status":"IN_PROGRESS","priority":"HIGH","assignee":{"id":"0193a1f2-0000-7000-8000-0000000000b2","name":"Bob Tran","email":"bob@efl.dev","avatarUrl":null},"reporter":{"id":"0193a1f2-0000-7000-8000-0000000000b1","name":"Alice Nguyen","email":"alice@efl.dev","avatarUrl":null},"parentTaskId":null,"startDate":null,"dueDate":"2026-11-20T17:00:00.000Z","scheduledDate":"2026-11-17","estimatedHours":3,"actualHours":null,"position":"a1","completedAt":null,"recurrence":null,"version":4,"labels":[{"id":"0193a1f2-0000-7000-8000-0000000000e1","name":"frontend","color":"success"}],"isOverdue":false,"subtaskCount":2,"subtaskDoneCount":1,"commentCount":3,"attachmentCount":0,"blockedByOpenCount":0,"createdAt":"2026-11-10T08:00:00.000Z","updatedAt":"2026-11-16T09:00:00.000Z"}}},"example":"import type { ServerToClientEvents } from '@efl/shared';\nimport { useEffect } from 'react';\nimport { getSocket } from '@/shared/lib/socket';\n\nuseEffect(() => {\n  const socket = getSocket();\n  const handler: ServerToClientEvents['task.created'] = (payload) => {\n    // Insert into the task list cache (skip if causationId is your own pending mutation); for a subtask refresh the parent.\n  };\n  socket.on('task.created', handler);\n  return () => {\n    socket.off('task.created', handler); // always clean up listeners\n  };\n}, []);"},{"id":"event-task-updated","name":"task.updated","direction":"server-to-client","category":"task","summary":"Task fields, schedule or labels changed","description":"Sent after PATCH /tasks/:id, PATCH /tasks/:id/schedule and PUT /tasks/:id/labels. `entity.version` equals `task.version`; ignore it when your cached version is already ≥.","namespace":"/","rooms":["project:{projectId}","user:{assigneeId}","user:{previousAssigneeId}"],"authorization":"Sockets that joined the project room (any effective project role).","handledBy":"TasksService → RealtimePublisher (server-web/src/modules/tasks)","frontendBehavior":"Replace the cached task when the version is newer; refresh the parent counters for subtasks.","related":["task.created","task.assigned"],"payloadSchema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7, dedupe key — drop events already seen"},"event":{"type":"string"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"User who caused it; null for system jobs"},"causationId":{"description":"X-Client-Mutation-Id of the originating request, to skip your own echo","type":["string","null"]},"scope":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","task","comment","project","member","notification"]},"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","id"]},"data":{"type":"object","properties":{"task":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["TODO","IN_PROGRESS","IN_REVIEW","DONE","CANCELLED"]},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH","URGENT"]},"assignee":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"avatarUrl":{"type":["string","null"]}},"required":["id","name","email","avatarUrl"]},{"type":"null"}]},"reporter":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"avatarUrl":{"type":["string","null"]}},"required":["id","name","email","avatarUrl"]},"parentTaskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"scheduledDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"estimatedHours":{"type":["number","null"]},"actualHours":{"type":["number","null"]},"position":{"type":"string"},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"recurrence":{"anyOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["DAILY","WEEKDAYS","WEEKLY","MONTHLY"]},"interval":{"type":"integer","minimum":1,"maximum":99},"weekdays":{"maxItems":7,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"monthDay":{"type":"integer","minimum":1,"maximum":31},"until":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]}},"required":["frequency","interval"]},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"color":{"type":"string","enum":["gray","primary","secondary","accent","success","warning","danger"]}},"required":["id","name","color"]}},"isOverdue":{"type":"boolean"},"subtaskCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"subtaskDoneCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"commentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"attachmentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blockedByOpenCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","workspaceId","key","number","title","description","status","priority","assignee","reporter","parentTaskId","startDate","dueDate","scheduledDate","estimatedHours","actualHours","position","completedAt","recurrence","version","labels","isOverdue","subtaskCount","subtaskDoneCount","commentCount","attachmentCount","blockedByOpenCount","createdAt","updatedAt"]},"changedFields":{"type":"array","items":{"type":"string"},"description":"API field names that changed, e.g. [\"status\", \"completedAt\"]"}},"required":["task","changedFields"]}},"required":["eventId","event","occurredAt","actorId","causationId","scope","entity","data"]},"examplePayload":{"eventId":"0193a1f2-7c3e-7d40-9b1a-000000000e01","event":"task.updated","occurredAt":"2026-11-16T09:00:00.000Z","actorId":"0193a1f2-0000-7000-8000-0000000000b1","causationId":"m-42","scope":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001","projectId":"0193a1f2-0000-7000-8000-0000000000a1"},"entity":{"type":"task","id":"0193a1f2-0000-7000-8000-0000000000c1","version":4},"data":{"task":{"id":"0193a1f2-0000-7000-8000-0000000000c1","projectId":"0193a1f2-0000-7000-8000-0000000000a1","workspaceId":"0193a1f2-0000-7000-8000-000000000001","key":"WEB-12","number":12,"title":"Drag & drop between columns","description":null,"status":"IN_PROGRESS","priority":"HIGH","assignee":{"id":"0193a1f2-0000-7000-8000-0000000000b2","name":"Bob Tran","email":"bob@efl.dev","avatarUrl":null},"reporter":{"id":"0193a1f2-0000-7000-8000-0000000000b1","name":"Alice Nguyen","email":"alice@efl.dev","avatarUrl":null},"parentTaskId":null,"startDate":null,"dueDate":"2026-11-20T17:00:00.000Z","scheduledDate":"2026-11-17","estimatedHours":3,"actualHours":null,"position":"a1","completedAt":null,"recurrence":null,"version":4,"labels":[{"id":"0193a1f2-0000-7000-8000-0000000000e1","name":"frontend","color":"success"}],"isOverdue":false,"subtaskCount":2,"subtaskDoneCount":1,"commentCount":3,"attachmentCount":0,"blockedByOpenCount":0,"createdAt":"2026-11-10T08:00:00.000Z","updatedAt":"2026-11-16T09:00:00.000Z"},"changedFields":["status"]}},"example":"import type { ServerToClientEvents } from '@efl/shared';\nimport { useEffect } from 'react';\nimport { getSocket } from '@/shared/lib/socket';\n\nuseEffect(() => {\n  const socket = getSocket();\n  const handler: ServerToClientEvents['task.updated'] = (payload) => {\n    // Replace the cached task when the version is newer; refresh the parent counters for subtasks.\n  };\n  socket.on('task.updated', handler);\n  return () => {\n    socket.off('task.updated', handler); // always clean up listeners\n  };\n}, []);"},{"id":"event-task-deleted","name":"task.deleted","direction":"server-to-client","category":"task","summary":"A task was deleted (with its subtasks, comments and attachments)","description":"Deleting a parent deletes its subtasks; one event is sent for the parent only.","namespace":"/","rooms":["project:{projectId}","user:{assigneeId}","user:{previousAssigneeId}"],"authorization":"Sockets that joined the project room (any effective project role).","handledBy":"TasksService → RealtimePublisher (server-web/src/modules/tasks)","frontendBehavior":"Remove it from caches; close its drawer with a toast if it is open.","related":["task.created"],"payloadSchema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7, dedupe key — drop events already seen"},"event":{"type":"string"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"User who caused it; null for system jobs"},"causationId":{"description":"X-Client-Mutation-Id of the originating request, to skip your own echo","type":["string","null"]},"scope":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","task","comment","project","member","notification"]},"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","id"]},"data":{"type":"object","properties":{"taskId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"parentTaskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["taskId","parentTaskId"]}},"required":["eventId","event","occurredAt","actorId","causationId","scope","entity","data"]},"examplePayload":{"eventId":"0193a1f2-7c3e-7d40-9b1a-000000000e01","event":"task.deleted","occurredAt":"2026-11-16T09:00:00.000Z","actorId":"0193a1f2-0000-7000-8000-0000000000b1","causationId":"m-42","scope":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001","projectId":"0193a1f2-0000-7000-8000-0000000000a1"},"entity":{"type":"task","id":"0193a1f2-0000-7000-8000-0000000000c1"},"data":{"taskId":"0193a1f2-0000-7000-8000-0000000000c1","parentTaskId":null}},"example":"import type { ServerToClientEvents } from '@efl/shared';\nimport { useEffect } from 'react';\nimport { getSocket } from '@/shared/lib/socket';\n\nuseEffect(() => {\n  const socket = getSocket();\n  const handler: ServerToClientEvents['task.deleted'] = (payload) => {\n    // Remove it from caches; close its drawer with a toast if it is open.\n  };\n  socket.on('task.deleted', handler);\n  return () => {\n    socket.off('task.deleted', handler); // always clean up listeners\n  };\n}, []);"},{"id":"event-task-assigned","name":"task.assigned","direction":"server-to-client","category":"task","summary":"The assignee changed (or was cleared)","description":"Sent after PATCH /tasks/:id/assignee, and when a member removed from the workspace is unassigned (BR-W4).","namespace":"/","rooms":["project:{projectId}","user:{assigneeId}","user:{previousAssigneeId}"],"authorization":"Sockets that joined the project room (any effective project role).","handledBy":"TasksService → RealtimePublisher (server-web/src/modules/tasks)","frontendBehavior":"Replace the cached task when the version is newer; invalidate My Day if you are the old or new assignee.","related":["task.updated"],"payloadSchema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7, dedupe key — drop events already seen"},"event":{"type":"string"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"User who caused it; null for system jobs"},"causationId":{"description":"X-Client-Mutation-Id of the originating request, to skip your own echo","type":["string","null"]},"scope":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","task","comment","project","member","notification"]},"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","id"]},"data":{"type":"object","properties":{"task":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["TODO","IN_PROGRESS","IN_REVIEW","DONE","CANCELLED"]},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH","URGENT"]},"assignee":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"avatarUrl":{"type":["string","null"]}},"required":["id","name","email","avatarUrl"]},{"type":"null"}]},"reporter":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"avatarUrl":{"type":["string","null"]}},"required":["id","name","email","avatarUrl"]},"parentTaskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"scheduledDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"estimatedHours":{"type":["number","null"]},"actualHours":{"type":["number","null"]},"position":{"type":"string"},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"recurrence":{"anyOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["DAILY","WEEKDAYS","WEEKLY","MONTHLY"]},"interval":{"type":"integer","minimum":1,"maximum":99},"weekdays":{"maxItems":7,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"monthDay":{"type":"integer","minimum":1,"maximum":31},"until":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]}},"required":["frequency","interval"]},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"color":{"type":"string","enum":["gray","primary","secondary","accent","success","warning","danger"]}},"required":["id","name","color"]}},"isOverdue":{"type":"boolean"},"subtaskCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"subtaskDoneCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"commentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"attachmentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blockedByOpenCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","workspaceId","key","number","title","description","status","priority","assignee","reporter","parentTaskId","startDate","dueDate","scheduledDate","estimatedHours","actualHours","position","completedAt","recurrence","version","labels","isOverdue","subtaskCount","subtaskDoneCount","commentCount","attachmentCount","blockedByOpenCount","createdAt","updatedAt"]},"previousAssigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["task","previousAssigneeId"]}},"required":["eventId","event","occurredAt","actorId","causationId","scope","entity","data"]},"examplePayload":{"eventId":"0193a1f2-7c3e-7d40-9b1a-000000000e01","event":"task.assigned","occurredAt":"2026-11-16T09:00:00.000Z","actorId":"0193a1f2-0000-7000-8000-0000000000b1","causationId":"m-42","scope":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001","projectId":"0193a1f2-0000-7000-8000-0000000000a1"},"entity":{"type":"task","id":"0193a1f2-0000-7000-8000-0000000000c1","version":4},"data":{"task":{"id":"0193a1f2-0000-7000-8000-0000000000c1","projectId":"0193a1f2-0000-7000-8000-0000000000a1","workspaceId":"0193a1f2-0000-7000-8000-000000000001","key":"WEB-12","number":12,"title":"Drag & drop between columns","description":null,"status":"IN_PROGRESS","priority":"HIGH","assignee":{"id":"0193a1f2-0000-7000-8000-0000000000b2","name":"Bob Tran","email":"bob@efl.dev","avatarUrl":null},"reporter":{"id":"0193a1f2-0000-7000-8000-0000000000b1","name":"Alice Nguyen","email":"alice@efl.dev","avatarUrl":null},"parentTaskId":null,"startDate":null,"dueDate":"2026-11-20T17:00:00.000Z","scheduledDate":"2026-11-17","estimatedHours":3,"actualHours":null,"position":"a1","completedAt":null,"recurrence":null,"version":4,"labels":[{"id":"0193a1f2-0000-7000-8000-0000000000e1","name":"frontend","color":"success"}],"isOverdue":false,"subtaskCount":2,"subtaskDoneCount":1,"commentCount":3,"attachmentCount":0,"blockedByOpenCount":0,"createdAt":"2026-11-10T08:00:00.000Z","updatedAt":"2026-11-16T09:00:00.000Z"},"previousAssigneeId":null}},"example":"import type { ServerToClientEvents } from '@efl/shared';\nimport { useEffect } from 'react';\nimport { getSocket } from '@/shared/lib/socket';\n\nuseEffect(() => {\n  const socket = getSocket();\n  const handler: ServerToClientEvents['task.assigned'] = (payload) => {\n    // Replace the cached task when the version is newer; invalidate My Day if you are the old or new assignee.\n  };\n  socket.on('task.assigned', handler);\n  return () => {\n    socket.off('task.assigned', handler); // always clean up listeners\n  };\n}, []);"},{"id":"event-task-moved","name":"task.moved","direction":"server-to-client","category":"task","summary":"A card was dragged on the Kanban board (new status and/or position)","description":"Sent after PATCH /tasks/:id/move. `task.position` is the new fractional index inside `task.status`; sort each column by position (byte order, like COLLATE \"C\"). A status change also sets or clears `completedAt` (BR-T1).","namespace":"/","rooms":["project:{projectId}","user:{assigneeId}","user:{previousAssigneeId}"],"authorization":"Sockets that joined the project room (any effective project role).","handledBy":"TasksService → RealtimePublisher (server-web/src/modules/tasks)","frontendBehavior":"When the version is newer: remove the card from its old column and insert it into `task.status` at its position; update the task caches too.","related":["task.updated"],"payloadSchema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7, dedupe key — drop events already seen"},"event":{"type":"string"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"User who caused it; null for system jobs"},"causationId":{"description":"X-Client-Mutation-Id of the originating request, to skip your own echo","type":["string","null"]},"scope":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","task","comment","project","member","notification"]},"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","id"]},"data":{"type":"object","properties":{"task":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"key":{"type":"string"},"number":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"title":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["TODO","IN_PROGRESS","IN_REVIEW","DONE","CANCELLED"]},"priority":{"type":"string","enum":["LOW","MEDIUM","HIGH","URGENT"]},"assignee":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"avatarUrl":{"type":["string","null"]}},"required":["id","name","email","avatarUrl"]},{"type":"null"}]},"reporter":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"avatarUrl":{"type":["string","null"]}},"required":["id","name","email","avatarUrl"]},"parentTaskId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"scheduledDate":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"estimatedHours":{"type":["number","null"]},"actualHours":{"type":["number","null"]},"position":{"type":"string"},"completedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"recurrence":{"anyOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["DAILY","WEEKDAYS","WEEKLY","MONTHLY"]},"interval":{"type":"integer","minimum":1,"maximum":99},"weekdays":{"maxItems":7,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"monthDay":{"type":"integer","minimum":1,"maximum":31},"until":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]}},"required":["frequency","interval"]},{"type":"null"}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"labels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"color":{"type":"string","enum":["gray","primary","secondary","accent","success","warning","danger"]}},"required":["id","name","color"]}},"isOverdue":{"type":"boolean"},"subtaskCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"subtaskDoneCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"commentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"attachmentCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"blockedByOpenCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","projectId","workspaceId","key","number","title","description","status","priority","assignee","reporter","parentTaskId","startDate","dueDate","scheduledDate","estimatedHours","actualHours","position","completedAt","recurrence","version","labels","isOverdue","subtaskCount","subtaskDoneCount","commentCount","attachmentCount","blockedByOpenCount","createdAt","updatedAt"]},"previousStatus":{"type":"string","enum":["TODO","IN_PROGRESS","IN_REVIEW","DONE","CANCELLED"]}},"required":["task","previousStatus"]}},"required":["eventId","event","occurredAt","actorId","causationId","scope","entity","data"]},"examplePayload":{"eventId":"0193a1f2-7c3e-7d40-9b1a-000000000e01","event":"task.moved","occurredAt":"2026-11-16T09:00:00.000Z","actorId":"0193a1f2-0000-7000-8000-0000000000b1","causationId":"m-42","scope":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001","projectId":"0193a1f2-0000-7000-8000-0000000000a1"},"entity":{"type":"task","id":"0193a1f2-0000-7000-8000-0000000000c1","version":4},"data":{"task":{"id":"0193a1f2-0000-7000-8000-0000000000c1","projectId":"0193a1f2-0000-7000-8000-0000000000a1","workspaceId":"0193a1f2-0000-7000-8000-000000000001","key":"WEB-12","number":12,"title":"Drag & drop between columns","description":null,"status":"IN_PROGRESS","priority":"HIGH","assignee":{"id":"0193a1f2-0000-7000-8000-0000000000b2","name":"Bob Tran","email":"bob@efl.dev","avatarUrl":null},"reporter":{"id":"0193a1f2-0000-7000-8000-0000000000b1","name":"Alice Nguyen","email":"alice@efl.dev","avatarUrl":null},"parentTaskId":null,"startDate":null,"dueDate":"2026-11-20T17:00:00.000Z","scheduledDate":"2026-11-17","estimatedHours":3,"actualHours":null,"position":"a1","completedAt":null,"recurrence":null,"version":4,"labels":[{"id":"0193a1f2-0000-7000-8000-0000000000e1","name":"frontend","color":"success"}],"isOverdue":false,"subtaskCount":2,"subtaskDoneCount":1,"commentCount":3,"attachmentCount":0,"blockedByOpenCount":0,"createdAt":"2026-11-10T08:00:00.000Z","updatedAt":"2026-11-16T09:00:00.000Z"},"previousStatus":"TODO"}},"example":"import type { ServerToClientEvents } from '@efl/shared';\nimport { useEffect } from 'react';\nimport { getSocket } from '@/shared/lib/socket';\n\nuseEffect(() => {\n  const socket = getSocket();\n  const handler: ServerToClientEvents['task.moved'] = (payload) => {\n    // When the version is newer: remove the card from its old column and insert it into `task.status` at its position; update the task caches too.\n  };\n  socket.on('task.moved', handler);\n  return () => {\n    socket.off('task.moved', handler); // always clean up listeners\n  };\n}, []);"},{"id":"event-task-dependencies-changed","name":"task.dependencies.changed","direction":"server-to-client","category":"task","summary":"A \"blocked by\" link was added or removed, or a blocker opened / finished","description":"Sent after POST / DELETE /tasks/:id/dependencies (both tasks in `taskIds`) and after a task that blocks others enters or leaves DONE / CANCELLED (the blocker and its blocked tasks). `counts` carries the new `blockedByOpenCount` of the blocked tasks. Task versions do not change.","namespace":"/","rooms":["project:{projectId}"],"authorization":"Sockets that joined the project room (any effective project role).","handledBy":"DependenciesService / TasksService → RealtimePublisher (server-web/src/modules/tasks)","frontendBehavior":"Patch `blockedByOpenCount` on cached cards / tasks from `counts` (no version check) and refetch the open dependency lists of `taskIds`.","related":["task.updated","task.moved"],"payloadSchema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7, dedupe key — drop events already seen"},"event":{"type":"string"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"User who caused it; null for system jobs"},"causationId":{"description":"X-Client-Mutation-Id of the originating request, to skip your own echo","type":["string","null"]},"scope":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","task","comment","project","member","notification"]},"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","id"]},"data":{"type":"object","properties":{"taskIds":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"counts":{"type":"array","items":{"type":"object","properties":{"taskId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"blockedByOpenCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["taskId","blockedByOpenCount"]}}},"required":["taskIds","counts"]}},"required":["eventId","event","occurredAt","actorId","causationId","scope","entity","data"]},"examplePayload":{"eventId":"0193a1f2-7c3e-7d40-9b1a-000000000e01","event":"task.dependencies.changed","occurredAt":"2026-11-16T09:00:00.000Z","actorId":"0193a1f2-0000-7000-8000-0000000000b1","causationId":"m-42","scope":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001","projectId":"0193a1f2-0000-7000-8000-0000000000a1"},"entity":{"type":"task","id":"0193a1f2-0000-7000-8000-0000000000c1","version":4},"data":{"taskIds":["0193a1f2-0000-7000-8000-0000000000c1","0193a1f2-0000-7000-8000-0000000000c2"],"counts":[{"taskId":"0193a1f2-0000-7000-8000-0000000000c1","blockedByOpenCount":1}]}},"example":"import type { ServerToClientEvents } from '@efl/shared';\nimport { useEffect } from 'react';\nimport { getSocket } from '@/shared/lib/socket';\n\nuseEffect(() => {\n  const socket = getSocket();\n  const handler: ServerToClientEvents['task.dependencies.changed'] = (payload) => {\n    // Patch `blockedByOpenCount` on cached cards / tasks from `counts` (no version check) and refetch the open dependency lists of `taskIds`.\n  };\n  socket.on('task.dependencies.changed', handler);\n  return () => {\n    socket.off('task.dependencies.changed', handler); // always clean up listeners\n  };\n}, []);"},{"id":"event-task-time-changed","name":"task.time.changed","direction":"server-to-client","category":"task","summary":"A time entry of the task was started, stopped, logged or deleted","description":"Sent after the timer / time-entry endpoints. Starting a timer also stops the user's running one, which emits this event for that other task too. Task versions do not change.","namespace":"/","rooms":["project:{projectId}"],"authorization":"Sockets that joined the project room (any effective project role).","handledBy":"TimeEntriesService → RealtimePublisher (server-web/src/modules/tasks)","frontendBehavior":"Refetch the time entries of `taskId` if they are loaded.","related":["task.dependencies.changed"],"payloadSchema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7, dedupe key — drop events already seen"},"event":{"type":"string"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"User who caused it; null for system jobs"},"causationId":{"description":"X-Client-Mutation-Id of the originating request, to skip your own echo","type":["string","null"]},"scope":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","task","comment","project","member","notification"]},"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","id"]},"data":{"type":"object","properties":{"taskId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["taskId"]}},"required":["eventId","event","occurredAt","actorId","causationId","scope","entity","data"]},"examplePayload":{"eventId":"0193a1f2-7c3e-7d40-9b1a-000000000e01","event":"task.time.changed","occurredAt":"2026-11-16T09:00:00.000Z","actorId":"0193a1f2-0000-7000-8000-0000000000b1","causationId":"m-42","scope":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001","projectId":"0193a1f2-0000-7000-8000-0000000000a1"},"entity":{"type":"task","id":"0193a1f2-0000-7000-8000-0000000000c1","version":4},"data":{"taskId":"0193a1f2-0000-7000-8000-0000000000c1"}},"example":"import type { ServerToClientEvents } from '@efl/shared';\nimport { useEffect } from 'react';\nimport { getSocket } from '@/shared/lib/socket';\n\nuseEffect(() => {\n  const socket = getSocket();\n  const handler: ServerToClientEvents['task.time.changed'] = (payload) => {\n    // Refetch the time entries of `taskId` if they are loaded.\n  };\n  socket.on('task.time.changed', handler);\n  return () => {\n    socket.off('task.time.changed', handler); // always clean up listeners\n  };\n}, []);"},{"id":"event-comment-created","name":"comment.created","direction":"server-to-client","category":"comment","summary":"A comment or reply was posted","description":"Replies have `parentId` set (one level deep).","namespace":"/","rooms":["project:{projectId}"],"authorization":"Sockets that joined the project room (any effective project role).","handledBy":"CommentsService → RealtimePublisher (server-web/src/modules/tasks)","frontendBehavior":"Append to the task's comment cache if it is loaded; bump the task's commentCount.","related":["comment.updated","comment.deleted"],"payloadSchema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7, dedupe key — drop events already seen"},"event":{"type":"string"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"User who caused it; null for system jobs"},"causationId":{"description":"X-Client-Mutation-Id of the originating request, to skip your own echo","type":["string","null"]},"scope":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","task","comment","project","member","notification"]},"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","id"]},"data":{"type":"object","properties":{"comment":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"taskId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"author":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"avatarUrl":{"type":["string","null"]}},"required":["id","name","email","avatarUrl"]},"parentId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"body":{"type":["string","null"]},"editedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"replyCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","taskId","author","parentId","body","editedAt","deletedAt","createdAt","replyCount"]}},"required":["comment"]}},"required":["eventId","event","occurredAt","actorId","causationId","scope","entity","data"]},"examplePayload":{"eventId":"0193a1f2-7c3e-7d40-9b1a-000000000e01","event":"comment.created","occurredAt":"2026-11-16T09:00:00.000Z","actorId":"0193a1f2-0000-7000-8000-0000000000b1","causationId":"m-42","scope":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001","projectId":"0193a1f2-0000-7000-8000-0000000000a1"},"entity":{"type":"comment","id":"0193a1f2-0000-7000-8000-0000000000d1"},"data":{"comment":{"id":"0193a1f2-0000-7000-8000-0000000000d1","taskId":"0193a1f2-0000-7000-8000-0000000000c1","author":{"id":"0193a1f2-0000-7000-8000-0000000000b2","name":"Bob Tran","email":"bob@efl.dev","avatarUrl":null},"parentId":null,"body":"Pushed a fix for the drop target.","editedAt":null,"deletedAt":null,"createdAt":"2026-11-16T09:00:00.000Z","replyCount":0}}},"example":"import type { ServerToClientEvents } from '@efl/shared';\nimport { useEffect } from 'react';\nimport { getSocket } from '@/shared/lib/socket';\n\nuseEffect(() => {\n  const socket = getSocket();\n  const handler: ServerToClientEvents['comment.created'] = (payload) => {\n    // Append to the task's comment cache if it is loaded; bump the task's commentCount.\n  };\n  socket.on('comment.created', handler);\n  return () => {\n    socket.off('comment.created', handler); // always clean up listeners\n  };\n}, []);"},{"id":"event-comment-updated","name":"comment.updated","direction":"server-to-client","category":"comment","summary":"A comment was edited","description":"`editedAt` is set.","namespace":"/","rooms":["project:{projectId}"],"authorization":"Sockets that joined the project room (any effective project role).","handledBy":"CommentsService → RealtimePublisher (server-web/src/modules/tasks)","frontendBehavior":"Replace the comment in the cache.","related":["comment.created"],"payloadSchema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7, dedupe key — drop events already seen"},"event":{"type":"string"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"User who caused it; null for system jobs"},"causationId":{"description":"X-Client-Mutation-Id of the originating request, to skip your own echo","type":["string","null"]},"scope":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","task","comment","project","member","notification"]},"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","id"]},"data":{"type":"object","properties":{"comment":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"taskId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"author":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"avatarUrl":{"type":["string","null"]}},"required":["id","name","email","avatarUrl"]},"parentId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"body":{"type":["string","null"]},"editedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"deletedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"replyCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","taskId","author","parentId","body","editedAt","deletedAt","createdAt","replyCount"]}},"required":["comment"]}},"required":["eventId","event","occurredAt","actorId","causationId","scope","entity","data"]},"examplePayload":{"eventId":"0193a1f2-7c3e-7d40-9b1a-000000000e01","event":"comment.updated","occurredAt":"2026-11-16T09:00:00.000Z","actorId":"0193a1f2-0000-7000-8000-0000000000b1","causationId":"m-42","scope":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001","projectId":"0193a1f2-0000-7000-8000-0000000000a1"},"entity":{"type":"comment","id":"0193a1f2-0000-7000-8000-0000000000d1"},"data":{"comment":{"id":"0193a1f2-0000-7000-8000-0000000000d1","taskId":"0193a1f2-0000-7000-8000-0000000000c1","author":{"id":"0193a1f2-0000-7000-8000-0000000000b2","name":"Bob Tran","email":"bob@efl.dev","avatarUrl":null},"parentId":null,"body":"Pushed a fix for the drop target.","editedAt":"2026-11-16T09:05:00.000Z","deletedAt":null,"createdAt":"2026-11-16T09:00:00.000Z","replyCount":0}}},"example":"import type { ServerToClientEvents } from '@efl/shared';\nimport { useEffect } from 'react';\nimport { getSocket } from '@/shared/lib/socket';\n\nuseEffect(() => {\n  const socket = getSocket();\n  const handler: ServerToClientEvents['comment.updated'] = (payload) => {\n    // Replace the comment in the cache.\n  };\n  socket.on('comment.updated', handler);\n  return () => {\n    socket.off('comment.updated', handler); // always clean up listeners\n  };\n}, []);"},{"id":"event-comment-deleted","name":"comment.deleted","direction":"server-to-client","category":"comment","summary":"A comment was deleted","description":"With replies it is soft-deleted (`soft: true`, body hidden, replies stay); otherwise the row is removed.","namespace":"/","rooms":["project:{projectId}"],"authorization":"Sockets that joined the project room (any effective project role).","handledBy":"CommentsService → RealtimePublisher (server-web/src/modules/tasks)","frontendBehavior":"Remove it (or show \"comment deleted\" when soft); decrement the task commentCount.","related":["comment.created"],"payloadSchema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7, dedupe key — drop events already seen"},"event":{"type":"string"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"User who caused it; null for system jobs"},"causationId":{"description":"X-Client-Mutation-Id of the originating request, to skip your own echo","type":["string","null"]},"scope":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","task","comment","project","member","notification"]},"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","id"]},"data":{"type":"object","properties":{"commentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"taskId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"soft":{"type":"boolean"}},"required":["commentId","taskId","soft"]}},"required":["eventId","event","occurredAt","actorId","causationId","scope","entity","data"]},"examplePayload":{"eventId":"0193a1f2-7c3e-7d40-9b1a-000000000e01","event":"comment.deleted","occurredAt":"2026-11-16T09:00:00.000Z","actorId":"0193a1f2-0000-7000-8000-0000000000b1","causationId":"m-42","scope":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001","projectId":"0193a1f2-0000-7000-8000-0000000000a1"},"entity":{"type":"comment","id":"0193a1f2-0000-7000-8000-0000000000d1"},"data":{"commentId":"0193a1f2-0000-7000-8000-0000000000d1","taskId":"0193a1f2-0000-7000-8000-0000000000c1","soft":false}},"example":"import type { ServerToClientEvents } from '@efl/shared';\nimport { useEffect } from 'react';\nimport { getSocket } from '@/shared/lib/socket';\n\nuseEffect(() => {\n  const socket = getSocket();\n  const handler: ServerToClientEvents['comment.deleted'] = (payload) => {\n    // Remove it (or show \"comment deleted\" when soft); decrement the task commentCount.\n  };\n  socket.on('comment.deleted', handler);\n  return () => {\n    socket.off('comment.deleted', handler); // always clean up listeners\n  };\n}, []);"},{"id":"event-notification-created","name":"notification.created","direction":"server-to-client","category":"notification","summary":"You have a new notification","description":"Sent only to the recipient, after the notification is stored. Created from domain events (assigned, comment on your task, reply, mention, invitation, added to a project) and by the daily deadline job (due soon, overdue). The actor is never notified about their own action; `dedupeKey` keeps one notification per (user, key).","namespace":"/","rooms":["user:{userId}"],"authorization":"The recipient only.","handledBy":"NotificationsService → RealtimePublisher (server-web/src/modules/notifications)","frontendBehavior":"Prepend it to the notification lists, set the unread badge to `unreadCount`, show a toast with a link.","related":["notification.read","task.assigned","comment.created"],"payloadSchema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7, dedupe key — drop events already seen"},"event":{"type":"string"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"User who caused it; null for system jobs"},"causationId":{"description":"X-Client-Mutation-Id of the originating request, to skip your own echo","type":["string","null"]},"scope":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","task","comment","project","member","notification"]},"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","id"]},"data":{"type":"object","properties":{"notification":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","enum":["TASK_ASSIGNED","TASK_DUE_SOON","TASK_OVERDUE","TASK_COMMENTED","COMMENT_REPLIED","COMMENT_MENTIONED","WORKSPACE_INVITATION","PROJECT_MEMBER_ADDED","TASK_UNBLOCKED"]},"title":{"type":"string"},"body":{"type":["string","null"]},"data":{"type":"object","properties":{"workspaceSlug":{"type":"string"},"workspaceName":{"type":"string"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectName":{"type":"string"},"taskId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"taskKey":{"type":"string"},"commentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"invitationToken":{"type":"string"},"reminder":{"type":"string","enum":["due-12h","due-1h"]}}},"workspaceId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"actor":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"name":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"avatarUrl":{"type":["string","null"]}},"required":["id","name","email","avatarUrl"]},{"type":"null"}]},"readAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","type","title","body","data","workspaceId","actor","readAt","createdAt"]},"unreadCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["notification","unreadCount"]}},"required":["eventId","event","occurredAt","actorId","causationId","scope","entity","data"]},"examplePayload":{"eventId":"0193a1f2-7c3e-7d40-9b1a-000000000e01","event":"notification.created","occurredAt":"2026-11-16T09:00:00.000Z","actorId":"0193a1f2-0000-7000-8000-0000000000b1","causationId":"m-42","scope":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001"},"entity":{"type":"notification","id":"0193a1f2-0000-7000-8000-0000000000f1"},"data":{"notification":{"id":"0193a1f2-0000-7000-8000-0000000000f1","type":"TASK_ASSIGNED","title":"Alice Nguyen assigned you WEB-12","body":"Drag & drop between columns","data":{"workspaceSlug":"efl","projectId":"0193a1f2-0000-7000-8000-0000000000a1","taskId":"0193a1f2-0000-7000-8000-0000000000c1","taskKey":"WEB-12"},"workspaceId":"0193a1f2-0000-7000-8000-000000000001","actor":{"id":"0193a1f2-0000-7000-8000-0000000000b1","name":"Alice Nguyen","email":"alice@efl.dev","avatarUrl":null},"readAt":null,"createdAt":"2026-11-16T09:00:00.000Z"},"unreadCount":3}},"example":"import type { ServerToClientEvents } from '@efl/shared';\nimport { useEffect } from 'react';\nimport { getSocket } from '@/shared/lib/socket';\n\nuseEffect(() => {\n  const socket = getSocket();\n  const handler: ServerToClientEvents['notification.created'] = (payload) => {\n    // Prepend it to the notification lists, set the unread badge to `unreadCount`, show a toast with a link.\n  };\n  socket.on('notification.created', handler);\n  return () => {\n    socket.off('notification.created', handler); // always clean up listeners\n  };\n}, []);"},{"id":"event-notification-read","name":"notification.read","direction":"server-to-client","category":"notification","summary":"Notifications were marked as read","description":"Keeps every open tab of the same user in sync after \"read\" or \"mark all as read\". Mark-all spans every workspace, so its `scope.workspaceId` is the nil UUID (00000000-0000-0000-0000-000000000000) — do not use the scope for this event.","namespace":"/","rooms":["user:{userId}"],"authorization":"The recipient only.","handledBy":"NotificationsService → RealtimePublisher (server-web/src/modules/notifications)","frontendBehavior":"Mark the ids (or all) read in cached lists and set the unread badge to `unreadCount`.","related":["notification.created"],"payloadSchema":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"UUIDv7, dedupe key — drop events already seen"},"event":{"type":"string"},"occurredAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"actorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}],"description":"User who caused it; null for system jobs"},"causationId":{"description":"X-Client-Mutation-Id of the originating request, to skip your own echo","type":["string","null"]},"scope":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"projectId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["workspaceId"]},"entity":{"type":"object","properties":{"type":{"type":"string","enum":["workspace","task","comment","project","member","notification"]},"id":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["type","id"]},"data":{"type":"object","properties":{"notificationIds":{"anyOf":[{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"type":"null"}]},"unreadCount":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["notificationIds","unreadCount"]}},"required":["eventId","event","occurredAt","actorId","causationId","scope","entity","data"]},"examplePayload":{"eventId":"0193a1f2-7c3e-7d40-9b1a-000000000e01","event":"notification.read","occurredAt":"2026-11-16T09:00:00.000Z","actorId":"0193a1f2-0000-7000-8000-0000000000b1","causationId":"m-42","scope":{"workspaceId":"0193a1f2-0000-7000-8000-000000000001"},"entity":{"type":"notification","id":"0193a1f2-0000-7000-8000-0000000000f1"},"data":{"notificationIds":["0193a1f2-0000-7000-8000-0000000000f1"],"unreadCount":2}},"example":"import type { ServerToClientEvents } from '@efl/shared';\nimport { useEffect } from 'react';\nimport { getSocket } from '@/shared/lib/socket';\n\nuseEffect(() => {\n  const socket = getSocket();\n  const handler: ServerToClientEvents['notification.read'] = (payload) => {\n    // Mark the ids (or all) read in cached lists and set the unread badge to `unreadCount`.\n  };\n  socket.on('notification.read', handler);\n  return () => {\n    socket.off('notification.read', handler); // always clean up listeners\n  };\n}, []);"}]}