5015

Ship the Loyalty Strategy

Extensibility
Medium
Pro
interface
implements
strategy-pattern
extension-point

Ship the Loyalty Strategy

The starter is a base application in miniature: an order-discount feature where the enum "Order Discount Strategy" picks the strategy, the interface "Order Discount Calculator" defines the contract, and the shipped codeunit "Order Discount Engine" dispatches through the enum without ever naming a concrete calculator — the exact shape of the base application's Price Calculation extension point. Your company sells a loyalty add-on, so you get the real ISV job: plug a new strategy into that extension point from the outside, without editing a single line of the "base app".

Requirements

  1. Treat the five shipped files as the base application and submit them unchanged alongside your new objects. This read-only rule is the working constraint of the exercise, not something grading can inspect — the tests verify behavior only, so honour it the way a real ISV must. The enum is Extensible = true for exactly this purpose.
  2. From a new object of your own, add a value named Loyalty (exact name) to the enum "Order Discount Strategy". Pick its value ID in 50100–50199.
The rest of the statement and 3 hints Unlock with Pro
ALBusiness Central 28.5
Pro
Pro problem

Solve it with Pro

You’re reading the opening of the statement. Pro unlocks the whole problem:

  • The full statement
  • Starter code in the browser editor
  • 11 grading tests, run on Business Central 28.5
  • 3 hints
  • The reference solution

Pro also opens all 92 Pro problems and lifts the daily limits on compile checks and submissions.

$10 / month
or $100 / year
Upgrade
This problem is part of Pro
Pro unlocks the full statement, tests, hints and solution. The code editor works on a computer.
Upgrade