changes / admin

MPC Admin — Version Changelog

Versi aktif berikutnya: v0.16 (naik dari v0.15). Chat sama → jangan bump, update bullet saja.

Independen dari app lain. Indeks: mpc-dev/docs/versions/README.md.


v0.15 — 2026-08-21

  • Push tanpa ketergantungan mpc-be: register token + broadcast tulis Prisma (device_tokens / notifications) dan kirim FCM via Firebase Admin SDK.
  • Prisma: model DeviceToken; Notification.category + Notification.data selaras migration 023.
  • Hapus kebutuhan MPC_BE_URL / ADMIN_API_KEY di admin untuk push.

v0.14 — 2026-08-20

  • All admin image uploads go through Firebase Storage (generalized uploadImage / deleteStorageImage; folders: courts, products, promos, spaces, coaches, classes, events).
  • Shared EntityPhotosPanel (main + gallery, multi-file, set-as-main, replace, delete, drag reorder) — Court panel refactored to use it; Product (FnB / Pro Shop / Rent) gets the same Photos quick-action panel.
  • ImageUploadField replaces paste-URL on Promo, Resto Space, Coach, Class, and Event forms.
  • Prisma: Product.imageUrl + Product.gallery; Event.imageUrl. Sync migration workspace 027.
  • updateProductPhotos granular action (does not overwrite other product fields).
  • Upload size limit 150KB per photo (was 5MB); product catalog images re-compressed and hosted on Firebase Storage.

v0.13 — 2026-08-20

  • Prisma: model EmailOtp (email_otps) selaras migration 026 — tanpa UI; dipakai mpc-be untuk OTP email.

v0.12 — 2026-08-15

  • All remaining user-facing copy in mpc-admin-site is English (Court photos/pricing/specs panels, Promos helpers, Notifications broadcast, Push opt-in, Settings FnB pickup, POS Devices).

v0.11 — 2026-08-15

  • Halaman Court (/services/courts): pecah form edit monolitik jadi Court Info ringkas (Name/Type/Status/Bundled Room) + 3 panel quick-edit yang dibuka dari ikon aksi cepat di tabel — Foto, Harga, Specs & Description — tanpa perlu buka form edit penuh.
  • Court Photos: panel baru (CourtPhotosPanel.tsx) dengan upload foto asli (bukan paste URL) ke Firebase Storage — grid thumbnail, "Jadikan Utama", "Ganti", "Hapus" per foto, drag untuk reorder gallery, upload multi-file sekaligus. Auto-save tiap aksi.
  • Court Pricing: panel baru (CourtPricingPanel.tsx) — Base Price/Hour, Special Day Price, Time Group override (pindahan dari form lama, kini terpisah).
  • Court Specs & Description: panel baru (CourtSpecsPanel.tsx) — Description, Specs (label/value), Perks (pindahan dari form lama, kini terpisah).
  • Infra baru: firebase-admin SDK (src/lib/firebaseAdmin.ts), server actions uploadCourtImage / deleteStorageImage (src/actions/uploads.ts); SlidePanel dapat prop width (md/lg) untuk panel Foto yang lebih lega; next.config.ts server actions bodySizeLimit dinaikkan ke 10mb untuk upload foto.
  • Env baru (wajib diisi manual dari Firebase Console → Project Settings → Service Accounts): FIREBASE_CLIENT_EMAIL, FIREBASE_PRIVATE_KEY, FIREBASE_STORAGE_BUCKET.
  • src/actions/courts.ts: saveCourt dipangkas (hanya identity fields, court baru dibuat dengan basePricePerHour=0 lalu diisi lewat panel Harga); tambah updateCourtPhotos, updateCourtSpecs, updateCourtPricing granular (tidak lagi saling menimpa field lain).

v0.10 — 2026-08-15

  • Form Promo (/customers/promos): tambah Image URL + Display Order — hanya promo dengan gambar yang tampil di carousel Home member app (Android/iOS), urutan makin kecil makin awal.
  • Prisma: Promo.imageUrl (image_url), Promo.displayOrder (display_order, default 0) — sync migration 025.

v0.9 — 2026-08-15

  • Web Push opt-in (Bell → FCM) + POST /api/push/register ke mpc-be device_tokens (audience=admin).
  • Halaman /notifications — broadcast promo ke semua member via mpc-be.
  • Env: NEXT_PUBLIC_FIREBASE_*, MPC_BE_URL, ADMIN_API_KEY.

v0.8 — 2026-08-13

  • Halaman Resto (/services/resto, sidebar group Service): tab Spaces (CRUD Room/TableArea — kapasitas, online pool, max party, minimum spend, online reservable, soft delete) + tab Reservations harian (date picker, guest/customer, pax, minimum spend snapshot, meja assigned read-only dari POS, source Online/Staff/Court Bundle, ubah status Confirmed→Seated→Completed/Cancelled/NoShow) + dialog Walk-in / Manual (durasi ikut store_settings, snapshot minimum spend, hint sisa online pool — tanpa capacity block).
  • Form Court: picker Bundled VIP Room (spaces space_type=Room aktif) → courts.bundled_space_id.
  • Prisma: model Space, SpaceReservation, SpaceTable, SpaceReservationTable; Court.bundledSpaceId; StoreSettings.spaceReservationDurationMinutes / restoOpenTime / restoCloseTime (sync migration 020).
  • Prisma: Transaction.spaceReservationId + relasi ke SpaceReservation.orders (sync migration 021) — hanya sync schema, belum ada tampilan detail order terkait di halaman Resto (deferred, tidak wajib untuk perubahan ini).

v0.7 — 2026-08-11

  • Prisma: extend Match (hostCustomerId, isDouble, courtId); model MatchParticipant, MatchGame (sync matchplay schema migration 017).
  • Store Settings: Pick up FnB — fnb_pickup_before_minutes / fnb_pickup_interval_minutes (default 30 / 15); Prisma + form Admin Settings.
  • Prisma transactions.fnbPickupTime (sync migration 018).
  • Court showcase: Prisma Court + imageUrl/description/gallery/specs/perks (migration 019); CourtForm kelola konten showcase (description, main image, gallery, specs, perks).

v0.6 — 2026-08-10

  • Drop developers Tasks (DB + UI); product catalog cascade: product_type → group → category.
  • Rename Prisma products.categoryproductType; item_groups.productType; coaches → staff_coaches.
  • Promo/voucher channel (+ voucher auto_apply); Weekday/Weekend price fields on product forms.
  • Seed: reviews, classes, matches, favorites, notifications, tier_benefits, subscriptions.
  • Drop misleading ProShop group Rent; add GRP-RENT-GEAR (product_type=Rent); store_settings.default_branch_id; seed categories updated.
  • Migration 015: Prisma @db.Uuid on remaining deletedBy / referenceId fields.

v0.5 — 2026-08-10

  • Drop Prisma amenities / BranchStock; Rent tetap via products.
  • Snake_case pricing/benefit columns; ProductVariant/Addon PascalCase; GORM models in Prisma.
  • Services: Classes CRUD; Membership structured tier_benefits.
  • Promos copy: marketing only (vouchers = checkout).

v0.4 — 2026-08-10

  • ProductCategory: FnB | ProShop | Rent (ex Merch/Equipment).
  • Sidebar Services: Pro Shop + Rent (ganti Merchandise); /services/inventory redirect ke Pro Shop.
  • Seed contoh: T-shirt = ProShop, Rental Racket = Rent.
  • Deploy + seed data ProShop/Rent di prod (migrasi enum 006).

v0.3 — 2026-08-09

  • Seed courts: 3 aktif saja (Court 1–3), display_order 1–3; Court 3 kategori VIP; Regular untuk 1–2.

v0.2 — 2026-08-08

  • Multi-branch: model Branch / BranchStock; CRUD /admin/branches.
  • Header branch switcher (cookie); courts list/create scoped to active branch.
  • Seed creates Main branch and links courts/outlet.

v0.1 — baseline

  • Admin site Next.js (mpc-admin-site) sebelum changelog formal di mpc-dev/docs/changes/admin.md.