Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api): fix spelling on some DTOs #287

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/regtech_user_fi_management/entities/models/dto.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ class VersionedData(BaseModel, Generic[T]):
data: T


class FinancialInsitutionDomainBase(BaseModel):
class FinancialInstitutionDomainBase(BaseModel):
domain: str


class FinancialInsitutionDomainCreate(FinancialInsitutionDomainBase):
class FinancialInstitutionDomainCreate(FinancialInstitutionDomainBase):
pass


class FinancialInsitutionDomainDto(FinancialInsitutionDomainBase):
class FinancialInstitutionDomainDto(FinancialInstitutionDomainBase):
lei: str

class Config:
Expand Down Expand Up @@ -165,7 +165,7 @@ class FinancialInstitutionWithRelationsDto(FinancialInstitutionDto):
sbl_institution_types: List[SblTypeAssociationDetailsDto] = []
hq_address_state: AddressStateDto | None = None
lei_status: LeiStatusDto | None = None
domains: List[FinancialInsitutionDomainDto] = []
domains: List[FinancialInstitutionDomainDto] = []


class FinancialInstitutionAssociationDto(FinancialInstitutionWithRelationsDto):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from regtech_user_fi_management.entities.models.dto import (
FinancialInstitutionDto,
FinancialInsitutionDomainCreate,
FinancialInstitutionDomainCreate,
SblTypeAssociationDto,
)

Expand Down Expand Up @@ -92,7 +92,7 @@ def update_sbl_types(


def add_domains(
session: Session, lei: str, domains: List[FinancialInsitutionDomainCreate]
session: Session, lei: str, domains: List[FinancialInstitutionDomainCreate]
) -> Set[FinancialInstitutionDomainDao]:
daos = set(
map(
Expand Down
8 changes: 4 additions & 4 deletions src/regtech_user_fi_management/routers/institutions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from regtech_user_fi_management.entities.models.dto import (
FinancialInstitutionDto,
FinancialInstitutionWithRelationsDto,
FinancialInsitutionDomainDto,
FinancialInsitutionDomainCreate,
FinancialInstitutionDomainDto,
FinancialInstitutionDomainCreate,
FinancialInstitutionAssociationDto,
InstitutionTypeDto,
AddressStateDto,
Expand Down Expand Up @@ -163,12 +163,12 @@ def update_types(
)


@router.post("/{lei}/domains/", response_model=List[FinancialInsitutionDomainDto], dependencies=[Depends(check_domain)])
@router.post("/{lei}/domains/", response_model=List[FinancialInstitutionDomainDto], dependencies=[Depends(check_domain)])
@requires(["query-groups", "manage-users"])
def add_domains(
request: Request,
lei: str,
domains: List[FinancialInsitutionDomainCreate],
domains: List[FinancialInstitutionDomainCreate],
):
return repo.add_domains(request.state.db_session, lei, domains)

Expand Down
4 changes: 2 additions & 2 deletions tests/entities/repos/test_institutions_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from regtech_user_fi_management.entities.models.dto import (
FinancialInstitutionDto,
FinancialInsitutionDomainCreate,
FinancialInstitutionDomainCreate,
SblTypeAssociationDto,
)
from regtech_user_fi_management.entities.models.dao import (
Expand Down Expand Up @@ -331,7 +331,7 @@ def test_add_domains(self, transaction_session: Session, query_session: Session)
repo.add_domains(
transaction_session,
"TESTBANK123000000000",
[FinancialInsitutionDomainCreate(domain="bank.test")],
[FinancialInstitutionDomainCreate(domain="bank.test")],
)
transaction_session.expunge_all()
fi = repo.get_institution(query_session, "TESTBANK123000000000")
Expand Down
Loading