fix: add missing metadata fields to /execute/ payload and clean up consent status request#1
Draft
sd-gh-bot wants to merge 1 commit into
Draft
fix: add missing metadata fields to /execute/ payload and clean up consent status request#1sd-gh-bot wants to merge 1 commit into
sd-gh-bot wants to merge 1 commit into
Conversation
…ent status request Gap 1 (Critical): The /execute/ endpoint accepts first_name, last_name, user_email, additional_custom_information, key_pointer_information, and external_metadata but the SDK was not sending any of them. Changes: - Add ClickwrapSubmitMetadata.kt - new public data class for optional submit metadata - Update RequestBody to include all 6 optional API fields (null fields are omitted by Gson so existing integrations are unaffected) - Extend ClickwrapService.submitAcceptance() and ClickwrapRepository (interface + DefaultClickwrapRepository) to accept and forward ClickwrapSubmitMetadata - Extend SpotDraftManager.submitAcceptance(userIdentifier, metadata) with the new optional metadata parameter (@jvmoverloads ensures Java callers are unaffected) Gap 2 (Minor): ConsentStatusRequest was sending additional_custom_information, key_pointer_information, and agreements to the consent_status endpoint which the API does not consume. Stripped back to user_identifier only. Co-authored-by: Prakasha G <prakasha@spotdraft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Summary
Fixes two gaps identified in the mobile SDK vs API alignment analysis.
Gap 1 —
/execute/payload missing 6 optional fields (Critical)The SpotDraft backend
POST .../execute/endpoint acceptsfirst_name,last_name,user_email,additional_custom_information,key_pointer_information, andexternal_metadatabut the SDK was silently dropping all of them. Teams that need custom metadata or user-detail capture on consent records were completely blocked.Changes:
ClickwrapSubmitMetadataSubmissionRequestModel/RequestBodynullvalues are omitted from the JSON payload — backward-compatibleClickwrapRepository(interface + impl)ClickwrapSubmitMetadata?ClickwrapService.submitAcceptance()ClickwrapSubmitMetadata?SpotDraftManager.submitAcceptance()metadataparameter (defaultnil/null) — backward-compatibleGap 2 —
ConsentStatusRequestsending unused fields (Minor / Cleanup)ConsentStatusRequestwas sendingadditional_custom_information,key_pointer_information, andagreementstoPOST .../consent_status/which the API does not consume. Stripped back touser_identifieronly to keep the wire format accurate.How to validate
1. Backward-compatibility — existing call sites still compile unchanged
2. New metadata path — pass metadata and verify it reaches the backend
Enable SDK logging (
enableLogging = trueinClickwrapConfig) and confirm the POST body printed to the log includes the metadata fields.3. Verify consent status request is slim
Enable logging and confirm
POST .../consent_status/body is{"user_identifier": "<id>"}only.4. Integration test against staging
Point
baseURLto the staging environment, triggersubmitAcceptancewith metadata, and confirm the created contract record on the SpotDraft dashboard shows the custom information fields populated.References: Gap analysis — [mobile-sdk-api-gap-analysis.md]
Generated description
Below is a concise technical summary of the changes proposed in this PR:
Enable optional metadata to flow through
SpotDraftManager,ClickwrapService,ClickwrapRepository, andSubmissionRequestModelso the/execute/endpoint can capture the six custom consent fields. ClarifyConsentStatusRequestto only senduser_identifierto keep the consent status payload aligned with the API.ConsentStatusRequestbody to only includeuser_identifierto reflect the backend contract.Modified files (1)
Latest Contributors(2)
ClickwrapSubmitMetadatato pass through the manager, service, repository, and request model so custom user and contract context reaches the/execute/endpoint.Modified files (5)
Latest Contributors(2)