feat: 优化默认建档模板和时间轴
This commit is contained in:
@@ -14,6 +14,13 @@ interface MediaItem {
|
||||
type?: string;
|
||||
}
|
||||
|
||||
const DEFAULT_TRACE_NODES: Prisma.TraceNodeCreateWithoutArtworkInput[] = [
|
||||
{ nodeType: 'CREATE', title: '创作 / 选胚', sortOrder: 0 },
|
||||
{ nodeType: 'PRODUCE', title: '制作过程', sortOrder: 1 },
|
||||
{ nodeType: 'STORAGE', title: '仓储 / 托管', sortOrder: 2 },
|
||||
{ nodeType: 'OUTBOUND', title: '出库 / 流转', sortOrder: 3 },
|
||||
];
|
||||
|
||||
@Injectable()
|
||||
export class ArtworkService {
|
||||
constructor(
|
||||
@@ -46,6 +53,7 @@ export class ArtworkService {
|
||||
dynamicFields: (dto.dynamicFields ?? {}) as Prisma.InputJsonValue,
|
||||
images: (dto.images ?? []) as unknown as Prisma.InputJsonValue,
|
||||
createdBy: userId,
|
||||
traceNodes: { create: DEFAULT_TRACE_NODES },
|
||||
},
|
||||
});
|
||||
// 创建后回填档案编号(需要自增 id)
|
||||
|
||||
Reference in New Issue
Block a user