Merge branch 'development' of https://git.aduanasoft.com/ADUANASOFT/anexo76 into fix/pediemntos-fecha-inicio

This commit is contained in:
2026-05-08 09:48:40 -05:00
18 changed files with 1112 additions and 57 deletions

View File

@@ -58,6 +58,21 @@ export interface ChangePasswordRequest {
temporary?: boolean;
}
export interface InviteUserRequest {
email: string;
company_id: number;
role_id: number;
}
export interface InviteUserResponse {
id: number;
email: string;
role: string;
expires_at: string;
invite_url: string;
created_at: string;
}
export const usersAPI = {
/**
* Obtiene estadísticas de usuarios del tenant
@@ -166,5 +181,16 @@ export const usersAPI = {
if (response.error) {
throw new Error(response.error);
}
},
/**
* Genera un token de invitación y envía email al usuario
*/
async invite(data: InviteUserRequest): Promise<InviteUserResponse> {
const response = await api.post<InviteUserResponse>('/v1/core/invites', data);
if (response.error) {
throw new Error(response.error);
}
return response.data!;
}
};