docs: service docstrings

Issue: #13
This commit is contained in:
Chris Milne 2026-05-28 14:41:11 +01:00
parent 71f26a4c9b
commit d852bda091
9 changed files with 24 additions and 47 deletions

View file

@ -1,7 +1,3 @@
""" """
Configurations for <this module> Configurations for the services module
Configurations:
- List: Description
- Configs: Description
""" """

View file

@ -1,7 +1,3 @@
""" """
Constants and error codes for <this module> Constants for the services module
Constants:
- List: Description
- Consts: Description
""" """

View file

@ -1,13 +1,9 @@
""" """
Router dependencies for <this module> Dependencies related to the services module
Classes: Exports:
- List: Description - service_model_query_dependency: service_model: Gets service model from db, if it exists. Uses service_id from query param.
- Classes: Description - service_model_body_dependency: service_model: Gets service model from db, if it exists. Uses service_id from request body.
Functions:
- List: Description
- Functions: Description
""" """
from typing import Annotated from typing import Annotated
from fastapi import Depends, Query from fastapi import Depends, Query

View file

@ -1,9 +1,8 @@
""" """
Module specific exceptions for <this module> Exceptions related to the services module
Exceptions: Exceptions:
- List: Description - ServiceNotFoundException: Takes an optional service_id int
- Exceptions: Description
""" """
from typing import Optional from typing import Optional

View file

@ -2,8 +2,8 @@
Database models for the services module Database models for the services module
Models: Models:
- List: Description - Service:
- Models: Description - id[PK], name[U], api_key[U]
""" """
from sqlalchemy import Column, Integer, String from sqlalchemy import Column, Integer, String

View file

@ -1,9 +1,11 @@
""" """
Router endpoints for <this module> Router endpoints for the services module
Endpoints: Endpoints:
- List: Description - [GET](/): [root user]: Get a list of all services(id, name)
- Endpoints: Description - [POST](/): [super admin]: Register a new service(name) on the hub, returns the API key for the service to access the hub.
- [PATCH](/key): [super_admin]: Refreshes the API key for a service(id), returning a new one.
- [DELETE](/): [super_admin]: Removes a service(id) from the hub.
""" """
from fastapi import APIRouter, status from fastapi import APIRouter, status
from psycopg.errors import UniqueViolation from psycopg.errors import UniqueViolation

View file

@ -1,9 +1,10 @@
""" """
Pydantic models for the service module Pydantic models for service module
Models: Models follow the nomenclature of:
- List: Description - Sub-models: "<Resource><Opt:>Schema"
- Models: Description - Mixins: "<Attribute>Mixin"
- Models: "<Module><Method><Resource><Opt:Resource><Direction>" ie "ServiceGetServiceResponse"
""" """
from pydantic import ConfigDict from pydantic import ConfigDict

View file

@ -1,11 +1,3 @@
""" """
Module specific business logic for <this module> Business logic for the services module
Classes:
- List: Description
- Classes: Description
Functions:
- List: Description
- Functions: Description
""" """

View file

@ -1,13 +1,8 @@
""" """
Non-business logic reusable functions and classes for <this module> Non-business logic reusable functions and classes for the services module
Classes: Exports:
- List: Description - generate_api_key(): returns a new UUID
- Classes: Description
Functions:
- List: Description
- Functions: Description
""" """
import uuid import uuid