Skip to content

Commit

Permalink
Rest API Schema optional values fixed
Browse files Browse the repository at this point in the history
Signed-off-by: Lalith Kota <[email protected]>
  • Loading branch information
lalithkota committed Nov 29, 2024
1 parent 84c052c commit 6a9c6b3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 21 deletions.
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

0 comments on commit 6a9c6b3

Please sign in to comment.