Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/andrespaul123/micole-flutter/llms.txt

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

Circulares are school-wide announcements published by directors and delivered to a targeted audience of role groups. Every circular carries a target that determines which user roles receive it (e.g. teachers, parents, or everyone), and each recipient has an individual leido flag that tracks whether they have opened the circular.

Route Map

RouteScreenDescription
/circularesCircularListScreenInbox of all circulars visible to the authenticated user
/circulares/createCircularCreateScreenForm to compose and publish a new circular (directors only)
/circulares/:idCircularDetailScreenFull content of a single circular

Circular Model

id
int?
Circular record ID.
titulo
String?
Short headline of the circular.
contenido
String?
Full body text of the announcement.
target
String?
Role group that receives this circular. Accepted values include "profesores", "padres", and "all". See Target Values below.
publishedAt
String?
ISO timestamp of when the circular was published. Mapped from published_at.
leido
bool?
Whether the authenticated user has read this circular. Resolved from the first entry of the users pivot array returned by the API.
creadoPor
String?
Display name of the director who created the circular. Resolved from creator.name.

CircularRepository

class CircularRepository {
  final Dio _dio;
  CircularRepository(this._dio);

  Future<List<Circular>> getCirculares() async {
    final response = await _dio.get('/circulares');
    return (response.data as List)
        .map((e) => Circular.fromJson(e))
        .toList();
  }

  Future<Circular> getCircularById(int id) async {
    final response = await _dio.get('/circulares/$id');
    return Circular.fromJson(response.data);
  }

  Future<void> createCircular({
    required String titulo,
    required String contenido,
    required String target,
  }) async {
    await _dio.post(
      '/circulares',
      data: {
        'titulo': titulo,
        'contenido': contenido,
        'target': target,
      },
    );
  }

  Future<void> marcarLeido(int id) async {
    await _dio.post('/circulares/$id/leer');
  }

  Future<void> deleteCircular(int id) async {
    await _dio.delete('/circulares/$id');
  }
}

Method Reference

MethodHTTPEndpointDescription
getCirculares()GET/circularesFetch all circulars for the authenticated user
getCircularById(id)GET/circulares/:idFetch a single circular by ID
createCircular(titulo, contenido, target)POST/circularesPublish a new circular
marcarLeido(id)POST/circulares/:id/leerMark a circular as read
deleteCircular(id)DELETE/circulares/:idPermanently delete a circular

The target Field

The target value controls which authenticated users see a circular in their inbox. The following values are recognised by the platform:
ValueAudience
"profesores"All teachers enrolled in the tenant
"padres"All parent accounts linked to the tenant
"all"Every user in the tenant regardless of role

Creating a Circular

Directors can publish a new circular from the /circulares/create screen. The repository method accepts the three required fields and performs a POST to /circulares.
await circularRepository.createCircular(
  titulo: 'Reunión de padres de familia',
  contenido:
      'Se convoca a todos los padres de familia a la reunión ordinaria '
      'del primer quimestre, el viernes 14 de junio a las 18:00 en el '
      'auditorio principal.',
  target: 'padres',
);
The request body sent to the API:
{
  "titulo": "Reunión de padres de familia",
  "contenido": "Se convoca a todos los padres de familia a la reunión ordinaria del primer quimestre, el viernes 14 de junio a las 18:00 en el auditorio principal.",
  "target": "padres"
}

Marking a Circular as Read

1

User opens the detail screen

The app navigates to /circulares/:id, which triggers CircularRepository.getCircularById(id) to load the full content.
2

Call marcarLeido

Immediately after the content renders, call marcarLeido(id) to record the read event on the server.
await circularRepository.marcarLeido(circular.id!);
3

Update local state

Refresh the circulars list or update the leido flag locally so the unread indicator disappears in the inbox.
Call marcarLeido() as soon as the detail screen mounts — before the user scrolls. This ensures the read status is recorded even if the user navigates away quickly, keeping the inbox badge count accurate.

Deleting a Circular

Only the director who created a circular (or a super-admin) should be allowed to delete it. The app should confirm the action with the user before calling deleteCircular.
await circularRepository.deleteCircular(circular.id!);
Endpoint: DELETE /circulares/:id

Build docs developers (and LLMs) love