Skip to content

setup-entities: seed entity interactions via the real API#116

Merged
AquiGorka merged 1 commit into
mainfrom
tweak/entities-view
Jun 12, 2026
Merged

setup-entities: seed entity interactions via the real API#116
AquiGorka merged 1 commit into
mainfrom
tweak/entities-view

Conversation

@AquiGorka

Copy link
Copy Markdown
Contributor

Adds setup-entities to the local-dev harness — a reusable seeder that drives three real submitter flows against one PP so the provider-console Entities section can be brought up with the full range of interaction states, produced entirely through the public API (no DB writes).

Flows (all via the real endpoints)

  • K1 — unauthorized bundle submit → 403 (recorded UNVERIFIED at SEP-10 connect, bumped at the 403), then KYC register → APPROVED.
  • K2 — unauthorized bundle submit → 403, left UNVERIFIED (no identity).
  • K3 — KYC register → APPROVED, then a real deposit bundle → accepted and settled.

Reuses the existing lib/client helpers (authenticate / registerEntity / deposit), so the only difference between a rejected and an accepted bundle is KYC status — exactly the per-PP approval gate the view surfaces. Fixed keypairs make re-runs idempotent (connect upserts; KYC returns 409-as-success).

Usage

./up.sh && ./setup-c.sh && ./setup-pp.sh && ./setup-entities.sh

Env overrides: PP_INDEX (default 1), DEPOSIT_AMOUNT (default 50).

Checks

  • deno fmt --check / lint / check green on the new file. No version field in local-dev deno.json, so no bump.

Supports the entities-view tweaks in Moonlight-Protocol/provider-console#39.
Relates to ClickUp 86ca439ah

Adds setup-entities.sh + setup-entities.ts to the harness: a reusable
seeder that drives three real submitter flows against one PP so the
provider-console "Entities" section shows the full range of states,
produced entirely through the public endpoints (no DB writes):

- K1  unauthorized bundle submit (403) -> then KYC register -> APPROVED
- K2  unauthorized bundle submit (403) -> stays UNVERIFIED
- K3  KYC register (APPROVED) -> then a real deposit bundle (accepted)

Reuses the existing lib/client helpers (authenticate / registerEntity /
deposit), so the only difference between a rejected and an accepted
bundle is KYC status — exactly the per-PP approval gate the view
surfaces. Fixed keypairs make re-runs idempotent. Requires
up.sh + setup-c.sh + setup-pp.sh; reads .local-dev-state.

Supports provider-console#39.
Relates to ClickUp 86ca439ah
@AquiGorka AquiGorka merged commit 0c78b70 into main Jun 12, 2026
7 checks passed
@AquiGorka AquiGorka deleted the tweak/entities-view branch June 12, 2026 20:56
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