feat: vet directory, GDPR/CCPA, insurance integration, and Elasticsearch search#427
Merged
Merged
Conversation
|
@miss-yusrah Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Description
closes #321
closes #324
closes #325
closes #327
Summary
Implements four features for PetChain: a searchable vet directory with real-time messaging, GDPR/CCPA compliance tools, pet insurance integration, and full-text Elasticsearch
search.
Changes
Task 1 — Vet Directory with Search & In-App Messaging
Backend
backend/migrations/006_vet_directory_messaging.sql—vet_profilestable with PostGISGEOGRAPHYcolumn + spatial index;messagestable with conversation indexbackend/services/messagingService.ts— WebSocket server (/ws/messages), in-memory message store, real-time delivery to online recipientsbackend/server/routes/vets.ts—GET /api/vets(filter by radius/specialty/availability using Haversine),GET /api/vets/:id,POST /api/vets,GET/POST /api/vets/messages/:vetIdwith paginationFrontend
src/services/vetService.ts— typed API wrappers for vet search and messagingsrc/screens/VetDirectoryScreen.tsx— three-screen flow: directory list → vet profile → real-time chat UITask 2 — GDPR/CCPA Compliance
Backend
backend/migrations/007_gdpr_ccpa.sql—consent_logs(timestamped audit trail) anddata_deletion_requeststablesbackend/services/dataExportService.ts—exportUserData(stripspasswordHash),eraseUserData(hard-deletes all PII),logConsent/getConsentHistorybackend/server/routes/privacy.ts—GET /export(JSON download),GET/POST /consent,GET /consent/history,DELETE /eraseFrontend
src/screens/PrivacyDashboardScreen.tsx— per-category consent toggles (necessary locked), save preferences, export data, right-to-erasure with confirmation dialogTask 3 — Pet Insurance Integration
Backend
backend/migrations/008_insurance.sql—insurance_policiesandinsurance_claimstablesbackend/services/insuranceService.ts— mock OAuth code exchange for Trupanion/Nationwide, claim submission with async status progression, claim historybackend/server/routes/insurance.ts—GET /policies,POST /connect,GET/POST /claims,GET /claims/:idFrontend
src/services/claimsService.ts— typed API wrapperssrc/screens/InsuranceScreen.tsx— tabbed policies/claims view, connect provider flow, claim submission form with policy selectorTask 4 — Elasticsearch Full-Text Search
Backend
backend/services/searchService.ts—@elastic/elasticsearchclient,search()with fuzzy multi-match, field filters, result highlighting,indexDocument/deleteDocumentfor CDC sync,ensureIndicesfor bootstrapbackend/server/routes/search.ts—GET /api/search?q=&index=&from=&size=&<field>=<value>with 100-result capFrontend
src/screens/SearchScreen.tsx— search-as-you-type with 350 ms debounce, highlight display, result count, clear buttonWiring
backend/server/app.ts— registered/vets,/privacy,/insurance,/searchroutessrc/navigation/types.ts— addedVetDirectory,PrivacyDashboard,Insurance,SearchtoPetStackParamListTesting
/ws/messages?userId=<id>provider: "mock"with any code string)ensureIndices()then index sample docs and verify fuzzy search returns highlighted hitsDELETE /api/privacy/erase