users: tabla + sync detalle + lookups para roles/companies

- db.ts v6: tablas users + lookups con schema
- users-db.ts: CRUD users + lookups
- user-sync.ts: fetch /api/users/{id}/ con concurrencia 5
- kappa-api.ts: +getUserDetail(id)
- users store: +syncDetails() con progreso + mapeo roleId→name
- UsersView: boton 'Sincronizar roles' con progreso
- UserRecord: username, isStaff, phone, position, lastActive, createdAt
This commit is contained in:
2026-05-29 00:14:30 -05:00
parent 4e90f6f7b2
commit fff84c552c
6 changed files with 222 additions and 4 deletions
+4
View File
@@ -99,6 +99,10 @@ class KappaAPI {
return this.request<unknown[]>('GET', '/users/all/')
}
async getUserDetail(id: number): Promise<Record<string, unknown>> {
return this.request<Record<string, unknown>>('GET', `/users/${id}/`)
}
async getEmployees(page = 1): Promise<PaginatedResponse<KappaEmployee>> {
return this.request<PaginatedResponse<KappaEmployee>>('GET', `/employees/?page=${page}`)
}