feat(版本): 完善研发计划与预警已读
关键改动: - 增加版本表单、发布校验和调研方向进度规则 - 扩展小宝预警已读状态、风险签名和今日证据 - 补充组长权限、加班查看范围、活动记录与相关测试 Co-Authored-By: Codex GPT-5 <codex@openai.com>
This commit is contained in:
@@ -279,6 +279,89 @@ test('getWorkspaceDailyReport counts actual hours from today activity sources',
|
||||
assert.equal(report.totalCount, 2);
|
||||
});
|
||||
|
||||
test('getWorkspaceDailyReport does not double count overlapping activity time ranges', () => {
|
||||
const report = getWorkspaceDailyReport({
|
||||
activities: [
|
||||
{
|
||||
id: 'act-overlap-a',
|
||||
actorId: 'Alice',
|
||||
date: '2026-06-26',
|
||||
occurredAt: '2026-06-26T02:10:00.000Z',
|
||||
sourceType: 'dev_task',
|
||||
sourceId: 'task-overlap-a',
|
||||
action: 'dev_task_started',
|
||||
category: 'progress',
|
||||
title: 'Overlap A',
|
||||
summary: 'Started development: Overlap A',
|
||||
},
|
||||
{
|
||||
id: 'act-overlap-b',
|
||||
actorId: 'Alice',
|
||||
date: '2026-06-26',
|
||||
occurredAt: '2026-06-26T02:20:00.000Z',
|
||||
sourceType: 'dev_task',
|
||||
sourceId: 'task-overlap-b',
|
||||
action: 'dev_task_started',
|
||||
category: 'progress',
|
||||
title: 'Overlap B',
|
||||
summary: 'Started development: Overlap B',
|
||||
},
|
||||
],
|
||||
worklogs: [],
|
||||
workItems: [
|
||||
{
|
||||
id: 'task-overlap-a',
|
||||
type: 'devTask',
|
||||
title: 'Overlap A',
|
||||
status: 'submitted',
|
||||
completed: true,
|
||||
productName: 'FTB',
|
||||
projectName: 'Project Management',
|
||||
versionName: 'V1.0',
|
||||
versionId: 'version-1',
|
||||
extra: {
|
||||
actualStartAt: '2026-06-26T02:00:00.000Z',
|
||||
actualEndAt: '2026-06-26T04:00:00.000Z',
|
||||
},
|
||||
raw: {
|
||||
id: 'task-overlap-a',
|
||||
actualStartAt: '2026-06-26T02:00:00.000Z',
|
||||
actualEndAt: '2026-06-26T04:00:00.000Z',
|
||||
status: 'submitted',
|
||||
updatedAt: '2026-06-26T04:00:00.000Z',
|
||||
} as any,
|
||||
},
|
||||
{
|
||||
id: 'task-overlap-b',
|
||||
type: 'devTask',
|
||||
title: 'Overlap B',
|
||||
status: 'submitted',
|
||||
completed: true,
|
||||
productName: 'FTB',
|
||||
projectName: 'Project Management',
|
||||
versionName: 'V1.0',
|
||||
versionId: 'version-1',
|
||||
extra: {
|
||||
actualStartAt: '2026-06-26T02:00:00.000Z',
|
||||
actualEndAt: '2026-06-26T04:00:00.000Z',
|
||||
},
|
||||
raw: {
|
||||
id: 'task-overlap-b',
|
||||
actualStartAt: '2026-06-26T02:00:00.000Z',
|
||||
actualEndAt: '2026-06-26T04:00:00.000Z',
|
||||
status: 'submitted',
|
||||
updatedAt: '2026-06-26T04:00:00.000Z',
|
||||
} as any,
|
||||
},
|
||||
],
|
||||
userId: 'Alice',
|
||||
date: '2026-06-26',
|
||||
});
|
||||
|
||||
assert.equal(report.totalHours, 2);
|
||||
assert.equal(report.totalCount, 2);
|
||||
});
|
||||
|
||||
test('getWorkspaceDailyReport rebuilds activity evidence from persisted work item timestamps', () => {
|
||||
const report = getWorkspaceDailyReport({
|
||||
activities: [],
|
||||
|
||||
Reference in New Issue
Block a user