Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/gestor-backend/llms.txt

Use this file to discover all available pages before exploring further.

Gestor Deportivo enforces resource limits on a per-user basis through a membership plan system. Each user is assigned a plan that controls how many teams they can create. Plans are managed exclusively on the server; users cannot upgrade or change their own plan.
Plan enforcement is entirely server-side. Clients cannot self-assign or escalate a membership plan — only an Admin user can update another user’s plan via the designated endpoint.

Plans and team limits

PlanMax TeamsDescription
Plan Gratis1Default plan assigned to every new account
Plan Basico3First paid tier with expanded team capacity
Plan Premium10Premium tier for clubs and academies with large rosters
All new users start on Plan Gratis automatically. No action is required by the user or an admin to assign this initial plan.

Admin override

Users with the Admin role (role.name === "Admin" and role.value === "2") are exempt from all plan-based limits and can create an unlimited number of teams. Admin status is checked on every team-creation request before the plan limits are evaluated.

Exceeding plan limits

When a user attempts to create a team beyond their plan’s limit, the API responds with HTTP 403 and a descriptive error message:
PlanError message
Plan Gratis"En el plan gratis solo puedes registrar 1 equipo"
Plan Basico"En el plan basico solo puedes registrar hasta 3 equipos"
Plan Premium"En el plan premium solo puedes registrar hasta 10 equipos"
Example 403 response:
{
  "msj": "En el plan gratis solo puedes registrar 1 equipo",
  "status": false
}

Assigning or changing a plan

Only an Admin user can change a user’s membership plan. Send a POST request to /api/user/update-data/:userId with the new plan and organisation type in the request body.
curl -X POST https://your-api.com/api/user/update-data/USER_ID \
  -H "access-token: ADMIN_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "membership": "Plan Basico",
    "academyOrClub": "Academia"
  }'
membership
string
The plan to assign. Must be one of: "Plan Gratis", "Plan Basico", "Plan Premium".
academyOrClub
string
The organisation type associated with the user. Must be one of: "Sin academia o club", "Academia", "Club".

Organisation type (academyOrClub)

Each user also carries an academyOrClub field that classifies the type of sports organisation they manage:
ValueDescription
Sin academia o clubDefault — no associated organisation
AcademiaUser manages a sports academy
ClubUser manages a registered sports club

Checking the current plan

The user object returned from a successful login includes the membership field directly in the response, so clients can read the active plan without a separate API call:
{
  "status": true,
  "token": "eyJhbGci...",
  "user": {
    "_id": "64c3f...",
    "firstName": "Carlos",
    "membership": "Plan Basico",
    "academyOrClub": "Academia"
  }
}

Extensibility

The membership system is designed to be extended. New plan tiers can be added to the membership enum on the User model and enforced in the team controller without breaking existing users or plans. Future versions of the API may introduce limits on additional resource types such as events, players, or clubs.

Build docs developers (and LLMs) love