Customer Product Restriction
First-Pass Node Dossier
This page is an evidence-backed node dossier generated from the domain hierarchy and node questionnaire.
What It Is
CustomerProductRestriction is an ERP-synced restriction row that links a customer to a product and records whether that product is excluded or allowed for that customer context.
Parent hierarchy:
Customer ManagementSegmentation And RestrictionsCustomer Product Restriction
Primary implementation paths:
packages/framework/src/Models/CustomerProductRestriction.phppackages/framework/src/Actions/CustomerProductRestriction/CreateCustomerProductRestriction.phppackages/framework/src/Actions/CustomerProductRestriction/DeleteCustomerProductRestriction.phppackages/framework/src/Actions/ErpBridge/CustomerProductRestriction/SyncModelsFromErp.phppackages/framework/src/Actions/FastSearch/SearchProducts.php
What Users Can Do With It
Direct capabilities
In the inspected packaged product, operators do not get a dedicated customer-product-restriction management screen.
The supported lifecycle is:
- create restriction rows through actions or ERP sync
- delete restriction rows through actions or ERP sync cleanup
- have the ERP bridge restore, update, or remove records from incoming source data
Indirect capabilities
Other workflows consume customer-product restrictions without editing them directly:
- product search can receive a
customer_product_restrictionsfilter payload - ERP sync can create or remove records based on source truth
- product and customer relations expose the restriction as part of the data model
Where It Is Managed
| Channel | Role | Notes |
|---|---|---|
| ERP bridge | Direct | The restriction model is synced from ERP requests and DTOs |
| Framework actions | Direct | Create and delete actions exist for the restriction row |
| Fast search / product filtering | Indirect | Search requests accept customer_product_restrictions payload data |
| Packaged admin Livewire UI | Not confirmed | No dedicated customer-product-restriction settings page was found in this sprint |
| Storefront | Indirect | The base search layer can use restriction data to alter product visibility |
Sources:
packages/framework/src/Actions/ErpBridge/CustomerProductRestriction/SyncModelsFromErp.phppackages/framework/src/Actions/ErpBridge/CustomerProductRestriction/UpdateOrCreateModelFromDTO.phppackages/framework/src/Actions/CustomerProductRestriction/CreateCustomerProductRestriction.phppackages/framework/src/Actions/CustomerProductRestriction/DeleteCustomerProductRestriction.phppackages/framework/src/Actions/FastSearch/SearchProducts.php
Channel-Level Field Coverage
Model fields
The stored restriction fields are:
customer_idproduct_idexcludedrestrictable_idrestrictable_type
Source:
packages/framework/src/Models/CustomerProductRestriction.php
ERP DTO
The ERP DTO exposes:
customerIdproductIdexcluded
Source:
packages/erp-bridge/src/DTOs/Models/CustomerProductRestriction.php
ERP request
The ERP request is keyed off:
get_customer_product_restrictions
Source:
packages/erp-bridge/src/Requests/CustomerProductRestrictions/GetCustomerProductRestrictionsRequest.php
Configuration And Data Model
Key model characteristics:
- ERP-syncable
- product-linked
- customer-linked
Important field groups:
| Field | Purpose |
|---|---|
customer_id | owning customer |
product_id | restricted product |
excluded | whether the product is excluded or allowed |
restrictable_id, restrictable_type | polymorphic restriction context |
Sources:
packages/framework/src/Models/CustomerProductRestriction.phppackages/framework/src/Actions/ErpBridge/CustomerProductRestriction/UpdateOrCreateModelFromDTO.php
Relationships
CustomerProductRestriction directly relates to:
customerproductrestrictable
Source:
packages/framework/src/Models/CustomerProductRestriction.php
Rules And Downstream Effects
Important rules and effects:
- ERP sync can create or refresh restriction rows from source records
- missing ERP rows can delete unsynced local restriction rows
- the fast-search layer exposes a customer-product-restrictions filter hook that host apps can extend
- the base package does not surface a dedicated packaged UI for manual restriction maintenance
Sources:
packages/framework/src/Actions/ErpBridge/CustomerProductRestriction/SyncModelsFromErp.phppackages/framework/src/Actions/ErpBridge/CustomerProductRestriction/DeleteUnsyncedModels.phppackages/framework/src/Actions/FastSearch/SearchProducts.php
Integrations And Automation
ERP bridge
This node is primarily maintained through the ERP bridge request and sync flow.
Sources:
packages/framework/src/Services/ErpBridge/CustomerProductRestriction/CustomerProductRestrictionErpSyncService.phppackages/framework/src/Actions/ErpBridge/CustomerProductRestriction/SyncModelsFromErp.phppackages/erp-bridge/src/Requests/CustomerProductRestrictions/GetCustomerProductRestrictionsRequest.php
Search hooks
The search layer includes a customer-product-restriction payload hook that host apps can use to narrow product results.
Sources:
packages/framework/src/Actions/FastSearch/SearchProducts.php
Where It Appears To End Users
CustomerProductRestriction is not a shopper-managed concept in the packaged product.
It affects end users indirectly through:
- restricted product visibility in search and browse flows
- ERP-driven customer-specific product availability
Sources:
packages/framework/src/Actions/FastSearch/SearchProducts.phppackages/framework/src/Models/Product.phppackages/framework/src/Models/Customer.php
Current Documentation Takeaways
CustomerProductRestrictionis an integration-first record, not a packaged settings-page record.- The codebase treats it as a syncable restriction source that can influence search and availability behavior.
- If a host app wants richer manual management, that would be an extension point rather than a confirmed packaged surface.
Open Questions
- This first pass did not identify a dedicated packaged admin or storefront UI for managing these records manually.
- The exact host-app implementation of
applyCustomerProductRestrictionsin search is intentionally left open by the framework.
Sources
packages/framework/src/Models/CustomerProductRestriction.phppackages/framework/src/Actions/CustomerProductRestriction/CreateCustomerProductRestriction.phppackages/framework/src/Actions/CustomerProductRestriction/DeleteCustomerProductRestriction.phppackages/framework/src/Actions/ErpBridge/CustomerProductRestriction/SyncModelsFromErp.phppackages/framework/src/Actions/ErpBridge/CustomerProductRestriction/UpdateOrCreateModelFromDTO.phppackages/framework/src/Actions/FastSearch/SearchProducts.phppackages/erp-bridge/src/Requests/CustomerProductRestrictions/GetCustomerProductRestrictionsRequest.phppackages/erp-bridge/src/DTOs/Models/CustomerProductRestriction.php