Skip to content

feat: add Rev 6 status and account_data to Product | MC-16319 - #398

Merged
SandhyaBhatia merged 1 commit into
masterfrom
sb/mdx-product-rev6
Oct 1, 2026
Merged

SandhyaBhatia merged 1 commit into
masterfrom
sb/mdx-product-rev6

Conversation

@SandhyaBhatia

Copy link
Copy Markdown
Contributor

Summary of Changes

MDX Product Rev 6 (2026.05.14) adds status and account_data, and deprecates is_selected and activate_challenges. The model was still Rev 5 -- Product.java had only two commits ever and neither touched these fields.

Additive only, so no versioned package. The three existing versioned packages in this repo each exist because something broke: id/v20240213 changed the type of challenges, id/v20260428 removed challenge from ResetPassword, and payment/v20260427 flipped the 202 condition. Rev 6 for products changes no type, removes no field, and moves no status code.

Backward compatibility rests on Gson omitting nulls -- MdxSerializerFactoryBean builds without serializeNulls(), so a null status produces no key at all and moneymobilex's responses stay byte-identical. ProductTest asserts exactly that, alongside a Rev 5 body with is_selected still deserializing.

status is a String rather than an enum, matching type, which is likewise a spec-defined enumeration modelled as a String. An unrecognised value from a later revision then cannot break deserialization.

AccountData carries only accountType: the spec defines no field table for it, and all four JSON examples have that one field.

The deprecated pair is kept, not removed -- moneymobilex still sends is_selected in production. Removing it would be the id/v20260428 case and would need a versioned package.

Fixes # (issue)
https://mxcom.atlassian.net/browse/MC-16319

Public API Additions/Changes

Please include a description of any new or modified publicly available classes and/or methods (if applicable).

Please include a description of any new or modified publicly available classes and/or methods (if applicable).

  • Product (mdx-models/src/main/java/com/mx/path/model/mdx/model/products/Product.java):
    • Added status (String) — spec-defined enumeration, modelled as String (same approach as the existing type field) so an unrecognized value
      from a future revision can't break deserialization.
    • Added accountData (AccountData, JSON key account_data).
    • isSelected and activateChallenges are marked @deprecated but retained — moneymobilex still sends is_selected in production, so removing it
      would be a breaking/versioned-package change (like id/v20260428), which this is not.
  • New class com.mx.path.model.mdx.model.products.AccountData: single field accountType (String, JSON key account_type). The spec defines no
    broader field table for AccountData, and all four spec JSON examples contain only that one field.

Downstream Consumer Impact

Please include a description of how downstream consumers will be affected (breaking changes, bug fixes, internal behavior modification, etc.). If
this PR introduces breaking changes please list out each of the breaking changes, as well as steps for migrating incompatible code.

  • Non-breaking. MdxSerializerFactoryBean builds its Gson instance without serializeNulls(), so when status/account_data are left unset (null),
    they're omitted from the JSON entirely — Rev 5 consumers like moneymobilex continue to see byte-identical responses.
  • Existing Rev 5 payloads containing is_selected continue to deserialize correctly.
  • New Rev 6 consumers can read status and account_data when populated; is_selected/activate_challenges remain available but should be considered
    deprecated in favor of status/account_data.
  • No migration steps required for existing consumers.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details
for your test configuration

Added ProductTest.groovy, built against a Gson instance that mirrors MdxSerializerFactoryBean's configuration (no serializeNulls,
LOWER_CASE_WITH_UNDERSCORES naming) to validate real wire behavior.

  • Rev 6 fields (status, account_data/account_type) serialize with the correct spec field names
  • Rev 6 fields are omitted entirely (not emitted as null) when unset, so a Rev 5-shaped Product (with is_selected set) serializes
    byte-identical to pre-Rev 6 output
  • A Rev 5 JSON body containing is_selected still deserializes correctly, with status/account_data resolving to null
  • A Rev 6 JSON body deserializes status and nested account_data.account_type correctly
  • AccountData round-trips through serialize/deserialize correctly

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

MDX Product Rev 6 (2026.05.14) adds `status` and `account_data`, and deprecates
`is_selected` and `activate_challenges`. The model was still Rev 5 -- Product.java
had only two commits ever and neither touched these fields.

Additive only, so no versioned package. The three existing versioned packages in
this repo each exist because something broke: id/v20240213 changed the type of
`challenges`, id/v20260428 removed `challenge` from ResetPassword, and
payment/v20260427 flipped the 202 condition. Rev 6 for products changes no type,
removes no field, and moves no status code.

Backward compatibility rests on Gson omitting nulls -- MdxSerializerFactoryBean
builds without serializeNulls(), so a null `status` produces no key at all and
moneymobilex's responses stay byte-identical. `ProductTest` asserts exactly that,
alongside a Rev 5 body with `is_selected` still deserializing.

`status` is a String rather than an enum, matching `type`, which is likewise a
spec-defined enumeration modelled as a String. An unrecognised value from a later
revision then cannot break deserialization.

AccountData carries only `accountType`: the spec defines no field table for it,
and all four JSON examples have that one field.

The deprecated pair is kept, not removed -- moneymobilex still sends `is_selected`
in production. Removing it would be the id/v20260428 case and would need a
versioned package.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@SandhyaBhatia
SandhyaBhatia merged commit 8be8115 into master Oct 1, 2026
7 checks passed
@SandhyaBhatia
SandhyaBhatia deleted the sb/mdx-product-rev6 branch October 1, 2026 16:09
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.

2 participants