Car-Link
Rental fleet and partner booking system
A rental company was updating vehicle availability in Google Sheets while its website and partner bookings used the same information. I built a system to keep those records in sync without replacing the spreadsheet.
The problem
Rental staff managed pricing, availability, and deposits in Google Sheets. Manual re-entry into the application created inventory lag, double-booking risk during peak demand, and partner disputes when a referral could not be reconstructed.
What I built
An installable Apps Script trigger records sheet changes, increments a version, and places work in a sync queue. A signed request revalidates the public catalog, while server-side partner validation records the click and resolves the WhatsApp destination.
Engineering decisions
The script lock covers only the cell mutation and queue enqueue. External network calls happen after release. Idempotency keys, requested sheet versions, and server-side cookie validation keep retries and tampered input from changing the wrong record.
What shipped
The live catalog, technical documentation, and a standalone operator manual are available. The partner attribution chain is documented and verified in pieces; the recorded project state still leaves end-to-end deployment and walkthrough work open.
Current boundary
The page separates shipped evidence from delivery evidence. Task counts and test counts show how the work was checked; they do not by themselves prove a business outcome.
See the system move from a spreadsheet edit to a partner request.
The build is more than a catalog. Explore the synchronization boundary, the attribution contract, and the verification process that kept the pieces connected.
Google Sheets to a dependable catalog
Explore the four handoffs that keep staff edits, the public catalog, and the repair path in agreement.
Trigger and enqueue
An installable trigger reads the edited row, increments the sheet version, and places the change in a queue. The script lock is released before any network call.
const row = event.range.getRow();
const carId = sheet.getRange(row, 1).getValue();
const version = bumpSheetVersion();
enqueueSync({ operationId: newId(), tab: "cars", row, carId, version });The lock protects the sheet mutation, not the external request.
Authentication, shape, version, and publication state stay explicit.
The last safe snapshot and the repair path remain separate concerns.
This walkthrough uses public-safe mechanism names. Client data, credentials, and private operational values are not shown.
Referral state that survives the redirect
Choose a safe sample partner and vehicle to see how the server carries attribution and records the event.
Set first-party attribution
A partner entry point validates the slug and sets a first-party attribution cookie. The visitor can browse normally while the referral stays attached to the session.
const partner = PartnerSlug.safeParse(params.partner);
if (!partner.success) redirectToCatalog();
response.cookies.set("pc", partner.data, attributionCookieOptions);
return NextResponse.redirect(new URL("/", request.url));First-party state stays attached without exposing a partner-controlled URL to the client.
Booking requests and ordinary clicks are separate event types, not one blurred metric.
Names, phone numbers, and private partner values are replaced with illustrative labels here.
The example is intentionally anonymized. The production code holds the real validation, redirect, and ledger rules.
A build process that leaves evidence
Explore how the work moved from a written contract to a system another person can operate.
Verify in layers
Logic, wire contracts, composition, database behavior, and browser behavior are checked at different levels instead of trusting one green command.
Pure logic is tested without the surrounding system.
Golden files protect contracts and failure states.
Browser and database checks cover the seams between layers.
$ vitest run
$ tsc --noEmit
$ git diff --check
[OK] checks run before handoverThe recorded history includes both designed coordination and its limits; the diagram does not turn a broken mechanism into a guarantee.
Counts describe delivery evidence, not a guaranteed business outcome.
The operator path is treated as part of the system that ships.
The project history contains stale counts in older documents. This view uses the reconciled evidence and labels delivery metrics for what they are.