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.
- A car is an
ItemofType = Non-InventorywithBase Unit of Measure = DAY— every booking, pricing, billing and reporting flow runs on standard Sales/Pricing plumbing without UoM conversions. - A booking is a standard
Blanket Sales Orderwith one Item line per car — Blanket Sales Orders are first-class inSales Header.Document Typeand have a standardMake Ordermechanism (codeunit 87). - Rental Start Date reuses
Sales Header.Requested Delivery Date(field 5790); Rental Finish Date is a single new field on aSales Headertableextension. - Each billing cycle is its own Sales Order created from the Blanket via codeunit 87, with
Posting Date = Rental Finish Dateif remaining rental is under 30 days, otherwiseRental Start Date + 30 days × n. - A daily Job Queue task creates cycles 2…N automatically by filtering Blanket Orders where
Next Billing Date ≤ Todayand advancingNext Billing Dateby 30 days each time. - 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.
- Duration discounts are configured as
Price List Linerows withMinimum Quantityof 7 and 30 — the Best Price engine handles it; zero AL pricing code. - Availability is a query against open Sales Lines using
Requested Delivery DateandRental Finish Date— no separate availability table, noRes. Capacity Entrywrites. Standard Sales tables are the single source of truth. - 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.
- Customer identity documents are stored as
Document Attachmentson the Customer, identity numbers as a tableextension field classifiedEndUserIdentifiableInformation. - Pickup/return data is captured on Blanket Sales Header extension fields plus
Document Attachments— the rental agreement is a standard report layout. - 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
Itemdata 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".