mirror of
https://git.zhongyuan.online/ytke/tap.git
synced 2026-11-24 22:15:18 -08:00
支持自部署需求管理、交付流程与飞书集成
This commit is contained in:
1 parent
4556a5b483
commit
e22b66d9dd
148 files changed
+8300
-6393
No files matched your search
@@ -0,0 +1,36 @@
|
||||
import type { Attachment } from './attachments.ts';
|
||||
import type { Demand, Fields } from './demand.ts';
|
||||
|
||||
export type ReviewPerson = { userId: string; username: string; displayName: string };
|
||||
export type ReviewProposal = {
|
||||
version: number;
|
||||
scope: string;
|
||||
outOfScope: string;
|
||||
developer: ReviewPerson;
|
||||
submittedAt: string;
|
||||
businessFields: Fields;
|
||||
businessAttachments?: Attachment[];
|
||||
invalidated?: { time: string; reason: string };
|
||||
decision?: { result: 'confirmed' | 'changes_requested'; actor: ReviewPerson; time: string; comment: string };
|
||||
};
|
||||
export type DemandReview = { developer: ReviewPerson; proposals: ReviewProposal[] };
|
||||
export type DemandAccess = { business: boolean; developer: boolean; canTakeOverDevelopment?: boolean };
|
||||
|
||||
export function currentProposal(d: Demand): ReviewProposal | undefined {
|
||||
return d.review?.proposals.at(-1);
|
||||
}
|
||||
|
||||
export function reviewStage(d: Demand): string {
|
||||
if (!d.reviewReady) return '资料待补充';
|
||||
if (!d.review) return '待开发提出方案';
|
||||
const proposal = currentProposal(d);
|
||||
if (!proposal || proposal.invalidated) return '待开发提出方案';
|
||||
if (proposal.decision?.result === 'confirmed') return '方案已确认';
|
||||
if (proposal.decision?.result === 'changes_requested') return '待开发修改方案';
|
||||
return '待业务确认方案';
|
||||
}
|
||||
|
||||
export function invalidateProposal(d: Demand, time: string, reason: string): void {
|
||||
const proposal = currentProposal(d);
|
||||
if (proposal && !proposal.invalidated) proposal.invalidated = { time, reason };
|
||||
}
|
||||
Reference in new issue
Block a user