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

Rest API Schema optional values fixed #215

Merged
merged 1 commit into from
Nov 29, 2024
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
2 changes: 1 addition & 1 deletion g2p_bank_rest_api/schemas/group_membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
class GroupMembersInfoRequest(
group_membership.GroupMembersInfoRequest, extends=group_membership.GroupMembersInfoRequest
):
bank_ids: list[bank_details.BankDetailsRequest] | None
bank_ids: list[bank_details.BankDetailsRequest] | None = None
6 changes: 3 additions & 3 deletions g2p_registry_rest_api/schemas/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ class GroupInfoResponse(RegistrantInfoResponse):

class GroupInfoRequest(RegistrantInfoRequest):
is_group: bool = True
members: list[GroupMembersInfoRequest]
kind: str | None
is_partial_group: bool | None
members: list[GroupMembersInfoRequest] = []
kind: str | None = None
is_partial_group: bool | None = None
20 changes: 3 additions & 17 deletions g2p_registry_rest_api/schemas/group_membership.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from datetime import date, datetime
from datetime import datetime

from .individual import IndividualInfoResponse
from .individual import IndividualInfoRequest, IndividualInfoResponse
from .naive_orm_model import NaiveOrmModel
from .registrant import PhoneNumberRequest, RegistrantIDRequest


class GroupMembershipKindInfo(NaiveOrmModel):
Expand All @@ -17,18 +16,5 @@ class GroupMembersInfoResponse(NaiveOrmModel):
write_date: datetime = None


class GroupMembersInfoRequest(NaiveOrmModel):
name: str
given_name: str = None
addl_name: str = None
family_name: str = None
ids: list[RegistrantIDRequest] = None
registration_date: date = None
phone_numbers: list[PhoneNumberRequest] = None
email: str | None
address: str | None
gender: str | None
birthdate: date = None
birth_place: str | None
is_group: bool = False
class GroupMembersInfoRequest(IndividualInfoRequest):
kind: list[GroupMembershipKindInfo] = None # TODO: Would be nicer to have it as a list of str
Loading