define([
    'knockout',
    'jquery',
    'arches',
    'viewmodels/workflow',
    'templates/views/components/plugins/bienes-muebles-workflow.htm',
    'views/components/workflows/final-step'
], function(ko, $, arches, Workflow, BienesMueblesWorkflowTemplate) {
    return ko.components.register('bienes-muebles-workflow', {
        viewModel: function(params) {
            this.componentName = 'bienes-muebles-workflow';
            this.quitUrl = "/search";
            this.stepConfig = [
                {
                    title: 'Crear nuevo Patrimonio Material de tipo Bienes Muebles',
                    name: 'fijar-info-basica',  /* unique to workflow */
                    required: true,
                    workflowstepclass: 'crear-pcb-bm-atajo',
                    informationboxdata: {
                        heading: 'Primero, establezca la ubicación Administrativa, Departamento / Provincia / Municipio',
                        text: 'Este descriptor es relevante para la conformación del código de identificación principal',
                    },
                    layoutSections: [
                        {
                            componentConfigs: [
                                {
                                    componentName: 'default-card',
                                    uniqueInstanceName: 'pcb-bm-lugar', /* unique to step */
                                    tilesManaged: 'one',
                                    parameters: {
                                        graphid: '10b03fec-4d85-11ee-a708-ffcd06c08a5d',
                                        nodegroupid: 'b2913d6e-e139-11ee-8042-03ba1b5a73e5',
                                        hiddenNodes: "['c2e29d9c-9869-11ef-bf1b-5fbb45b1a9c6', 'bd74fd30-e13c-11ee-8042-03ba1b5a73e5', 'bc5cc562-e142-11ee-8042-03ba1b5a73e5']",
                                    },
                                },
                            ], 
                        },
                    ]
                },
                {
                    title: 'Establecer Ámbito y subámbito',
                    name: 'fijar-alcance',  /* unique to workflow */
                    required: true,
                    informationboxdata: {
                        heading: 'Establezca El Ámbito y el subámbito del Patrimonio, procure llenar ambos valores',
                        text: 'Luego establezca el valor numérico del codigo (sufijo del tipo 000000)',
                    },
                    layoutSections: [
                        {
                            componentConfigs: [
                                {
                                    componentName: 'default-card',
                                    uniqueInstanceName: 'pcb-bm-alcance', /* unique to step */
                                    tilesManaged: 'one',
                                    parameters: {
                                        graphid: '10b03fec-4d85-11ee-a708-ffcd06c08a5d',
                                        nodegroupid: 'a7deaf7e-e147-11ee-8042-03ba1b5a73e5',
                                        hiddenNodes: "['67e62a02-e14a-11ee-8042-03ba1b5a73e5', '84e15d34-e14a-11ee-8042-03ba1b5a73e5']",
                                        resourceid: "['fijar-info-basica']['pcb-bm-lugar'][0]['resourceInstanceId']",
                                    },
                                },
                            ], 
                        },
                    ],
                },
                {
                    title: 'Establecer la denominación y el subtipo',
                    name: 'fijar-nombre',  /* unique to workflow */
                    required: true,
                    informationboxdata: {
                        heading: 'Establezca la denominación (nombre o título) del bien mueble',
                        text: 'Finalmente establezca el subtipo de patrimonio material',
                    },
                    layoutSections: [
                        {
                            componentConfigs: [
                                {
                                    componentName: 'default-card',
                                    uniqueInstanceName: 'pcb-bm-nombre', /* unique to step */
                                    tilesManaged: 'one',
                                    parameters: {
                                        graphid: '10b03fec-4d85-11ee-a708-ffcd06c08a5d',
                                        nodegroupid: '67e62a02-e14a-11ee-8042-03ba1b5a73e5',
                                        hiddenNodes: "[]",
                                        resourceid: "['fijar-info-basica']['pcb-bm-lugar'][0]['resourceInstanceId']",
                                    },
                                },
                            ], 
                        },
                    ],
                },
                {
                    title: 'Finalizar',
                    name: 'add-resource-complete',  /* unique to workflow */
                    description: 'Finalizar la creación del recurso.',
                    layoutSections: [
                        {
                            componentConfigs: [
                                { 
                                    componentName: 'final-step',
                                    uniqueInstanceName: 'create-resource-final',
                                    tilesManaged: 'none',
                                    parameters: {
                                        resourceid: "['fijar-info-basica']['pcb-bm-lugar'][0]['resourceInstanceId']",
                                    },
                                },
                            ], 
                        },
                    ],
                }
            ];
            Workflow.apply(this, [params]);
        },
        template: BienesMueblesWorkflowTemplate,
    });
});