feat(aihr): close functional checklist gaps
This commit is contained in:
@@ -8,6 +8,15 @@ type ApiResult<T> = {
|
||||
|
||||
export type BroadcastStatus = 'PUBLISHED' | 'WITHDRAWN';
|
||||
export type BroadcastInsightStatus = 'NOT_PROCESSED' | 'PENDING' | 'READY' | 'PARTIAL' | 'FAILED';
|
||||
export type BroadcastVisibilityMode = 'ALL' | 'TARGET_ONLY';
|
||||
|
||||
export type BroadcastTopicTag = {
|
||||
name: string;
|
||||
sourceType: 'AUTO' | 'MANUAL';
|
||||
evidenceQuote: string;
|
||||
};
|
||||
|
||||
export type BroadcastTopicTagRequest = Pick<BroadcastTopicTag, 'name' | 'evidenceQuote'>;
|
||||
|
||||
export type BroadcastTargetRequest = {
|
||||
projectCodes: string[];
|
||||
@@ -38,6 +47,8 @@ export type BroadcastAdminMessage = {
|
||||
withdrawnAt?: string;
|
||||
withdrawReason?: string;
|
||||
requiredRead: boolean;
|
||||
visibilityMode: BroadcastVisibilityMode;
|
||||
allowDownload: boolean;
|
||||
targetRuleCount: number;
|
||||
matchedRecipientCount: number;
|
||||
unmatchedTargetCount: number;
|
||||
@@ -51,7 +62,11 @@ export type BroadcastAttachment = {
|
||||
status: 'QUEUED' | 'PROCESSING' | 'READY' | 'FAILED';
|
||||
summary?: string;
|
||||
errorMessage?: string;
|
||||
viewUrl?: string;
|
||||
downloadUrl?: string;
|
||||
allowDownload: boolean;
|
||||
watermarkText?: string;
|
||||
topicTags: BroadcastTopicTag[];
|
||||
insightStatus?: BroadcastInsightStatus;
|
||||
perspectiveLabels?: string[];
|
||||
};
|
||||
@@ -71,6 +86,8 @@ export type PublishBroadcastRequest = {
|
||||
content: string;
|
||||
expectedTenantId: string;
|
||||
requiredRead: boolean;
|
||||
visibilityMode: BroadcastVisibilityMode;
|
||||
allowDownload: boolean;
|
||||
targets: BroadcastTargetRequest;
|
||||
attachmentId?: number;
|
||||
};
|
||||
@@ -119,6 +136,17 @@ export function getBroadcastAttachment(id: number): Promise<ApiResult<BroadcastA
|
||||
});
|
||||
}
|
||||
|
||||
export function updateBroadcastAttachmentTopicTags(
|
||||
id: number,
|
||||
data: { expectedTenantId: string; topicTags: BroadcastTopicTagRequest[] }
|
||||
): Promise<ApiResult<BroadcastAttachment>> {
|
||||
return request({
|
||||
url: `/api/aihr/broadcast/admin/attachments/${id}/topic-tags`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
export function publishBroadcast(data: PublishBroadcastRequest): Promise<ApiResult<{
|
||||
id: number;
|
||||
version: number;
|
||||
|
||||
@@ -24,6 +24,10 @@ export type CaseRecord = {
|
||||
time: string;
|
||||
owner: string;
|
||||
summary: string;
|
||||
knowledgeStatus?: 'CANDIDATE' | 'PUBLISHED' | 'OFFLINE' | string;
|
||||
sourceType?: string;
|
||||
applicablePositions?: string;
|
||||
contentVersion?: string;
|
||||
};
|
||||
|
||||
export type CaseDetailResponse = {
|
||||
@@ -40,6 +44,15 @@ export type CaseDetailResponse = {
|
||||
mediaOssId?: number | null;
|
||||
learningPoints: string[];
|
||||
supervisorComment: string;
|
||||
knowledgeStatus?: 'CANDIDATE' | 'PUBLISHED' | 'OFFLINE' | string;
|
||||
sourceType?: string;
|
||||
applicablePositions?: string;
|
||||
contentVersion?: string;
|
||||
effectiveFrom?: string;
|
||||
effectiveTo?: string;
|
||||
releaseOwner?: string;
|
||||
releaseNote?: string;
|
||||
retireReason?: string;
|
||||
};
|
||||
|
||||
export type CaseUploadResponse = {
|
||||
@@ -122,3 +135,33 @@ export function reviewKnowledgeCase(caseId: string, comment: string): Promise<Ap
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export type CasePublishRequest = {
|
||||
sourceType: string;
|
||||
applicablePositions: string;
|
||||
contentVersion: string;
|
||||
releaseOwner: string;
|
||||
releaseNote?: string;
|
||||
sourceAuthorized: boolean;
|
||||
deidentified: boolean;
|
||||
effectiveFrom: string;
|
||||
effectiveTo?: string;
|
||||
};
|
||||
|
||||
export function publishKnowledgeCase(caseId: string, data: CasePublishRequest): Promise<ApiResult<void>> {
|
||||
return request({
|
||||
url: `/api/knowledge/case/records/${encodeURIComponent(caseId)}/publish`,
|
||||
method: 'post',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export function retireKnowledgeCase(caseId: string, reason: string): Promise<ApiResult<void>> {
|
||||
return request({
|
||||
url: `/api/knowledge/case/records/${encodeURIComponent(caseId)}/retire`,
|
||||
method: 'post',
|
||||
data: { reason },
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
@@ -152,9 +152,32 @@ export type PracticeQuestion = {
|
||||
contentHash: string;
|
||||
enabled: boolean;
|
||||
sortOrder: number;
|
||||
examFormat?: 'single' | 'multiple' | 'judge' | 'short' | '';
|
||||
examOptions?: string[];
|
||||
examAnswers?: string[];
|
||||
examExplanation?: string;
|
||||
examEnabled?: boolean;
|
||||
reviewStatus?: 'DRAFT' | 'APPROVED' | 'REJECTED';
|
||||
reviewedBy?: string;
|
||||
reviewedTime?: string;
|
||||
};
|
||||
|
||||
export type PracticeQuestionSaveRequest = Omit<PracticeQuestion, 'scenarioName' | 'contentVersion' | 'contentHash'>;
|
||||
export type PracticeQuestionSaveRequest = Pick<
|
||||
PracticeQuestion,
|
||||
| 'code'
|
||||
| 'scenarioCode'
|
||||
| 'positionCode'
|
||||
| 'type'
|
||||
| 'question'
|
||||
| 'referenceAnswer'
|
||||
| 'enabled'
|
||||
| 'sortOrder'
|
||||
| 'examFormat'
|
||||
| 'examOptions'
|
||||
| 'examAnswers'
|
||||
| 'examExplanation'
|
||||
| 'examEnabled'
|
||||
>;
|
||||
|
||||
export type ManagedPracticeAssignment = {
|
||||
id: number;
|
||||
@@ -190,6 +213,70 @@ export type ManagedPracticeAssignmentBatchResponse = {
|
||||
results: Array<{ extPartyId: string; traineeName: string; status: string; message: string }>;
|
||||
};
|
||||
|
||||
export type ManagedLearningTask = {
|
||||
id: number;
|
||||
extPartyId: string;
|
||||
traineeName: string;
|
||||
projectCode: string;
|
||||
positionCode: string;
|
||||
taskType: string;
|
||||
status: string;
|
||||
materialType: 'DOCUMENT' | 'VIDEO' | 'COURSE' | 'SOP';
|
||||
materialAttachmentId: number;
|
||||
materialTitle: string;
|
||||
materialVersion: string;
|
||||
progressPercent: number;
|
||||
completionRule: 'MANUAL_CONFIRM' | 'EXAM_PASS';
|
||||
examId?: number | null;
|
||||
examTitle?: string | null;
|
||||
recurrenceType: 'ONCE' | 'DAILY' | 'WEEKLY' | 'MONTHLY';
|
||||
assignedTime: string;
|
||||
dueTime: string;
|
||||
completedTime?: string;
|
||||
assignBy: string;
|
||||
};
|
||||
|
||||
export type LearningMaterialOption = {
|
||||
attachmentId: number;
|
||||
title: string;
|
||||
fileType: string;
|
||||
materialVersion: string;
|
||||
updatedTime: string;
|
||||
};
|
||||
|
||||
export type LearningExamOption = {
|
||||
examId: number;
|
||||
title: string;
|
||||
projectCode: string;
|
||||
positionCode: string;
|
||||
dueDate: string;
|
||||
targetCount: number;
|
||||
};
|
||||
|
||||
export type ManagedLearningTaskBatchRequest = {
|
||||
requestId: string;
|
||||
targets: Array<{ extPartyId: string; traineeName?: string }>;
|
||||
projectCode: string;
|
||||
positionCode: string;
|
||||
taskType: string;
|
||||
materialType: ManagedLearningTask['materialType'];
|
||||
materialAttachmentId: number;
|
||||
completionRule: ManagedLearningTask['completionRule'];
|
||||
examId?: number | null;
|
||||
recurrenceType: ManagedLearningTask['recurrenceType'];
|
||||
startTime: string;
|
||||
dueTime: string;
|
||||
};
|
||||
|
||||
export type ManagedLearningTaskBatchResponse = {
|
||||
requestId: string;
|
||||
total: number;
|
||||
created: number;
|
||||
duplicate: number;
|
||||
failed: number;
|
||||
items: Array<{ extPartyId: string; traineeName: string; status: string; message: string }>;
|
||||
};
|
||||
|
||||
export type PracticePrepCardResponse = {
|
||||
keyPoints: string[];
|
||||
redLines: string[];
|
||||
@@ -328,6 +415,30 @@ export function updatePracticeQuestionEnabled(code: string, enabled: boolean): P
|
||||
return request({ url: `/api/train/practice/questions/${encodeURIComponent(code)}/enabled`, method: 'patch', data: { enabled } });
|
||||
}
|
||||
|
||||
export function reviewPracticeQuestion(code: string, decision: 'APPROVE' | 'REJECT', note = ''): Promise<ApiResult<PracticeQuestion>> {
|
||||
return request({
|
||||
url: `/api/train/practice/questions/${encodeURIComponent(code)}/review`,
|
||||
method: 'patch',
|
||||
data: { decision, note }
|
||||
});
|
||||
}
|
||||
|
||||
export function listManagedLearningTasks(params?: { status?: string; keyword?: string; limit?: number }): Promise<ApiResult<ManagedLearningTask[]>> {
|
||||
return request({ url: '/api/train/practice/onboard-tasks/manage', method: 'get', params });
|
||||
}
|
||||
|
||||
export function listLearningMaterials(): Promise<ApiResult<LearningMaterialOption[]>> {
|
||||
return request({ url: '/api/train/practice/onboard-tasks/manage/materials', method: 'get' });
|
||||
}
|
||||
|
||||
export function listLearningExams(): Promise<ApiResult<LearningExamOption[]>> {
|
||||
return request({ url: '/api/train/practice/onboard-tasks/manage/exams', method: 'get' });
|
||||
}
|
||||
|
||||
export function createManagedLearningTasks(data: ManagedLearningTaskBatchRequest): Promise<ApiResult<ManagedLearningTaskBatchResponse>> {
|
||||
return request({ url: '/api/train/practice/onboard-tasks/manage/batch', method: 'post', data, headers: { repeatSubmit: false } });
|
||||
}
|
||||
|
||||
export function updatePracticeScenarioEnabled(id: string, data: PracticeScenarioEnabledRequest): Promise<ApiResult<null>> {
|
||||
return request({
|
||||
url: `/api/train/practice/scenarios/${id}/enabled`,
|
||||
|
||||
Reference in New Issue
Block a user