| # | Issue/Improvement | Type | Severity |
|---|---|---|---|
| 1 | Prize quantity habis tapi masih bisa drawing (qty: 0) | Bug | ๐ด Critical |
| 2 | Create/Wizard page belum responsif | Improvement | ๐ก Medium |
| 3 | Urutan winner berubah setelah redraw | Bug/Improvement | ๐ก Medium |
| 4 | Perlu page detail event (readonly) | New Feature | ๐ข Enhancement |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ LANGKAH WAJIB: โ
โ โ
โ 1. TAMPILKAN CODE YANG RELEVAN โ
โ 2. TRACE FLOW โ
โ 3. IDENTIFY ROOT CAUSE โ
โ 4. PROPOSE FIX โ
โ 5. TUNGGU APPROVAL sebelum implementasi โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
[useDrawState] calling drawService.draw, qty: 0 โ Quantity sudah 0!
[Draw] quantity: 0 โ Tetap dipanggil!
[Draw] batchNumber: 21 โ Batch ke-21 (seharusnya max 20)
[Draw] Active coupons count: 129929
[Draw] Complete, results: 0
- Prize qty: 20, tapi bisa draw sampai batch 21
- Draw dipanggil dengan quantity: 0
- Tidak ada guard untuk prevent drawing ketika qty habis
- Tampilkan bagaimana
quantitydihitung untuk setiap draw - Tampilkan apakah ada check sebelum
drawService.draw()dipanggil - Tampilkan apakah tombol Start Draw di-disable ketika qty habis
// Guard 1: Di UI - disable Start Draw button
const remainingQty = prize.quantity - prize.drawnCount
const canDraw = remainingQty > 0
<button disabled={!canDraw}>Start Draw</button>
// Guard 2: Di drawService.draw()
if (quantity <= 0) {
console.log('[Draw] Quantity is 0, nothing to draw')
return []
}
// Guard 3: Di useDrawState
const quantityToDraw = Math.min(batchSize, remainingQty)
if (quantityToDraw <= 0) {
throw new Error('No more winners to draw for this prize')
}- Home dan History sudah responsif
- Create/Wizard page masih belum responsif
- Tampilkan current layout structure di Wizard pages (Step 1-4)
- Identifikasi hardcoded widths, missing breakpoints
- List komponen-komponen yang perlu diubah
Breakpoints:
- sm: 640px
- md: 768px
- lg: 1024px
- xl: 1280px
Pattern:
- Container: max-w-7xl mx-auto px-4 sm:px-6 lg:px-8
- Grid: grid-cols-1 sm:grid-cols-2 lg:grid-cols-3
- Stack on mobile, side-by-side on desktop
Original order: a, b, c, d, e, f, g, h, i, j
โ
f cancelled
โ
After redraw: a, b, c, d, e, g, h, i, j, k
โ
k di akhir (seharusnya di posisi f)
Original order: a, b, c, d, e, f, g, h, i, j
โ
f cancelled
โ
After redraw: a, b, c, d, e, k, g, h, i, j
โ
k menggantikan posisi f
- Tampilkan bagaimana redraw winner di-create
- Tampilkan apakah
lineNumberatauslotdigunakan untuk urutan - Tampilkan bagaimana winners di-sort saat display
- Winner baru dibuat dengan
lineNumberbaru (increment), bukan reuselineNumberdari cancelled - Atau sorting tidak berdasarkan
lineNumber
// redrawAll() - reuse lineNumber dari cancelled winner
const newWinner = await winnerRepository.create({
...
lineNumber: cancelledWinner.lineNumber, // Reuse posisi!
...
})
// Display - sort by lineNumber
const sortedWinners = winners.sort((a, b) => a.lineNumber - b.lineNumber)- Tidak kompleks jika
lineNumbersudah ada dan tinggal reuse - Perlu pastikan sorting konsisten di semua tempat display
| Route | Page | Purpose |
|---|---|---|
/ |
Home | List events |
/event/new |
Create Wizard | Create new event |
/event/:id/edit |
Edit Wizard | Edit existing event |
/event/:id/draw |
Draw Screen | Drawing process |
/event/:id/history |
History | View winners |
| Route | Page | Purpose |
|---|---|---|
/event/:id |
Event Detail | View event info (readonly) |
Interaction:
- Klik card body โ
/event/:id(Detail page) - Klik icon โ Quick action langsung
Status: draft / ready
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Event Name ๐ฒ โ๏ธ โฎ โ
โ Draft | 5 Prizes | 1000 Coupons โ โ Klik โ Detail
โ โ
โ Created: 2025-01-15 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฒ = Draw (/event/:id/draw)
โ๏ธ = Edit (/event/:id/edit)
โฎ = More (History, Delete, Export)
Status: in_progress
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Event Name ๐ฒ ๐ โฎ โ
โ In Progress | 3/5 Prizes Done โ โ Klik โ Detail
โ โ
โ Created: 2025-01-15 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฒ = Draw (/event/:id/draw)
๐ = History (/event/:id/history)
โฎ = More (Edit, Delete, Export)
Status: completed
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Event Name ๐ โฎ โ
โ Completed | 5/5 Prizes Done โ โ Klik โ Detail
โ โ
โ Created: 2025-01-15 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ = History (/event/:id/history)
โฎ = More (Edit, Delete, Export)
Event Detail Page (/event/:id)
โโโ Header
โ โโโ Event Name
โ โโโ Status Badge (draft/ready/in_progress/completed)
โ โโโ Action Buttons [Draw] [History] [Edit] (contextual by status)
โ
โโโ Section: Event Info
โ โโโ Description
โ โโโ Start Date
โ โโโ End Date
โ โโโ Win Rule (type + maxWins jika limited)
โ
โโโ Section: Prizes
โ โโโ Prize 1: Name, Image, Qty, Drawn/Confirmed
โ โโโ Prize 2: Name, Image, Qty, Drawn/Confirmed
โ โโโ ... (card atau table format)
โ
โโโ Section: Participants
โ โโโ Total Participants: X
โ โโโ Total Coupons: Y
โ โโโ Active Coupons: Z (remaining in pool)
โ
โโโ Section: Display Settings
โโโ Animation Type
โโโ Winner Display Mode
โโโ Grid: X ร Y
โโโ Background Image (thumbnail preview)
| Status | Actions |
|---|---|
| draft | [Edit] |
| ready | [Start Draw] [Edit] |
| in_progress | [Continue Draw] [History] [Edit] |
| completed | [History] [Edit] |
- Clean, card-based sections
- Readonly display (no editable inputs)
- Responsive (mobile-friendly)
- Consistent with existing design system
1. Issue #1 (Qty guard) - CRITICAL, prevent invalid state
โ
2. Issue #3 (Redraw order) - Affects data integrity
โ
3. Issue #2 (Wizard responsive) - UI polish
โ
4. Issue #4 (Detail page) - New feature
- Prize qty: 20, draw 20 โ tidak bisa draw lagi
- Start Draw button disabled ketika qty habis
- Console tidak show "quantity: 0"
- Proper message/UI ketika prize completed
- Test di 320px, 375px, 768px, 1024px
- Form inputs tidak overflow
- Buttons accessible di mobile
- Steps indicator responsive
- Cancel winner di posisi 3
- Redraw โ winner baru di posisi 3 (bukan di akhir)
- Urutan tampilan tetap konsisten
- Route
/event/:idaccessible - Semua info event ditampilkan
- Readonly (tidak bisa edit)
- Links ke edit/draw/history berfungsi
- Responsive