diff --git a/src/services/group-sync.ts b/src/services/group-sync.ts index 067b58d..69a8edf 100644 --- a/src/services/group-sync.ts +++ b/src/services/group-sync.ts @@ -5,11 +5,31 @@ const env = process.env; // In-memory cache for active groups const activeGroupsCache = new Map(); // groupId -> groupName +/** + * Represents a group from the Evolution API response + * + * API returns an array of groups in this format: + * [ + * { + * id: string, // Group ID in @g.us format (primary key) + * subject: string, // Group name (displayed to users) + * linkedParent?: string, // Parent community ID if group belongs to one + * size?: number, // Current member count (unused in our system) + * creation?: number, // Unix timestamp of group creation (unused) + * desc?: string, // Group description text (unused) + * // ...other fields exist but are ignored by our implementation + * } + * ] + * + * Required fields for our implementation: + * - id (used as database primary key) + * - subject (used as group display name) + * - linkedParent (used for community filtering) + */ type EvolutionGroup = { id: string; subject: string; linkedParent?: string; - // Other fields from API response }; export class GroupSyncService {