Skip to content

feat(cli): campaign conversions record and report (beta) - #62

Merged
purpshell merged 1 commit into
devfrom
codex/oa-31-conversions
Oct 1, 2026
Merged

purpshell merged 1 commit into
devfrom
codex/oa-31-conversions

Conversation

@purpshell

@purpshell purpshell commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Summary

CLI commands for the campaign conversion reporting beta (API polymorfa/polymorfa#427, SDK polymorfa/sdks#327).

  • polymorfa campaign conversions record <campaign> --project-id --recipient --event-id --event-type --occurred-at [--amount-minor --currency]
  • polymorfa campaign conversions report <campaign> --project-id
  • Pins @polymorfa/sdk to 0.1.0-dev.20261001202146, the first dev prerelease with campaigns.recordConversion and campaigns.conversions. The README version line and the prerelease test are updated to match.

Both commands use the Platform client, so they need a team API key, matching the SDK methods. Human output never prints the event ID, which can be an order number. Amounts are shown in minor units with their currency, as reported. --amount-minor and --currency each require the other. API refusals, including the beta 403, go through the existing error presentation and exit non-zero.

Verification

npm run verify: format, lint, typecheck, 101 files / 957 tests (2 skipped), build, pack and prod audit, all passing. The new test/commands/campaign-conversions.test.ts covers the request shape, the hidden event ID, --amount-minor without --currency (refused before sending), replay output, the per-currency report, and the beta refusal exit.

Not exercised

No calls against a deployed API: the beta isn't deployed or enrolled.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

The included review limit has been reached and this organization has disabled usage-based review continuation. Wait for reviews to reset or ask a billing admin to change After included review limits.

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 61 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: dba33538-1a50-4ac5-b050-05e8e57b118c

📥 Commits

Reviewing files that changed from the base of the PR and between bf8fa0a and 8812038.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (7)
  • README.md
  • package.json
  • src/commands/campaign/conversions/record.ts
  • src/commands/campaign/conversions/report.ts
  • src/services/campaign-conversions.ts
  • test/commands/campaign-conversions.test.ts
  • test/release/check-prerelease.test.ts
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Comment @coderabbitai help to get the list of available commands.

@purpshell

Copy link
Copy Markdown
Member Author

Local review on 8812038 (manual pass over the full diff). The commands call only the SDK methods published in 0.1.0-dev.20261001202146, and the pin is exact. Required flags match the API's required fields. The value pair is enforced with dependsOn. The event ID is never echoed in human output. Errors use the shared presenter. No findings.

@purpshell
purpshell merged commit a1c517a into dev Oct 1, 2026
3 checks passed
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