Skip to content

docs: emergency requirement meta and area levels as the API sends them - #60

Merged
Fivell merged 1 commit into
didww:mainfrom
Skumring:fix/emergency-requirement-meta-and-area-levels
Sep 3, 2026
Merged

docs: emergency requirement meta and area levels as the API sends them#60
Fivell merged 1 commit into
didww:mainfrom
Skumring:fix/emergency-requirement-meta-and-area-levels

Conversation

@Skumring

@Skumring Skumring commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

What

EmergencyRequirement's Javadoc said setup_price "is sent as the JSON number 0 and is read
back as the string "0"". The server side of that mismatch is fixed, so a priced requirement
now returns "0.0". The class documents that, and documents the area level attributes as null
when the country does not accept that kind of identity.

No code change: MetaMap (added in #58) already coerces both wire forms, and the area level
fields are String. The fixtures carry the new wire form, with one entry keeping the numeric
setup_price as a coercion guard, and drop area level values the API cannot return (region).

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

./gradlew test and ./gradlew javadoc are green locally (the 4 javadoc warnings are pre-existing, in other files).

Summary by CodeRabbit

  • Documentation

    • Clarified emergency requirement pricing formats, including decimal-string values and compatibility with numeric setup prices.
    • Documented nullable identity area levels and availability rules for personal and business requirements.
    • Updated location-scope and mandatory-field examples to reflect current behavior.
  • Tests

    • Expanded coverage for pricing conversion, area levels, mandatory fields, and unsupported identity scenarios.
    • Added coverage for converting string, numeric, boolean, and null metadata values.
    • Updated emergency requirement fixtures and examples to reflect current pricing and location-scope values.

@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: 1678780b-1292-45dd-8bfb-26c5f3685cff

📥 Commits

Reviewing files that changed from the base of the PR and between 0e704f6 and 1cd34fa.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • src/main/java/com/didww/sdk/resource/EmergencyRequirement.java
  • src/test/java/com/didww/sdk/resource/EmergencyRequirementTest.java
  • src/test/java/com/didww/sdk/resource/MetaMapTest.java
  • src/test/resources/fixtures/emergency_requirements/index.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/java/com/didww/sdk/resource/EmergencyRequirement.java

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


📝 Walkthrough

Walkthrough

The change updates emergency requirement documentation, fixtures, and tests. It documents decimal-string pricing, numeric setup_price coercion, and nullable identity area levels. Tests cover revised area scopes, mandatory fields, and normalized pricing.

Changes

Emergency requirement metadata

Layer / File(s) Summary
Metadata contract documentation
src/main/java/com/didww/sdk/resource/EmergencyRequirement.java, CHANGELOG.md
Documents decimal-string price metadata, numeric setup_price coercion, and nullable identity area levels.
Fixture and assertion validation
src/test/java/com/didww/sdk/resource/EmergencyRequirementTest.java, src/test/java/com/didww/sdk/resource/MetaMapTest.java, src/test/resources/fixtures/emergency_requirements/*.json
Updates area levels, mandatory fields, and setup-price representations. Tests verify mixed JSON value deserialization and normalized pricing.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 1cd34

This PR updates emergency-requirement documentation and test fixtures to match the API’s price and nullable area-level representations; no actionable merge-blocking risk remains beyond 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 3 functions across 3 files. (2 skipped: 2 … 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 and fixture updates for emergency requirement metadata and area levels. It is specific, concise, and related to the changeset.
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.
Full details: Docstring Coverage

Explanation

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 3 functions across 3 files. (2 skipped: 2 unsupported.)

  • 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.

🟡 Changes recommended

The Unreleased changelog contains contradictory statements about the current setup_price wire format.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Updates emergency requirement documentation and fixtures to match current API wire formats.

Changes:

  • Documents nullable identity area levels and decimal-string prices.
  • Updates fixtures while retaining numeric-price coercion coverage.
  • Expands deserialization assertions.
File summaries
File Description
EmergencyRequirement.java Clarifies API response formats.
EmergencyRequirementTest.java Tests updated formats and nullability.
index.json Updates list fixture.
show.json Updates detail fixture.
CHANGELOG.md Records response-format changes.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Balanced

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

Comment thread CHANGELOG.md Outdated
@Skumring Skumring self-assigned this Sep 2, 2026
@Skumring
Skumring force-pushed the fix/emergency-requirement-meta-and-area-levels branch from 07fbd2e to 0e704f6 Compare September 2, 2026 11:59
@Skumring
Skumring requested a balanced review from Copilot September 2, 2026 12:06

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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

The documentation, fixtures, and tests consistently reflect the described API behavior while preserving compatibility coverage.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@Skumring
Skumring requested a review from Fivell September 2, 2026 13:51
@Skumring
Skumring force-pushed the fix/emergency-requirement-meta-and-area-levels branch from 0e704f6 to 1cd34fa Compare September 2, 2026 16:25
…sends them

The class documented setup_price as the JSON number 0 read back as "0". The
server side of that mismatch is fixed: a priced requirement now returns the
decimal string "0.0", like every other price in the API. MetaMap keeps
coercing the numeric form, so both wire shapes are read back as strings, and
one fixture holds the numeric form to guard that.

The area level attributes are documented as null when the country does not
accept that kind of identity, which the fixtures now exercise. No code change
there: the fields are String and have always read a null back as null. The
fixtures also drop area level values the API cannot return ("region").
@Skumring
Skumring force-pushed the fix/emergency-requirement-meta-and-area-levels branch from 1cd34fa to 442f39d Compare September 2, 2026 16:40
@sonarqubecloud

sonarqubecloud Bot commented Sep 2, 2026

Copy link
Copy Markdown

@Fivell
Fivell merged commit 9b786ba into didww:main Sep 3, 2026
4 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