Skip to content

Commit edb20d5

Browse files
[Unticketed] Automated Update to Database ERD Diagrams and OpenAPI Docs (#8938)
Automated update of ERD diagrams and OpenAPI specs. Co-authored-by: nava-platform-bot <platform-admins@navapbc.com>
1 parent 929c648 commit edb20d5

File tree

2 files changed

+325
-0
lines changed

2 files changed

+325
-0
lines changed

api/openapi.generated.yml

Lines changed: 325 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,48 @@ paths:
784784
$ref: '#/components/schemas/UserUpdateProfileRequest'
785785
security:
786786
- ApiJwtAuth: []
787+
/v1/workflows/{workflow_id}:
788+
get:
789+
parameters:
790+
- in: path
791+
name: workflow_id
792+
schema:
793+
type: string
794+
required: true
795+
responses:
796+
'200':
797+
content:
798+
application/json:
799+
schema:
800+
$ref: '#/components/schemas/WorkflowGetResponse'
801+
description: Successful response
802+
'401':
803+
content:
804+
application/json:
805+
schema:
806+
$ref: '#/components/schemas/ErrorResponse'
807+
description: Authentication error
808+
'404':
809+
content:
810+
application/json:
811+
schema:
812+
$ref: '#/components/schemas/ErrorResponse'
813+
description: Not found
814+
'403':
815+
content:
816+
application/json:
817+
schema:
818+
$ref: '#/components/schemas/ErrorResponse'
819+
description: Forbidden
820+
tags:
821+
- Workflow
822+
summary: Get Workflow Details
823+
description: Retrieve detailed information about a specific workflow including
824+
audit history, approvals, and approval configuration. Access is controlled
825+
by entity-based privileges (VIEW_OPPORTUNITY or VIEW_APPLICATION).
826+
security:
827+
- ApiJwtAuth: []
828+
- ApiUserKeyAuth: []
787829
/v1/users/{user_id}/agencies:
788830
post:
789831
parameters:
@@ -5858,6 +5900,289 @@ components:
58585900
type: integer
58595901
description: The HTTP status code
58605902
example: 200
5903+
WorkflowUser:
5904+
type: object
5905+
properties:
5906+
user_id:
5907+
type: string
5908+
format: uuid
5909+
description: The user's unique identifier
5910+
example: 123e4567-e89b-12d3-a456-426614174000
5911+
email:
5912+
type:
5913+
- string
5914+
- 'null'
5915+
description: The user's email address
5916+
example: user@example.com
5917+
first_name:
5918+
type:
5919+
- string
5920+
- 'null'
5921+
description: The user's first name
5922+
example: John
5923+
last_name:
5924+
type:
5925+
- string
5926+
- 'null'
5927+
description: The user's last name
5928+
example: Smith
5929+
WorkflowAuditEvent:
5930+
type: object
5931+
properties:
5932+
workflow_audit_id:
5933+
type: string
5934+
format: uuid
5935+
description: The audit event's unique identifier
5936+
example: 123e4567-e89b-12d3-a456-426614174000
5937+
acting_user:
5938+
description: The user who triggered the transition
5939+
type:
5940+
- object
5941+
$ref: '#/components/schemas/WorkflowUser'
5942+
transition_event:
5943+
type: string
5944+
description: The event that triggered the state transition
5945+
example: approve
5946+
source_state:
5947+
type: string
5948+
description: The state before the transition
5949+
example: pending_review
5950+
target_state:
5951+
type: string
5952+
description: The state after the transition
5953+
example: approved
5954+
event_id:
5955+
type: string
5956+
format: uuid
5957+
description: The workflow event that triggered this audit
5958+
example: 123e4567-e89b-12d3-a456-426614174000
5959+
audit_metadata:
5960+
type:
5961+
- object
5962+
- 'null'
5963+
description: Additional metadata about the audit event
5964+
example:
5965+
comment: Looks good
5966+
additionalProperties: {}
5967+
created_at:
5968+
type: string
5969+
format: date-time
5970+
description: When the audit event was created
5971+
WorkflowApproval:
5972+
type: object
5973+
properties:
5974+
workflow_approval_id:
5975+
type: string
5976+
format: uuid
5977+
description: The workflow approval's unique identifier
5978+
example: 123e4567-e89b-12d3-a456-426614174000
5979+
approving_user:
5980+
description: The user who provided the approval
5981+
type:
5982+
- object
5983+
$ref: '#/components/schemas/WorkflowUser'
5984+
event_id:
5985+
type: string
5986+
format: uuid
5987+
description: The workflow event that created this approval
5988+
example: 123e4567-e89b-12d3-a456-426614174000
5989+
is_still_valid:
5990+
type: boolean
5991+
description: Whether this approval is still valid or has been invalidated
5992+
example: true
5993+
comment:
5994+
type:
5995+
- string
5996+
- 'null'
5997+
description: Optional comment from the approver
5998+
example: Approved with conditions
5999+
approval_type:
6000+
description: The type of approval
6001+
example: !!python/object/apply:src.constants.lookup_constants.ApprovalType
6002+
- program_officer_approval
6003+
enum:
6004+
- initial_prototype_approval
6005+
- program_officer_approval
6006+
- budget_officer_approval
6007+
type:
6008+
- string
6009+
approval_response_type:
6010+
description: The response type of the approval
6011+
example: !!python/object/apply:src.constants.lookup_constants.ApprovalResponseType
6012+
- approved
6013+
enum:
6014+
- approved
6015+
- declined
6016+
- requires_modification
6017+
type:
6018+
- string
6019+
created_at:
6020+
type: string
6021+
format: date-time
6022+
description: When the approval was created
6023+
WorkflowApprovalConfigItem:
6024+
type: object
6025+
properties:
6026+
approval_type:
6027+
description: The type of approval required
6028+
example: !!python/object/apply:src.constants.lookup_constants.ApprovalType
6029+
- program_officer_approval
6030+
enum:
6031+
- initial_prototype_approval
6032+
- program_officer_approval
6033+
- budget_officer_approval
6034+
type:
6035+
- string
6036+
required_privileges:
6037+
type: array
6038+
description: List of privileges required to provide this approval
6039+
example:
6040+
- !!python/object/apply:src.constants.lookup_constants.Privilege
6041+
- program_officer_approval
6042+
items:
6043+
enum:
6044+
- manage_org_members
6045+
- manage_org_admin_members
6046+
- view_org_membership
6047+
- start_application
6048+
- list_application
6049+
- view_application
6050+
- modify_application
6051+
- submit_application
6052+
- update_form
6053+
- manage_agency_members
6054+
- get_submitted_applications
6055+
- legacy_agency_viewer
6056+
- legacy_agency_grant_retriever
6057+
- legacy_agency_assigner
6058+
- manage_internal_roles
6059+
- manage_competition
6060+
- read_test_user_token
6061+
- view_opportunity
6062+
- create_opportunity
6063+
- update_opportunity
6064+
- publish_opportunity
6065+
- internal_workflow_access
6066+
- view_org_saved_opportunities
6067+
- modify_org_saved_opportunities
6068+
- internal_workflow_event_send
6069+
- view_award_recommendation
6070+
- create_award_recommendation
6071+
- update_award_recommendation
6072+
- submit_award_recommendation
6073+
- program_officer_approval
6074+
- budget_officer_approval
6075+
type:
6076+
- string
6077+
possible_users:
6078+
type: array
6079+
description: List of users in the workflow's agency who have the required
6080+
privileges
6081+
items:
6082+
type:
6083+
- object
6084+
$ref: '#/components/schemas/WorkflowUser'
6085+
WorkflowGetResponseData:
6086+
type: object
6087+
properties:
6088+
workflow_id:
6089+
type: string
6090+
format: uuid
6091+
description: The workflow's unique identifier
6092+
example: 123e4567-e89b-12d3-a456-426614174000
6093+
workflow_type:
6094+
description: The type of workflow
6095+
example: !!python/object/apply:src.constants.lookup_constants.WorkflowType
6096+
- opportunity_publish
6097+
enum:
6098+
- opportunity_publish
6099+
- application_submission
6100+
- initial_prototype
6101+
- basic_test_workflow
6102+
type:
6103+
- string
6104+
current_workflow_state:
6105+
type: string
6106+
description: The current state in the workflow
6107+
example: draft
6108+
is_active:
6109+
type: boolean
6110+
description: Whether the workflow is active (false when workflow reaches
6111+
end state)
6112+
example: true
6113+
created_at:
6114+
type: string
6115+
format: date-time
6116+
description: When the workflow was created
6117+
updated_at:
6118+
type: string
6119+
format: date-time
6120+
description: When the workflow was last updated
6121+
workflow_audit_events:
6122+
type: array
6123+
description: Ordered list of audit events (sorted by created_at)
6124+
items:
6125+
type:
6126+
- object
6127+
$ref: '#/components/schemas/WorkflowAuditEvent'
6128+
workflow_approvals:
6129+
type: array
6130+
description: Ordered list of approvals (sorted by created_at)
6131+
items:
6132+
type:
6133+
- object
6134+
$ref: '#/components/schemas/WorkflowApproval'
6135+
workflow_approval_config:
6136+
type: object
6137+
description: Configuration mapping event names to approval requirements
6138+
and possible users
6139+
example:
6140+
receive_program_officer_approval:
6141+
approval_type: PROGRAM_OFFICER_APPROVAL
6142+
required_privileges:
6143+
- PROGRAM_OFFICER_APPROVAL
6144+
possible_users: []
6145+
additionalProperties:
6146+
type:
6147+
- object
6148+
$ref: '#/components/schemas/WorkflowApprovalConfigItem'
6149+
opportunity_id:
6150+
type:
6151+
- string
6152+
- 'null'
6153+
format: uuid
6154+
description: The opportunity ID if this is an opportunity workflow
6155+
example: 123e4567-e89b-12d3-a456-426614174000
6156+
application_id:
6157+
type:
6158+
- string
6159+
- 'null'
6160+
format: uuid
6161+
description: The application ID if this is an application workflow
6162+
example: 123e4567-e89b-12d3-a456-426614174000
6163+
application_submission_id:
6164+
type:
6165+
- string
6166+
- 'null'
6167+
format: uuid
6168+
description: The application submission ID if this is a submission workflow
6169+
example: 123e4567-e89b-12d3-a456-426614174000
6170+
WorkflowGetResponse:
6171+
type: object
6172+
properties:
6173+
message:
6174+
type: string
6175+
description: The message to return
6176+
example: Success
6177+
data:
6178+
description: The workflow details with audit history and approval configuration
6179+
type:
6180+
- object
6181+
$ref: '#/components/schemas/WorkflowGetResponseData'
6182+
status_code:
6183+
type: integer
6184+
description: The HTTP status code
6185+
example: 200
58616186
UserAgency:
58626187
type: object
58636188
properties:
-451 Bytes
Loading

0 commit comments

Comments
 (0)