generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 21
Labels
Complexity: MediumIssue is clearly defined and documentation is provided. Solution has room for interpretation.Issue is clearly defined and documentation is provided. Solution has room for interpretation.Role: Back EndRole: Front Endp-Feature: Host dashboardsize: 2ptCan be done in 7-12 hoursCan be done in 7-12 hours
Description
🧩 Overview
Implement a contact information feature allowing hosts to submit their preferred contact method and phone number. Also create a page to view the stored contact information. This feature enables better communication by capturing and displaying host contact details reliably.
More Info
Implement the backend API endpoints, database schema, and frontend pages for storing and retrieving host contact information. This includes the form submission, data persistence with migrations, and display of stored data, including creation timestamps.
📐 Scope of Work
- Create
contact_infotable with columns for preferred contact method, phone number, and created timestamp - Implement backend POST API to submit contact info
- Implement backend GET API to fetch contact info by ID
- Ensure backend models and schemas align with migration
- Build frontend form page to submit contact info
- Build frontend display page to show contact info, including formatted creation date
- Add frontend routing for the new display page
- Handle API errors gracefully in the frontend
🔧 Engineering Tasks
Steps to Implement:
- Write Alembic migration to create
contact_infotable - Define SQLAlchemy
ContactInfomodel to match table schema - Create Pydantic schemas for contact info request and response
- Implement POST
/contact-infoAPI route to save data - Implement GET
/contact-info/{contact_id}API route to retrieve data - Build React display component to fetch and show contact info by ID
- Add React router entry for display page
/host/contact-info/:contactId
✅ Acceptance Criteria
- Database schema created with
preferred_method,phone_number, andcreated_atcolumns - POST
/contact-infoaccepts contact info and stores it correctly - GET
/contact-info/{contact_id}returns stored contact info with correct fields - Frontend form submits data and redirects to display page
- Frontend display page fetches contact info by ID and shows preferred method, phone number, and formatted creation date
- API and frontend handle errors gracefully (e.g., 404 if contact not found)
🔄 Dependencies
- Dependency: Database must be migrated with the new
contact_infotable before backend APIs can work - Dependency: Frontend routing and API base URL configuration to match backend routes
📦 Technical Notes
- Backend uses FastAPI with SQLAlchemy ORM and Alembic migrations
- Frontend uses React, React Router, Axios for API calls, and MUI for UI components
- ContactInfo model uses
idas primary key; usecontact_idas path param to identify records - Ensure consistent naming: use
preferred_methodin both DB schema and model - API endpoints are under
/api/host-dashboard/contact-info
🧪 Testing Strategy
- Manual testing by filling out the contact info form and checking the browser console logs (
console.log('Received:', response.data);) to ensure the correct data is received from the backend. - Verify that the displayed contact info matches the submitted data.
- Confirm redirects and route handling on frontend
🚩 Risks / Considerations
- Risk: Date formatting might vary by user locale — confirm consistent display or normalize timezones
- Consideration: API error handling should provide clear messages for missing records
- Risk: If migration and model schema are out of sync, data errors could occur
- Dependency: Database must be migrated before deploying backend code that uses new tables
🧵 Related Issues
Action Items
- Complete all steps in the Engineering Tasks section above
📎 Resources
- N/A
Attachments/Screenshots (If Applicable):
- N/A
Metadata
Metadata
Assignees
Labels
Complexity: MediumIssue is clearly defined and documentation is provided. Solution has room for interpretation.Issue is clearly defined and documentation is provided. Solution has room for interpretation.Role: Back EndRole: Front Endp-Feature: Host dashboardsize: 2ptCan be done in 7-12 hoursCan be done in 7-12 hours
Type
Projects
Status
In Progress