mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-06 17:36:53 +01:00
Add interfaces knowledge domain and review leaf skill (#42)
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>
This commit is contained in:
parent
45c2b2f5ec
commit
23d5478ac6
12 changed files with 458 additions and 2 deletions
|
|
@ -0,0 +1,32 @@
|
|||
enum 50204 "Shipping Method Bad"
|
||||
{
|
||||
Extensible = true;
|
||||
|
||||
value(0; Standard) { }
|
||||
value(1; Express) { }
|
||||
}
|
||||
|
||||
codeunit 50205 "Shipping Charge Bad"
|
||||
{
|
||||
// Anti-pattern: every call site must 'case' over the enum, and every new
|
||||
// shipping method forces a synchronized edit to each of these blocks.
|
||||
procedure GetRate(Method: Enum "Shipping Method Bad"; Weight: Decimal): Decimal
|
||||
begin
|
||||
case Method of
|
||||
Method::Standard:
|
||||
exit(Weight * 1.5);
|
||||
Method::Express:
|
||||
exit((Weight * 1.5) + 25);
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure GetDeliveryDays(Method: Enum "Shipping Method Bad"): Integer
|
||||
begin
|
||||
case Method of
|
||||
Method::Standard:
|
||||
exit(5);
|
||||
Method::Express:
|
||||
exit(1);
|
||||
end;
|
||||
end;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue