56 lines
1.7 KiB
Python
56 lines
1.7 KiB
Python
"""
|
|
app/api/__init__.py
|
|
-------------------
|
|
Registers the /api/v1 blueprint group.
|
|
|
|
Phase A: /api/v1/facilities/*, /api/v1/templates/*
|
|
Phase B: /api/v1/inspections/*, /api/v1/issues/*, /api/v1/photos/*
|
|
Phase C: /api/v1/notifications/*
|
|
"""
|
|
|
|
from flask import Blueprint
|
|
from app.api.errors import register_error_handlers
|
|
|
|
api_bp = Blueprint('api', __name__, url_prefix='/api/v1')
|
|
register_error_handlers(api_bp)
|
|
|
|
|
|
def register_api(app):
|
|
"""
|
|
Register all API sub-blueprints.
|
|
CSRF exemption for each child blueprint is handled in app/__init__.py.
|
|
"""
|
|
# Phase 7: Auth
|
|
from app.api.auth import bp as auth_bp
|
|
api_bp.register_blueprint(auth_bp)
|
|
|
|
# Phase A: Reference data
|
|
from app.api.facilities import bp as facilities_bp
|
|
from app.api.templates import bp as templates_bp
|
|
api_bp.register_blueprint(facilities_bp)
|
|
api_bp.register_blueprint(templates_bp)
|
|
|
|
# Phase B: Offline inspection submission
|
|
from app.api.inspections import bp as inspections_bp
|
|
from app.api.issues import bp as issues_bp
|
|
from app.api.photos import bp as photos_bp
|
|
api_bp.register_blueprint(inspections_bp)
|
|
api_bp.register_blueprint(issues_bp)
|
|
api_bp.register_blueprint(photos_bp)
|
|
|
|
# Phase C: Notification polling
|
|
from app.api.notifications import bp as notifications_bp
|
|
api_bp.register_blueprint(notifications_bp)
|
|
|
|
# Phase B (stats): Dashboard KPI endpoint
|
|
from app.api.stats import bp as stats_bp
|
|
api_bp.register_blueprint(stats_bp)
|
|
|
|
# Phase D: Issue comments
|
|
from app.api.comments import bp as comments_bp
|
|
api_bp.register_blueprint(comments_bp)
|
|
|
|
from app.api.devices import bp as devices_bp
|
|
api_bp.register_blueprint(devices_bp)
|
|
|
|
app.register_blueprint(api_bp) |