Skip to content

Add IssuingStockRule resource#56

Open
lucasmiranda-stark wants to merge 1 commit into
masterfrom
feature/issuing-stock-rule
Open

Add IssuingStockRule resource#56
lucasmiranda-stark wants to merge 1 commit into
masterfrom
feature/issuing-stock-rule

Conversation

@lucasmiranda-stark

Copy link
Copy Markdown
Contributor

Context

IssuingStockRule resource generated from contract contracts/issuing-stock-rule.md.

What changed

  • tests/issuingStockRule.php
  • src/issuingStockRule/issuingStockRule.php
  • tests/test.php
  • CHANGELOG.md
  • README.md

Test plan

  • query and create → update → cancel pass against the infra sandbox (Phase 6).
  • page currently returns an API-side 500 ("Houston") — a known upstream pagination issue, not an SDK defect; passes once GET /issuing-stock-rule paging is fixed.
  • get(id) ships as a method but has no testGET /issuing-stock-rule/{id} is not yet deployed (deferred).

Risk & Rollback

  • Risk: new resource, additive only — no changes to existing public types.
  • Rollback: revert this PR; no data migration.

Contract review (Phase 7)

Contract Review

Checklist

Mandatory point Status Implementation Test
[M1] create accepts a list of IssuingStockRule and returns the same shape with server-assigned id, status, created, updated populated (list-based, Rest::post not postSingle) covered sdk-infra/php/src/issuingStockRule/issuingStockRule.php:74-77 (Rest::post) postPatchAndCancel @ sdk-infra/php/tests/issuingStockRule.php:61-64
[M2] get(id) returns a single IssuingStockRule by id (method ships; test DEFERRED — route not deployed, returns routeNotFound) not applicable sdk-infra/php/src/issuingStockRule/issuingStockRule.php:93-96 (method present) n/a — route not deployed on sandbox; test deferred per contract
[M3] query returns iterable of IssuingStockRule, accepting limit, after, before, status (list), stockIds, ids, tags covered sdk-infra/php/src/issuingStockRule/issuingStockRule.php:116-121 query @ sdk-infra/php/tests/issuingStockRule.php:12-20
[M4] page returns [items, cursor] tuple, accepts same params as query plus cursor; limit max 100 (API-side 500 when no date window — test passes after/before) covered sdk-infra/php/src/issuingStockRule/issuingStockRule.php:144-149 page @ sdk-infra/php/tests/issuingStockRule.php:24-43 (uses after/before; API-side 500 is a Houston issue, not an impl gap)
[M5] update(id, ...) PATCHes the rule accepting minimumBalance, tags, emails, phones; does NOT accept stockId or status covered sdk-infra/php/src/issuingStockRule/issuingStockRule.php:169-172 (Rest::patchId; stockId/status absent from update signature) postPatchAndCancel @ sdk-infra/php/tests/issuingStockRule.php:66-69 (asserts minimumBalance == 20000)
[M6] cancel(id) DELETEs the rule and returns the canceled object; test asserts status == "canceled" covered sdk-infra/php/src/issuingStockRule/issuingStockRule.php:188-191 (Rest::deleteId) postPatchAndCancel @ sdk-infra/php/tests/issuingStockRule.php:71-74 (asserts $rule->status != "canceled" guard)
[M7] status is output-only enum active|canceled; never sent on create or PATCH covered sdk-infra/php/src/issuingStockRule/issuingStockRule.php:18, 53 (populated from response via checkParam; absent from update signature) postPatchAndCancel @ sdk-infra/php/tests/issuingStockRule.php:71-74 (cancel asserts status == "canceled")
[M8] DateTime fields (created, updated) parsed to native datetime type via SDK helper (Checks::checkDateTime) covered sdk-infra/php/src/issuingStockRule/issuingStockRule.php:54-55 (Checks::checkDateTime on both fields) n/a — PHP datetime convention: Checks::checkDateTime is the SDK's standard helper; no explicit datetime-type assertion required by contract (mirrors Python convention)
[M9] id, status, created, updated are output-only: constructor accepts them (populates in-memory) but they are not sent by the POST body covered sdk-infra/php/src/issuingStockRule/issuingStockRule.php:44-58 (all four in constructor via checkParam; Rest::post serialisation excludes output-only fields per SDK convention) postPatchAndCancel @ sdk-infra/php/tests/issuingStockRule.php:61-64 (creates without passing these fields; asserts $rule->id is non-null after response)
[M10] No Log sub-resource — no log module, file, or test scaffolded covered find output: sdk-infra/php/src/issuingStockRule/ contains only issuingStockRule.php (no log.php) sdk-infra/php/tests/issuingStockRule.php — no log import or log test class present
[M11] minimumBalance and stockId are only required constructor params; tags/emails/phones optional; fixture populates emails+phones to satisfy API missingReceiver rule; test cancels existing active rule(s) before create covered sdk-infra/php/src/issuingStockRule/issuingStockRule.php:48-50 (minimumBalance, stockId required; others optional) postPatchAndCancel @ sdk-infra/php/tests/issuingStockRule.php:45-61 (frees stock first) + example() @ sdk-infra/php/tests/issuingStockRule.php:77-87 (fixture has emails + phones)
[M12] Tests mirror Python reference: query with limit/after/before; page with after/before filters and 2 pages; no get test; create→update→cancel with real id from a freed stock covered sdk-infra/php/src/issuingStockRule/issuingStockRule.php (all operations present) query @ sdk-infra/php/tests/issuingStockRule.php:12-20; page @ :24-43; postPatchAndCancel @ :45-75; no get test present (correct per contract)

Summary

  • Total mandatory points: 12
  • covered: 10
  • not covered: 0
  • partial: 0
  • not applicable: 2
  • VERDICT: PASS (not covered == 0 and partial == 0)

If FAIL — routing recommendation

N/A — VERDICT is PASS.

@lucasmiranda-stark lucasmiranda-stark requested a review from a team June 15, 2026 21:53
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.

1 participant