Skip to content

Tech Design — Cheat Sheet

This page is here if you get stuck, or after you've run your own version and want to compare.

Don't read this before attempting Step 3. The exploration is the point.


Correction prompt

If your first draft missed the mark, paste this into the main chat and ask Opus to revise specs/tech-design.md:

Update specs/tech-design.md with these architectural decisions. Keep the existing structure but revise the relevant sections:

**Cars**: Non-Inventory Item, Unit of Measure = Day.

**Bookings**: Blanket Sales Order. Rental Start Date = Requested Delivery Date (existing field). Rental Finish Date = custom field on Sales Header.

**Billing**: Each billing cycle is a separate Sales Order created from the Blanket Order.
- Sales Order posting date = if (Rental Finish Date - today) < 30 days → Rental Finish Date, else Rental Start Date + 30 days.
- A Job Queue task runs daily, filters Blanket Orders where Next Billing Date ≤ today, creates the period Sales Order and advances Next Billing Date by 30 days.
- Final Sales Order (unbilled days + all extra charges) is created by the Return wizard, not the Job Queue.

**Custom actions on Blanket Order**:
- **Pickup wizard** — creates and auto-releases the first Sales Order; sets Next Billing Date = Rental Start + 30 days; posts Security Deposit via Bank Deposit.
- **Prolong action** — updates Rental Finish Date; creates a new period Sales Order if needed.
- **Return wizard** — runs return checklist; creates final Sales Order for remaining unbilled days + expenses; refunds/forfeits deposit via Bank Deposit.

**Deposits**: Bank Deposits feature. Posted automatically when the Pickup and Return wizards complete.

**Availability**: query via Sales Lines using Requested Delivery Date and Rental Finish Date range — no separate availability table.

Do not add new requirements. Only update the sections that these decisions affect. Keep all other decisions unchanged.

Reference — key design decisions

This is what a well-reasoned specs/tech-design.md should converge on for the Key design decisions section. Use it to verify your agent's output — not as a shortcut.

  1. A car is an Item of Type = Non-Inventory with Base Unit of Measure = DAY — every booking, pricing, billing and reporting flow runs on standard Sales/Pricing plumbing without UoM conversions.
  2. A booking is a standard Blanket Sales Order with one Item line per car — Blanket Sales Orders are first-class in Sales Header.Document Type and have a standard Make Order mechanism (codeunit 87).
  3. Rental Start Date reuses Sales Header.Requested Delivery Date (field 5790); Rental Finish Date is a single new field on a Sales Header tableextension.
  4. Each billing cycle is its own Sales Order created from the Blanket via codeunit 87, with Posting Date = Rental Finish Date if remaining rental is under 30 days, otherwise Rental Start Date + 30 days × n.
  5. A daily Job Queue task creates cycles 2…N automatically by filtering Blanket Orders where Next Billing Date ≤ Today and advancing Next Billing Date by 30 days each time.
  6. The Pickup wizard creates and releases the first cycle Sales Order; the Return wizard creates the final Sales Order — the Job Queue never produces the first or last invoice.
  7. Duration discounts are configured as Price List Line rows with Minimum Quantity of 7 and 30 — the Best Price engine handles it; zero AL pricing code.
  8. Availability is a query against open Sales Lines using Requested Delivery Date and Rental Finish Date — no separate availability table, no Res. Capacity Entry writes. Standard Sales tables are the single source of truth.
  9. Security deposits are posted through the standard Bank Deposits feature, not Sales Order Prepayments — Prepayments are recognised as revenue and would net off the final invoice.
  10. Customer identity documents are stored as Document Attachments on the Customer, identity numbers as a tableextension field classified EndUserIdentifiableInformation.
  11. Pickup/return data is captured on Blanket Sales Header extension fields plus Document Attachments — the rental agreement is a standard report layout.
  12. The two genuinely custom UIs are the Fleet Booking Board (Gantt-style calendar) and the Fleet Live Map — both are JavaScript control add-ins on AL pages backed by standard Item data and a thin GPS-position table.

Reference implementation

The complete specs/tech-design.md for this workshop is on the ready branch of the workshop repo.

Browse it at commit 67a3168"Step 3.2 - Technical design - final".