package dp.kotul.templategroupsbackend.data.templategroup

import dp.kotul.solrapimodel.solrsearch.TemplateType.CHILI_PRINT
import dp.kotul.solrapimodel.solrsearch.TemplateType.TACTIC_WEB_AD
import dp.kotul.templategroupsbackend.model.entity.VariableSourceType.*
import dp.kotul.templategroupsbackend.model.request.TemplateGroupRequest
import dp.kotul.templategroupsbackend.model.request.TemplateRequest
import dp.kotul.templategroupsbackend.model.request.TemplateVariableRequest
import dp.kotul.templategroupsbackend.model.request.VariableSourceRequest

object TemplateGroupUpdateData {
    val templateGroupUpdateRequest = TemplateGroupRequest(
        templateGroupId = 1,
        name = "Test",
        templates = listOf(
            TemplateRequest(
                templateId = 1,
                templateExtId = "132e6e51-aa3e-4985-a428-84648a7ad389",
                templateType = CHILI_PRINT,
                sortOrder = 0,
                templateVariables = listOf(
                    TemplateVariableRequest(
                        templateVariableId = 1,
                        templateVariableExtId = "user:COMPANY_NAME",
                        name = "Company name",
                        included = false,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 2,
                        templateVariableExtId = "max-width-increase",
                        name = "max-width-increase",
                        included = false,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 3,
                        templateVariableExtId = "max-height-increase",
                        name = "max-height-increase",
                        included = false,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 4,
                        templateVariableExtId = "min-scaling",
                        name = "min-scaling",
                        included = false,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 5,
                        templateVariableExtId = "max-scaling",
                        name = "max-scaling",
                        included = false,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    )
                )
            ),
            TemplateRequest(
                templateId = 3,
                templateExtId = "3897d79a-d5b7-45fc-a806-84a5ab6a68fe",
                templateType = CHILI_PRINT,
                sortOrder = 0,
                templateVariables = listOf(
                    TemplateVariableRequest(
                        templateVariableId = 8,
                        templateVariableExtId = "document-bleed",
                        name = "document-bleed",
                        included = false,
                        defaultValue = "false",
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 9,
                        templateVariableExtId = "bleed-marks-enabled",
                        name = "bleed-marks-enabled",
                        included = false,
                        defaultValue = "true",
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 10,
                        templateVariableExtId = "mandatory-variable",
                        name = "MANDATORY_VARIABLE!",
                        included = true,
                        defaultValue = "",
                        mandatoryExt = true,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 11,
                        templateVariableExtId = "maxLength-variable",
                        name = "maxLength-variable",
                        included = false,
                        defaultValue = "",
                        mandatoryExt = false,
                        variableSource = null
                    )
                )
            ),
            TemplateRequest(
                templateId = 2,
                templateExtId = "825ccd4116a8b7237899d6ab2aa0e3b6",
                templateType = TACTIC_WEB_AD,
                sortOrder = 0,
                templateVariables = listOf(
                    TemplateVariableRequest(
                        templateVariableId = 6,
                        templateVariableExtId = "myCustomHeading",
                        name = "myCustomHeading",
                        included = false,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 7,
                        templateVariableExtId = "myCustomMessage",
                        name = "myCustomMessage",
                        included = false,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    )
                )
            )
        )
    )

    val templateGroupAllIncludedVariablesUpdateRequest = TemplateGroupRequest(
        templateGroupId = 1,
        name = "Test",
        templates = listOf(
            TemplateRequest(
                templateId = 1,
                templateExtId = "132e6e51-aa3e-4985-a428-84648a7ad389",
                templateType = CHILI_PRINT,
                sortOrder = 0,
                templateVariables = listOf(
                    TemplateVariableRequest(
                        templateVariableId = 1,
                        templateVariableExtId = "user:COMPANY_NAME",
                        name = "Company name",
                        included = true,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = VariableSourceRequest(
                            variableSourceId = 0,
                            sourceId = "2",
                            sourceType = TEMPLATE,
                            sourceFieldId = "6"
                        )
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 2,
                        templateVariableExtId = "max-width-increase",
                        name = "max-width-increase",
                        included = true,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 3,
                        templateVariableExtId = "max-height-increase",
                        name = "max-height-increase",
                        included = true,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 4,
                        templateVariableExtId = "min-scaling",
                        name = "min-scaling",
                        included = true,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = VariableSourceRequest(
                            variableSourceId = 0,
                            sourceId = "user_id",
                            sourceType = USER_DATA,
                            sourceFieldId = null
                        )
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 5,
                        templateVariableExtId = "max-scaling",
                        name = "max-scaling",
                        included = true,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    )
                )
            ),
            TemplateRequest(
                templateId = 3,
                templateExtId = "3897d79a-d5b7-45fc-a806-84a5ab6a68fe",
                templateType = CHILI_PRINT,
                sortOrder = 0,
                templateVariables = listOf(
                    TemplateVariableRequest(
                        templateVariableId = 8,
                        templateVariableExtId = "document-bleed",
                        name = "document-bleed",
                        included = true,
                        defaultValue = "false",
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 9,
                        templateVariableExtId = "bleed-marks-enabled",
                        name = "bleed-marks-enabled",
                        included = true,
                        defaultValue = "true",
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 10,
                        templateVariableExtId = "mandatory-variable",
                        name = "MANDATORY_VARIABLE!",
                        included = true,
                        defaultValue = "",
                        mandatoryExt = true,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 11,
                        templateVariableExtId = "maxLength-variable",
                        name = "maxLength-variable",
                        included = true,
                        defaultValue = "",
                        mandatoryExt = false,
                        variableSource = null
                    )
                )
            ),
            TemplateRequest(
                templateId = 2,
                templateExtId = "825ccd4116a8b7237899d6ab2aa0e3b6",
                templateType = TACTIC_WEB_AD,
                sortOrder = 0,
                templateVariables = listOf(
                    TemplateVariableRequest(
                        templateVariableId = 6,
                        templateVariableExtId = "myCustomHeading",
                        name = "myCustomHeading",
                        included = true,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = VariableSourceRequest(
                            variableSourceId = 0,
                            sourceId = "1",
                            sourceType = UNIT_DATA,
                            sourceFieldId = "2"
                        )
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 7,
                        templateVariableExtId = "myCustomMessage",
                        name = "myCustomMessage",
                        included = true,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    )
                )
            )
        )
    )

    val templateGroupWithRemovedTemplateAndNotIncludedVariablesUpdateRequest = TemplateGroupRequest(
        templateGroupId = 1,
        name = "Test",
        templates = listOf(
            TemplateRequest(
                templateId = 1,
                templateExtId = "132e6e51-aa3e-4985-a428-84648a7ad389",
                templateType = CHILI_PRINT,
                sortOrder = 0,
                templateVariables = listOf(
                    TemplateVariableRequest(
                        templateVariableId = 1,
                        templateVariableExtId = "user:COMPANY_NAME",
                        name = "Company name",
                        included = true,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = VariableSourceRequest(
                            variableSourceId = 1,
                            sourceId = "2",
                            sourceType = TEMPLATE,
                            sourceFieldId = "6"
                        )
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 2,
                        templateVariableExtId = "max-width-increase",
                        name = "max-width-increase",
                        included = true,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 3,
                        templateVariableExtId = "max-height-increase",
                        name = "max-height-increase",
                        included = true,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 4,
                        templateVariableExtId = "min-scaling",
                        name = "min-scaling",
                        included = true,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = VariableSourceRequest(
                            variableSourceId = 2,
                            sourceId = "user_id",
                            sourceType = USER_DATA,
                            sourceFieldId = null
                        )
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 5,
                        templateVariableExtId = "max-scaling",
                        name = "max-scaling",
                        included = true,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    )
                )
            ),
            TemplateRequest(
                templateId = 3,
                templateExtId = "3897d79a-d5b7-45fc-a806-84a5ab6a68fe",
                templateType = CHILI_PRINT,
                sortOrder = 0,
                templateVariables = listOf(
                    TemplateVariableRequest(
                        templateVariableId = 8,
                        templateVariableExtId = "document-bleed",
                        name = "document-bleed",
                        included = true,
                        defaultValue = "false",
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 9,
                        templateVariableExtId = "bleed-marks-enabled",
                        name = "bleed-marks-enabled",
                        included = false,
                        defaultValue = "true",
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 10,
                        templateVariableExtId = "mandatory-variable",
                        name = "MANDATORY_VARIABLE!",
                        included = true,
                        defaultValue = "",
                        mandatoryExt = true,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 11,
                        templateVariableExtId = "maxLength-variable",
                        name = "maxLength-variable",
                        included = false,
                        defaultValue = "",
                        mandatoryExt = false,
                        variableSource = null
                    )
                )
            )
        )
    )

    val templateGroupTransitiveDependencyTemplateVariablesUpdateRequest = TemplateGroupRequest(
        templateGroupId = 1,
        name = "Test",
        templates = listOf(
            TemplateRequest(
                templateId = 1,
                templateExtId = "132e6e51-aa3e-4985-a428-84648a7ad389",
                templateType = CHILI_PRINT,
                sortOrder = 0,
                templateVariables = listOf(
                    TemplateVariableRequest(
                        templateVariableId = 1,
                        templateVariableExtId = "user:COMPANY_NAME",
                        name = "Company name",
                        included = true,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = VariableSourceRequest(
                            variableSourceId = 0,
                            sourceId = "2",
                            sourceType = TEMPLATE,
                            sourceFieldId = "6"
                        )
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 2,
                        templateVariableExtId = "max-width-increase",
                        name = "max-width-increase",
                        included = false,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 3,
                        templateVariableExtId = "max-height-increase",
                        name = "max-height-increase",
                        included = false,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 4,
                        templateVariableExtId = "min-scaling",
                        name = "min-scaling",
                        included = false,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 5,
                        templateVariableExtId = "max-scaling",
                        name = "max-scaling",
                        included = false,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    )
                )
            ),
            TemplateRequest(
                templateId = 3,
                templateExtId = "3897d79a-d5b7-45fc-a806-84a5ab6a68fe",
                templateType = CHILI_PRINT,
                sortOrder = 0,
                templateVariables = listOf(
                    TemplateVariableRequest(
                        templateVariableId = 8,
                        templateVariableExtId = "document-bleed",
                        name = "document-bleed",
                        included = false,
                        defaultValue = "false",
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 9,
                        templateVariableExtId = "bleed-marks-enabled",
                        name = "bleed-marks-enabled",
                        included = false,
                        defaultValue = "true",
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 10,
                        templateVariableExtId = "mandatory-variable",
                        name = "MANDATORY_VARIABLE!",
                        included = true,
                        defaultValue = "",
                        mandatoryExt = true,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 11,
                        templateVariableExtId = "maxLength-variable",
                        name = "maxLength-variable",
                        included = false,
                        defaultValue = "",
                        mandatoryExt = false,
                        variableSource = null
                    )
                )
            ),
            TemplateRequest(
                templateId = 2,
                templateExtId = "825ccd4116a8b7237899d6ab2aa0e3b6",
                templateType = TACTIC_WEB_AD,
                sortOrder = 0,
                templateVariables = listOf(
                    TemplateVariableRequest(
                        templateVariableId = 6,
                        templateVariableExtId = "myCustomHeading",
                        name = "myCustomHeading",
                        included = true,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = VariableSourceRequest(
                            variableSourceId = 0,
                            sourceId = "1",
                            sourceType = UNIT_DATA,
                            sourceFieldId = "2"
                        )
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 7,
                        templateVariableExtId = "myCustomMessage",
                        name = "myCustomMessage",
                        included = true,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = VariableSourceRequest(
                            variableSourceId = 0,
                            sourceId = "1",
                            sourceType = TEMPLATE,
                            sourceFieldId = "1"
                        )
                    )
                )
            )
        )
    )

    val templateGroupNotIncludedTemplateVariablesUpdateRequest = TemplateGroupRequest(
        templateGroupId = 1,
        name = "Test",
        templates = listOf(
            TemplateRequest(
                templateId = 1,
                templateExtId = "132e6e51-aa3e-4985-a428-84648a7ad389",
                templateType = CHILI_PRINT,
                sortOrder = 0,
                templateVariables = listOf(
                    TemplateVariableRequest(
                        templateVariableId = 1,
                        templateVariableExtId = "user:COMPANY_NAME",
                        name = "Company name",
                        included = false,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = VariableSourceRequest(
                            variableSourceId = 0,
                            sourceId = "1",
                            sourceType = UNIT_DATA,
                            sourceFieldId = "2"
                        )
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 2,
                        templateVariableExtId = "max-width-increase",
                        name = "max-width-increase",
                        included = false,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 3,
                        templateVariableExtId = "max-height-increase",
                        name = "max-height-increase",
                        included = false,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 4,
                        templateVariableExtId = "min-scaling",
                        name = "min-scaling",
                        included = false,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 5,
                        templateVariableExtId = "max-scaling",
                        name = "max-scaling",
                        included = false,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    )
                )
            ),
            TemplateRequest(
                templateId = 3,
                templateExtId = "3897d79a-d5b7-45fc-a806-84a5ab6a68fe",
                templateType = CHILI_PRINT,
                sortOrder = 0,
                templateVariables = listOf(
                    TemplateVariableRequest(
                        templateVariableId = 8,
                        templateVariableExtId = "document-bleed",
                        name = "document-bleed",
                        included = false,
                        defaultValue = "false",
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 9,
                        templateVariableExtId = "bleed-marks-enabled",
                        name = "bleed-marks-enabled",
                        included = false,
                        defaultValue = "true",
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 10,
                        templateVariableExtId = "mandatory-variable",
                        name = "MANDATORY_VARIABLE!",
                        included = true,
                        defaultValue = "",
                        mandatoryExt = true,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 11,
                        templateVariableExtId = "maxLength-variable",
                        name = "maxLength-variable",
                        included = false,
                        defaultValue = "",
                        mandatoryExt = false,
                        variableSource = null
                    )
                )
            ),
            TemplateRequest(
                templateId = 2,
                templateExtId = "825ccd4116a8b7237899d6ab2aa0e3b6",
                templateType = TACTIC_WEB_AD,
                sortOrder = 0,
                templateVariables = listOf(
                    TemplateVariableRequest(
                        templateVariableId = 6,
                        templateVariableExtId = "myCustomHeading",
                        name = "myCustomHeading",
                        included = false,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = null
                    ),
                    TemplateVariableRequest(
                        templateVariableId = 7,
                        templateVariableExtId = "myCustomMessage",
                        name = "myCustomMessage",
                        included = true,
                        defaultValue = null,
                        mandatoryExt = false,
                        variableSource = VariableSourceRequest(
                            variableSourceId = 0,
                            sourceId = "1",
                            sourceType = TEMPLATE,
                            sourceFieldId = "1"
                        )
                    )
                )
            )
        )
    )
}
