Skip to content

Commit

Permalink
Add #387 Update audit list data agreement records to use id field as …
Browse files Browse the repository at this point in the history
…query param
  • Loading branch information
albinpa authored and georgepadayatti committed Oct 27, 2023
1 parent ec7f7ec commit b9e21fe
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 504 deletions.
1 change: 1 addition & 0 deletions src/config/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const (
IndividualHeaderKey = "X-ConsentBB-IndividualId"
RevisionId = "revisionId"
LawfulBasis = "lawfulBasis"
Id = "id"
)

// Schemas
Expand Down
2 changes: 1 addition & 1 deletion src/database/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func Init(config *config.Configuration) error {
return err
}

err = initCollection("dataAgreementRecords", []string{"id"}, true)
err = initCollection("dataAgreementRecords", []string{"id", "dataagreementid", "individualid"}, true)
if err != nil {
return err
}
Expand Down
5 changes: 4 additions & 1 deletion src/v2/dataagreement_record/dataagreement_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type DataAgreementRecordForAuditList struct {
OptIn bool `json:"optIn"`
State string `json:"state" valid:"required"`
SignatureId string `json:"signatureId"`
AgreementData DataAgreementForListDataAgreementRecord `json:"dataAgreement"`
DataAgreements DataAgreementForListDataAgreementRecord `json:"dataAgreement"`
Timestamp string `json:"timestamp"`
}

Expand All @@ -61,6 +61,7 @@ const (
RevisionIdIsMissingError
DataAgreementRecordIdIsMissingError
LawfulBasisIsMissingError
IdIsMissingError
)

// Error returns the string representation of the error.
Expand All @@ -76,6 +77,8 @@ func (e DataAgreementRecordError) Error() string {
return "Query param dataAgreementRecordId is missing!"
case LawfulBasisIsMissingError:
return "Query param lawfulbasis is missing!"
case IdIsMissingError:
return "Query param id is missing!"
default:
return "Unknown error!"
}
Expand Down
Loading

0 comments on commit b9e21fe

Please sign in to comment.