Conversation
…r groups Adds support for Square's customer-specific pricing primitives: - Extends CatalogObjectType with PRICING_RULE, PRODUCT_SET, TIME_PERIOD and typed data interfaces on CatalogObject - New catalog helpers: createProductSet, createPricingRule, createTimePeriod - New composite createWholesalePricing that atomically creates a product set, discount, and pricing rule in a single batchUpsert - New CustomerGroupsService wrapping customers.groups SDK client with CRUD, list pagination, and addCustomer/removeCustomer membership helpers - Wired square.customerGroups into client and index exports Closes #59
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #64 +/- ##
==========================================
- Coverage 97.18% 97.06% -0.12%
==========================================
Files 17 18 +1
Lines 853 955 +102
Branches 244 277 +33
==========================================
+ Hits 829 927 +98
Misses 1 1
- Partials 23 27 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds Square Customer Groups support and extends the Catalog wrapper to support pricing-rule-related catalog object types (pricing rules, product sets, time periods), including an atomic wholesale-pricing batch upsert helper.
Changes:
- Extended
CatalogObjectTypeandCatalogObjecttyped data to includePRICING_RULE,PRODUCT_SET, andTIME_PERIOD. - Added catalog helpers:
createProductSet,createPricingRule,createTimePeriod, plus compositecreateWholesalePricingusingbatchUpsert. - Introduced
CustomerGroupsServicewith CRUD, cursor-paginated listing, and membership helpers; wired into client + exports, with new tests.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/core/services/customer-groups.service.ts | New Customer Groups service with CRUD, list pagination, and membership methods. |
| src/core/services/catalog.service.ts | Adds new catalog object types/data and helper methods, including atomic wholesale pricing creation. |
| src/core/client.ts | Wires customerGroups service onto the wrapper client. |
| src/core/index.ts | Exports CustomerGroupsService. |
| src/core/tests/customer-groups.service.test.ts | Adds unit tests for the new Customer Groups service. |
| src/core/tests/catalog.service.test.ts | Adds unit tests for new catalog helpers and createWholesalePricing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- customerGroups.create: auto-generate idempotencyKey for consistency with other services - customerGroups.update: validate non-empty name like create - createWholesalePricing: rename shadowed 'discount' variable to 'discountInput'
|
🎉 This PR is included in version 1.10.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
CatalogObjectTypewithPRICING_RULE,PRODUCT_SET,TIME_PERIODand typed data interfaces onCatalogObjectcreateProductSet,createPricingRule,createTimePeriodcreateWholesalePricing— atomically creates product set + discount + pricing rule viabatchUpsertso the rule can reference freshly-created IDsCustomerGroupsService(square.customerGroups) with CRUD, cursor-paginatedlist, andaddCustomer/removeCustomermembership helpersclient.tsandindex.tsexportsUnblocks wholesale pricing per retailer (Mickles admin dashboard) — the dashboard can now sync wholesale prices to Square POS instead of storing them in DynamoDB as an invoicing-only workaround.
Test plan
npm run typecheckcleannpm run lintcleannpm test— 444/444 pass (18 new tests covering new helpers, validation, BigInt coercion, batch response handling, and allCustomerGroupsServicemethods)Closes #59