Skip to content

Conversation

@OttiaDevsPT
Copy link
Collaborator

@OttiaDevsPT OttiaDevsPT commented Aug 5, 2025

Related tickets & documents

JS SDK: Update Item unitPrice validation

Fix tests to use model classes

Description

  • Removed @min(0) from unitPrice to allow negative values as per Paytrail docs.
  • Added custom decorator to validate unitPrice
    Prevents negative values if:
    • usePricesWithoutVat = true, or
    • Item is part of Shop-in-Shop.
  • Handled Shop-in-Shop limitation in its model class.
  • Added tests to verify all cases:
  • updated testcases from plain object to proper SDK model classes

- supports negative item unitPrice
- created Testcase for negative item unitPrice
- Updated from plain objects to updated SDK model classes
@OttiaDevsPT OttiaDevsPT requested a review from kotivuori August 5, 2025 10:30
OttiaDevsPT and others added 2 commits August 22, 2025 10:43
- moved commission logic back to the ShopInShopItem model
- extracted custom validators and decorators into their own files
@kotivuori kotivuori merged commit 2c36b72 into main Sep 15, 2025
2 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.

2 participants