Skip to content

Commit bea976b

Browse files
Ensure confirming a refusal updates the response status to ‘Consent refused’
1 parent 43f6e19 commit bea976b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

app/models/reply.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ export class Reply {
7676
this.createdBy_uid = options?.createdBy_uid
7777
this.updatedAt = options?.updatedAt && new Date(options.updatedAt)
7878
this.child = options?.child && new Child(options.child)
79+
this.confirmed = stringToBoolean(options?.confirmed)
80+
this.decision =
81+
this.confirmed === true ? ReplyDecision.Refused : options?.decision
7982
this.ethnicity = stringToBoolean(options?.ethnicity)
8083
this.parent = options?.parent && new Parent(options.parent)
8184
this.method = options?.method
@@ -90,10 +93,9 @@ export class Reply {
9093
this.decision =
9194
options?.refusalReason === ReplyRefusal.AlreadyVaccinatedMMR
9295
? ReplyDecision.AlreadyVaccinated
93-
: options?.decision
96+
: this.decision
9497
this.alternative =
9598
options?.alternative && stringToBoolean(options?.alternative)
96-
this.confirmed = stringToBoolean(options?.confirmed)
9799
this.consultation = stringToBoolean(options?.consultation)
98100
this.declined = this.decision === ReplyDecision.Declined
99101
this.given = [

0 commit comments

Comments
 (0)