-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update family DTOs * wip * reinstall pre-commit * Make changes to generate family import id * update tests * update FIXMEs with ticket refs
- Loading branch information
1 parent
277ff8c
commit 7ae4b2f
Showing
21 changed files
with
273 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
from typing import Optional, Protocol | ||
from sqlalchemy.orm import Session | ||
|
||
from app.model.family import FamilyCreateDTO, FamilyReadDTO, FamilyWriteDTO | ||
|
||
|
||
class FamilyRepo(Protocol): | ||
"""The interface definition for a FamilyRepo""" | ||
|
||
@staticmethod | ||
def all(db: Session) -> list[FamilyReadDTO]: | ||
"""Returns all the families""" | ||
... | ||
|
||
@staticmethod | ||
def get(db: Session, import_id: str) -> Optional[FamilyReadDTO]: | ||
"""Gets a single family""" | ||
... | ||
|
||
@staticmethod | ||
def search(db: Session, search_term: str) -> list[FamilyReadDTO]: | ||
"""Searches the families""" | ||
... | ||
|
||
@staticmethod | ||
def update( | ||
db: Session, import_id: str, family: FamilyWriteDTO, geo_id: int | ||
) -> bool: | ||
"""Updates a family""" | ||
... | ||
|
||
@staticmethod | ||
def create(db: Session, family: FamilyCreateDTO, geo_id: int, org_id: int) -> str: | ||
"""Creates a family""" | ||
... | ||
|
||
@staticmethod | ||
def delete(db: Session, import_id: str) -> bool: | ||
"""Deletes a family""" | ||
... | ||
|
||
@staticmethod | ||
def count(db: Session) -> Optional[int]: | ||
"""Counts all the families""" | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.