Individual account approval resources (node)#64
Open
lucasmiranda-stark wants to merge 1 commit into
Open
Conversation
5d165c0 to
2b182e3
Compare
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.
Context
The account-approval feature —
IndividualAccountRequestandIndividualAccountAttachment(each with a read-only.Log) — for the node infra SDK. Generated from contractsindividual-account-request.md(v3) andindividual-account-attachment.md(v3). Run-type: migrate. Run artifacts:runs/20260528-182857-account-approval/node/.What changed
IndividualAccountRequest.addressfrom a string into a structuredAddressobject (nested JSON, never flattened).AccountRequestAttachmentwithIndividualAccountAttachment, addingcancel(DELETE →status: "deleted", idempotent); legacy source and tests removed — no dual exposure (M14).IndividualAccountAttachmentconstructor encodescontent+contentTypeinto adata:URL client-side;contentTypeis input-only.Test plan
runs/20260528-182857-account-approval/node/test-run-success.md)Risk & Rollback
IndividualAccountRequest.addresschanges string→object, and legacyAccountRequestAttachmentis removed (callers migrate toIndividualAccountAttachment).Contract review (Phase 7)
Contract Review
Run metadata
Checklist — IndividualAccountRequest (M1–M12)
createaccepts list, returns shape with server-assignedid,status,accountType,created,updatedaddressis structured object (not string), with required sub-fields; serialized as nested JSON, not flattenedget(id)returns single IndividualAccountRequest by idqueryreturns async iterable acceptinglimit,after,before,status,tags,idspagereturns[items, cursor], accepts same params as query pluscursorupdate(id, ...)PATCHes, accepts subset ofname,taxId,address,income,status,tags; replaces address wholesalestatusenum exactlyapproved|created|denied|processing|updated(v1 values not used); test asserts membershipIndividualAccountRequest.Logis read-only, exposed under<resource>.log, providesget,query,page;requestfield is parent typeLog.queryandLog.pageacceptlimit,after,before,types,accountRequestIdscreatedandupdatedparsed to language's native datetime type viacheck.datetimeaccountType,flags,id,status,created,updatedare output-only; passing them to constructor populates locallynameempty →InputErrorsraised; code-agnostic (type-only assertion)taxIdinvalid (bad CPF) →InputErrorsraised; type-only assertionaddresspresent but missing required sub-fields →InputErrorsraised; type-only assertionincome < 0(triggered with -1, not 0) →InputErrorsraised; type-only assertionstatustransition not allowed →InputErrorsraised; type-only assertionidonget→InputErrorsraised; type-only assertionChecklist — IndividualAccountAttachment (M1–M14)
createaccepts list, returns shape with server-assignedid,status,createdcontent+contentTypeintodata:<contentType>;base64,<payload>URL client-side before serializationcontentTypeis input-only: after constructor builds data URL it is nulled; not serialized as own wire fieldthis.contentType = null)get(id)returns single IndividualAccountAttachment by idqueryreturns async iterable acceptinglimit,after,before,status,tags,idspagereturns[items, cursor], accepts same params as query pluscursorcancel(id)maps to DELETE, returns resource withstatus = "deleted"(not "canceled"); idempotent — second cancel succeedsindividualAccountAttachment(module) andIndividualAccountAttachment(class), notaccountRequestAttachmentIndividualAccountAttachment.Logread-only, exposed under<resource>.log, providesget,query,page;attachmentfield is parent typeLog.queryandLog.pageacceptlimit,after,before,types,attachmentIds(notaccountRequestIds)typeenum exactlydrivers-license-front|drivers-license-back|identity-front|identity-back; sandbox rejectsselfiecreatedparsed to language's native datetime type viacheck.datetimetypenot in enum →InputErrorsraised; type-only assertion; fresh parent per testcontentmissing or empty →InputErrorsraised; type-only assertion; fresh parent per testcontentTypemissing whencontentprovided →InputErrorsraised; type-only; client-serialization-dependent codeaccountRequestIdnot found →InputErrorsraised; type-only assertionidonget→InputErrorsraised; type-only assertionAccountRequestAttachmentremoved: DEL lines in manifest;accountRequestAttachmentabsent from sdk/ and tests/ (no dual exposure)starkinfra.accountRequestAttachment === undefined; sdk dir absent (verified: ls sdk/accountRequestAttachment → DIR ABSENT; test file absent)starkinfra.accountRequestAttachment === undefined@ sdk-infra/node/tests/testIndividualAccountAttachment.js:32-33Summary
If FAIL — routing recommendation
N/A — all mandatory points covered.
Metadata
contracts/individual-account-request.md(v3),contracts/individual-account-attachment.md(v3)runs/20260528-182857-account-approval/node/feature/account-approvalf8db786e07dc6c07d82bb0838b67e702360b6fab