Skip to content

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 Management
  • Segmentation And Restrictions
  • Customer Product Restriction

Primary implementation paths:

  • packages/framework/src/Models/CustomerProductRestriction.php
  • packages/framework/src/Actions/CustomerProductRestriction/CreateCustomerProductRestriction.php
  • packages/framework/src/Actions/CustomerProductRestriction/DeleteCustomerProductRestriction.php
  • packages/framework/src/Actions/ErpBridge/CustomerProductRestriction/SyncModelsFromErp.php
  • packages/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_restrictions filter 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

ChannelRoleNotes
ERP bridgeDirectThe restriction model is synced from ERP requests and DTOs
Framework actionsDirectCreate and delete actions exist for the restriction row
Fast search / product filteringIndirectSearch requests accept customer_product_restrictions payload data
Packaged admin Livewire UINot confirmedNo dedicated customer-product-restriction settings page was found in this sprint
StorefrontIndirectThe base search layer can use restriction data to alter product visibility

Sources:

  • packages/framework/src/Actions/ErpBridge/CustomerProductRestriction/SyncModelsFromErp.php
  • packages/framework/src/Actions/ErpBridge/CustomerProductRestriction/UpdateOrCreateModelFromDTO.php
  • packages/framework/src/Actions/CustomerProductRestriction/CreateCustomerProductRestriction.php
  • packages/framework/src/Actions/CustomerProductRestriction/DeleteCustomerProductRestriction.php
  • packages/framework/src/Actions/FastSearch/SearchProducts.php

Channel-Level Field Coverage

Model fields

The stored restriction fields are:

  • customer_id
  • product_id
  • excluded
  • restrictable_id
  • restrictable_type

Source:

  • packages/framework/src/Models/CustomerProductRestriction.php

ERP DTO

The ERP DTO exposes:

  • customerId
  • productId
  • excluded

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:

FieldPurpose
customer_idowning customer
product_idrestricted product
excludedwhether the product is excluded or allowed
restrictable_id, restrictable_typepolymorphic restriction context

Sources:

  • packages/framework/src/Models/CustomerProductRestriction.php
  • packages/framework/src/Actions/ErpBridge/CustomerProductRestriction/UpdateOrCreateModelFromDTO.php

Relationships

CustomerProductRestriction directly relates to:

  • customer
  • product
  • restrictable

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.php
  • packages/framework/src/Actions/ErpBridge/CustomerProductRestriction/DeleteUnsyncedModels.php
  • packages/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.php
  • packages/framework/src/Actions/ErpBridge/CustomerProductRestriction/SyncModelsFromErp.php
  • packages/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.php
  • packages/framework/src/Models/Product.php
  • packages/framework/src/Models/Customer.php

Current Documentation Takeaways

  • CustomerProductRestriction is 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 applyCustomerProductRestrictions in search is intentionally left open by the framework.

Sources

  • packages/framework/src/Models/CustomerProductRestriction.php
  • packages/framework/src/Actions/CustomerProductRestriction/CreateCustomerProductRestriction.php
  • packages/framework/src/Actions/CustomerProductRestriction/DeleteCustomerProductRestriction.php
  • packages/framework/src/Actions/ErpBridge/CustomerProductRestriction/SyncModelsFromErp.php
  • packages/framework/src/Actions/ErpBridge/CustomerProductRestriction/UpdateOrCreateModelFromDTO.php
  • packages/framework/src/Actions/FastSearch/SearchProducts.php
  • packages/erp-bridge/src/Requests/CustomerProductRestrictions/GetCustomerProductRestrictionsRequest.php
  • packages/erp-bridge/src/DTOs/Models/CustomerProductRestriction.php