from typing import ClassVar, Union
import modules.database.schemas.entities as entities
import modules.database.schemas.nodes.users as user_nodes
import modules.database.schemas.nodes.workers.workers as worker_nodes
import modules.database.schemas.nodes.schools.schools as school_nodes
import modules.database.schemas.nodes.schools.curriculum as curriculum_nodes
import modules.database.schemas.nodes.structures.schools as school_structures
from modules.database.tools.neontology.baserelationship import BaseRelationship
    
class UserIsSchoolWorker(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'IS_SCHOOL_WORKER'
    source: user_nodes.UserNode
    target: Union[worker_nodes.SchoolAdminNode, worker_nodes.TeacherNode, worker_nodes.StudentNode]

class UserIsSystemWorker(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'IS_SYSTEM_WORKER'
    source: user_nodes.UserNode
    target: Union[worker_nodes.DeveloperNode, worker_nodes.SuperAdminNode]

class EntityBelongsToSchool(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'BELONGS_TO'
    source: Union[entities.worker_entities, entities.school_entities]
    target: entities.school_entities
    
class EntityBelongsToDepartment(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'BELONGS_TO'
    source: entities.worker_entities
    target: school_nodes.DepartmentNode
    
class SchoolHasDepartmentStructure(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'HAS_DEPARTMENT_STRUCTURE'
    source: school_nodes.SchoolNode
    target: school_structures.DepartmentStructureNode

class DepartmentStructureHasDepartment(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'HAS_DEPARTMENT'
    source: school_structures.DepartmentStructureNode
    target: school_nodes.DepartmentNode

class DepartmentManagesKeyStageSyllabus(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'MANAGES_KEY_STAGE_SYLLABUS'
    source: school_nodes.DepartmentNode
    target: curriculum_nodes.KeyStageSyllabusNode

class DepartmentManagesSubject(BaseRelationship):
    __relationshiptype__: ClassVar[str] = 'MANAGES_SUBJECT'
    source: school_nodes.DepartmentNode
    target: curriculum_nodes.SubjectNode

