Back to capability index01 / CAR-LINK

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.

Build shapeTwo connected builds
DeliveryCatalog + partner engine
Verification67 test files / golden contracts
HandoverManual + technical docs
Visit the live site Production code is held by the client.
Project detail

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.

Car-Link / inventory

Google Sheets to a dependable catalog

Explore the four handoffs that keep staff edits, the public catalog, and the repair path in agreement.

TRIGGER / staff path

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.

Versioned handoff
01Trigger and enqueueGoogle Apps Script
02Versioned dispatchQueue worker
03Validate before publishNext.js revalidation route
04Detect and repair driftScheduled repair
Mechanism excerptSource trail: Apps Script / revalidation route / inventory store
const row = event.range.getRow();
const carId = sheet.getRange(row, 1).getValue();
const version = bumpSheetVersion();
enqueueSync({ operationId: newId(), tab: "cars", row, carId, version });
Lock boundary

The lock protects the sheet mutation, not the external request.

Wire contract

Authentication, shape, version, and publication state stay explicit.

Recovery

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.

Car-Link / partner records

Referral state that survives the redirect

Choose a safe sample partner and vehicle to see how the server carries attribution and records the event.

Public-safe simulation
Referral source
Vehicle state
Stage 01 / /p/[partner]

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.

booking_request
ReferralPartner Aactive partner record
VehicleVehicle Apublished catalog record
Eventbooking_requestcar id can be retained
Server-side contractCookie input is re-validated before use
const partner = PartnerSlug.safeParse(params.partner);
if (!partner.success) redirectToCatalog();
response.cookies.set("pc", partner.data, attributionCookieOptions);
return NextResponse.redirect(new URL("/", request.url));
Attribution

First-party state stays attached without exposing a partner-controlled URL to the client.

Revenue meaning

Booking requests and ordinary clicks are separate event types, not one blurred metric.

Privacy

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.

Car-Link / delivery method

A build process that leaves evidence

Explore how the work moved from a written contract to a system another person can operate.

Process, not mythology
Phase 03 / CHECK

Verify in layers

Logic, wire contracts, composition, database behavior, and browser behavior are checked at different levels instead of trusting one green command.

67 test files / golden contracts
01

Pure logic is tested without the surrounding system.

02

Golden files protect contracts and failure states.

03

Browser and database checks cover the seams between layers.

Process traceNames and counts reflect the recorded project state
$ vitest run
$ tsc --noEmit
$ git diff --check
[OK] checks run before handover
Coordination

The recorded history includes both designed coordination and its limits; the diagram does not turn a broken mechanism into a guarantee.

Verification

Counts describe delivery evidence, not a guaranteed business outcome.

Handover

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.