---
id: JNY-PFM-INT-005
title: Test and apply a customer pricing rule
feature: FEAT-PFM-INT-05
product_area: platform
module: integrations
revision: 1
status: draft
product_intent: proposed
implementation_evidence: partially-observed
supersedes: []
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
actor: ACT-PFM-022
goal: Configure a fifteen percent package discount for Northeast members through a rule handler.
capabilities:
  - CAP-PFM-INT-016
  - CAP-PFM-INT-017
screens:
  - '/console/{tenantId}/configuration/platform/extensions'
  - '/console/{tenantId}/configuration/platform/extensions/points/{pointKey}'
  - '/console/{tenantId}/configuration/platform/extensions/handlers/{handlerId}'
steps:
  - 'n': 1
    surface: getExtensionPoint
    action: Inspect the pricing point’s contract and sample inputs.
    capability: CAP-PFM-INT-016
    expected: 'The point shows its current definition, examples and permitted rule facts.'
    provenance: test
    source: >-
      services-platform:modules/extensions/tests/e2e/extensions.e2e.spec.js#reads one point with its contract
      and examples
  - 'n': 2
    surface: createExtensionHandler
    action: 'Attempt to save an incompatible rule, then save a corrected rule.'
    capability: CAP-PFM-INT-017
    expected: Validation identifies the first rule’s problems and accepts the corrected definition.
    provenance: test
    source: >-
      services-platform:modules/extensions/tests/e2e/rule-handlers.e2e.spec.js#saves a rule that fits its
      point’s current version
  - 'n': 3
    surface: testExtensionHandler
    action: Run the rule for a Northeast member and for a member elsewhere.
    capability: CAP-PFM-INT-017
    expected: >-
      The first run returns the discount; the second returns the neutral result, and both are recorded as
      tests.
    provenance: test
    source: >-
      services-platform:modules/extensions/tests/e2e/rule-handlers.e2e.spec.js#answers the Northeast member’s
      example with 15 percent of the package off, in minor units, in quote mode
  - 'n': 4
    surface: createExtensionBinding
    action: Enable a binding from the rule to the package product.
    capability: CAP-PFM-INT-017
    expected: The product receives an enabled customization binding.
    provenance: test
    source: >-
      services-platform:modules/extensions/tests/e2e/extensions.e2e.spec.js#creates an enabled binding at a
      product scope
  - 'n': 5
    surface: previewExtensionResolution
    action: Preview customization resolution for the product.
    capability: CAP-PFM-INT-017
    expected: The preview selects its product binding.
    provenance: test
    source: >-
      services-platform:modules/extensions/tests/e2e/extensions.e2e.spec.js#answers the product binding for a
      scope that names its product
alternates: []
failures:
  - from_step: 4
    condition: The product already has another enabled handler at a single-answer point
    path: Reject the competing binding
    outcome: Keep the existing binding as the selected customization
    provenance: test
    source: >-
      services-platform:modules/extensions/tests/e2e/extensions.e2e.spec.js#refuses a second enabled binding
      at one scope of a single point as 409
rules_in_play:
  - BR-CAP-PFM-INT-016-07
  - BR-CAP-PFM-INT-017-05
  - BR-CAP-PFM-INT-017-06
  - BR-CAP-PFM-INT-017-08
  - BR-CAP-PFM-INT-017-09
  - BR-CAP-PFM-INT-017-10
assertions:
  - id: AS-JNY-PFM-INT-005-01
    statement: Contract-incompatible rules are rejected with specific validation problems.
    provenance: test
    source: >-
      services-platform:modules/extensions/tests/e2e/rule-handlers.e2e.spec.js#refuses a rule its point’s
      contract refuses as 400, naming each problem by its path and code
  - id: AS-JNY-PFM-INT-005-02
    statement: Each handler test creates a test invocation record.
    provenance: test
    source: >-
      services-platform:modules/extensions/tests/e2e/rule-handlers.e2e.spec.js#records each run as a test
      invocation of the handler
e2e_policy: none
e2e_reason: >-
  The extension console uses examples. Service acceptance covers configuration and tests, with host use
  requiring further proof.
evidence:
  - >-
    Steps, alternates, failures and assertions cite the acceptance journeys and service tests at the commits
    in source_sha.
proved_by: []
---
# Test and apply a customer pricing rule

## Story

A configuration administrator studies the pricing contract, corrects an invalid rule and tests both matching and nonmatching membership examples. The administrator binds the accepted rule to a product and previews its selection. Service tests support this sequence; the console’s sample-backed extension pages do not establish a working browser journey.
