Amigo Invisible stores all group and draw data in a single MongoDB collection using theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Sufianeh7/AmigoInvisible/llms.txt
Use this file to discover all available pages before exploring further.
Sorteo Mongoose model defined in Node/modelos/Sorteo.js. One Sorteo document represents one Secret Santa group — it holds the group metadata, the full list of participants, and the schema fields for tracking draw state and history.
Schema Source
timestamps option, which automatically adds createdAt and updatedAt fields to every document.
Field Reference
The display name of the Secret Santa group (e.g.
"Oficina 2024"). Required and automatically trimmed of leading/trailing whitespace.An optional free-text description of the gift budget (e.g.
"20€ máximo"). Trimmed but not validated for format — any string is accepted.The planned date on which gifts will be exchanged. Optional. Stored as a native MongoDB
Date type.A UUID generated by
crypto.randomUUID() at group creation time. Serves as both the secret identifier and the authentication credential for the group organizer. Marked unique — no two groups can share the same token. The admin dashboard URL is constructed as /admin/{adminToken}.The current draw status. Accepted values are
borrador and completado. Defaults to borrador when a group is first created. Transitions to completado when lanzarSorteo is called successfully and emails have been dispatched.An array of embedded participant sub-documents. See the Participant Sub-document section below for the full field breakdown.
An array of embedded past-draw sub-documents intended to store the results of each draw run for history tracking. The schema defines its structure (see Past Pairings Sub-document below), though the current controller writes the generated pairings to
sorteo.emparejamientosActuales rather than pushing into this array.Participant Sub-document
Each entry in theparticipantes array represents one person in the group.
The participant’s display name. Used in email greetings and as the identifier inside exclusion lists.
The participant’s email address. Used both as a unique identifier within the draw algorithm (pairs are stored as
{ de: email, para: email }) and as the delivery address for the reveal email.An optional list of participant names (not emails) that this person must not be assigned as a recipient. For example, if Alice should never give a gift to Bob,
"Bob" would appear in Alice’s exclusiones array. Exclusions are one-directional.Past Pairings Sub-document
TheemparejamientosPasados array is defined in the schema to capture the full result of each draw run. Each entry in the array has the following structure:
The timestamp when the draw was run. Defaults to
Date.now at the time the sub-document is created.An array of
{ de: String, para: String } objects. Each object records one giver-recipient pair using email addresses as identifiers.Status Lifecycle
ASorteo document moves through two states:
borrador— The default state. The group has been created and participants have been added, but the draw has not yet been run. The organizer can still review the group via their admin link.completado— The draw has been executed successfully and all reveal emails have been sent. ThelanzarSorteocontroller setsestado = 'completado'and saves the document after the algorithm produces valid pairings and before the emails are dispatched.