feat: add production task set API client and item mapping

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-08-18 16:16:04 +08:00
1 parent 49e208c241
commit d60d4bd4b6
4 files changed
+162

No files matched your search

@@ -0,0 +1,30 @@
export type ProductionTaskSetItemPreview = {
taskName: string
routeId: string
routeName: string
description: string
remark: string
}
export function mapWorkOrderTasksToSetItems(tasks: Record<string, any>[] | undefined): {
items: ProductionTaskSetItemPreview[]
skippedEmptyNameCount: number
} {
const items: ProductionTaskSetItemPreview[] = []
let skippedEmptyNameCount = 0
for (const row of tasks || []) {
const taskName = String(row.taskName || '').trim()
if (!taskName) {
skippedEmptyNameCount += 1
continue
}
items.push({
taskName,
routeId: String(row.routeId || '').trim(),
routeName: String(row.routeName || '').trim(),
description: String(row.description || '').trim(),
remark: String(row.remark || '').trim()
})
}
return { items, skippedEmptyNameCount }
}