Skip to content

Add workflow tests + CI#2

Merged
xnodeoncode merged 13 commits intomainfrom
feature/workflow-tests-ci
Dec 10, 2025
Merged

Add workflow tests + CI#2
xnodeoncode merged 13 commits intomainfrom
feature/workflow-tests-ci

Conversation

@xnodeoncode
Copy link
Copy Markdown
Owner

Adds targeted workflow unit tests and a CI workflow. Branch: feature/workflow-tests-ci.

CIS Guru added 13 commits December 6, 2025 10:55
- Added CompleteScreeningAsync for updating screening results
- Added GenerateLeaseOfferAsync with competing app denial
- Added AcceptLeaseOfferAsync with tenant/lease creation
- Added DeclineLeaseOfferAsync with property rollback
- Added ExpireLeaseOfferAsync for scheduled expiration
- Added ScreeningResultModel and LeaseOfferModel
- All methods wrapped in transactions with audit logging
- Smart property status rollback when no active apps
- Updated SubmitApplication.razor to use WorkflowService.SubmitApplicationAsync
- Updated ReviewApplication.razor to use workflow methods for approve/deny/withdraw/screening
- Updated GenerateLeaseOffer.razor to use WorkflowService.GenerateLeaseOfferAsync
- Updated ViewLeaseOffer.razor to use AcceptLeaseOfferAsync/DeclineLeaseOfferAsync
- All UI components now use workflow service for transactional safety and audit logging
- Removed manual status management code from UI layer
- Simplified UI error handling with WorkflowResult pattern
- Changed GetActiveOrganizationIdAsync to return string instead of int
- Updated ValidateOrganizationOwnershipAsync to use string OrganizationId
- Replaced all orgId.ToString() calls with orgId throughout ApplicationWorkflowService
- Fixes error: 'The input string 'GUID' was not in a correct format'
- OrganizationId is a GUID stored as string, not an integer
- Changed WorkflowAuditLog.OrganizationId from int to string
- Updated LogTransitionAsync to use string without parsing
- Updated GetAuditHistoryAsync to use string comparison
- Created and applied migration ChangeWorkflowAuditLogOrganizationIdToString
- Fixes second GUID parsing error in workflow audit logging
- Removed all intermediate SaveChangesAsync calls in ApplicationWorkflowService
- SaveChanges now only occurs once at transaction commit in ExecuteWorkflowAsync
- Ensures all-or-nothing execution - prevents partial updates on failure
- EF Core assigns IDs during tracking, available for use before final commit
- Fixes issue where property/prospect status changed despite workflow failure

Critical fix: Previously calling SaveChangesAsync in the middle of operations
committed those changes even when later steps failed, breaking transaction rollback.
- Fixed property selection validation in SubmitApplication.razor
  - Removed conflicting @onchange handler
  - Added @bind-Value:after to sync selectedProperty
  - Added ValidationSummary for better error visibility
  - Added console logging for debugging

- Fixed InitiateScreeningAsync workflow transition
  - Auto-transitions from Submitted to UnderReview before screening
  - Eliminates need for manual 'Mark Under Review' step
  - More user-friendly workflow progression
  - Logs auto-transition in audit trail
@xnodeoncode xnodeoncode merged commit e39f51d into main Dec 10, 2025
1 check passed
@xnodeoncode xnodeoncode deleted the feature/workflow-tests-ci branch December 10, 2025 04:06
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.

1 participant