WIP durable state models#112
Draft
nonprofittechy wants to merge 18 commits into
Draft
Conversation
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.
Summary
Adds a durable filing-draft foundation for the LITEFile workflow while preserving the existing session-backed behavior for incremental migration and review.
Key changes:
FilingDraftfor one filing workflow instance, including jurisdiction, status, current step, case classification, existing-case identifiers, selected payment account, extracted guesses, optional services, extra case data, and submission response.FilingDocumentfor lead/supporting uploaded documents, including S3/public URL metadata, file metadata, Tyler filing/document/component codes, courtesy copy email, and document order.FilingPartyfor people or organizations associated with a draft, including role, party type, contact fields, name fields, address fields, and metadata.services/drafts.py.services/current_drafts.pyto resolve the current browser's draft while validating authenticated ownership, active status, and jurisdiction. The session stores only the current durable draft ID.services/legacy_draft_bridge.pyas a temporary compatibility adapter that mirrors legacycase_dataandupload_datasession blobs into durable draft/document/party records.POST /jurisdiction/<jurisdiction>/drafts/and a current-draft API atGET /api/draft/.get_workflow_step_choices()so the model'scurrent_stepchoices stay derived from the workflow registry.docs/filing-draft-data-model.mddescribing the model boundaries, compatibility bridge, rollout expectations, and follow-up migration sequence.Behavior and compatibility notes
extra_case_data, documentmetadata, and partymetadataare intentionally kept as temporary escape hatches while the UI moves from arbitrary session blobs to typed draft updates.Migration and deploy notes
efileapp previously had no migrations even though existing environments may already have theUserProfiletable.0001_initial.pytherefore baselines the existingUserProfilemodel.0002_filing_drafts.pycreates the newFilingDraft,FilingDocument, andFilingPartytables, indexes, and ordering constraints.migrate --noinput --fake-initialso existing deployments can fake the baseline migration while fresh databases still apply both migrations normally.Intended follow-up migration sequence
FilingDraft,FilingDocument, andFilingParty.legacy_draft_bridge.py, arbitrary session-merge APIs, and browser storage persistence.Open question
@BryceStevenWilley this is still a rough starting point for discussing migration to a clearer data model and draft system. Do we need backwards compatibility with the existing draft/session system, or are we free to fully discard it? If we can discard it, a fair amount of the compatibility bridge and fallback code here can be removed.