58 lines
1.6 KiB
Python
58 lines
1.6 KiB
Python
"""Request Management Module."""
|
|
|
|
from pathlib import Path
|
|
from typing import List, Optional
|
|
from fastapi import APIRouter
|
|
|
|
from app.core.sdk.module import BaseModule
|
|
|
|
|
|
class RequestModule(BaseModule):
|
|
"""Module for managing service requests/tickets.
|
|
|
|
This is the first module registered with the platform,
|
|
providing request/ticket management capabilities.
|
|
"""
|
|
|
|
id = "request"
|
|
name = "Request Management"
|
|
version = "1.0.0"
|
|
description = "Модуль управления заявками"
|
|
|
|
def __init__(self):
|
|
self._module_dir = Path(__file__).parent
|
|
|
|
def routers(self) -> List[APIRouter]:
|
|
"""Return API routers for the request module.
|
|
|
|
Currently returns empty list - routes will be added
|
|
when migrating the request API to the module system.
|
|
"""
|
|
return []
|
|
|
|
def permissions(self) -> List[str]:
|
|
"""Return permissions managed by this module."""
|
|
return [
|
|
"request.read",
|
|
"request.write",
|
|
"request.delete",
|
|
]
|
|
|
|
def static_path(self) -> Optional[Path]:
|
|
"""Return path to static files directory."""
|
|
static = self._module_dir / "static"
|
|
return static if static.exists() else None
|
|
|
|
def templates_path(self) -> Optional[Path]:
|
|
"""Return path to templates directory."""
|
|
templates = self._module_dir / "templates"
|
|
return templates if templates.exists() else None
|
|
|
|
async def startup(self) -> None:
|
|
"""Initialize request module resources."""
|
|
pass
|
|
|
|
async def shutdown(self) -> None:
|
|
"""Cleanup request module resources."""
|
|
pass
|