Skip to content

refactor: address ecommerce review types without changing runtime - #1367

Draft
jaissica12 wants to merge 3 commits into
developmentfrom
refactor/SDKE-1108-ecommerce-type-followup
Draft

refactor: address ecommerce review types without changing runtime#1367
jaissica12 wants to merge 3 commits into
developmentfrom
refactor/SDKE-1108-ecommerce-type-followup

Conversation

@jaissica12

Copy link
Copy Markdown
Contributor

Background

  • Follow-up to the ecommerce JS→TS migrate. Review asked to drop any in tests and to stop casting valid checkout { Step, Option } through as unknown as TransactionAttributes.

What Has Changed

  • logProductAction now takes an internal ProductActionTransactionAttributes type that includes checkout Step/Option, so valid tests need no cast.
  • Ecommerce tests no longer use any; invalid inputs still go through unknown.
  • extractActionAttributes is an arrow function; promotion arrays use Array.

Screenshots/Video

  • {Include any screenshots or video demonstrating the new feature or fix, if applicable}

Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have tested this locally.

Additional Notes

  • Repo-wide @typescript-eslint/no-explicit-any and a one-object createProduct API are out of scope.

Reference Issue (For employees only. Ignore if you are an outside contributor)

@jaissica12
jaissica12 force-pushed the refactor/SDKE-1108-ecommerce-type-followup branch from 1d71c77 to 6516202 Compare August 25, 2026 01:56
* refactor: migrate ecommerce module to TS

Rename ecommerce.js to ecommerce.ts and add types. Keep function() style and self = this. Align IECommerce with the SDKEvent/SDKProduct shapes the runtime already uses.

* refactor: tighten ecommerce TS types and convert eCommerce tests

Align impression/promotion signatures with runtime arrays, drop unused event-models types, and migrate tests-eCommerce to TypeScript.

* refactor: drop non-required ecommerce.ts type cleanup

Keep createImpression on SDKProduct; restore the remaining casts and formatting from the migration commit so this PR stays compile-required only.

* refactor: type logPromotionEvent to accept a promotion or array

* refactor: destructure Messages from Constants in ecommerce
Base automatically changed from refactor/SDKE-1108-update-ecommerce-module-to-TS to development August 25, 2026 14:21
@jaissica12
jaissica12 force-pushed the refactor/SDKE-1108-ecommerce-type-followup branch from 18df836 to 1c529ec Compare August 25, 2026 14:21
@sonarqubecloud

Copy link
Copy Markdown

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