from typing import ClassVar
from modules.database.tools.neontology.baserelationship import BaseRelationship

import modules.database.schemas.nodes.schools.pastoral as pastoral_nodes
import modules.database.schemas.nodes.schools.curriculum as curriculum_nodes
import modules.database.schemas.nodes.structures.schools as school_structures

# Structure layer relationships
class CurriculumStructureIncludesKeyStage(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'CURRICULUM_STRUCTURE_INCLUDES_KEY_STAGE'
    source: school_structures.CurriculumStructureNode
    target: curriculum_nodes.KeyStageNode
    
class PastoralStructureIncludesYearGroup(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'PASTORAL_STRUCTURE_INCLUDES_YEAR_GROUP'
    source: school_structures.PastoralStructureNode
    target: pastoral_nodes.YearGroupNode

## Curriculum layer relationships
class SubjectForKeyStage(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'SUBJECT_FOR_KEY_STAGE'
    source: curriculum_nodes.SubjectNode
    target: curriculum_nodes.KeyStageNode
    
class SubjectHasYearGroupSyllabus(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'SUBJECT_HAS_YEAR_GROUP_SYLLABUS'
    source: curriculum_nodes.SubjectNode
    target: pastoral_nodes.YearGroupSyllabusNode
    
class SubjectHasKeyStageSyllabus(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'SUBJECT_HAS_KEY_STAGE_SYLLABUS'
    source: curriculum_nodes.SubjectNode
    target: curriculum_nodes.KeyStageSyllabusNode

class TopicPartOfYearGroupSyllabus(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'YEAR_SYLLABUS_INCLUDES_TOPIC'
    source: pastoral_nodes.YearGroupSyllabusNode
    target: curriculum_nodes.TopicNode
    
class KeyStageSyllabusIncludesTopic(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'KEY_STAGE_SYLLABUS_INCLUDES_TOPIC'
    source: curriculum_nodes.KeyStageSyllabusNode
    target: curriculum_nodes.TopicNode

class YearGroupHasYearGroupSyllabus(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'YEAR_GROUP_HAS_YEAR_GROUP_SYLLABUS'
    source: pastoral_nodes.YearGroupNode
    target: pastoral_nodes.YearGroupSyllabusNode

class KeyStageSyllabusIncludesYearGroupSyllabus(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'KEY_STAGE_SYLLABUS_INCLUDES_YEAR_GROUP_SYLLABUS'
    source: curriculum_nodes.KeyStageSyllabusNode
    target: pastoral_nodes.YearGroupSyllabusNode

class KeyStageIncludesKeyStageSyllabus(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'KEY_STAGE_INCLUDES_KEY_STAGE_SYLLABUS'
    source: curriculum_nodes.KeyStageNode
    target: curriculum_nodes.KeyStageSyllabusNode

class KeyStageIncludesTopic(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'KEY_STAGE_INCLUDES_TOPIC'
    source: curriculum_nodes.KeyStageNode
    target: curriculum_nodes.TopicNode

class SubjectIncludesTopic(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'SUBJECT_INCLUDES_TOPIC'
    source: curriculum_nodes.SubjectNode
    target: curriculum_nodes.TopicNode

class TopicIncludesTopicLesson(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'TOPIC_INCLUDES_LESSON'
    source: curriculum_nodes.TopicNode
    target: curriculum_nodes.TopicLessonNode

class TopicIncludesLearningStatement(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'TOPIC_INCLUDES_LEARNING_STATEMENT'
    source: curriculum_nodes.TopicNode
    target: curriculum_nodes.LearningStatementNode

class LessonIncludesLearningStatement(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'LESSON_INCLUDES_LEARNING_STATEMENT'
    source: curriculum_nodes.TopicLessonNode
    target: curriculum_nodes.LearningStatementNode

# Science-specific curriculum layer relationships
class TopicLessonIncludesScienceLab(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'LESSON_INCLUDES_SCIENCE_LAB'
    source: curriculum_nodes.TopicLessonNode
    target: curriculum_nodes.ScienceLabNode
    
class KeyStageFollowsKeyStage(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'KEY_STAGE_FOLLOWS_KEY_STAGE'
    source: curriculum_nodes.KeyStageNode
    target: curriculum_nodes.KeyStageNode

class YearGroupFollowsYearGroup(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'YEAR_GROUP_FOLLOWS_YEAR_GROUP'
    source: pastoral_nodes.YearGroupNode
    target: pastoral_nodes.YearGroupNode

class KeyStageSyllabusFollowsKeyStageSyllabus(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'KEY_STAGE_SYLLABUS_FOLLOWS_KEY_STAGE_SYLLABUS'
    source: curriculum_nodes.KeyStageSyllabusNode
    target: curriculum_nodes.KeyStageSyllabusNode

class YearGroupSyllabusFollowsYearGroupSyllabus(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'YEAR_GROUP_SYLLABUS_FOLLOWS_YEAR_GROUP_SYLLABUS'
    source: pastoral_nodes.YearGroupSyllabusNode
    target: pastoral_nodes.YearGroupSyllabusNode

class TopicLessonFollowsTopicLesson(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'LESSON_FOLLOWS_LESSON'
    source: curriculum_nodes.TopicLessonNode
    target: curriculum_nodes.TopicLessonNode
    
class YearGroupSyllabusIncludesTopic(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'YEAR_GROUP_SYLLABUS_INCLUDES_TOPIC'
    source: pastoral_nodes.YearGroupSyllabusNode
    target: curriculum_nodes.TopicNode
