Skip to content

docs: note None area levels on emergency requirements - #44

Merged
Fivell merged 1 commit into
didww:mainfrom
Skumring:fix/nullable-area-levels
Sep 3, 2026
Merged

docs: note None area levels on emergency requirements#44
Fivell merged 1 commit into
didww:mainfrom
Skumring:fix/nullable-area-levels

Conversation

@Skumring

@Skumring Skumring commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

What

EmergencyRequirement's docstring says personal_area_level / business_area_level are
None when the country does not accept that kind of identity, and that the meta prices are
decimal strings. The cassettes now hold such a requirement and carry the resource meta, so both
the None level and the string prices are exercised.

The requirement records in the cassettes also drop values the API cannot return: it answers
any, not Any, and a personal or business area level is only ever world_wide or country.

No code change: SafeAttributeField and to_enum already pass None through.

Background

Two things prompted this, both on the server side:

  1. GET /v3/emergency_requirements returned meta.setup_price as the JSON number 0 while
    meta.monthly_price on the same object was a decimal string — the mismatch behind the Java
    SDK's ClassCastException. The API now returns "0.0", so both meta prices are decimal
    strings.
  2. The published OpenAPI document was corrected in the same pass: personal_area_level and
    business_area_level are nullable on both emergency_requirements and
    address_requirements. A country that accepts only one kind of identity leaves the other
    level unset.

⚠️ Not on production yet

The setup_price change (1) is merged on the API side but has not been released to
production
; the release is expected shortly. Until then the endpoint still sends the JSON
number 0, which is why nothing here rejects the numeric form.

The area level nullability (2) is not a new behaviour — the API has always returned null
there and does so on production today (AL / Local is business-only and returns
"personal_area_level": null). Only the published document was wrong about it.

Verification

uv is not installed locally, so pytest runs here in CI.

Summary by CodeRabbit

  • Documentation

    • Clarified when personal and business area levels may be unavailable for emergency requirements.
    • Documented that setup and monthly pricing values are represented as decimal strings.
  • Bug Fixes

    • Corrected emergency requirement data for absent business area levels, empty business mandatory fields, and pricing metadata.
    • Corrected address requirement enum formatting.
    • Corrected emergency calling service area-level values and included activation timestamps.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 4032d6d7-6733-46fc-b075-c0fa1047e8f8

📥 Commits

Reviewing files that changed from the base of the PR and between 2a38c5d and 4b858e0.

📒 Files selected for processing (1)
  • src/didww/resources/emergency_requirement.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/didww/resources/emergency_requirement.py

Included review availability: Your plan provides up to 8 included reviews per hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The emergency requirement documentation, fixtures, and tests now cover nullable business area levels and decimal-string pricing metadata. Related fixtures normalize enum values and include an activation timestamp.

Changes

Emergency requirement metadata

Layer / File(s) Summary
Metadata contract and validation
src/didww/resources/emergency_requirement.py, tests/fixtures/emergency_requirements/*.yaml, tests/resources/test_emergency_requirement.py
The documentation allows None area levels and defines decimal-string prices. Fixtures and tests cover absent business requirements and setup and monthly prices.
Related response fixture normalization
tests/fixtures/address_requirements/list.yaml, tests/fixtures/emergency_calling_services/show_with_includes.yaml
Related fixtures use lowercase area-level values, normalize identity_type, include activated_at, and use world_wide values.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 4b858

This localized documentation, model metadata, and fixture update introduces no actionable merge-blocking risk and is merge-ready after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main documentation change: noting nullable area levels on emergency requirements.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@Skumring

Skumring commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

@Fivell could you take this one? I cannot add you as a reviewer myself — the branch comes from a fork and I have no write access on the org repos, so a review request has to be set by someone who does.

This is one of seven SDK pull requests from the same API change (meta.setup_price on emergency requirements, and the requirement area levels documented as nullable):

Worth knowing before merging: the setup_price half of the API change is not on production yet, so nothing here rejects the old numeric form. The nullable area levels are current production behaviour. Details are in the PR description.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Changes are limited to documentation, tests, and fixtures/cassettes and appear consistent with existing SDK parsing behavior.

Pull request overview

Updates SDK documentation and test fixtures to reflect current/expected API payload semantics for emergency requirements (nullable area levels and per-resource pricing meta), ensuring recorded VCR cassettes exercise those cases.

Changes:

  • Extend EmergencyRequirement docstring to document nullable personal_area_level/business_area_level and decimal-string pricing meta.
  • Update emergency requirement resource test to assert business_area_level is None and that meta.setup_price/meta.monthly_price are strings.
  • Refresh VCR cassettes to include resource-level meta and align enum-like fields with API values (e.g., any, world_wide, area).
File summaries
File Description
tests/resources/test_emergency_requirement.py Adds assertions for nullable business area level and string pricing meta.
tests/fixtures/emergency_requirements/show.yaml Updates show cassette to include business_area_level: null, empty business fields, and resource meta prices.
tests/fixtures/emergency_requirements/list.yaml Updates list cassette similarly, including per-resource meta prices.
tests/fixtures/emergency_calling_services/show_with_includes.yaml Normalizes included emergency requirement area-level values to world_wide.
tests/fixtures/address_requirements/list.yaml Normalizes enum-like fields to lowercase/snake_case values consistent with SDK enums.
src/didww/resources/emergency_requirement.py Docstring clarifies nullable area levels and decimal-string pricing meta.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Changes are limited to fixtures/tests and docstring clarification, and the updated fixtures align with existing enum values and per-resource meta handling in the SDK.

Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

A country that accepts only one kind of identity leaves the other area level
unset and the API returns null. The cassettes now hold such a requirement and
carry the resource meta, so both the None level and the decimal-string prices
are exercised.

The requirement records in the cassettes also drop values the API cannot
return: it answers `any`, not `Any`, and a personal or business area level is
only ever `world_wide` or `country`.
@Skumring
Skumring force-pushed the fix/nullable-area-levels branch from 2a38c5d to 4b858e0 Compare September 2, 2026 16:25
@sonarqubecloud

sonarqubecloud Bot commented Sep 2, 2026

Copy link
Copy Markdown

@Fivell
Fivell merged commit 123e13d into didww:main Sep 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants