Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/160906/Yakultt-App/llms.txt

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

The Clients module is where Yakult App stores all of your customer relationships. Every client record holds the contact and location details your sales team needs in the field — and because each record carries an active/inactive status, you can retire a customer without losing their historical order data. The mobile app makes it fast to find any client through real-time search and status filtering, and the stored phone number doubles as a direct gateway to WhatsApp for sending order updates.

Client Fields

Each client record contains the following fields:
FieldTypeDescription
idintegerAuto-incremented primary key
nombrestringFull client name
telefonostring10-digit Mexican mobile number
direccionstringDelivery address
activobooleanWhether the client is active (true by default on creation)
creado_entimestampRecord creation timestamp

Sample Client Object

{
  "id": 14,
  "nombre": "María González",
  "telefono": "5512345678",
  "direccion": "Av. Insurgentes Sur 1234, Col. Del Valle",
  "activo": true,
  "creado_en": "2024-09-18T10:45:00.000Z"
}

Validation Rules

The mobile app enforces the following validation before any create or update request is sent to the API:

nombre

Letters (and spaces) only — no numbers or special characters. Cannot be empty.

telefono

Exactly 10 digits — no spaces, dashes, or country codes. The app strips non-digit characters before validating.

direccion

Minimum 5 characters. Cannot be blank or a trivial placeholder.
These validations are enforced client-side in the mobile app. If you call the API directly (e.g., via curl or an integration), the backend will accept the record as-is. Always sanitize inputs on your own side when bypassing the mobile UI.

API Endpoints

The clients resource is mounted at /api/clientes.
Retrieve all client records ordered alphabetically by name.
curl https://your-api.example.com/api/clientes
Response — array of client objects:
[
  {
    "id": 14,
    "nombre": "María González",
    "telefono": "5512345678",
    "direccion": "Av. Insurgentes Sur 1234, Col. Del Valle",
    "activo": true,
    "creado_en": "2024-09-18T10:45:00.000Z"
  }
]

Search and Filtering

The mobile app provides two complementary ways to narrow down the client list without any additional API calls — both operate on the full list already loaded in memory.

Search

The search bar matches against both nombre and telefono simultaneously as you type, so you can find a client by partial name or by part of their phone number.

Status Filter

A segmented control lets you switch between three views: Todos (all clients), Activos (only activo: true), and Inactivos (only activo: false). The filter stacks with search.

WhatsApp Integration

The telefono field stored on each client record is the foundation of Yakult App’s WhatsApp notification system. When a sales rep wants to notify a client about their order, the app constructs a wa.me deep-link using the stored number. The link is built as follows:
const waLink = (telefono: string, texto: string) => {
  const digits = String(telefono || '').replace(/\D/g, '');
  if (!digits) return null;
  const num = digits.startsWith('52') ? digits : `52${digits}`;
  return `https://wa.me/${num}?text=${encodeURIComponent(texto)}`;
};
The function strips any non-digit characters and prepends Mexico’s country code (52) if it is not already present, resulting in links of the form:
https://wa.me/525512345678?text=Tu%20pedido%20fue%20entregado%20%E2%9C%85
Tapping the link opens WhatsApp with the client’s number pre-filled and the message pre-composed, ready to send in one tap. Message content varies by order status — see the Orders page for the full set of templates.
Store phone numbers as bare 10-digit strings (e.g., 5512345678) and let the app handle country code prefixing. Storing numbers with a leading 52 or +52 is also supported — the link builder detects the prefix and avoids doubling it.

Build docs developers (and LLMs) love