Skip to content

Commit

Permalink
DRy-up participant declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
padv2010 committed Jul 5, 2024
1 parent 518407d commit f5275af
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 64 deletions.
26 changes: 0 additions & 26 deletions public/api/docs/v3/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -328,26 +328,6 @@ paths:
description: The participant declaration being created
content:
application/json:
examples:
success:
value:
data:
id: d0b4a32e-a272-489e-b30a-cb17131457fc
type: participant-declaration
attributes:
participant_id: db3a7848-7308-4879-942a-c4a70ced400a
declaration_type: started
declaration_date: '2021-05-31T02:21:32.000Z'
course_identifier: npq-leading-teaching
state: submitted
updated_at: '2021-05-31T02:22:32.000Z'
created_at: '2021-05-31T02:22:32.000Z'
statement_id: cd3a12347-7308-4879-942a-c4a70ced400a
clawback_statement_id: cd3a12347-7308-4879-942a-c4a70ced400a
ineligible_for_funding_reason: duplicate_declaration
uplift_paid: true
has_passed: true
lead_provider_name:
schema:
"$ref": "#/components/schemas/ParticipantDeclarationResponse"
'401':
Expand Down Expand Up @@ -972,12 +952,6 @@ components:
cohort or cohorts. This is a comma delimited string of years.
type: string
example: '2021,2022'
delivery_partner_id:
description: Return participant declarations associated to the specified
delivery partner or delivery partners. This is a comma delimited string
of delivery partner IDs.
type: string
example: 7e5bcdbf-c818-4961-8da5-439cab1984e0
ListStatementsFilter:
description: Filter statements to return more specific results
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
description: "Return participant declarations associated to the specified cohort or cohorts. This is a comma delimited string of years.",
type: :string,
example: "2021,2022",
}
},
})
}.freeze
42 changes: 5 additions & 37 deletions spec/swagger_schemas/models/participant_declaration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,7 @@
type: :string,
nullable: false,
example: "started",
enum: %w[
started
retained-1
retained-2
retained-3
retained-4
completed
extended-1
extended-2
extended-3
],
enum: Schedule::DECLARATION_TYPES,
},
declaration_date: {
description: "The event declaration date",
Expand All @@ -60,21 +50,8 @@
description: "The NPQ course this NPQ application relates to",
type: :string,
nullable: false,
example: "npq-leading-teaching",
enum: %w[
npq-leading-teaching
npq-leading-behaviour-culture
npq-leading-teaching-development
npq-leading-literacy
npq-senior-leadership
npq-headship
npq-executive-leadership
npq-early-years-leadership
npq-additional-support-offer
npq-early-headship-coaching-offer
npq-leading-primary-mathematics
npq-senco
],
example: Course::IDENTIFIERS.first,
enum: Course::IDENTIFIERS,
},
eligible_for_payment: {
description: "[Deprecated - use state instead] Indicates whether this declaration would be eligible for funding from the DfE",
Expand All @@ -93,16 +70,7 @@
type: :string,
nullable: false,
example: "submitted",
enum: %w[
submitted
eligible
payable
paid
voided
ineligible
awaiting-clawback
clawed-back
],
enum: Declaration.states.keys,
},
updated_at: {
description: "The date the application was last updated",
Expand All @@ -112,7 +80,7 @@
example: "2021-05-31T02:22:32.000Z",
},
has_passed: {
description: "The date the declaration was last updated",
description: "Whether the participant has failed or passed",
type: :string,
nullable: true,
example: true,
Expand Down

0 comments on commit f5275af

Please sign in to comment.