Skip to content

fix(payments): use stripe/cjs resource types in reconciliationService#168

Open
georgyia wants to merge 1 commit into
mainfrom
fix/reconciliation-stripe22-types
Open

fix(payments): use stripe/cjs resource types in reconciliationService#168
georgyia wants to merge 1 commit into
mainfrom
fix/reconciliation-stripe22-types

Conversation

@georgyia

@georgyia georgyia commented May 13, 2026

Copy link
Copy Markdown
Collaborator

Why

main fails npx tsc --noEmit after PRs #149 and #159 landed in parallel:

src/payments/providers/stripe/reconciliationService.ts(54,26): error TS2694:
  Namespace 'StripeConstructor' has no exported member 'Issuing'.
src/payments/providers/stripe/reconciliationService.ts(55,28): error TS2694:
  Namespace 'StripeConstructor' has no exported member 'Issuing'.

#149 added Stripe.Issuing.Card / Stripe.Issuing.Transaction annotations; #159 (Stripe 16 → 22) removed those namespace exports from the default Stripe import. Neither PR conflicted textually, but their semantic combination is broken on main.

What

Switch to the same stripe/cjs/resources/Issuing resource-type imports that cardService.ts, webhookHandler.ts, and checkoutSimulator.ts already use post-Stripe 22. Drop the now-unused default Stripe import.

Verification

  • npx tsc --noEmit → clean
  • npx eslint src/payments/providers/stripe/reconciliationService.ts → clean
  • npx jest --testPathIgnorePatterns=tests/integration → 38 suites / 412 tests pass

No runtime behaviour change — types only.

Summary by CodeRabbit

  • Refactor
    • Internal code improvements to payment reconciliation service with no changes to functionality or user-facing behavior.

Review Change Stack

After Stripe 22 (#159) the default Stripe export no longer exposes the
Issuing namespace as typed members. PR #149 added Stripe.Issuing.Card /
Stripe.Issuing.Transaction annotations and was merged in parallel, which
broke 'npx tsc --noEmit' on main:

  TS2694: Namespace 'StripeConstructor' has no exported member 'Issuing'

Switch to the same 'stripe/cjs/resources/Issuing' type imports already
used by cardService.ts, webhookHandler.ts and checkoutSimulator.ts.
@coderabbitai

coderabbitai Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 03fb6bd1-10a9-4292-abac-29850ae31992

📥 Commits

Reviewing files that changed from the base of the PR and between 4e0e788 and 41329a4.

📒 Files selected for processing (1)
  • src/payments/providers/stripe/reconciliationService.ts

📝 Walkthrough

Walkthrough

The PR refactors type imports in the Stripe reconciliation service. It replaces the default Stripe SDK import with direct type-only imports of Card and Transaction from the Issuing resource, then updates local variable type annotations to use these imported types instead of the Stripe.Issuing.* namespace variants.

Changes

Stripe Issuing Type Import Refactoring

Layer / File(s) Summary
Stripe Issuing type imports and declarations
src/payments/providers/stripe/reconciliationService.ts
Import statement imports Card and Transaction types directly, and local variable declarations for stripeCard and transactions are updated to use the imported types instead of Stripe.Issuing.* namespace qualifiers.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested labels

javascript

Suggested reviewers

  • JonasBaeumer

Poem

🐰 A type import dance so clean and bright,
Direct and clear, no namespaces in sight!
Stripe's Issuing cards find their way home,
Simpler imports through the code they roam. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: importing Stripe/CJS resource types directly instead of using the Stripe namespace.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/reconciliation-stripe22-types

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

@georgyia georgyia requested a review from JonasBaeumer May 13, 2026 20:14
@georgyia

Copy link
Copy Markdown
Collaborator Author

Heads up: main is currently failing npx tsc --noEmit because #149 and #159 merged in parallel and the resulting combination breaks two type references in reconciliationService.ts. This PR is the minimal types-only fix — same import pattern already used by cardService.ts / webhookHandler.ts / checkoutSimulator.ts. All checks are green; needs 1 approval to satisfy the branch ruleset, then it can be merged.

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