Add IssuingStockRule resource#26
Open
lucasmiranda-stark wants to merge 1 commit into
Open
Conversation
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
IssuingStockRuleresource generated from contractcontracts/issuing-stock-rule.md.What changed
test/starkinfra/test_issuingstockrule.rbtest/example_generator.rblib/issuing_stock_rule/issuing_stock_rule.rblib/starkinfra.rbCHANGELOG.mdREADME.mdTest plan
queryandcreate → update → cancelpass against the infra sandbox (Phase 6).pagecurrently returns an API-side 500 ("Houston") — a known upstream pagination issue, not an SDK defect; passes onceGET /issuing-stock-rulepaging is fixed.get(id)ships as a method but has no test —GET /issuing-stock-rule/{id}is not yet deployed (deferred).Risk & Rollback
Contract review (Phase 7)
Contract Review
Resource: IssuingStockRule
Language: ruby
Run-type: generate
Phase: 7/9
Checklist
createaccepts a list ofIssuingStockRuleand returns the same shape with server-assignedid,status,created,updatedpopulated (list-based,rest.post_multi/post)self.create(rules:, user: nil)→Rest.post)rule.idpresent and is String)get(id)method ships (mirrors Python); test DEFERRED —GET /issuing-stock-rule/{id}not deployed (routeNotFound)self.get(id, user: nil)→Rest.get_id)queryreturns iterable acceptinglimit,after,before,status(list),stockIds/stock_ids,ids,tagsRest.get_stream)rule.idis String)pagereturns[items, cursor]tuple accepting same params asquerypluscursor;limitmax 100; must passafter/beforeto avoid API 500cursor, docstring says max 100,Rest.get_page)after: '2022-01-01',before: Date.today.to_s, accumulates ids without duplicates, stops on nil cursor) — Note: endpoint currently returns API-side 500 without date window; test correctly supplies the windowupdate(id, ...)PATCHes accepting any subset ofminimumBalance/minimum_balance,tags,emails,phones; does NOT acceptstockIdorstatusid, minimum_balance: nil, tags: nil, emails: nil, phones: nil, user: nil—stock_idandstatusabsent)update(rule.id, minimum_balance: 20_000), assertsrule.minimum_balance == 20_000)cancel(id)DELETEs the rule and returns canceled object; test assertsstatus == "canceled"self.cancel(id, user: nil)→Rest.delete_id)cancel(rule.id), assertsrule.status == 'canceled')statusis output-only enum (active|canceled), not sent on create or PATCH@status = statusin constructor; absent fromcreateandupdatemethod signatures)statusback from cancel return, never sets it on creation)created,updated) parsed to native datetime type via SDK helperStarkCore::Utils::Checks.check_datetime(created)andcheck_datetime(updated))id,status,created,updatedare output-only — constructor accepts them (populates in-memory) but they are not sent on POSTcreateposts only viarest.postwhich serialises only non-nil input fields)id/status/created/updated)logmodule, file, or testrequire_relative('issuing_stock_rule/issuing_stock_rule')— no log require;findconfirms only one file inissuing_stock_rule/)minimum_balanceandstock_idare required constructor params;tags,emails,phonesoptional; fixture includes at least one ofemails/phones(API requires it)minimum_balance:,stock_id:; optional with default nil:tags:,emails:,phones:)emailsandphones); sdk-infra/ruby/test/example_generator.rb:442-454 (issuing_stock_rule_exampleincludes both)Summary
If FAIL — routing recommendation
N/A — VERDICT is PASS.