Add adjustment preset node type validation and enhance render data normalization

- Introduced `adjustmentPresetNodeTypeValidator` for validating new adjustment preset node types.
- Added new constants for render output resolutions and formats, including custom dimension constraints.
- Implemented normalization functions for render data, ensuring proper validation and error handling.
- Updated node creation and update mutations to utilize normalized data for improved consistency.
This commit is contained in:
Matthias
2026-04-02 08:46:55 +02:00
parent 624beac6dc
commit 9bab9bb93d
5 changed files with 255 additions and 12 deletions

View File

@@ -3,6 +3,7 @@ import { defineSchema, defineTable } from "convex/server";
import { v } from "convex/values";
import {
adjustmentPresetNodeTypeValidator,
nodeTypeValidator,
phase1NodeTypeValidator,
} from "./node-type-validator";
@@ -19,6 +20,7 @@ const phase1NodeTypes = phase1NodeTypeValidator;
// jedem Phasenübergang migriert werden muss. Die UI zeigt nur die Typen
// der jeweiligen Phase an.
const nodeType = nodeTypeValidator;
const adjustmentPresetNodeType = adjustmentPresetNodeTypeValidator;
// Node Status — direkt am Node sichtbar (UX-Strategie aus dem PRD)
const nodeStatus = v.union(
@@ -175,6 +177,16 @@ export default defineSchema({
"clientRequestId",
]),
adjustmentPresets: defineTable({
userId: v.string(),
name: v.string(),
nodeType: adjustmentPresetNodeType,
params: v.any(),
createdAt: v.number(),
})
.index("by_userId", ["userId"])
.index("by_userId_nodeType", ["userId", "nodeType"]),
// ==========================================================================
// Credit-System
// ==========================================================================