mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 13:38:22 +00:00
refactor(workflow): enforce strict nested type safety for WorkflowTaskPayload
This commit is contained in:
@@ -400,26 +400,32 @@ export class TranscodeService {
|
||||
|
||||
// --- Task Creation Helpers ---
|
||||
|
||||
async createVideoTranscodeTask(assetId: string, spec: PrismaJson.TaskSpec) {
|
||||
async createVideoTranscodeTask(assetId: string, projectId: string, spec: PrismaJson.TaskSpec) {
|
||||
return this.prismaClient.workflowTask.create({
|
||||
data: {
|
||||
assetId,
|
||||
projectId,
|
||||
type: WorkflowTaskType.transcode,
|
||||
status: WorkflowTaskStatus.pending,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
payload: spec as any,
|
||||
payload: {
|
||||
projectId,
|
||||
transcode: spec,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
async createImageTranscodeTask(assetId: string, spec: PrismaJson.TaskSpec) {
|
||||
async createImageTranscodeTask(assetId: string, projectId: string, spec: PrismaJson.TaskSpec) {
|
||||
return this.prismaClient.workflowTask.create({
|
||||
data: {
|
||||
assetId,
|
||||
projectId,
|
||||
type: WorkflowTaskType.transcode,
|
||||
status: WorkflowTaskStatus.pending,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
payload: spec as any,
|
||||
payload: {
|
||||
projectId,
|
||||
transcode: spec,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user