from dataclasses import dataclass

from ._SchemaModel import SchemaModel


@dataclass
class RefSchemaModel(SchemaModel):
    schema: SchemaModel
    path: str

    def get_schema_name(self) -> str:
        return self.schema.get_schema_name()

    def get_schema_uuid(self) -> str:
        return self.schema.get_schema_uuid()

    def to_dict(self) -> dict:
        return {
            "$ref": f"#/{self.path}/{self.schema.get_schema_name()}"
        }
