feat: auto populate machine structures and seed sample data

This commit is contained in:
Matthieu
2025-10-13 09:01:33 +02:00
parent b7682ac312
commit dc4a12440b
21 changed files with 2218 additions and 7267 deletions

View File

@@ -9,46 +9,22 @@ const CUSTOM_FIELD_SELECT = {
} as const;
export const COMPONENT_WITH_RELATIONS_INCLUDE = {
machine: true,
parentComposant: true,
typeComposant: {
include: {
customFields: true,
},
},
typeMachineComponentRequirement: {
include: {
typeComposant: {
include: {
customFields: true,
},
},
},
},
constructeur: true,
customFieldValues: {
include: {
customField: { select: CUSTOM_FIELD_SELECT },
},
},
pieces: {
machineLinks: {
include: {
customFieldValues: {
include: {
customField: { select: CUSTOM_FIELD_SELECT },
},
},
constructeur: true,
typeMachinePieceRequirement: {
include: {
typePiece: {
include: {
customFields: true,
},
},
},
},
documents: true,
machine: true,
typeMachineComponentRequirement: true,
childLinks: true,
},
},
documents: true,