improvement: tasks and cases feature updated based on the new prosthesis types and their steps. the whole assignment proccess removed from the flow.

This commit is contained in:
2026-07-07 15:31:09 +03:30
parent ed7e7b1d8f
commit cb63ced4e3
35 changed files with 1819 additions and 454 deletions

View File

@@ -1,6 +1,5 @@
import { apiClient } from './client';
import type {
AssignableMember,
CasesFilterOptions,
LabCaseDetail,
LabCaseTask,
@@ -21,22 +20,17 @@ export const casesApi = {
return response.data;
},
listAssignableMembers: async (): Promise<{ success: boolean; data: AssignableMember[] }> => {
const response = await apiClient.get('/cases/assignable-members');
return response.data;
},
listFilterOptions: async (): Promise<{ success: boolean; data: CasesFilterOptions }> => {
const response = await apiClient.get('/cases/filter-options');
return response.data;
},
updateTask: async (
setTaskImportant: async (
caseId: string,
taskId: string,
payload: { assigneeUserId?: string | null; priority?: number },
isImportant: boolean,
): Promise<{ success: boolean; data: LabCaseTask }> => {
const response = await apiClient.patch(`/cases/${caseId}/tasks/${taskId}`, payload);
const response = await apiClient.patch(`/cases/${caseId}/tasks/${taskId}`, { isImportant });
return response.data;
},
};

View File

@@ -1,5 +1,6 @@
import { apiClient } from './client';
import type {
LabCaseComment,
LabCaseDetail,
ListLabCasesParams,
PaginatedLabCases,
@@ -161,4 +162,26 @@ export const organizationApi = {
);
return response.data;
},
listConnectionCaseComments: async (
connectionId: string,
caseId: string,
): Promise<{ success: boolean; data: LabCaseComment[] }> => {
const response = await apiClient.get(
`/organizations/connections/${connectionId}/cases/${caseId}/comments`,
);
return response.data;
},
addConnectionCaseComment: async (
connectionId: string,
caseId: string,
body: string,
): Promise<{ success: boolean; data: LabCaseComment }> => {
const response = await apiClient.post(
`/organizations/connections/${connectionId}/cases/${caseId}/comments`,
{ body },
);
return response.data;
},
};

View File

@@ -1,11 +1,16 @@
import { apiClient } from './client';
import type { LabTaskListItem, LabTaskStatus, PaginatedLabTasks } from '@/types/cases';
import type {
LabCaseComment,
LabTaskListItem,
LabTaskStatus,
ListLabTasksParams,
PaginatedLabTasks,
} from '@/types/cases';
export const tasksApi = {
list: async (params: { page?: number; limit?: number } = {}): Promise<{
success: boolean;
data: PaginatedLabTasks;
}> => {
list: async (
params: ListLabTasksParams = {},
): Promise<{ success: boolean; data: PaginatedLabTasks }> => {
const response = await apiClient.get('/tasks', { params });
return response.data;
},
@@ -17,4 +22,29 @@ export const tasksApi = {
const response = await apiClient.patch(`/tasks/${taskId}`, { status });
return response.data;
},
listComments: async (
caseId: string,
): Promise<{ success: boolean; data: LabCaseComment[] }> => {
const response = await apiClient.get(`/case-comments/${caseId}`);
return response.data;
},
addComment: async (
caseId: string,
payload: { body: string; visibleToClinic?: boolean },
): Promise<{ success: boolean; data: LabCaseComment }> => {
const response = await apiClient.post(`/case-comments/${caseId}`, payload);
return response.data;
},
setCommentVisibility: async (
commentId: string,
visibleToClinic: boolean,
): Promise<{ success: boolean; data: LabCaseComment }> => {
const response = await apiClient.patch(`/case-comments/item/${commentId}/visibility`, {
visibleToClinic,
});
return response.data;
},
};