Skip to content

Commit

Permalink
Introduce base V4 PayloadValidator (#5494)
Browse files Browse the repository at this point in the history
**Story card:** [sc-14156](URL)

## Because

I'm working on introducing a new sync route and…
- I couldn't find the specs for the validators where they should be
- V4 sync route payload validators were ineriting from a V3 base

## This addresses

- One step towards proper separation of concerns
- Implemeting the same technique for the V3 and V4 sync controllers

## Test instructions

- Ensure existing tests pass since this is purely refactoring
  • Loading branch information
igbanam authored Nov 27, 2024
1 parent 6bd10a1 commit b09de2d
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/validators/api/v4/blood_sugar_payload_validator.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Api::V4::BloodSugarPayloadValidator < Api::V3::PayloadValidator
class Api::V4::BloodSugarPayloadValidator < Api::V4::PayloadValidator
attr_accessor(
:id,
:blood_sugar_type,
Expand Down
2 changes: 1 addition & 1 deletion app/validators/api/v4/call_result_payload_validator.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Api::V4::CallResultPayloadValidator < Api::V3::PayloadValidator
class Api::V4::CallResultPayloadValidator < Api::V4::PayloadValidator
attr_accessor(
:id,
:user_id,
Expand Down
2 changes: 2 additions & 0 deletions app/validators/api/v4/payload_validator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
class Api::V4::PayloadValidator < Api::V3::PayloadValidator
end
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Api::V4::QuestionnaireResponsePayloadValidator < Api::V3::PayloadValidator
class Api::V4::QuestionnaireResponsePayloadValidator < Api::V4::PayloadValidator
attr_accessor(
:id,
:questionnaire_id,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Api::V4::TeleconsultationPayloadValidator < Api::V3::PayloadValidator
class Api::V4::TeleconsultationPayloadValidator < Api::V4::PayloadValidator
attr_accessor(
:id,
:patient_id,
Expand Down

0 comments on commit b09de2d

Please sign in to comment.