feat(22-1990n): Add Rails backend — generated by Optimus#2
Draft
voidspooks wants to merge 1 commit into
Draft
Conversation
Generated by Optimus (https://github.com/aquia-inc/optimus). All files require human review before merging. Files: - app/controllers/v0/form22_1990n_controller.rb - app/models/form22_1990n_submission.rb - app/serializers/form22_1990n_serializer.rb - app/sidekiq/lighthouse/submit_form22_1990n_job.rb - config/routes/form22_1990n.rb - db/migrate/20260426223952_create_form22_1990n_submissions.rb - spec/controllers/v0/form22_1990n_controller_spec.rb - spec/models/form22_1990n_submission_spec.rb - spec/serializers/form22_1990n_serializer_spec.rb - spec/sidekiq/lighthouse/submit_form22_1990n_job_spec.rb - spec/factories/form22_1990n_submissions.rb
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
This PR introduces a standalone Rails backend implementation for VA Form 22-1990n (Application for VA Education Benefits by a National Call to Service Participant). The implementation follows the standalone controller/model/serializer/job pattern across 10+ files:
Controller (
app/controllers/v0/form22_1990n_controller.rb): Defines aV0::Form22_1990nControllerwithbefore_action :authenticateandbefore_action :require_loa3guards. Thecreateaction instantiates aForm22_1990nSubmissionrecord scoped to the authenticated user, persists it, and enqueues the async Sidekiq job for Lighthouse submission. Returns a serialized response on success or structured error messages on failure.Model (
app/models/form22_1990n_submission.rb):Form22_1990nSubmissionActiveRecord model backed by theform22_1990n_submissionstable. Includes presence validations on required fields (e.g.,form_data,user_uuid), astatusenum tracking lifecycle states (pending,submitted,failed), and serialized storage of the form payload.Serializer (
app/serializers/form22_1990n_serializer.rb):Form22_1990nSerializerusingActiveModel::Serializer, exposing attributes such asid,status,created_at, andupdated_atfor API responses.Sidekiq Job (
app/sidekiq/lighthouse/submit_form22_1990n_job.rb):Lighthouse::SubmitForm22_1990nJobworker configured with retry logic, responsible for submitting the form payload to the Lighthouse Benefits Intake API and updating the submissionstatusaccordingly. Includes structured logging on success and failure paths.Routes (
config/routes/form22_1990n.rb): Registers thePOST /v0/form22_1990nroute scoped under thev0namespace, mapped toform22_1990n#create.Migration (
db/migrate/20260426223952_create_form22_1990n_submissions.rb): Creates theform22_1990n_submissionstable with columns foruser_uuid,form_data(jsonb),status(integer with default), and standard timestamps.Specs: Full RSpec coverage across controller, model, serializer, Sidekiq job, and FactoryBot factory, including authenticated/unauthenticated request scenarios, model validation cases, serializer attribute assertions, and job enqueue/execution behavior.
Team: Optimus / Aquia.
Files
app/controllers/v0/form22_1990n_controller.rbapp/models/form22_1990n_submission.rbapp/serializers/form22_1990n_serializer.rbapp/sidekiq/lighthouse/submit_form22_1990n_job.rbconfig/routes/form22_1990n.rbdb/migrate/20260426223952_create_form22_1990n_submissions.rbspec/controllers/v0/form22_1990n_controller_spec.rbspec/models/form22_1990n_submission_spec.rbspec/serializers/form22_1990n_serializer_spec.rbspec/sidekiq/lighthouse/submit_form22_1990n_job_spec.rbspec/factories/form22_1990n_submissions.rbRelated issue(s)
Testing done
Acceptance criteria