feat(22-1990n): Add Rails backend — generated by Optimus#1
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 - spec/controllers/v0/form22_1990n_controller_spec.rb - app/models/form22_1990n_submission.rb - spec/models/form22_1990n_submission_spec.rb - app/serializers/form22_1990n_serializer.rb - spec/serializers/form22_1990n_serializer_spec.rb - app/sidekiq/lighthouse/submit_form22_1990n_job.rb - spec/sidekiq/lighthouse/submit_form22_1990n_job_spec.rb - config/routes/form22_1990n.rb - db/migrate/20260426215806_create_form22_1990n_submissions.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 the Rails backend implementation for VA Form 22-1990n (Application for VA Education Benefits by a Spouse or Child — Transfer of Entitlement). The implementation follows the canonical
simple_forms_apimodule pattern while satisfying all required file output specifications:Controller (
app/controllers/v0/form22_1990n_controller.rb): Exposes acreateaction that accepts a form submission payload, validates presence of required fields, and delegates processing to the Sidekiq job. Returns a serialized response on success or a structured error on failure.Model (
app/models/form22_1990n_submission.rb): Defines theForm22_1990nSubmissionActiveRecord model backed by the newform22_1990n_submissionstable. Includes validations for required fields (e.g.,veteran_full_name,benefit_type,relationship_to_veteran) and enum definitions for submission status (pending,submitted,failed).Serializer (
app/serializers/form22_1990n_serializer.rb): ActiveModel::Serializer implementation exposingid,status,created_at,updated_at, andconfirmation_numberattributes for API responses.Sidekiq Job (
app/sidekiq/lighthouse/submit_form22_1990n_job.rb): Asynchronous worker in theLighthousenamespace that submits the form payload to the Lighthouse Benefits Intake API, updates submission status on the model record, and logs success/failure events viaRails.loggerand StatsD metrics.Routes (
config/routes/form22_1990n.rb): RegistersPOST /v0/form22_1990nunder theV0namespace, scoped to authenticated users.Migration (
db/migrate/20260426215806_create_form22_1990n_submissions.rb): Creates theform22_1990n_submissionstable with columns forveteran_full_name,benefit_type,relationship_to_veteran,status,confirmation_number,form_data(jsonb), and standard timestamps, including appropriate indexes onstatusandcreated_at.Factory (
spec/factories/form22_1990n_submissions.rb): FactoryBot factory with default trait forpendingstatus and asubmittedtrait for use across specs.Team: Optimus / Aquia.
Files
app/controllers/v0/form22_1990n_controller.rbspec/controllers/v0/form22_1990n_controller_spec.rbapp/models/form22_1990n_submission.rbspec/models/form22_1990n_submission_spec.rbapp/serializers/form22_1990n_serializer.rbspec/serializers/form22_1990n_serializer_spec.rbapp/sidekiq/lighthouse/submit_form22_1990n_job.rbspec/sidekiq/lighthouse/submit_form22_1990n_job_spec.rbconfig/routes/form22_1990n.rbdb/migrate/20260426215806_create_form22_1990n_submissions.rbspec/factories/form22_1990n_submissions.rbRelated issue(s)
Testing done
Acceptance criteria