Add customer contract clearance console
This commit is contained in:
+14
-4
@@ -3,6 +3,7 @@ import { addAudit, addUsage, hasPermission, httpError, requireEntitlement, requi
|
||||
import { inspectMediaForProject } from "./media-qa.mjs";
|
||||
import { latestArtifactForShot, listProjectArtifacts, syncProjectJobArtifacts } from "./media-artifacts.mjs";
|
||||
import { dispatchNotificationEvent } from "./notifications.mjs";
|
||||
import { evaluateProjectContractClearance } from "./contracts.mjs";
|
||||
import { createHash } from "node:crypto";
|
||||
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
@@ -908,8 +909,14 @@ function buildDeliveryClearanceReport(context, delivery, options = {}) {
|
||||
const knowledge = knowledgeClearanceSection(context);
|
||||
const qa = qaClearanceSection(context);
|
||||
const jobs = jobClearanceSection(context);
|
||||
const blockers = [...media.blockers, ...assets.blockers, ...voices.blockers, ...knowledge.blockers, ...qa.blockers, ...jobs.blockers];
|
||||
const reviewItems = [...media.reviewItems, ...assets.reviewItems, ...voices.reviewItems, ...knowledge.reviewItems, ...qa.reviewItems, ...jobs.reviewItems];
|
||||
const contracts = evaluateProjectContractClearance(context, project.id, {
|
||||
channel: options.channel || null,
|
||||
channelKind: options.channel?.kind || "",
|
||||
deliverables: ["vertical-video", "delivery-manifest"],
|
||||
territory: options.territory || "CN"
|
||||
});
|
||||
const blockers = [...media.blockers, ...assets.blockers, ...voices.blockers, ...knowledge.blockers, ...qa.blockers, ...jobs.blockers, ...contracts.blockers];
|
||||
const reviewItems = [...media.reviewItems, ...assets.reviewItems, ...voices.reviewItems, ...knowledge.reviewItems, ...qa.reviewItems, ...jobs.reviewItems, ...contracts.reviewItems];
|
||||
const status = clearanceStatus(blockers, reviewItems);
|
||||
const checkedAt = now();
|
||||
const baseCertificate = {
|
||||
@@ -931,6 +938,7 @@ function buildDeliveryClearanceReport(context, delivery, options = {}) {
|
||||
approvedKnowledgeRequired: true,
|
||||
fixedVoiceEvidenceRequired: true,
|
||||
actualLastFrameRequired: true,
|
||||
contractAuthorizationRequired: true,
|
||||
paidCloudPublishDisabled: true
|
||||
},
|
||||
counts: {
|
||||
@@ -941,7 +949,8 @@ function buildDeliveryClearanceReport(context, delivery, options = {}) {
|
||||
knowledgeMaterials: knowledge.materials.length,
|
||||
qaReviews: qa.reviews.length,
|
||||
mediaItems: media.items.length,
|
||||
pendingJobs: jobs.jobs.length
|
||||
pendingJobs: jobs.jobs.length,
|
||||
contractBindings: contracts.counts?.activeBindings || 0
|
||||
}
|
||||
};
|
||||
const certificateId = `clearance-${jsonHash(baseCertificate).slice(0, 16)}`;
|
||||
@@ -966,7 +975,8 @@ function buildDeliveryClearanceReport(context, delivery, options = {}) {
|
||||
voices: voices.voices,
|
||||
knowledge,
|
||||
qa,
|
||||
jobs
|
||||
jobs,
|
||||
contracts
|
||||
},
|
||||
certificate
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user