mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-06 17:36:53 +01:00
Adds the interfaces knowledge domain covering AL interfaces and enum-with-implementation: three atomic articles with good/bad AL samples, a new al-interfaces-review leaf skill, and additive wiring into al-code-review and the README. Purely additive; no contract change. Part of #34. Co-authored-by: Jesper Schulz-Wedde <jesper.schulzwedde@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
22 lines
591 B
AL
22 lines
591 B
AL
codeunit 50217 "Standard Discount Calc Bad"
|
|
{
|
|
procedure CalculateDiscount(Amount: Decimal): Decimal
|
|
begin
|
|
if Amount > 1000 then
|
|
exit(Amount * 0.1);
|
|
exit(0);
|
|
end;
|
|
}
|
|
|
|
codeunit 50216 "Order Total Bad"
|
|
{
|
|
// Anti-pattern: the dependency is a concrete codeunit type, so a test
|
|
// cannot substitute a double - it always runs the production rule.
|
|
var
|
|
DiscountCalc: Codeunit "Standard Discount Calc Bad";
|
|
|
|
procedure NetAmount(Amount: Decimal): Decimal
|
|
begin
|
|
exit(Amount - DiscountCalc.CalculateDiscount(Amount));
|
|
end;
|
|
}
|