Skip to content

Add entity relationship diagram for Social Work provider data model#1660

Merged
isabeleliassen merged 6 commits into
csg-org:mainfrom
InspiringApps:doc/erd-update
Jun 18, 2026
Merged

Add entity relationship diagram for Social Work provider data model#1660
isabeleliassen merged 6 commits into
csg-org:mainfrom
InspiringApps:doc/erd-update

Conversation

@landonshumway-ia

@landonshumway-ia landonshumway-ia commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

This adds requested documentation to outline the provider/license data model for Social work to illustrate the relationships between providers and the various record types associated with them.

This also removes outdated diagrams for pipeline design and consolidates the pipeline architecture docs at the top level of the project, since all compact share a similar CI/CD pipeline design and deployment process.

Testing List

  • yarn test:unit:all should run without errors or warnings
  • yarn serve should run without errors or warnings
  • yarn build should run without errors or warnings
  • For API configuration changes: CDK tests added/updated in backend/compact-connect/tests/unit/test_api.py
  • For API endpoint changes: OpenAPI spec updated to show latest endpoint configuration run compact-connect/bin/download_oas30.py
  • Code review

Closes #1643

Summary by CodeRabbit

  • Documentation
    • Updated CI/CD pipeline documentation links and clarified the multi-compact pipeline setup.
    • Refreshed backend design guidance on SSN handling, audit logging, access restrictions, and OAuth scope examples.
    • Added a new social work provider data ER diagram for the DynamoDB design.
    • Removed outdated backend-specific pipeline architecture design documents now superseded by the shared reference guide.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@landonshumway-ia, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 34 minutes and 29 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1cae4ca8-b429-44ae-ac2b-ff469d37e7dd

📥 Commits

Reviewing files that changed from the base of the PR and between e1df65a and 6108c6f.

⛔ Files ignored due to path filters (3)
  • backend/compact-connect/lambdas/nodejs/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
  • backend/cosmetology-app/lambdas/nodejs/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
  • backend/social-work-app/lambdas/nodejs/yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (5)
  • backend/compact-connect/lambdas/nodejs/package.json
  • backend/compact-connect/lambdas/python/purchases/requirements-dev.in
  • backend/compact-connect/lambdas/python/purchases/requirements-dev.txt
  • backend/cosmetology-app/lambdas/nodejs/package.json
  • backend/social-work-app/lambdas/nodejs/package.json
📝 Walkthrough

Walkthrough

Consolidates per-app pipeline-architecture.md files from cosmetology and social-work design directories into a single shared docs/pipeline-architecture.md, updating all README links. Simultaneously updates SSN access control policy, OAuth2 scope examples, DynamoDB data model documentation (tiered sort keys, new licenseUploadDateGSI), license/privilege/adverse action semantics, and adds a new provider data model ERD for the social work app.

Changes

Pipeline Architecture Doc Consolidation

Layer / File(s) Summary
Shared pipeline-architecture.md: multi-compact and SynthSubstitute updates
docs/pipeline-architecture.md
Removes the PDF link, documents per-compact backend pipelines for JCC/Cosmetology/Social Work, expands tag patterns, adds a numbered SynthSubstituteStage/SynthSubstituteStack explanation, updates implementation references, and changes the bootstrapping link to per-compact READMEs.
Update CI/CD pipeline links in all backend app READMEs
backend/compact-connect/docs/design/README.md, backend/cosmetology-app/docs/design/README.md, backend/social-work-app/docs/design/README.md
Updates the CI/CD pipeline documentation link in all three backend app README files to point to the consolidated shared pipeline-architecture.md path.

Security Controls and Data Model Design Updates

Layer / File(s) Summary
SSN access controls and OAuth2 scope examples
backend/social-work-app/docs/design/README.md, backend/cosmetology-app/docs/design/README.md
Both app READMEs remove api_query_role from SSN IAM role lists, add audit logging sub-bullets, clarify readPrivate excludes full SSN, and replace jurisdiction/compact-wide OAuth2 scope code fences with admin/write/readPrivate/readGeneral patterns.
DynamoDB data model, GSI, and status calculation docs
backend/social-work-app/docs/design/README.md, backend/cosmetology-app/docs/design/README.md
Social work README receives a major rewrite of the Data Model section with explicit pk/sk patterns, record-type definitions, and tiered update sort-key structure. Cosmetology README applies the same tiered sort-key scheme. Both apps add licenseUploadDateGSI documentation; social work adds load-time status calculation details.
New social work provider data model ERD
backend/social-work-app/docs/design/provider-data-model-erd.mmd
Adds a Mermaid ERD file defining entities (PROVIDER, LICENSE, LICENSE_UPDATE, PROVIDER_UPDATE, ADVERSE_ACTION, INVESTIGATION, PRIVILEGE) with field lists and relationship cardinalities.
License scopes, privilege generation, and adverse action semantics
backend/social-work-app/docs/design/README.md
Adds a licenseScope cross-reference to the Data Model section, specifies privilege status derivation from adverse actions and investigations via licenseScope targeting, expands adverse action docs to distinguish privilege-specific vs license-based encumbrance and its runtime effect, and makes a minor formatting adjustment to the OpenSearch document-model paragraph.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Poem

🐇 Hop hop! The pipeline docs found a home,
No more copies scattered, lost, alone.
The SSN rules now clearly state —
Four digits only, audit the gate!
ERD diagrams bloom like spring clover,
This rabbit's doc spring-cleaning is over! 🌸

Suggested reviewers

  • jlkravitz
  • jusdino
  • isabeleliassen
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the primary change: adding an entity relationship diagram for the Social Work provider data model, which aligns with the main addition in the changeset.
Description check ✅ Passed The description covers the main changes (data model documentation and pipeline consolidation), includes the required testing checklist, but lacks a structured format matching the template with separate Requirements, Description, and Testing sections.
Linked Issues check ✅ Passed The PR addresses issue #1643 by adding the entity relationship diagram and updating design documentation for the Social Work component, satisfying the core coding-related objectives of providing clear data model visualization and design documentation.
Out of Scope Changes check ✅ Passed The pipeline-architecture documentation consolidation is closely related to the primary objective, improving overall documentation organization alongside the main Social Work data model additions without introducing unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@backend/social-work-app/docs/design/provider-data-model-erd.mmd`:
- Around line 121-137: The INVESTIGATION entity definition in the ERD is missing
the licenseTypeAbbreviation field, which is referenced in the sort-key pattern
on line 122 and used by the accessor code in provider_record_util.py. Add the
licenseTypeAbbreviation field to the INVESTIGATION entity field list as a string
type, positioning it logically with the other license-related fields
(licenseType and licenseScope) to ensure the data model accurately reflects all
fields used in the sort key and application code.

In `@backend/social-work-app/docs/design/README.md`:
- Around line 371-372: The document contains a broken internal link at lines
371-372 that references the anchor
`#license-identity-jurisdiction--licensetype--licensescope`, but this section
header does not exist in the document. The referenced content about license
identity and scope composition is located in lines 238-245 under the "Record
Types in Detail" section without its own dedicated header. Either create a new
section header titled "License Identity" (or similar) in the Data Model section
and place it near the existing content about license identity to match the
anchor being referenced, or update the link at lines 371-372 to point to the
correct existing section anchor where this content is actually documented.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0fdde07f-0568-48ad-99a0-9060bfc14875

📥 Commits

Reviewing files that changed from the base of the PR and between 04e1723 and d168427.

⛔ Files ignored due to path filters (6)
  • backend/compact-connect/docs/design/pipeline-architecture.pdf is excluded by !**/*.pdf
  • backend/cosmetology-app/docs/design/advanced-provider-search.pdf is excluded by !**/*.pdf
  • backend/cosmetology-app/docs/design/pipeline-architecture.pdf is excluded by !**/*.pdf
  • backend/social-work-app/docs/design/advanced-provider-search.pdf is excluded by !**/*.pdf
  • backend/social-work-app/docs/design/pipeline-architecture.pdf is excluded by !**/*.pdf
  • backend/social-work-app/docs/design/provider-data-model-erd.png is excluded by !**/*.png
📒 Files selected for processing (7)
  • backend/compact-connect/docs/design/README.md
  • backend/cosmetology-app/docs/design/README.md
  • backend/cosmetology-app/docs/design/pipeline-architecture.md
  • backend/social-work-app/docs/design/README.md
  • backend/social-work-app/docs/design/pipeline-architecture.md
  • backend/social-work-app/docs/design/provider-data-model-erd.mmd
  • docs/pipeline-architecture.md
💤 Files with no reviewable changes (2)
  • backend/social-work-app/docs/design/pipeline-architecture.md
  • backend/cosmetology-app/docs/design/pipeline-architecture.md

Comment thread backend/social-work-app/docs/design/provider-data-model-erd.mmd
Comment thread backend/social-work-app/docs/design/README.md Outdated

@ChiefStief ChiefStief left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, the second code rabbit comment looks valid though

@landonshumway-ia

Copy link
Copy Markdown
Collaborator Author

@jlkravitz This is ready for your review. Thanks

@jlkravitz jlkravitz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. Thanks for cleaning up and consolidating the docs. The mermaid diagram is very useful and synthesizes the data model nicely. Great work!

@isabeleliassen Good to merge.

@isabeleliassen isabeleliassen merged commit 6195c02 into csg-org:main Jun 18, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Social Work] - Update Design Documentation and Entity Relationship Diagram

4 participants