Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
332 commits
Select commit Hold shift + click to select a range
8df6f07
UPdate vercel config
appleseedcarrot May 10, 2025
6e735cc
Merge pull request #23 from sokanacollectiveCRM/deploy
appleseedcarrot May 10, 2025
07768a9
passing around
keigocodes May 10, 2025
23c8b60
working backend yay
keigocodes May 10, 2025
e351b51
Fixed for deployment and also added contract logic
appleseedcarrot May 12, 2025
4aad85e
Set server health to root directory /
appleseedcarrot May 13, 2025
8fba7c8
Fixed server.ts:
appleseedcarrot May 13, 2025
f8aa802
this might fix it?
appleseedcarrot May 13, 2025
ec5e92d
udpate vercel.json
appleseedcarrot May 13, 2025
938303a
fix src and dest
appleseedcarrot May 13, 2025
1cdda05
remove trailing slash
appleseedcarrot May 13, 2025
fd5839a
remove module
appleseedcarrot May 13, 2025
5f5d8b1
test
appleseedcarrot May 13, 2025
0bb7c12
fixed imports for server.ts
appleseedcarrot May 13, 2025
0d8e7d8
Fixed all imports to be relative
appleseedcarrot May 13, 2025
4f997a4
Fixed missing user repository
appleseedcarrot May 13, 2025
37a866c
fix supabase import
appleseedcarrot May 13, 2025
c413a26
Fixed more imports
appleseedcarrot May 13, 2025
d8da074
Versioning untracked files
appleseedcarrot May 13, 2025
e4019f2
Fixed types import
appleseedcarrot May 13, 2025
bdc5769
Fixed domains/errors
appleseedcarrot May 13, 2025
3dc0dfb
allow frontend for cors
appleseedcarrot May 13, 2025
99b059d
Fixed cors
appleseedcarrot May 13, 2025
15cae5f
api: connect quickbooks to app and connection status
jbony2888 May 14, 2025
374dcf3
api: added quickbooks disconnected
jbony2888 May 14, 2025
c94c26a
Added template viewing and logic
appleseedcarrot May 15, 2025
4192bf6
api: updated fetch clients
jbony2888 May 17, 2025
a2b1241
functionality for getting doula's clients by their id
keigocodes May 18, 2025
95100d9
finished add new hours backend
keigocodes May 18, 2025
302d554
fixed typo
keigocodes May 18, 2025
bb43005
api: detect if client is a customer
jbony2888 May 19, 2025
5e70703
Merge branch 'main' of https://github.com/sokanacollectiveCRM/backend…
danantony06 May 20, 2025
e4a3141
Fixed error message and added templates console log
appleseedcarrot May 20, 2025
9f0ee4f
implement invoicing
jbony2888 May 20, 2025
166ada2
Merge branch 'hours' into deploy
appleseedcarrot May 20, 2025
6798baf
Update signup so that you need to be approved before signing up
appleseedcarrot May 20, 2025
1cf66e8
fixed accessing wrong user_id
keigocodes May 22, 2025
e50de39
Backend merging
appleseedcarrot May 23, 2025
b94fcaa
Merge pull request #26 from sokanacollectiveCRM/deploy
appleseedcarrot May 23, 2025
64a7ca1
Merge branch 'main' into hours
appleseedcarrot May 23, 2025
0de0fc4
Merge pull request #25 from sokanacollectiveCRM/hours
appleseedcarrot May 23, 2025
8687ce3
Fixed for vercel imports
appleseedcarrot May 23, 2025
429d6e3
Merge pull request #27 from sokanacollectiveCRM/hours
sokanacollectiveCRM May 23, 2025
68bd535
Merge branch 'main' of https://github.com/sokanacollectiveCRM/backend…
danantony06 May 23, 2025
a645d94
Merge branch 'main' of https://github.com/sokanacollectiveCRM/backend…
danantony06 May 24, 2025
d84f946
Merged Teams page
danantony06 May 24, 2025
edef8be
Merge pull request #28 from sokanacollectiveCRM/DemographicData
appleseedcarrot May 24, 2025
f11080b
uploading note along with hours entry working
keigocodes May 24, 2025
7f39a7a
Merge branch 'hours' of https://github.com/sokanacollectiveCRM/backen…
keigocodes May 24, 2025
7ebf92f
getting hours also gets note data
keigocodes May 24, 2025
e541165
fixed bugs with not calling maptoclient with data passed in
keigocodes May 26, 2025
8191704
implemented getting hours for admins (getting all hours)
keigocodes May 27, 2025
fcff947
Merge branch 'main' into hours
keigocodes May 27, 2025
94147a3
fixed bugs with table accesses
keigocodes May 27, 2025
0560b78
removing/commenting out console.logs
keigocodes May 31, 2025
d476680
profile + email updates
danantony06 May 31, 2025
82adbce
Merge pull request #29 from sokanacollectiveCRM/hours
sokanacollectiveCRM May 31, 2025
6548ccf
Merge pull request #30 from sokanacollectiveCRM/ProfileRework
appleseedcarrot May 31, 2025
e062208
fixed request form
danantony06 May 31, 2025
ccaacca
fixed request form
danantony06 May 31, 2025
0215638
Merge pull request #31 from sokanacollectiveCRM/ProfileRework
appleseedcarrot May 31, 2025
2150b2c
Final commit
appleseedcarrot Jun 2, 2025
c7c1201
Merge pull request #32 from sokanacollectiveCRM/hours
appleseedcarrot Jun 2, 2025
ee9ff0a
commit create customer
jbony2888 Jun 3, 2025
30a7093
fix invoice issue
jbony2888 Jun 4, 2025
2ea40dc
fixed invoiceing customers
jbony2888 Jun 4, 2025
97020a7
check qb token status and refresh status
jbony2888 Jun 4, 2025
033a54c
Add invoice email test setup
jbony2888 Jun 5, 2025
62f536a
fixed refresh tokens and set up test email
jbony2888 Jun 5, 2025
41ee7e5
Merge branch 'main' into send-invoice-attachment-dev
jbony2888 Jun 5, 2025
ddae986
regenerate lock file
jbony2888 Jun 5, 2025
688af83
fixed imports
jbony2888 Jun 5, 2025
c20d54a
simulate payments
jbony2888 Jun 11, 2025
8358ad5
implemented paymebts with stripe
jbony2888 Jun 24, 2025
f57fa92
fixed vercel error
jbony2888 Jun 24, 2025
366812b
Merge pull request #35 from sokanacollectiveCRM/send-invoice-attachme…
jbony2888 Jun 24, 2025
f0e121d
commit
jbony2888 Jul 14, 2025
dba89b4
updated backend for new form
jbony2888 Jul 14, 2025
0c658a6
update email
jbony2888 Jul 14, 2025
d4ac970
Merge pull request #36 from sokanacollectiveCRM/request-form-update
sokanacollectiveCRM Jul 14, 2025
ded45d1
updated email
jbony2888 Jul 14, 2025
032aca1
Merge pull request #37 from sokanacollectiveCRM/request-form-update
sokanacollectiveCRM Jul 14, 2025
93cea61
Add controllers, routes, services, and SQL scripts
jbony2888 Jul 16, 2025
fbdf78e
git commit -m "feat: setup ESLint and enhance request form endpoint
jbony2888 Jul 19, 2025
70445c9
Add code coverage reports and assets
jbony2888 Jul 21, 2025
2fcaad8
Merge pull request #38 from sokanacollectiveCRM/form-request-and-clie…
jbony2888 Jul 21, 2025
46fdec6
Update notification email address
jbony2888 Jul 21, 2025
7da3521
Add client deletion endpoint and logic
jbony2888 Jul 21, 2025
4ac0d2e
Merge pull request #39 from sokanacollectiveCRM/form-request-and-clie…
jbony2888 Jul 21, 2025
df27daa
contract generation and prefilled values
jbony2888 Sep 13, 2025
74082fd
fixed coordinates
jbony2888 Sep 14, 2025
05ec983
generate contract flow
jbony2888 Sep 16, 2025
bd4b8a5
completed contarct to payments
jbony2888 Sep 16, 2025
eb49518
Update .gitignore to exclude sensitive files and remove .env.backup f…
jbony2888 Sep 16, 2025
11bad31
Update Stripe payment routes
jbony2888 Sep 16, 2025
142eddd
commit
jbony2888 Sep 16, 2025
cd577a1
type errors fixed
jbony2888 Sep 16, 2025
a030618
fix folder issue
jbony2888 Sep 16, 2025
99d7de5
write in memory
jbony2888 Sep 16, 2025
b330e5d
contracts updated
jbony2888 Oct 2, 2025
72ec1f7
commit
jbony2888 Oct 2, 2025
86f0af7
Merge branch 'updated-conbtract-backend' into main-dev-october-2-2025
jbony2888 Oct 2, 2025
b63c386
merge complete
jbony2888 Oct 2, 2025
110422d
initial commit
jbony2888 Oct 13, 2025
31da5e2
updated backend
jbony2888 Oct 14, 2025
cec8bad
feat(assignments): add doula assignment endpoints; admin doulas list;…
jbony2888 Oct 16, 2025
b2bab46
commit
jbony2888 Oct 16, 2025
a003d33
commit
jbony2888 Nov 10, 2025
9ce2b48
add link to profile in admin
jbony2888 Nov 10, 2025
d1dc584
Merge pull request #40 from sokanacollectiveCRM/email-notification-up…
jbony2888 Nov 10, 2025
9cfd821
api: dashboard stats endpoint
jbony2888 Nov 13, 2025
724d447
dashboard stats api
jbony2888 Nov 13, 2025
d276b05
Merge pull request #41 from sokanacollectiveCRM/dashboard-stats
jbony2888 Nov 13, 2025
3250286
quickbooks fix
jbony2888 Nov 26, 2025
e7e48b4
Merge pull request #42 from sokanacollectiveCRM/quickbooks-connection…
jbony2888 Nov 26, 2025
c30eb86
quickbooks fix
jbony2888 Nov 26, 2025
495a2a5
Merge pull request #43 from sokanacollectiveCRM/quickbooks-connection…
sokanacollectiveCRM Nov 26, 2025
a28c1b6
initial commit
jbony2888 Dec 1, 2025
36d328e
commit
jbony2888 Dec 3, 2025
d4318d4
Merge pull request #44 from sokanacollectiveCRM/qbo-integration
jbony2888 Dec 8, 2025
eed6dfe
Merge branch 'main' of https://github.com/sokanacollectiveCRM/backend
jbony2888 Dec 8, 2025
2eebd7f
doula client profile
jbony2888 Dec 9, 2025
7710ec6
Merge pull request #45 from sokanacollectiveCRM/doula-client-profile
jbony2888 Dec 9, 2025
12af75d
fix type error and removed secret
jbony2888 Dec 9, 2025
4250282
Merge pull request #46 from sokanacollectiveCRM/doula-client-profile
jbony2888 Dec 9, 2025
4ad8adb
doula test results update
jbony2888 Dec 27, 2025
cf7e67f
Merge pull request #47 from sokanacollectiveCRM/doula-client-profile
sokanacollectiveCRM Dec 27, 2025
6c9c98c
implemented client view
jbony2888 Jan 5, 2026
a8f2fc4
Merge pull request #48 from sokanacollectiveCRM/client-portal-view
jbony2888 Jan 5, 2026
356dbc6
fixed portal status
jbony2888 Jan 5, 2026
c1c96ef
Merge pull request #49 from sokanacollectiveCRM/client-portal-view
jbony2888 Jan 5, 2026
a317ace
client invite fix
jbony2888 Jan 14, 2026
283d5a9
Merge pull request #50 from sokanacollectiveCRM/client-fix-invite
sokanacollectiveCRM Jan 14, 2026
5648bb1
commit
jbony2888 Jan 14, 2026
af35b0f
Merge branch 'main' of https://github.com/sokanacollectiveCRM/backend
jbony2888 Jan 14, 2026
c1b6a88
fixed portal invite url
jbony2888 Jan 16, 2026
701ced4
added health endpoint
jbony2888 Feb 1, 2026
f52f100
Add Cloud Run entrypoint; remove duplicate server start
jbony2888 Feb 1, 2026
b44531f
Cloud Run: route generated files to /tmp via runtimePaths
jbony2888 Feb 1, 2026
74422e3
commit for cloud run
jbony2888 Feb 2, 2026
735fbb1
aded yaml. file
jbony2888 Feb 2, 2026
c0b1870
fix cloud run issue
jbony2888 Feb 2, 2026
da1ea2f
cloud fix
jbony2888 Feb 2, 2026
9b40443
cloud run fix
jbony2888 Feb 2, 2026
c658427
cloud run fix
jbony2888 Feb 2, 2026
e458179
cloud run
jbony2888 Feb 2, 2026
20cc533
commit
jbony2888 Feb 4, 2026
8910d95
migration for nonphi
jbony2888 Feb 5, 2026
848740c
phi broker
jbony2888 Feb 6, 2026
0f8643c
updated query for phi broker
jbony2888 Feb 6, 2026
e1dac84
Merge pull request #51 from sokanacollectiveCRM/phi-compliance-refactor
sokanacollectiveCRM Feb 6, 2026
6a2297e
fix type issues
jbony2888 Feb 6, 2026
7bec4fb
Merge pull request #52 from sokanacollectiveCRM/phi-compliance-refactor
sokanacollectiveCRM Feb 6, 2026
5f2112e
fix type issues
jbony2888 Feb 6, 2026
ee8f696
completed contarct to payments
jbony2888 Sep 16, 2025
d3e7cf5
Merge branch 'phi-compliance-refactor' of https://github.com/sokanaco…
jbony2888 Feb 6, 2026
edb9053
Create package-lock.json
jbony2888 Feb 6, 2026
78528f5
Merge pull request #53 from sokanacollectiveCRM/phi-compliance-refactor
sokanacollectiveCRM Feb 6, 2026
b4df683
phi broker update
jbony2888 Feb 9, 2026
9cf6b75
Merge pull request #54 from sokanacollectiveCRM/phi-compliance-refactor
sokanacollectiveCRM Feb 9, 2026
197ddc9
backend adjustments
jbony2888 Feb 9, 2026
e7925ea
Merge pull request #55 from sokanacollectiveCRM/phi-compliance-refactor
sokanacollectiveCRM Feb 9, 2026
41662aa
fix build issue
jbony2888 Feb 9, 2026
a96bdc6
Merge pull request #56 from sokanacollectiveCRM/phi-compliance-refactor
sokanacollectiveCRM Feb 9, 2026
2fad68e
fix build isue
jbony2888 Feb 9, 2026
0ab8777
Merge pull request #57 from sokanacollectiveCRM/phi-compliance-refactor
sokanacollectiveCRM Feb 9, 2026
c3d84b0
updated backend and phi broker
jbony2888 Feb 9, 2026
cf6e212
Merge pull request #58 from sokanacollectiveCRM/phi-compliance-refactor
sokanacollectiveCRM Feb 9, 2026
3d08f42
fix client controller
jbony2888 Feb 9, 2026
d7a706d
Merge pull request #59 from sokanacollectiveCRM/phi-compliance-refactor
sokanacollectiveCRM Feb 9, 2026
6f3d46e
updated backwnd
jbony2888 Feb 9, 2026
e9c73a5
phi strip
jbony2888 Feb 9, 2026
255168a
Merge pull request #60 from sokanacollectiveCRM/phi-compliance-refactor
sokanacollectiveCRM Feb 9, 2026
a9cbcd8
updated backend
jbony2888 Feb 9, 2026
f13ecd7
Merge pull request #61 from sokanacollectiveCRM/phi-compliance-refactor
sokanacollectiveCRM Feb 9, 2026
fa99895
fixed auth
jbony2888 Feb 9, 2026
bab2fb4
Merge pull request #62 from sokanacollectiveCRM/phi-compliance-refactor
sokanacollectiveCRM Feb 9, 2026
c38dafd
fixed backend
jbony2888 Feb 9, 2026
22073be
Merge pull request #63 from sokanacollectiveCRM/phi-compliance-refactor
sokanacollectiveCRM Feb 9, 2026
27071a2
fixed phi
jbony2888 Feb 9, 2026
6115c6c
Merge pull request #64 from sokanacollectiveCRM/phi-compliance-refactor
sokanacollectiveCRM Feb 9, 2026
8708722
split database fix
jbony2888 Feb 10, 2026
351f5b6
Merge pull request #65 from sokanacollectiveCRM/phi-compliance-refactor
sokanacollectiveCRM Feb 10, 2026
c0737d6
updated backend to connect to google cloud sql
jbony2888 Feb 12, 2026
49f5410
Merge pull request #66 from sokanacollectiveCRM/phi-compliance-refactor
sokanacollectiveCRM Feb 12, 2026
dd91b68
updated backend
jbony2888 Feb 21, 2026
9c54410
implemented primary and backup roles for client doula asisgnments
jbony2888 Mar 1, 2026
7e6c582
removed strip phi
jbony2888 Mar 1, 2026
a54edca
added doula services
jbony2888 Mar 2, 2026
782824c
implemented cloud sql doula profile parity and workflow rules
jbony2888 Mar 3, 2026
209b3df
fixed doula and added address field
jbony2888 Mar 9, 2026
4246281
added required doula documents
jbony2888 Mar 10, 2026
3d513b1
feat: auto-generate unique client number on intake form submission
jbony2888 Mar 10, 2026
f338d65
fix: doula documents ID mismatch + profile picture + admin completene…
jbony2888 Mar 11, 2026
e8abc2f
fix: client controller typing, doulasService variable, phi endpoint test
jbony2888 Mar 11, 2026
f6649d8
Save all current workspace changes
jbony2888 Mar 24, 2026
464e076
Add client billing and insurance card document APIs
jbony2888 Mar 24, 2026
67b1b96
quickbooks payment methods
jbony2888 Apr 23, 2026
68f1da5
sync intake billing fields
jbony2888 Apr 23, 2026
e35190b
Implement comprehensive doula platform enhancements and client lifecy…
jbony2888 May 4, 2026
3585cb2
fix(client-documents): service-role storage uploads and MIME allowlist
jbony2888 May 4, 2026
a6117cc
Intake: persist CRM fields on phi_clients; referral and billing parity
jbony2888 May 14, 2026
3aaebc7
fix(intake): align request submission validation with CRM contract
jbony2888 May 24, 2026
392cb13
feat(intake): persist CRM home step fields on phi_clients
jbony2888 May 24, 2026
e4dceb9
fix(team): align admin UNION columns in listTeamMembers
jbony2888 May 26, 2026
717ba21
Add billing Cloud SQL endpoints and reminder emails
jbony2888 Jun 11, 2026
3bc9fe8
Add doula availability enforcement and scheduling support
jbony2888 Jun 16, 2026
0c4aeb6
feat(portal): add onboarding readiness eligibility flow
jbony2888 Jul 8, 2026
e9bfe2f
Add portal readiness coverage and auto invoice on contract signature
jbony2888 Jul 8, 2026
2a0c71c
Fix QuickBooks verification invoice send flow
jbony2888 Jul 15, 2026
4ecec41
Fix QuickBooks fetch runtime in production
jbony2888 Jul 15, 2026
56f9088
Validate QuickBooks customer links before skipping sync
jbony2888 Jul 15, 2026
7bf984a
Harden Cloud SQL payment schedules
jbony2888 Jul 17, 2026
c5c418d
Align client billing installment workflow
jbony2888 Jul 17, 2026
c679a6b
Normalize card status and enrich installment invoices
jbony2888 Jul 17, 2026
c9d1810
Reconcile card status from QuickBooks
jbony2888 Jul 17, 2026
84374ed
Fix QuickBooks customer sync status
jbony2888 Jul 17, 2026
3ab43dd
Harden QuickBooks token refresh
jbony2888 Jul 17, 2026
d65ef03
Secure backend production logging
jbony2888 Jul 18, 2026
6ffe1ab
Merge pull request #68 from sokanacollectiveCRM/agent/sec-01-backend-…
jbony2888 Jul 18, 2026
06ace04
fix(cloud-sql): honor SSL disable on Cloud Run unix sockets
jbony2888 Aug 10, 2026
e12202a
Merge pull request #72 from sokanacollectiveCRM/fix/cloud-run-cutover
sokanacollectiveCRM Aug 10, 2026
3e20526
Expose contract templates from Supabase storage for the Contracts page.
jbony2888 Aug 10, 2026
fd14f81
Merge pull request #73 from sokanacollectiveCRM/fix/contracts-templat…
sokanacollectiveCRM Aug 10, 2026
b890c4f
Harden P0 security for Cloud Run and require tests on main.
jbony2888 Aug 14, 2026
e25e458
Fix CI lint by checking changed files and formatting this PR.
jbony2888 Aug 14, 2026
1ed965c
Merge pull request #74 from sokanacollectiveCRM/security/p0-pilot-har…
sokanacollectiveCRM Aug 14, 2026
535c41b
Add partitioned session cookies so Chrome can keep cross-site login.
jbony2888 Aug 17, 2026
c49a623
Merge pull request #75 from sokanacollectiveCRM/fix/mobile-session-ve…
sokanacollectiveCRM Aug 17, 2026
74ec1bc
Fix client profile saves for home type and PHI broker fallback.
jbony2888 Aug 19, 2026
3474334
Apply Prettier formatting to client profile save changes.
jbony2888 Aug 19, 2026
b72a06c
Merge pull request #76 from sokanacollectiveCRM/fix/client-profile-ho…
sokanacollectiveCRM Aug 19, 2026
734966a
Merge full intake profile fields on client GET/PUT (#77)
sokanacollectiveCRM Aug 20, 2026
8fe9dab
Restrict client CSV export to admins and fix payment-methods mount.
jbony2888 Aug 20, 2026
84ef20d
Fix Prettier formatting so CI lint gate passes.
jbony2888 Aug 20, 2026
8184a07
Merge pull request #78 from sokanacollectiveCRM/fix/hipaa13a-csv-and-…
sokanacollectiveCRM Aug 20, 2026
cc60fd9
Enforce birth-outcomes assignment and retire legacy narrative field.
jbony2888 Aug 23, 2026
3d4d88e
Document INV-12 production deployment revisions.
jbony2888 Aug 23, 2026
a257de6
Fix Prettier formatting for INV-12 PR files.
jbony2888 Aug 23, 2026
539226a
Merge pull request #79 from sokanacollectiveCRM/fix/hipaa13a-csv-and-…
sokanacollectiveCRM Aug 23, 2026
2fb4470
Restrict service-hours writes to assigned doula or admin (HIPAA-13E).
jbony2888 Aug 23, 2026
66332ab
Merge pull request #80 from sokanacollectiveCRM/fix/hipaa-13e-service…
sokanacollectiveCRM Aug 23, 2026
043fff3
Minimize intake emails to client number + CRM link (HIPAA-13F) (#82)
sokanacollectiveCRM Aug 25, 2026
9888f70
Document HIPAA-13F production deploy verification and close INV-01. (…
sokanacollectiveCRM Aug 25, 2026
e2588e5
Minimize doula assignment emails (HIPAA-05) (#84)
sokanacollectiveCRM Aug 25, 2026
4cc9b53
Document HIPAA-05 production deploy verification and close assignment…
jbony2888 Aug 25, 2026
33c8294
Add Husky pre-commit hook mirroring CI lint checks.
jbony2888 Aug 25, 2026
0cf9088
Close INV-11: remove hardcoded SMTP credential and enforce env-only a…
jbony2888 Aug 25, 2026
072efc3
Document INV-11 commit hash in verification sign-off.
jbony2888 Aug 25, 2026
4679feb
Add PR reference to INV-11 verification sign-off.
jbony2888 Aug 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 31 additions & 0 deletions .cursor/handoffs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Cross-Repo Handoffs

Use this folder to hand work cleanly between frontend and backend.

## Folders

- `open/` -> active requests waiting for pickup
- `done/` -> completed requests with outcome notes

## Naming

Use:

- `YYYY-MM-DD-backend-<slug>.md` for frontend -> backend
- `YYYY-MM-DD-frontend-<slug>.md` for backend -> frontend

## Rule

Every handoff must include:
- clear direction
- exact requested changes
- acceptance criteria
- verification steps

## Backend Startup Requirement

Before any new backend implementation task:
- check `open/` for frontend-originated tasks
- communicate either:
- `open_handoff_tasks_found` + file names, or
- `no_open_handoff_tasks`
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Handoff: Cloud SQL doula profile parity for profile tab fields

## Metadata
- Direction: `frontend->backend`
- Priority: `P0`
- Requested By: `frontend`
- Date: `2026-03-02`
- Status: `closed`
- Related Links:
- `frontend-crm/src/features/doula-dashboard/components/ProfileTab.tsx`
- `frontend-crm/src/api/doulas/doulaService.ts`
- `backend/src/controllers/doulaController.ts`
- `backend/src/services/cloudSqlTeamService.ts`
- `backend/src/db/migrations/add_bio_to_doulas.sql`

## Why This Is Needed
- Doula profile save can fail with `User not found` when legacy `users` row is missing.
- Frontend profile form includes `bio` and address fields that should persist reliably.
- Current source split between Supabase `users` and Cloud SQL `public.doulas` causes drift.

## Current Behavior
- `PUT /api/doulas/profile` may fail for Cloud SQL-only doula identities in some environments.
- `public.doulas` supports `bio` in code, but migration rollout and parity checks are still required.
- Field ownership is partially ambiguous across Cloud SQL, Supabase `users`, and Supabase storage.

## Expected Behavior
- Authenticated doula can always load and update profile through `/api/doulas/profile`.
- `bio` persists in Cloud SQL.
- Remaining profile fields have a defined source of truth and are returned consistently.

## Requested Changes
- [x] Apply migrations in local environment:
- `src/db/migrations/add_bio_to_doulas.sql`
- `src/db/migrations/add_profile_fields_to_doulas.sql`
- [ ] Apply migrations in all target environments (staging/production rollout).
- [x] Ensure `/api/doulas/profile` update path supports Cloud SQL-only doula records.
- [x] Implement final field ownership:
- Cloud SQL `public.doulas`: `firstname/lastname` (or `full_name` mapping), `email`, `phone_number`, `bio`, `address`, `city`, `state`, `country`, `zip_code`, `account_status`
- Supabase storage: `profile_picture` file storage
- No `business` field support needed
- [x] Keep response shape compatible with frontend: `{ success, profile }`.

## API/Contract Notes
- Endpoint(s):
- `GET /api/doulas/profile`
- `PUT /api/doulas/profile`
- Request shape:
- Current frontend sends `UpdateProfileData` from `doulaService.ts`.
- Response shape:
- `profile` object with user-facing doula fields:
- required: `firstname`, `lastname`, `email`, `bio`, `address`, `city`, `state`, `country`, `zip_code`, `account_status`
- optional passthrough: `profile_picture` (from Supabase-linked source)
- excluded: `business`
- Backward compatibility:
- Do not break existing frontend parser expectations for `profile`.

## Data/Migration Notes
- Tables:
- `public.doulas`
- optional legacy: `public.users`
- Required migration:
- `yes` ->
- `src/db/migrations/add_bio_to_doulas.sql`
- `src/db/migrations/add_profile_fields_to_doulas.sql`
- `address TEXT`
- `city TEXT`
- `state TEXT`
- `country TEXT`
- `zip_code TEXT`
- `account_status TEXT NOT NULL DEFAULT 'approved'`

## Backend File Touchpoints
- `src/services/cloudSqlTeamService.ts`
- map/select/update added profile fields from `public.doulas`
- `src/controllers/doulaController.ts`
- ensure GET/PUT profile returns new field set with Cloud SQL-first behavior
- `src/db/migrations/add_profile_fields_to_doulas.sql`
- add missing columns for profile tab parity

## Acceptance Criteria
- [x] Doula can update `bio` without `User not found` error path in Cloud SQL-first profile update flow.
- [x] `GET /api/doulas/profile` returns `bio` in profile response.
- [x] Profile update succeeds for users present only in Cloud SQL `public.doulas`.
- [x] `address`, `city`, `state`, `country`, `zip_code`, `account_status` now exist in Cloud SQL and round-trip via updated GET/PUT profile flow.
- [x] `business` is not required by backend contract and is ignored safely if sent.
- [x] Contract remains compatible with existing frontend `ProfileTab` expectations (`{ success, profile }`).

## Verification Steps
- Backend:
- Run both migrations in Cloud SQL.
- Call `PUT /api/doulas/profile` with `bio`, `address`, `city`, `state`, `country`, `zip_code`, `account_status` and confirm 200.
- Call `GET /api/doulas/profile` and confirm persisted fields.
- Frontend:
- Update bio in profile tab and refresh page.
- Confirm persisted values display and no error toast appears.

## Implementation Notes
- Current frontend relies on `ProfileTab` + `updateDoulaProfile` and expects stable profile payload.
- Profile picture remains in Supabase storage; do not move binary/media storage into Cloud SQL.

## Completion Summary (2026-03-02)

- Added and applied local Cloud SQL migrations:
- `src/db/migrations/add_bio_to_doulas.sql`
- `src/db/migrations/add_profile_fields_to_doulas.sql`
- Updated Cloud SQL profile mapping and update behavior in:
- `backend/src/services/cloudSqlTeamService.ts`
- `backend/src/controllers/doulaController.ts`
- Verified local Cloud SQL `public.doulas` now includes:
- `bio`, `address`, `city`, `state`, `country`, `zip_code`, `account_status`.
- Remaining non-code rollout item:
- apply migrations in all target environments.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Backend handoff: Doula documents ID mismatch

## Status: closed

## Summary

There's an **ID mismatch**: documents are stored with the **Supabase auth user id**, but the admin view loads them using the **Cloud SQL doula id**. For some doulas (e.g. info@techluminateacademy.com), those IDs can differ, so the admin sees no documents.

## Proposed fix

When the admin document endpoint finds no documents by Cloud SQL doula id, it should:

1. Look up the doula's email in Cloud SQL
2. Find the Supabase auth user id for that email
3. Fetch documents by that auth user id and return them

## Implementation (completed)

- [x] Added `DoulaDocumentIdResolver` service to resolve Cloud SQL doula id → Supabase auth user id via email
- [x] Updated `getDoulaDocumentsAdmin`: try Cloud SQL id first; if no docs, fallback to auth user id by email
- [x] Updated `reviewDocument` and `getDocumentUrl`: use `isDocumentOwnedByDoula` for ownership check (handles ID mismatch)
- [x] Frontend: No changes required

## Optional quick check

In Supabase, run:

```sql
SELECT doula_id, file_name, document_type FROM doula_documents;
```

In Cloud SQL, run:

```sql
SELECT id, email FROM public.doulas WHERE email = 'info@techluminateacademy.com';
```

If the `doula_id` in `doula_documents` is different from `id` in `doulas`, that confirms the mismatch.
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Backend handoff: request intake & client referral fields (`referral_source_other`)

## Status: closed

## Completion summary (2026-05-11)

- **Intake** (`POST /requestService/requestSubmission` → `RequestFormService.newForm`): `referral_source` is required and must be one of the CRM enum values; `referral_source_other` is required (trimmed non-empty) when source is `Other`; otherwise stored as null. `referral_email` validated when non-empty. Shared rules in `src/constants/referralSource.ts` (`parseIntakeReferral`).
- **Persistence**: `phi_clients` INSERT extended with `referral_source`, `referral_name`, `referral_email`, `referral_source_other`. Migration `src/db/migrations/add_phi_clients_referral_intake_fields.sql` adds columns if missing.
- **Staff PATCH** (`updateClient`): `normalizeStaffReferralOperationalPatch` runs when any referral field is present; if `referral_source` is set to a non-`Other` value, **`referral_source_other` is cleared server-side** (`null`).
- **GET /clients/:id** (PHI merge): returns `referral_source_other` with other referral fields.
- **Types / entities**: `RequestFormData`, `RequestFormResponse`, `User`, `ClientDetailDTO`, `RequestForm` entity; `cloudSqlClientRepository` map + `updateClient` + `updateClientOperational` allowlists; `phiFields` `OPERATIONAL_UPDATE_COLUMNS` + `referralSourceOther` alias; `supabaseClientRepository` parity for shadow/legacy.
- **Tests**: `src/__tests__/requestEndpoint.test.ts` updated and expanded.
- **Docs**: `docs/CLOUD_SQL_SOKANA_PRIVATE_SCHEMA.md` updated.

---

## Direction (original)

`frontend` → `backend` (Sokana CRM frontend contract)

## Summary (original)

The public **request form** and **admin lead/client profile** were updated in the frontend. Align the API and persistence layer so the same fields validate, save, and return consistently.

---

## 1. `referral_source_other` (new)

### Behavior (match frontend)

- `referral_source` remains a **required** categorical value on intake (one of the known options, including **`Other`**).
- When `referral_source === "Other"`, **`referral_source_other`** is **required**: non-empty string after trim (free-text explanation of how the client heard about Sokana).
- When `referral_source !== "Other"`, **`referral_source_other`** should be **optional**; treat empty/null as “not provided” and **prefer clearing** any stored value if the client changes from `Other` to another option.

### Allowed `referral_source` values (must include `Other`)

`Google`, `Doula Match`, `Former client`, `Sokana Member`, `Social Media`, `Email Blast`, `Other`

### Endpoints to update

1. **Request submission** — `POST /requestService/requestSubmission` (`src/routes/requestRoute.ts`, `RequestFormService`, `RequestFormController`, `RequestFormRepository`).
2. **Client / lead read + update** — staff CRM (`GET`/`PATCH` client flows in `clientController`, `cloudSqlClientRepository`, `ClientDetailDTO`, `User` entity / serializers).

### Database

- Nullable columns on `public.phi_clients`: `referral_source`, `referral_name`, `referral_email`, `referral_source_other` (migration adds if missing).

---

## 4. Acceptance criteria (backend)

- [x] Request submission accepts and stores **`referral_source_other`** when `referral_source` is **`Other`**; rejects missing/blank **`referral_source_other`** in that case with a clear validation error.
- [x] Request submission accepts **`referral_source`** = **`Other`** as a valid enum/value.
- [x] Client/lead detail APIs return **`referral_source_other`** when set.
- [x] Staff updates can set or clear **`referral_source_other`**; changing **`referral_source`** away from **`Other`** clears **`referral_source_other`** server-side.
- [x] Migration + ORM/model/DTO updates completed; no silent drops of the new key in serializers.

---

## Completion checklist

- [x] Implementation merged
- [x] Tests green (`npm test -- --testPathPattern=requestEndpoint`)
- [x] Handoff moved to `closed/` with summary and status updated
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Handoff: HIPAA-13A Restrict bulk client CSV exports

## Metadata

- Direction: `compliance->backend`
- Priority: `P0`
- Requested By: HIPAA remediation (INV-02)
- Date: `2026-08-20`
- Status: `ready_for_verification`
- Related Links:
- `docs/HIPAA_13A_CLIENT_CSV_EXPORT_STATUS.md`
- `docs/HIPAA_TECHNICAL_PHI_INVENTORY.md` (INV-02)
- `docs/HIPAA_BOARD_TECHNICAL_STATUS.md`

## Why This Is Needed

`GET /clients/fetchCSV` allowed the `client` role and exported all families’
names, income, and address. Highest-clarity P0 authorization issue.

## Requested Changes

- [x] Remove `client` (and non-admin) role access — interim **admin-only**
- [x] Enforce server-side (route + use case)
- [x] Negative tests: client, doula, billing, unauthenticated
- [x] Log denied attempts without PHI
- [x] Stakeholder status of access + exported fields
- [ ] Production deploy confirmation
- [ ] Formal closure approval / reviewer sign-off

## Acceptance Criteria

- Non-admin roles receive 403; unauthenticated receives 401
- Admin still receives CSV
- Deny logs include role/userId/event only
- Stakeholder doc lists current export columns

## Completion Summary (2026-08-20)

Contained in code. Automated tests: `src/__tests__/clientCsvExportAuth.test.ts`
— **10/10 passed**. Stakeholder brief:
`docs/HIPAA_13A_CLIENT_CSV_EXPORT_STATUS.md`. Remaining: deploy + formal
closure.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Handoff: HIPAA-13F — Remove clinical information from intake emails

## Metadata

- Direction: `compliance->backend`
- Priority: `P0`
- Requested By: HIPAA board / INV-01
- Date: `2026-08-24`
- Status: `closed`
- Related Links:
- `docs/HIPAA_13F_INTAKE_EMAIL_STATUS.md`
- `docs/HIPAA_BOARD_TECHNICAL_STATUS.md` (INV-01)
- `docs/EMAIL_NOTIFICATION_SYSTEM.md`

## Why This Is Needed

Public intake emailed the full clinical + identity payload to ordinary staff
Gmail (INV-01) — direct PHI exposure.

## Requested Changes

- Remove clinical fields from intake emails
- Keep PHI out of subject, body, URLs, and logs
- Send staff to authenticated CRM instead
- Add tests proving clinical fields are absent
- Document approved notification template

## Acceptance Criteria

- [x] Staff notification contains client number + CRM link only
- [x] Clinical / identity intake fields absent from staff subject/body
- [x] Submitter confirmation has no name/clinical content in subject/body
- [x] Unit + endpoint tests cover absence of clinical payload
- [x] Approved template documented (`docs/HIPAA_13F_INTAKE_EMAIL_STATUS.md`)

## Completion Summary

Implemented minimal intake notification builders under
`src/features/intake/notifications/`, wired through `requestFormController`,
propagated `client_number` on the intake entity, and updated email/HIPAA docs.
Pending production deploy and formal verification sign-off.
Loading