Skip to content

Commit

Permalink
Add #335 Data agreement record should be renamed as consent record
Browse files Browse the repository at this point in the history
  • Loading branch information
albinpa authored and georgepadayatti committed Oct 31, 2023
1 parent da16432 commit 4dacc50
Show file tree
Hide file tree
Showing 16 changed files with 29 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/config/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
WebhookId = "webhookId"
WebhookDeliveryId = "deliveryId"
PolicyId = "policyId"
DataAgreementRecordId = "dataAgreementRecordId"
DataAgreementRecordId = "consentRecordId"
IndividualId = "individualId"
DeliveryId = "deliveryId"
IdpId = "idpId"
Expand All @@ -37,7 +37,7 @@ const (
const (
DataAgreement = "dataAgreement"
Policy = "policy"
DataAgreementRecord = "dataAgreementRecord"
DataAgreementRecord = "consentRecord"
DataAttribute = "dataAttribute"
)

Expand Down
2 changes: 1 addition & 1 deletion src/v2/handler/audit/audit_list_dataagreement_records.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type DataAgreementForListDataAgreementRecord struct {
}

type fetchDataAgreementRecordsResp struct {
DataAgreementRecords interface{} `json:"dataAgreementRecords"`
DataAgreementRecords interface{} `json:"consentRecords"`
Pagination paginate.Pagination `json:"pagination"`
}

Expand Down
4 changes: 3 additions & 1 deletion src/v2/handler/audit/audit_read_dataagreement_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package audit

import (
"encoding/json"
"fmt"
"net/http"

"github.com/bb-consent/api/src/common"
Expand All @@ -11,7 +12,7 @@ import (
)

type readDataAgreementRecordResp struct {
DataAgreementRecord daRecord.DataAgreementRecord `json:"dataAgreementRecord"`
DataAgreementRecord daRecord.DataAgreementRecord `json:"consentRecord"`
}

// AuditDataAgreementRecordRead
Expand All @@ -24,6 +25,7 @@ func AuditDataAgreementRecordRead(w http.ResponseWriter, r *http.Request) {
// Repository
darRepo := daRecord.DataAgreementRecordRepository{}
darRepo.Init(organisationId)
fmt.Println(dataAgreementRecordId)

// fetch data agreement record from db
daRecord, err := darRepo.Get(dataAgreementRecordId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func createDataAgreementRecord(dataAgreementId string, rev revision.Revision, in
}

type createDataAgreementRecordResp struct {
DataAgreementRecord daRecord.DataAgreementRecord `json:"dataAgreementRecord"`
DataAgreementRecord daRecord.DataAgreementRecord `json:"consentRecord"`
Revision revision.Revision `json:"revision"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func createDraftDataAgreementRecord(dataAgreementId string, rev revision.Revisio
}

type draftDataAgreementRecordResp struct {
DataAgreementRecord daRecord.DataAgreementRecord `json:"dataAgreementRecord"`
DataAgreementRecord daRecord.DataAgreementRecord `json:"consentRecord"`
Signature signature.Signature `json:"signature"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import (
)

type createPairedDataAgreementRecordReq struct {
DataAgreementRecord daRecord.DataAgreementRecord `json:"dataAgreementRecord" valid:"required"`
DataAgreementRecord daRecord.DataAgreementRecord `json:"consentRecord" valid:"required"`
Signature signature.Signature `json:"signature" valid:"required"`
}

type createPairedDataAgreementRecordResp struct {
DataAgreementRecord daRecord.DataAgreementRecord `json:"dataAgreementRecord"`
DataAgreementRecord daRecord.DataAgreementRecord `json:"consentRecord"`
Revision revision.Revision `json:"revision"`
Signature signature.Signature `json:"signature"`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

type fetchDataAgreementRecordsResp struct {
DataAgreementRecords interface{} `json:"dataAgreementRecords"`
DataAgreementRecords interface{} `json:"consentRecords"`
Pagination paginate.Pagination `json:"pagination"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
)

type listDataAgreementRecordHistory struct {
DataAgreementRecordHistory interface{} `json:"dataAgreementRecordHistory"`
DataAgreementRecordHistory interface{} `json:"consentRecordHistory"`
Pagination paginate.Pagination `json:"pagination"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

type vFetchIndividualDataAgreementRecordsResp struct {
DataAgreementRecords interface{} `json:"dataAgreementRecords"`
DataAgreementRecords interface{} `json:"consentRecords"`
Pagination paginate.Pagination `json:"pagination"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

type fetchRecordsForDataAgreementResp struct {
DataAgreementRecords interface{} `json:"dataAgreementRecords"`
DataAgreementRecords interface{} `json:"consentRecords"`
Pagination paginate.Pagination `json:"pagination"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

type readDataAgreementRecordResp struct {
DataAgreementRecord daRecord.DataAgreementRecord `json:"dataAgreementRecord"`
DataAgreementRecord daRecord.DataAgreementRecord `json:"consentRecord"`
}

func ServiceReadDataAgreementRecord(w http.ResponseWriter, r *http.Request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
)

type updateDataAgreementRecordResp struct {
DataAgreementRecord daRecord.DataAgreementRecord `json:"dataAgreementRecord"`
DataAgreementRecord daRecord.DataAgreementRecord `json:"consentRecord"`
Revision revision.Revision `json:"revision"`
}
type updateDataAgreementRecordReq struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

type vFetchDataAgreementRecordResp struct {
DataAgreementRecord daRecord.DataAgreementRecord `json:"dataAgreementRecord"`
DataAgreementRecord daRecord.DataAgreementRecord `json:"consentRecord"`
Revision revision.Revision `json:"revision"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

type vfetchDataAgreementRecordsResp struct {
DataAgreementRecords interface{} `json:"dataAgreementRecords"`
DataAgreementRecords interface{} `json:"consentRecords"`
Pagination paginate.Pagination `json:"pagination"`
}

Expand Down
4 changes: 2 additions & 2 deletions src/v2/http_path/audit_paths.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package http_path

const AuditListDataAgreementRecords = "/v2/audit/data-agreement-records"
const AuditDataAgreementRecordRead = "/v2/audit/data-agreement-record/{dataAgreementRecordId}"
const AuditListDataAgreementRecords = "/v2/audit/consent-records"
const AuditDataAgreementRecordRead = "/v2/audit/consent-record/{consentRecordId}"
const AuditListDataAgreements = "/v2/audit/data-agreements"
const AuditReadDataAgreement = "/v2/audit/data-agreement/{dataAgreementId}"

Expand Down
18 changes: 9 additions & 9 deletions src/v2/http_path/service_paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ const ServiceListDataAttributesForDataAgreement = "/v2/service/data-agreement/{d
// Verification mechanisms
const ServiceVerificationFetchAllDataAgreementRecords = "/v2/service/verification/data-agreements"
const ServiceVerificationFetchDataAgreementRecord = "/v2/service/verification/data-agreement/{dataAgreementId}"
const ServiceVerificationFetchDataAgreementRecords = "/v2/service/verification/data-agreement-records"
const ServiceVerificationFetchDataAgreementRecords = "/v2/service/verification/consent-records"

// Recording consent
const ServiceCreateDraftConsentRecord = "/v2/service/individual/record/data-agreement-record/draft"
const ServiceCreateDraftConsentRecord = "/v2/service/individual/record/consent-record/draft"
const ServiceCreateDataAgreementRecord = "/v2/service/individual/record/data-agreement/{dataAgreementId}"
const ServiceReadDataAgreementRecord = "/v2/service/individual/record/data-agreement/{dataAgreementId}"
const ServiceUpdateDataAgreementRecord = "/v2/service/individual/record/data-agreement-record/{dataAgreementRecordId}"
const ServiceDeleteIndividualDataAgreementRecords = "/v2/service/individual/record/data-agreement-record"
const ServiceCreatePairedDataAgreementRecord = "/v2/service/individual/record/data-agreement-record"
const ServiceUpdateDataAgreementRecord = "/v2/service/individual/record/consent-record/{consentRecordId}"
const ServiceDeleteIndividualDataAgreementRecords = "/v2/service/individual/record/consent-record"
const ServiceCreatePairedDataAgreementRecord = "/v2/service/individual/record/consent-record"

const ServiceCreateBlankSignature = "/v2/service/individual/record/data-agreement-record/{dataAgreementRecordId}/signature"
const ServiceUpdateSignatureObject = "/v2/service/individual/record/data-agreement-record/{dataAgreementRecordId}/signature"
const ServiceCreateBlankSignature = "/v2/service/individual/record/consent-record/{consentRecordId}/signature"
const ServiceUpdateSignatureObject = "/v2/service/individual/record/consent-record/{consentRecordId}/signature"

const ServiceFetchIndividualDataAgreementRecords = "/v2/service/individual/record/data-agreement-record"
const ServiceFetchIndividualDataAgreementRecords = "/v2/service/individual/record/consent-record"
const ServiceFetchRecordsForDataAgreement = "/v2/service/individual/record/data-agreement/{dataAgreementId}/all"

const ServiceFetchRecordsHistory = "/v2/service/individual/record/data-agreement-record/history"
const ServiceFetchRecordsHistory = "/v2/service/individual/record/consent-record/history"

// Idp
const ServiceReadIdp = "/v2/service/idp/open-id/{idpId}"
Expand Down

0 comments on commit 4dacc50

Please sign in to comment.