> For the complete documentation index, see [llms.txt](https://docs.automaktab.uz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.automaktab.uz/toliq-funksional-xarita/audit-guruh-imtihon.md).

# Audit, Guruhlar, Imtihonlar

## Audit Jurnali

### Ro'yxat (AuditLogPage)

| Feature    | Details                           |
| ---------- | --------------------------------- |
| Route      | /audit (OwnerRoute)               |
| Service    | auditService                      |
| Pagination | 50/page                           |
| Sort       | client-side (userName, createdAt) |

### Filterlar (URL-persisted)

| Filter        | Type     | Options                                |
| ------------- | -------- | -------------------------------------- |
| Ob'ekt        | Select   | all/student/payment/user/branch/group  |
| Harakat       | Select   | all/CREATE/UPDATE/DELETE               |
| Sana tezkor   | Buttons  | today/week/month/lastMonth/all         |
| Sana kalendar | Calendar | range mode                             |
| Foydalanuvchi | Input    | server-side search → userId resolution |

**Smart user search:** 1 match → filter by userId; 0 or 2+ → sentinel `__no_match__` for empty results

### Ustunlar

| Column        | Render                                                |
| ------------- | ----------------------------------------------------- |
| #             | index                                                 |
| Foydalanuvchi | user name                                             |
| Rol           | role                                                  |
| Harakat       | colored badge (green=CREATE, blue=UPDATE, red=DELETE) |
| Ob'ekt        | entity type                                           |
| Tafsilot      | changes summary                                       |
| Vaqt          | relative or absolute                                  |

### Kim ko'ra oladi

* Owner: barcha filiallar
* Manager: faqat o'z filiali
* Operator/Teacher: yo'q (query disabled)

***

### Tafsilot (AuditDetailPage)

| Section     | Content                                                     |
| ----------- | ----------------------------------------------------------- |
| Header      | action badge (colored), entity, user, date                  |
| Info tab    | user, role, action, entity, entity\_id (linked), time       |
| Changes tab | UPDATE → before/after diff table; CREATE/DELETE → full dump |

**Linked entity IDs:**

* student → /students/:id
* branch → /branches/:id
* group → /groups/:id
* user → /users/:id

**Optimistic pre-fill:** router state → instant paint from AuditLogPage

***

## Guruhlar

### Ro'yxat (GroupsPage)

| Feature    | Details                  |
| ---------- | ------------------------ |
| Route      | /groups (ProtectedRoute) |
| Service    | groupService             |
| Pagination | 10/page (client-side)    |

### Filterlar

| Filter    | Type                  |
| --------- | --------------------- |
| Qidiruv   | Input                 |
| Kurs turi | Select                |
| Filial    | Select (cross-tenant) |

### Overview Section

* Branch accordion (default collapsed)
* Har bir branch ostida guruhlar:
  * Nomi, course type badge, student count, status badge

### Desktop Table

| Column         | Sortable          |
| -------------- | ----------------- |
| #              | ❌                 |
| Nomi           | ✅                 |
| Filial         | ✅                 |
| Kurs turi      | ✅ (colored badge) |
| Talabalar soni | ✅                 |
| Holati         | ✅                 |
| Yaratilgan     | ✅                 |
| Amallar        | ❌                 |

### Create/Edit (GroupFormDialog)

| Field     | Validation                                                |
| --------- | --------------------------------------------------------- |
| Nomi      | required, duplicate check (same branch, case-insensitive) |
| Filial    | required                                                  |
| Kurs turi | required                                                  |

**Duplicate detection:** warning banner with links to duplicate groups, dismissible

### Tafsilot (GroupDetailPage)

| Tab          | Content                                     |
| ------------ | ------------------------------------------- |
| Ma'lumot     | teacher, course type, branch, student count |
| Talabalar    | DataCard list, inline edit/remove           |
| Dars jadvali | template entries (day/time/type)            |

***

## Imtihonlar

### Record Exam Modal (\~226 lines)

| Field        | Required | Validation              |
| ------------ | -------- | ----------------------- |
| Imtihon turi | ✅        | THEORY / PRACTICE       |
| Sana         | ✅        | default = today (UTC+5) |
| Ball         | ❌        | 0-100                   |
| Natija       | ✅        | passed checkbox         |
| Izoh         | ❌        | text                    |

**Self-contained mutation:** `useCreateExam` → toast on success/error → reset form → close

### Student Exams Tab

| Feature | Details                                                         |
| ------- | --------------------------------------------------------------- |
| Loading | Single skeleton row                                             |
| Empty   | "Natijalar topilmadi"                                           |
| Data    | Table: date, type, result (passed/failed colored), score, notes |

### Compat

* `exam.exam_type` va `exam.examType` (camelCase/snake\_case) both handled
* Null values display `—`

***

## Imtihon Oqimi

```
StudentDetailPage → Imtihonlar tab → "Yangi imtihon"
                                      │
                              RecordExamModal
                                      │
                              POST /exams
                                      │
                              Toast (success/error)
                                      │
                              Tab refresh (invalidate)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.automaktab.uz/toliq-funksional-xarita/audit-guruh-imtihon.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
