feat(company-memberships): service + validators + tests
Adds company-membership service with six operations (add, update, end, setPrimary, listByCompany, listByClient), the corresponding Zod validators, three socket events, and a unit-test suite covering the portId-scoping rules, the unique_cm_exact conflict path, and the atomic setPrimary transaction. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -91,6 +91,22 @@ export interface ServerToClientEvents {
|
||||
'company:updated': (payload: { companyId: string; changedFields: string[] }) => void;
|
||||
'company:archived': (payload: { companyId: string }) => void;
|
||||
|
||||
// Company membership events
|
||||
'company_membership:added': (payload: {
|
||||
membershipId: string;
|
||||
companyId: string;
|
||||
clientId: string;
|
||||
}) => void;
|
||||
'company_membership:updated': (payload: {
|
||||
membershipId: string;
|
||||
changedFields: string[];
|
||||
}) => void;
|
||||
'company_membership:ended': (payload: {
|
||||
membershipId: string;
|
||||
companyId: string;
|
||||
clientId: string;
|
||||
}) => void;
|
||||
|
||||
// Document events
|
||||
'document:created': (payload: { documentId: string; type?: string; interestId?: string }) => void;
|
||||
'document:updated': (payload: { documentId: string; changedFields?: string[] }) => void;
|
||||
|
||||
Reference in New Issue
Block a user