feat: add MerchantApplicationModal and integrate into MerchantSection#35
feat: add MerchantApplicationModal and integrate into MerchantSection#35Obiajulu-gif wants to merge 4 commits intoPACTO-LAT:developfrom
Conversation
|
@Obiajulu-gif is attempting to deploy a commit to the Trustless Work Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughAdds a merchant application modal and integrates it into the MerchantSection; new merchant inserts set Changes
Sequence DiagramsequenceDiagram
participant User as User
participant Modal as MerchantApplicationModal
participant Form as Form (react-hook-form)
participant Hook as useUpsertMerchantProfile
participant Adapter as merchant.supabase
participant DB as Database
User->>Modal: Click "Apply to Become a Merchant"
Modal->>User: Open dialog
User->>Form: Fill biography and submit
Form->>Form: Validate bio (zod: min length)
Form->>Modal: Submit payload (includes derived display_name/slug)
Modal->>Hook: Trigger mutation with payload
Hook->>Adapter: upsertMyMerchantProfile(payload)
Adapter->>Adapter: Ensure insertPayload includes verification_status: 'pending'
Adapter->>DB: Insert merchant record
DB-->>Adapter: Insert success
Adapter-->>Hook: Return result
Hook-->>Modal: Mutation success
Modal->>User: Show success toast, close and reset modal
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…sactionCard components
|
@aguilar1x review the code and remember to allocate compliments point... Thank you |
…iable handling - Introduced functions to retrieve and validate Supabase environment variables. - Implemented a caching mechanism for the Supabase client to avoid redundant initializations. - Used a Proxy to dynamically access Supabase client methods and properties. - Updated server client creation to utilize the new environment variable handling. - Added error handling for missing environment variables with a descriptive message.
|
@aguilar1x review my code |
…or improved proxy handling
Close #29
This pull request introduces a merchant application workflow to the user profile section, allowing users to apply to become merchants and view the status of their application. The main changes include a new modal for merchant applications, updates to the profile UI to handle application states, and backend adjustments to set the initial verification status.
Merchant Application Workflow Implementation:
MerchantApplicationModalcomponent that provides a form for users to apply as merchants, including validation, submission handling, and user feedback.MerchantSectioncomponent to:Backend Integration:
verification_statusof'pending'.Summary by CodeRabbit
New Features
Documentation
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.