-
Notifications
You must be signed in to change notification settings - Fork 176
refactor: standardize createCategory error response pattern #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jezweb
wants to merge
10
commits into
ifindev:main
Choose a base branch
from
jezweb:fix/standardize-error-responses
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3acc741
refactor: standardize createCategory error response pattern
20bf287
Initial CRM project setup
67be712
checkpoint: Phase 1 Complete - Project setup finished
e4bec48
checkpoint: Phase 2 Complete - CRM database schema
b34adb7
feat: Phase 3 - Contacts Module (Server Actions + UI)
a0bc3e3
feat: Phase 4 - Deals Module (Pipeline Board + CRUD)
3950032
feat: Phase 5 - Dashboard Integration (CRM Metrics + Quick Actions)
df75e37
feat: Phase 6 - Testing & Documentation Complete
44607b1
fix: Radix UI Select empty value crash in deal form
69fa202
docs: Update SESSION.md with latest checkpoint hash
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| # Session State | ||
|
|
||
| **Current Phase**: All phases complete! 🎉 | ||
| **Current Stage**: Production Ready | ||
| **Last Checkpoint**: 44607b1 (2025-11-08) | ||
| **Planning Docs**: `docs/IMPLEMENTATION_PHASES.md`, `docs/DATABASE_SCHEMA.md` | ||
|
|
||
| --- | ||
|
|
||
| ## Phase 1: Project Setup ✅ | ||
| **Completed**: 2025-11-08 | **Checkpoint**: 20bf287 | ||
| **Summary**: Cloned project, configured new D1 database (a1d231c7-b7e7-4e7a-aa0e-78a56c2e123a), updated wrangler.jsonc and drizzle.config.ts, applied initial migrations, verified dev environment works. | ||
|
|
||
| ## Phase 2: Database Schema ✅ | ||
| **Completed**: 2025-11-08 | ||
| **Summary**: Created Drizzle schemas for contacts (with tags junction table) and deals. Generated and applied migration 0001_fantastic_captain_flint.sql. Verified all 4 tables created in D1 (contacts, contact_tags, contacts_to_tags, deals) with proper foreign keys, defaults, and data types. | ||
|
|
||
| **Key Files Created**: | ||
| - `src/modules/contacts/schemas/contact.schema.ts` (contacts, contactTags, contactsToTags tables + Zod schemas) | ||
| - `src/modules/deals/models/deal.enum.ts` (DealStage enum) | ||
| - `src/modules/deals/schemas/deal.schema.ts` (deals table + Zod schemas) | ||
| - `src/db/schema.ts` (updated exports) | ||
| - `src/drizzle/0001_fantastic_captain_flint.sql` (migration) | ||
|
|
||
| ## Phase 3: Contacts Module ✅ | ||
| **Completed**: 2025-11-08 | **Checkpoint**: b34adb7 | ||
| **Summary**: Implemented complete contacts CRUD with search, tags, and ownership verification. Built 5 server actions (create, get, update, delete, tag management), 3 UI components (form, card, delete dialog), and 3 pages (list, new, edit). Added Contacts navigation link. Build successful with no errors. | ||
|
|
||
| **Key Features**: | ||
| - Search by name/email/company (LIKE queries, case-insensitive) | ||
| - Tag system with many-to-many relationship | ||
| - Ownership verification on update/delete | ||
| - Form validation (at least one name, email format) | ||
| - Responsive grid layout | ||
|
|
||
| ## Phase 4: Deals Module ✅ | ||
| **Completed**: 2025-11-08 | **Checkpoint**: a0bc3e3 | ||
| **Summary**: Implemented complete deals/pipeline management with Kanban board. Built 4 server actions (create, get with JOIN, update, delete), 3 UI components (form with contact dropdown, card with currency formatting, delete dialog), and 3 pages (pipeline board, new, edit). Added Deals navigation link. Build successful with no errors. | ||
|
|
||
| **Key Features**: | ||
| - Pipeline Kanban board with 6 stage columns (responsive grid) | ||
| - Link deals to contacts via dropdown (optional) | ||
| - Currency formatting (AUD/USD/EUR/GBP with Intl.NumberFormat) | ||
| - Expected close date (HTML date input) | ||
| - Pipeline value calculation (excludes closed deals) | ||
| - Stage-specific color badges | ||
| - Ownership verification | ||
|
|
||
| ## Phase 5: Dashboard Integration ✅ | ||
| **Completed**: 2025-11-08 | **Checkpoint**: 3950032 | ||
| **Summary**: Transformed dashboard from TodoApp to CRM-centric command center with live metrics and quick actions. Created metrics action with 6 SQL queries, 2 reusable components (StatCard, QuickActionCard), redesigned dashboard page, and updated navigation title. | ||
|
|
||
| **Key Features**: | ||
| - 6 CRM metrics: total contacts, new contacts this month, active deals, pipeline value, deals won this month, win rate | ||
| - Responsive 3-column grid (1/2/3 columns on mobile/tablet/desktop) | ||
| - Quick action cards: New Contact, New Deal, View Pipeline | ||
| - Currency formatting (AUD) and percentage formatting | ||
| - Semantic color usage throughout (no raw Tailwind colors) | ||
| - Graceful error handling (returns zero values on failure) | ||
|
|
||
| **Key Files Created**: | ||
| - `src/modules/dashboard/actions/get-dashboard-metrics.action.ts` (6 SQL queries with Drizzle ORM) | ||
| - `src/modules/dashboard/components/stat-card.tsx` (reusable metric card with icon/value/trend) | ||
| - `src/modules/dashboard/components/quick-action-card.tsx` (action link card with hover effects) | ||
|
|
||
| **Key Files Modified**: | ||
| - `src/modules/dashboard/dashboard.page.tsx` (complete redesign for CRM) | ||
| - `src/components/navigation.tsx` (changed title from "TodoApp" to "CRM") | ||
|
|
||
| ## Phase 6: Testing & Documentation ✅ | ||
| **Completed**: 2025-11-08 | **Checkpoint**: df75e37 | ||
| **Summary**: Created comprehensive testing and documentation suite. Added seed script with realistic data (10 contacts, 5 tags, 5 deals), complete testing checklist (TESTING.md), verified DATABASE_SCHEMA.md accuracy, and updated README.md with CRM features section. | ||
|
|
||
| **Key Deliverables**: | ||
| - Seed script: `src/lib/seed.ts` with 10 contacts, 5 tags, 5 deals across all pipeline stages | ||
| - Testing guide: `docs/TESTING.md` with 60+ manual test cases covering all features | ||
| - Database docs: `docs/DATABASE_SCHEMA.md` verified and accurate | ||
| - README update: Added comprehensive CRM features section with module structure | ||
| - Package.json: Added `db:seed` script command | ||
| - Build: ✅ Successful, all pages compile | ||
|
|
||
| **Testing Coverage**: | ||
| - Contacts: Create, search, edit, delete, tags (10 test cases) | ||
| - Deals: Create, pipeline board, edit, delete, currency/dates (8 test cases) | ||
| - Dashboard: Metrics accuracy, quick actions (6 test cases) | ||
| - Security: Auth, ownership, data isolation (3 test cases) | ||
| - UI/UX: Forms, responsive, console errors (5 test cases) | ||
| - Edge cases: Data integrity, formatting, empty states (8 test cases) | ||
|
|
||
| **Documentation Complete**: | ||
| - Implementation phases guide | ||
| - Database schema with ERD and query patterns | ||
| - Testing checklist with manual test procedures | ||
| - README with CRM features overview and module structure | ||
|
|
||
| --- | ||
|
|
||
| ## Post-Launch Bug Fixes | ||
|
|
||
| ### Bug Fix: Radix UI Select Empty Value (2025-11-08) | ||
| **Issue**: Deal form crashed when opening contact dropdown due to empty string value in SelectItem | ||
| **Root Cause**: Radix UI Select doesn't support empty string values | ||
| **Fix**: Replaced `value=""` with sentinel value `"__none__"` and updated onChange logic | ||
| **File**: `src/modules/deals/components/deal-form.tsx` (lines 133, 136, 144) | ||
| **Status**: ✅ Fixed and tested |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add language specification to fenced code block.
Fenced code blocks should declare a language for proper syntax highlighting. The module structure block at line 687 should specify a language or use a plain text representation.
Apply this diff to add language specification:
Alternatively, use triple backticks with a language identifier if this represents a file tree:
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)
687-687: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents