feat(aihr): complete company message R1-R3
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { resolve } from 'node:path';
|
||||
|
||||
const read = (path: string) => readFileSync(resolve(process.cwd(), path), 'utf8');
|
||||
|
||||
describe('公司文件提炼发布契约', () => {
|
||||
it('上传后轮询提炼状态,并将同一附件ID纳入幂等发布', () => {
|
||||
const api = read('src/api/aihr/broadcast.ts');
|
||||
const page = read('src/views/content/broadcast.vue');
|
||||
const pending = read('src/utils/broadcast-pending.ts');
|
||||
|
||||
expect(api).toContain('/api/aihr/broadcast/admin/attachments');
|
||||
expect(api).toContain('attachmentId?: number');
|
||||
expect(page).toContain('上传并提炼文件');
|
||||
expect(page).toContain('refreshAttachment');
|
||||
expect(page).toContain("attachment.value?.status !== 'READY'");
|
||||
expect(page).toContain('attachmentId: form.attachmentId');
|
||||
expect(pending).toContain('attachmentId?: number');
|
||||
});
|
||||
});
|
||||
@@ -9,6 +9,7 @@ export interface PendingBroadcastPublish {
|
||||
content: string;
|
||||
requiredRead: boolean;
|
||||
targets: BroadcastTargetRequest;
|
||||
attachmentId?: number;
|
||||
}
|
||||
|
||||
export interface BroadcastPendingStorageOptions {
|
||||
@@ -73,7 +74,10 @@ const parsePendingPublish = (raw: string | null): PendingBroadcastPublish | unde
|
||||
title: candidate.title,
|
||||
content: candidate.content,
|
||||
requiredRead,
|
||||
targets
|
||||
targets,
|
||||
attachmentId: Number.isSafeInteger(candidate.attachmentId) && Number(candidate.attachmentId) > 0
|
||||
? Number(candidate.attachmentId)
|
||||
: undefined
|
||||
};
|
||||
} catch {
|
||||
return undefined;
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { resolve } from 'node:path';
|
||||
|
||||
const read = (path: string) => readFileSync(resolve(process.cwd(), path), 'utf8');
|
||||
|
||||
describe('直达反馈管理端契约', () => {
|
||||
it('按授权角色进入,匿名不暴露身份,正式回复携带租户确认', () => {
|
||||
const api = read('src/api/aihr/direct.ts');
|
||||
const page = read('src/views/content/direct.vue');
|
||||
const access = read('src/router/access.ts');
|
||||
const router = read('src/router/index.ts');
|
||||
|
||||
expect(api).toContain('/api/aihr/direct/admin/feedback');
|
||||
expect(api).toContain('expectedTenantId');
|
||||
expect(page).toContain('senderDisplayName');
|
||||
expect(page).toContain('匿名反馈不会显示提交人');
|
||||
expect(page).toContain('回复后不可覆盖');
|
||||
expect(access).toContain('direct_audit');
|
||||
expect(router).toContain("path: 'direct'");
|
||||
expect(router).toContain('roles: directHandlerRoles');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user