fix(consolidations): MemberOut.entity_type nullable, как legal_entity.entity_type в DBML (I-1, #42)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vJkmBGKKqMoEMzvsXG3y2
This commit is contained in:
parent
9cdcb9cb55
commit
9d187f2f83
@ -117,7 +117,7 @@ class MemberOut(BaseModel):
|
|||||||
id: uuid.UUID
|
id: uuid.UUID
|
||||||
name: str
|
name: str
|
||||||
inn: str
|
inn: str
|
||||||
entity_type: EntityType
|
entity_type: EntityType | None # DBML: `legal_entity.entity_type` nullable (I-1)
|
||||||
is_head_entity: bool
|
is_head_entity: bool
|
||||||
checklist: list[ChecklistCellOut]
|
checklist: list[ChecklistCellOut]
|
||||||
osv_accounts: list[str]
|
osv_accounts: list[str]
|
||||||
|
|||||||
@ -656,3 +656,18 @@ async def test_card_member_osv_accounts_q1_version_ignores_later_quarters(
|
|||||||
|
|
||||||
member = next(member for member in card["members"] if member["id"] == str(company.id))
|
member = next(member for member in card["members"] if member["id"] == str(company.id))
|
||||||
assert member["osv_accounts"] == ["60"]
|
assert member["osv_accounts"] == ["60"]
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.integration
|
||||||
|
async def test_card_member_without_entity_type_is_served(auth_client: AuthClientFactory, seeded: AsyncSession) -> None:
|
||||||
|
"""I-1: `legal_entity.entity_type` nullable в DBML — член периметра без типа не роняет карточку (тип `null`)."""
|
||||||
|
version, company, person = await _card_world(seeded)
|
||||||
|
person.entity_type = None
|
||||||
|
await seeded.flush()
|
||||||
|
client = await auth_client(KA_RF)
|
||||||
|
|
||||||
|
response = await client.get(f"{VERSIONS}/{version.id}")
|
||||||
|
|
||||||
|
assert response.status_code == HTTP_OK, response.text
|
||||||
|
types = {member["id"]: member["entity_type"] for member in response.json()["members"]}
|
||||||
|
assert types == {str(company.id): "ЮЛ", str(person.id): None}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user