All notable changes to the handoff spec (README.md + API_CONTRACT.md) are recorded here.
Versioning is semantic-ish: MAJOR for breaking model/flow changes, MINOR for new features, PATCH for clarifications.
Each released version is archived verbatim under versions/; the files at the handoff root are always the latest.
headcount minimum turun dari 1 ke 0
Peserta dengan headcount: 0 dianggap ikut trip secara administratif tapi tidak menggunakan shared resources (contoh: driver, bayi, koordinator non-aktif). Mereka tidak mendapat porsi dari item Per-Orang, tapi tetap dihitung dalam flat-split Per-PIC (karena Per-PIC dibagi per peserta, bukan per headcount).
SplitBill/SplitBillCalculator.swift: hapus max(p.headcount, 1) di baris perhitungan share Per-Orang — gunakan p.headcount langsung. Tetap pertahankan max(totalHeadcount, 1) untuk guard division-by-zero.Store/MockRepository.swift: updateParticipant — ubah max(v, 1) → max(v, 0) agar nilai 0 bisa disimpan (tapi negatif tetap ditolak).Views/Sheets.swift: ubah Stepper dari in: 1...20 → in: 0...20.Views/PesertaTab.swift: tampilkan "tidak ikut" (bukan "0 orang") ketika headcount == 0.PATCH /trips/:tripId/participants/:participantId — ubah validasi Pydantic field headcount dari ge=1 ke ge=0.GET /trips/:tripId/split-bill — pastikan server-side split-bill calculator tidak clamp headcount ke minimum 1. Peserta dengan headcount: 0 harus mendapat share: 0 untuk semua item Per-Orang. Per-PIC flat-split tetap dibagi oleh jumlah peserta (tidak berubah).headcount: 0 mendapat share: 0 untuk semua item Per-Orang di split-bill.headcount: 0 tetap menanggung 1/N dari item Per-PIC pooled.max(totalHeadcount, 1)).-- Tidak ada perubahan schema database.
-- Hanya perlu update validasi Pydantic dan logika split-bill di application layer.
headcount: int = Field(ge=1) → headcount: int = Field(ge=0) di schema Participantcompute_split_bill() tidak clamp headcount ke min 1ownerId — identitas pemilik trip
Trip dan TripSummary mendapatkan field baru ownerId: string — userId dari pembuat trip.POST /trips dari auth token caller, tidak bisa diubah via PATCH.ALTER TABLE trips ADD COLUMN owner_id TEXT NOT NULL DEFAULT ''; lalu isi dengan created_by atau user pertama yang join.userId — link peserta ke akun
Participant mendapatkan field baru userId: string | null — null untuk peserta yang ditambahkan manual (belum punya akun terhubung), diisi saat peserta join via invite link.ALTER TABLE participants ADD COLUMN user_id TEXT DEFAULT NULL;Hapus peserta — DELETE /trips/:tripId/participants/:participantId
ownerId == caller userId) yang boleh menghapus peserta lain.400).Keluar dari trip — DELETE /trips/:tripId/participants/me
403 — harus hapus trip (DELETE /trips/:id) jika ingin menutup trip.userId dari auth token, dicocokkan ke participants[].userId.ALTER TABLE trips ADD COLUMN owner_id TEXT NOT NULL DEFAULT '';
ALTER TABLE participants ADD COLUMN user_id TEXT DEFAULT NULL;
-- Isi owner_id untuk trip yang sudah ada (contoh: ambil dari participant pertama)
UPDATE trips SET owner_id = (
SELECT user_id FROM participants
WHERE trip_id = trips.id AND user_id IS NOT NULL
ORDER BY created_at ASC LIMIT 1
) WHERE owner_id = '';
docsLink — link dokumentasi trip (Google Drive, Notion, dll)
Trip dan TripSummary mendapatkan field docsLink: string | null. Default null.POST /trips request body menerima docsLink (string, boleh kosong).PATCH /trips/:id menerima docsLink. Kirim "" untuk menghapus link. Bersifat optional — field ini hanya di-update jika disertakan dalam request body (PATCH semantics biasa).docs_link TEXT DEFAULT NULL di tabel trips.ALTER TABLE trips ADD COLUMN docs_link TEXT DEFAULT NULL;Client-only (tidak ada perubahan endpoint):
docsLink adalah URL bebas — bisa Google Drive, Notion, PDF, atau apapun. Tidak ada validasi format di server selain memastikan nilainya string.Photo uploads — trip cover, checklist items, budget items
POST /trips/:tripId/cover (multipart) — sets/replaces the trip’s cover photo with uploader attribution (coverUploadedByName/coverUploadedAt on Trip/TripSummary).POST /trips/:tripId/items/:itemId/images / DELETE .../images/:imageId — checklist item photo gallery.POST /trips/:tripId/budget-items/:itemId/images / DELETE .../images/:imageId — budget item photo gallery (e.g. receipts).uploadedBy/uploadedByName/createdAt; only the uploader can delete their own image. Any participant who can see the entity (group item, or a personal item they own) can upload to it.items[]/budgetItems[] responses gain an images[] array (oldest first).GET /trips/:tripId/split-bill — poolDetails[] and direct-debt transfers[].parts[] gain budgetItemId, so the client can cross-reference trip.budgetItems[].images to show photos next to a settlement line without a new endpoint. null on merged “Bagi rata” parts (no single source item).trip_images (checklist/budget galleries) + trips.cover_uploaded_by/cover_uploaded_by_name/cover_uploaded_at columns — see sql/migrations/002_add_images.sql.POST /uploads (the old generic single-file upload) is unchanged and still available for one-off use, but the new attached-upload endpoints are preferred going forward since they persist attribution.Invite links now resolve to something even without Universal Links
https://kemah-sg-....run.app/join/:tripId) instead of the unowned kemah.app placeholder — no domain purchase needed, since a Cloud Run service’s default URL is already a real, backend-controlled HTTPS domain.GET /.well-known/apple-app-site-association — added so Universal Links can be turned on later with zero backend changes, once a paid Apple Developer account exists (Associated Domains requires it; not available today).GET /join/:tripId — new fallback landing page. Since Universal Links can’t intercept yet, tapping an invite link always opens this in Safari first; it auto-attempts the kemah:// custom scheme (silently no-ops if the app isn’t installed) with a visible “Buka di App Kemah” button as backup, and an honest “not on the App Store yet” message otherwise. Validates the token before revealing the trip name.Guest mode — preview a trip before signing in
GET /trips/:tripId/invite/preview?token=... — new unauthenticated endpoint. Anyone holding an invite link can see a narrow preview (name, location, date, cover, participants, checklist progress count) without signing in first.POST /join, which still requires login).Auth — Google Sign-In implemented (iOS)
GoogleSignIn-iOS) instead of the mocked entry.grant_type=id_token) — no Supabase SDK added, consistent with the app’s plain-REST networking convention.Split Bill Logic — self-paid Per-PIC category (new)
pic blank/nil. Split flatly by participant count (unchanged).pic set and equal to paidBy. Excluded from all settlement. The person already paid for their own cost; no redistribution to other participants. These items do not enter the pool and do not appear in any transfer.pic set and different from paidBy. Fixed 1:1 debt (unchanged).pic blank or equal to paidBy”) was incorrect and is now corrected. Self-payment is a distinct third case.Split Bill — backend-side (now required)
GET /trips/:tripId/split-bill is now the required computation path. The client MUST call this endpoint rather than computing settlement locally. Client-side computation (via SplitBillCalculator) remains available as an offline/fallback only.Split Bill API response — shape update (breaking)
perPerson[].paid renamed to perPerson[].contribution — “contribution” is clearer (it’s what they fronted, not what they owe).transfers[].amount renamed to transfers[].total — disambiguates from parts[].amount at the nested level.perPerson[].headcount added (was missing from response; needed for display in “Ringkasan per Orang”).perPerson[].poolDetails added — Level B pool transparency: per-item { name, share, paid } breakdown for the “Bagi rata” expansion in the transfer list. share = this person’s fair portion of the item; paid = full item price if this person was the payer, else 0.UI — Dark mode
Theme.background and Theme.surface now use UIColor adaptive semantic colors (systemGroupedBackground, secondarySystemGroupedBackground) so all screens, sheets, and card backgrounds adapt automatically to light/dark mode.Theme.textPrimary, textMuted, textSubtle now use UIColor.label, secondaryLabel, tertiaryLabel.Theme.neutralPillBg → UIColor.tertiarySystemGroupedBackground.LabeledField, SearchableParticipantField) changed from Theme.background to Theme.surface so fields are visually distinct from the page background in both modes.UI — AvatarStack overflow
AvatarStack now shows a maximum of 3 avatars (was 4). If more participants exist, a “···” pill is appended instead of a “+N” count label. This prevents the stack from overlapping the back button on Trip Detail.pic == paidBy == "Irma") were already present; they are now correctly excluded from settlement by the updated logic.Checklist tab — section split logic
pic not empty); “Pribadi” shows items without a PIC (pic null/empty). Previously split was by isPersonal flag.isPersonal: true) naturally fall into “Pribadi” since they never carry a PIC.Split Bill — transfer expansion
hasParts is now true for all transfers (even single-part ones). Previously only transfers with more than one part were expandable. Every transfer row shows a chevron and can be tapped to reveal its itemized breakdown.UI — Budget card
UI — Trip Detail header
ScrollView.ignoresSafeArea(edges: .top)). Cover frame height adjusted to 230pt to compensate.UI — Split Bill CTA bar
ignoresSafeArea).[↔ icon] Split Bill [›].y: -6) to visually lift the bar off the screen.Seed data (MockRepository — dev only)
.auto.API_CONTRACT.md version badge updated to 1.2.0 for consistency; the contract itself is unchanged.budgetItems[].isPersonal (bool, default false) and budgetItems[].owner (server-set from the auth token; null for group expenses).items[].owner (server-set when isPersonal: true; null otherwise).isPersonal items are dropped before any settlement math.GET /trips and GET /trips/:id responses are now filtered per caller — a participant never receives another user’s personal items/budgetItems.GET /trips/:tripId/split-bill computes over group expenses only.reference/Kemah Travel App.dc.html) reflects v1.0.0 scope and does not demonstrate the privacy features; build them from the README, not the HTML.Kemah Travel App.dc.html.