Spaces:
Sleeping
Sleeping
Commit History
-
feat(essentials): add vendor notes and activity endpoints with DB tables
c3e89d6
-
fix(analytics): create tables via migration + cross-db compatible SQLβ
Two root causes for INTERNAL_SERVER_ERROR on analytics routes: 1. No Laravel migration for analytics tables β the DDL was a raw SQL file meant for DBA application, so php artisan migrate never created the tables. Add 2026_07_13_000001_create_analytics_tables.php covering all six tables: analytics_visitors, analytics_sessions, analytics_events, analytics_funnel_progress, analytics_daily_page_views, analytics_daily_funnels. Each CREATE is guarded with Schema::hasTable so it's safe to re-run. 2. IF(cond, a, b) is MySQL-only β crashes SQLite (HF runtime). Replace all IF() calls in AnalyticsAdminRepository with ANSI CASE WHEN. Also use CAST(... AS REAL) for float division and Schema::hasTable guards on every public method so empty tables return zero-value shapes instead of 500s during the initial period before any events are recorded. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>6e5304d -
fix(migration): skip backfill join when advisory_request_id column absentβ
real_estate_recommendations.advisory_request_id may not exist on schemas that haven't run an earlier migration. Guard the entire LEFT JOIN backfill block behind Schema::hasColumn so the migration degrades to a safe schema- only change rather than crashing the container on startup. Fixes: SQLSTATE[HY000] General error: 1 no such column: r.advisory_request_id Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>3136cab -
fix(migration): guard r.project_id/listing_id selects against missing columnsβ
real_estate_recommendations may not have project_id or listing_id on older schemas. The backfill query now checks Schema::hasColumn before adding those fields to the SELECT list and guards the row property reads accordingly. Fixes: SQLSTATE[HY000] General error: 1 no such column: r.project_id Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>19f115d -
chore(merge): integrate origin/main + resolve analytics route conflictsβ
Merged 72 upstream commits (real-estate workflows, RBAC, identity services, Care Cover admin, emergency care, seeder expansion) into the analytics branch. Conflict resolutions: - routes/api.php: kept upstream service imports and routes; re-applied analytics ingestion route (POST /analytics/events) and admin query routes (GET /admin/analytics/acquisition|conversion) from the analytics commit - database/seeders/DatabaseSeeder.php: accepted upstream full seeder (inline Care + Real Estate + workflow seed logic), which supersedes the simplified call-based seeder in the analytics commit Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>cbc60cd
-
Backfill legacy advisory source linkage
a15f7b6 -
Link advisory requests to partner project listings
6e141a7 -
Seed real-estate workflow records for recommendations pipeline
5d8b07f -
Add idempotent real-estate workflow seed SQL for recommendations pipeline
9fdd8ac
-
seed: add Henbon and Optiven as permanent production partners with 64 projects + imagesβ
- Henbon Company Limited (info@henbon.co, +254716516900) β 5 projects - Optiven Group (info@optiven.co.ke, +254790300300) β 59 projects (16 active + 43 past) - Seeds cover images from optiven.co.ke for all projects that have published images - Uses title+partner_id uniqueness check so seeder is safe to re-run Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>f44d8d9 -
seed: run real-estate seeds even without identity tables
393ffbc -
seed: add idempotent real-estate partner test cohort
af01b64 -
real-estate: implement partner bridge persistence and lifecycle gates
43c0e11
-
feat(care): Peter b104020 β expand Care lifecycle, 17 new routes, migrationβ
- Add CareConfirmationService, CareCoverageCycleService, CareDocumentService, CareEligibilityService, CarePremiumService, CareRefundPolicy, CareReviewService - Update CareEnrollmentService (acceptTerms, calculatePremium, activate, defer, reject, requestClarification, renew, confirmation, queue, premiumStatus) - Migration: care_coverage_cycles, care_people, care_premium_calculations, care_confirmation_of_cover, care claim design tables, file_links care columns, CARE_ANNUAL_PREMIUM / CARE_ADDITIONAL_SPOUSE / CARE_ADDITIONAL_CHILD fee types - Add 17 new routes: GET /care/status, GET /care/admin/queue, all lifecycle endpoints per care-portal-integration.md - PaymentService: inject CareRefundPolicy, block Care premium refunds - FileLinkRepository / FileService: support care_enrollment_id + care_person_idbdec7a7
-
feat(api): deploy connect and essentials endpoints to HF space
3bdbcea -
feat(real-estate): add migration for all 18 real estate tables + REAL_ESTATE_MANAGE permissionβ
Creates the complete real estate schema that was missing from the HF deploy. Tables: real_estate_partners, opportunities, deals, deal_stage_history, due_diligence_tasks, closing_checklists, advisory_requests, recommendations, introductions, invoices, vetting_checklist_items, vetting_records, partner_agreements, benefits, watchlist_entries, risk_records, reviews, partner_documents. Also seeds REAL_ESTATE_MANAGE permission on SUPER_ADMIN role. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>efc7027 -
fix(hf): guard payment_fee_types id-column seed against code-pk schemaβ
Migration 000007 creates payment_fee_types with code as the primary key (no id column). Migration 000013 later tries to query ->value('id') on that table, which throws SQLSTATE no such column: id in SQLite. This caused php artisan migrate --force to exit non-zero, set -e killed start.sh before php-fpm/nginx started, and the HF space stayed in Starting state forever. Fix: add Schema::hasColumn('payment_fee_types','id') guard so the updateOrInsert block in 000013 only runs when this migration created the table itself (id-pk schema). Safe because 000007 already seeds CARE_ADMIN_FEE and CARE_PREMIUM via insertOrIgnore. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>89f74cd -
fix(seed): remove duplicate James enrollment2; add Sofia+David lifecycle dataβ
- Seeder now cleans up enrollment2 (SUBMITTED duplicate for James Wanjiku) on every run so the same member no longer appears twice in the list - Adds seedExtendedStageData call: Sofia Oduya (SUBMITTED) + David Mwangi (SUBMITTED) with payments, beneficiaries, and extra claims/certificates across all status stages for full lifecycle testing - Adds migration 000013 to create product_requests/payments/fee_types tables required by the Care Cover seeder on the HF SQLite instance - AuthenticateAccessToken: fall through to real JWT auth when a valid Bearer token is present in bypass mode (staging safety improvement) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>8d9fa4b
-
feat(seed): add sample Care Cover data for UI testingβ
Seeds a complete test scenario for James Wanjiku (member MDN-2026-00042): Enrollments - COV-2026 Enrollment 1 β ACTIVE, Jul 2026βJun 2027 coverage, 2 beneficiaries (spouse + child), both payments PAID, certificate COC-2026-00042-A ISSUED - COV-2026 Enrollment 2 β PENDING_REVIEW, 1 beneficiary (child), CARE_ADMIN_FEE + CARE_PREMIUM both PENDING Claims - CLM-2026-00001 β SUBMITTED, tier1, KES 150,000 (7 days old) - CLM-2026-00002 β APPROVED, tier2, KES 300,000 (30 days old) All fixed UUIDs so the block is idempotent; skipped if enrollment1 already exists. Member user james.wanjiku.test@mydiasporanexus.com is created alongside the existing admin.test account. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>70ac066 -
fix(hf): create skeleton membership/payments tables for SQLite stagingβ
The Care Cover admin list/detail queries INNER JOIN against memberships, applications, payments, file_links, and stored_files β tables that only exist on production MariaDB via raw SQL import, not from any migration. On HF SQLite every /admin/care/cover/* endpoint 500s with 'no such table'. Adds migration 000012 to create minimal skeleton versions of each table with the exact columns the cover admin queries reference. All blocks are Schema::hasTable guarded so this is a no-op on production MariaDB. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>0923bb3 -
fix(hf): create auth tables + seed admin user for SQLite stagingβ
Three fixes for the fresh-SQLite startup failure on HuggingFace: 1. Migration 000011 β creates user_sessions, login_events, and audit_events tables that exist on production MariaDB via raw SQL import but were absent from the HF SQLite instance, causing 500 on any login attempt. 2. DatabaseSeeder β creates admin.test@mydiasporanexus.com with ACTIVE status if absent, then grants SUPER_ADMIN to all users. The Docker image is rebuilt from scratch on every push so the SQLite file is always wiped; the seeder re-creates the test account idempotently on each startup. 3. AuthenticateAccessToken β AUTH_BYPASS now always returns next() even when the users table is empty, using a synthetic 'staging-bypass' actor rather than falling through to the JWT 401 path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>30d67d5 -
fix(seed): grant SUPER_ADMIN to all existing users on HF staging
cbaf4aa -
feat(auth): implement AUTH_BYPASS + seed CARE_COVER permissions and admin user
e7550e0 -
fix(db): create payment_fee_types table before seeding in migration 000007
c2d541d -
feat(care-cover): add Care Cover admin module + emergency fix routesβ
Backend: - app/Domain/Care/Cover/: 5 new service/repository classes for care_cover_periods, care_claims, care_claim_documents, care_cover_certificates and associated payment admin - routes/api.php: 17 new admin routes under /admin/care/cover/* (enrollments, claims, documents, certificates, payments) + 5 emergency care fixes (cases/{id}/disburse alias, campaigns/{id}/close, campaigns/{id}/disburse, fund/balance, campaigns/{id}/contributions/manual) Migrations: - 000007: seed CARE_ADMIN_FEE and CARE_PREMIUM payment_fee_types - 000008: create care_cover_periods, care_claims, care_claim_documents, care_cover_certificates tables - 000009: seed care_cover_periods enrollment windows All JOINs use production schema columns (applications.first_name/ last_name for names, payments.amount decimal, payments.gateway_reference).ba15404 -
Remove faker-dependent user factory from production seeder
0913f9b -
Fix UserFactory faker call for seeding runtime
631baee -
Guard permission seed migration when RBAC tables are absent
d96d90a -
Add missing RBAC base tables for sqlite startup
d72952c -
fix(care): enforce beneficiary gate on emergency cases + webhook + schemaβ
Three fixes in one commit: 1. Webhook bug: handleGatewayWebhook($data) passed one array where the method signature expects (string $gatewayReference, string $outcome, array $extra) β destructured correctly. 2. Missing schema: add migrations for care_enrollments and care_beneficiaries (no migration existed for these peter-branch tables). Also add affected_beneficiary_id, amount_requested_minor, and currency columns missing from care_emergency_cases. 3. Beneficiary gate on POST /care/cases: member must have an ACTIVE Care enrollment, and affected_beneficiary_id must resolve to a beneficiary on that enrollment. Submission is rejected (422) if the party is not on the member's own enrollment. Adds CARE_NO_ACTIVE_ENROLLMENT (403) and CARE_BENEFICIARY_NOT_ON_ENROLLMENT (422) error codes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>ed49310 -
feat(backend): replace backend with peter branch + Emergency Care integrationβ
Full overwrite of mdn-backend-main with the ISP peter branch (Laravel 12, PHP 8.3, clean domain architecture). Key changes: - New domain structure: Applications, Care, Communications, Config, Contracts, Files, Identity, Investments, Memberships, Payments, Products, RealEstate - MembershipPolicy with RBAC canAccess/canManage - CareEnrollmentService with DRAFTβSUBMITTEDβACTIVE state machine - PaymentService wired to PaymentGatewayRegistry (STRIPE, KCB_BUNI, MANUAL_TEST) - ProductRequestService + ProductEntitlementService for care/investment gating - Emergency Care module preserved and integrated on top of new domain base - Emergency Care migrations renumbered to 2026_07_07 to avoid timestamp conflict - All Emergency Care routes added to new api.php (client + admin + webhook) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>6773345
-
fix: sync all API changes to new schema β review notes, care campaigns, investment guardβ
- ApplicationService: wire application_review_notes table into reviewApplicationDetail and addReviewNote; fix Calendly config keys to services.calendly.* - InvestmentService: guard enrollment approval behind active membership check - api.php: fix /admin/care/campaigns selecting non-existent ec.member_name column; add users/memberships/applications JOINs and resolve member_name in PHP - Add migration 2026_07_06_000001_create_application_review_notes_table Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>58d56a4
-
fix(care): make contributor_member_id nullable β unblocks manual contributionsβ
Manual contributions have no contributor_member_id (cash/bank/mobile money recorded by admin). The original schema defined the column as NOT NULL, causing an integrity constraint violation on every manual contribution submit. New migration recreates the table for SQLite (HuggingFace staging) and uses ALTER COLUMN for MySQL (production). Also corrects the original create migration for clean installs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>44e720d -
fix(care): seed CARE_EMERGENCY permissions + show real names for anonymous contributionsβ
Migration seeds SYSTEM_ADMIN_ACCESS, CARE_EMERGENCY_{VIEW,REVIEW,APPROVE,DISBURSE} permissions and grants them to SUPER_ADMIN β fixes 403 on all care admin routes including manual contribution recording. AdminUserSeeder now grants all existing permissions to SUPER_ADMIN on every run so fresh installs work without a separate migration step. Frontend: contributionDisplayName() now shows contributor_name (resolved by backend) before checking display_mode, so admin view always shows real names even for contributions submitted as anonymous by members. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>19f2959
-
feat(care): manual disbursement with pool carry-forward + silent pool-funded approvalβ
- New care_disbursements table (migration) tracking each payout with amount_minor, funded_from (campaign|pool), reference, and notes - DisbursementRepository: create, list per case, poolBalance() computed as total SUCCEEDED contributions minus all disbursements - CareTransitioner: pool-funded approval path (no campaign, no email blast); disburse() method advances campaign to DISBURSED if linked - New routes: GET /admin/care/fund/balance, POST /admin/care/cases/{id}/disburse - Case detail response now includes disbursements[] and pool_balance_minor - Frontend: ActionDef extended with requiresAmount/amountLabel/amountHelp; ActionGroup renders a number input and passes amountMinor to onRun - Approve action split into "Approve & launch campaign" (community path) and "Approve from pool" (silent, no community alert) - Disburse action is now case-level with manual USD amount entry - New Disbursements section in case detail showing pool balance + history Co-Authored-By: Claude Sonneβ¦c806e49 -
feat(care): link emergency cases to member name and numberβ
Backend: LEFT JOIN memberships + applications on case list/detail routes so each case carries member_name, member_number, and member_email. Search now includes name and member number as search terms. Seeder: create real users, applications, and memberships for the 6 test members so the JOIN resolves correctly on HuggingFace. Frontend: list card shows member name + member number badge under title; detail header shows member identity chips below status badge. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>de2aadd -
feat(care): add CareEmergencySeeder with realistic test dataβ
Seeds 6 emergency cases across all statuses (SUBMITTED, UNDER_REVIEW, ON_HOLD, APPROVED x2, REJECTED), 2 campaigns (ACTIVE + DISBURSEMENT_PENDING), 13 contributions with named/anonymous ledger mix, and notification dispatch records. Runs on SQLite/HuggingFace only β never on production MySQL. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>e3f8d03 -
feat(care): Emergency Case & Community Contribution lifecycleβ
- 5 new tables via Schema builder migration (SQLite + MySQL compatible) - CareTransitioner: sole writer for case/campaign/contribution status - Atomic approval: CaseβAPPROVED + CampaignβPUBLISHED + community email in one transaction - ON_HOLDβAPPROVED blocked; SoD guard on disbursement - idempotent webhook handler on gateway_reference - EmergencyCarePolicy: CARE_EMERGENCY_REVIEW/APPROVE/DISBURSE/VIEW gates - 12 admin + member API routes under /admin/care and /care - MembershipPermissionSeeder + RBAC routes from previous session - deploy-cpanel.yml runs MembershipPermissionSeeder on every deploy Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>2076a9c
-
fix(real-estate): add file_name column to real_estate_partner_documentsβ
The upload route sets file_name from the uploaded file''s original name, but the migration for this table did not include the column -- inserts would fail with an unknown column error. Adds the nullable file_name column so uploaded filenames are stored and shown in the Documents tab. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>886ff5b -
fix(real-estate): seed Optiven at pending_review/draft; rename Hide to Unpublishβ
Optiven is now seeded at pending_review + draft so the full vetting workflow (request docs -> under_review -> verify -> publish) can be walked through on a fresh seed. Henbon stays verified+published as the demo-ready reference. Renames the Hide partner action to Unpublish with a confirmation dialog. The backend already sets publicVisibility=hidden; only the label changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1fb121a -
feat(real-estate-seed): add project images and partner cover imagesβ
Adds seedProjectImages() and seedPartnerCovers() to RealEstatePartnersSeeder. Both run unconditionally (separate per-entity idempotency) so they populate images even when the partner rows were already seeded in a prior run. - 6 projects Γ 2-3 images each (14 total) via picsum.photos seed URLs - Cover images for Henbon and Optiven (1600Γ600) - project_images + media_assets rows, is_featured=1 for the cover of each project Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>4a4e7db -
fix(connect-seeder): tolerate partial schemas β per-table upsert guardβ
Replaces the all-or-nothing hasRequiredTables() check with a per-table guard inside upsert(), so missing tables are skipped individually rather than aborting the entire seed. Syncs monorepo with the fix applied directly on HF (commits 8c7121f, 984aa58). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>2213a42 -
feat(real-estate): seed Henbon and Optiven partners with full coverage; clean debug routeβ
Adds RealEstatePartnersSeeder with 100% field coverage for both partners (core data, contacts, 3 projects each, listings, payment plans, amenities, locations, social links). Registered in DatabaseSeeder so HF startup auto-seeds on next deploy. Also removes the temp /debug/connect-bootstrap route and the /debug/investment-workbench route from api.php. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>12453fc -
Make Connect seeder tolerant of partial schemas
984aa58 -
Auto-seed Connect fixtures on sqlite runtimes
8c7121f -
Add Connect mock seeding for HF runtime
b005490 -
Add Connect mock seeding for HF runtime
db627e1 -
feat(investment): Investment Club Leaderboard β backend + admin UIβ
Backend: - Migration: inv_leaderboard_snapshots table (draft/published snapshots, per-period per-enrollment unique constraint, rank_overall/rank_in_tier, pseudo_name stable across regenerations, portfolio value, consistency score) - InvestmentLeaderboardRepository: upsert, publish, clientRows, adminRows, adminSummary, memberRank, existingPseudoName β admin joins legacy members table via DB::raw pattern (works on both SQLite and MySQL) - InvestmentLeaderboardService: snapshot generation from live unit-ledger Γ NAV, deterministic pseudo-name generation (crc32 hash + tier prefix + animal), status labels (Top Investor / High Performer / Consistent Contributor / Rising Member), ranking formula (portfolio DESC β contribution DESC β enrollment_date ASC), excludes frozen/suspended enrollments; auto-generate + publish on first request - API routes: GET /api/v1/investment/leaderboard (client, pseudo names only), GET /api/v1/admin/investment/leaderboard, POST .../generate, POST β¦ab611a8
-
fix(care-seeder): drop city/email/phone from generic_membership_applications insertβ
The winning migration creates this table without those columns. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>9029651 -
feat(care): add CareModuleSeeder with full mock data for all admin endpointsβ
Seeds all care tables on HF Space SQLite: members, applications, enrollments, payments, documents, claims, cover periods, certificates, notifications, audit logs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>3c97951