-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
220385a
commit 25ea52a
Showing
33 changed files
with
449 additions
and
409 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 0 additions & 18 deletions
18
src/app/core/models/data-request/data-request.interface.ts
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
src/app/core/models/data-request/data-request.mapper.spec.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
src/app/core/models/gdpr-data-request/gdpr-data-request.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* response data type for confirm data request | ||
*/ | ||
export interface GDPRDataRequestData { | ||
data?: [ | ||
{ | ||
hash: string; | ||
} | ||
]; | ||
infos?: GDPRDataRequestInfo[]; | ||
} | ||
|
||
export interface GDPRDataRequestInfo { | ||
causes?: GDPRDataRequestCauses[]; | ||
} | ||
|
||
interface GDPRDataRequestCauses { | ||
code: string; | ||
} |
19 changes: 19 additions & 0 deletions
19
src/app/core/models/gdpr-data-request/gdpr-data-request.mapper.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { GDPRDataRequestData, GDPRDataRequestInfo } from './gdpr-data-request.interface'; | ||
import { GDPRDataRequestMapper } from './gdpr-data-request.mapper'; | ||
import { GDPRDataRequest } from './gdpr-data-request.model'; | ||
|
||
describe('Gdpr Data Request Mapper', () => { | ||
describe('fromData', () => { | ||
it(`should return DataRequest when getting DataRequestData with request id`, () => { | ||
const payloadData = { | ||
infos: [{ causes: [{ code: 'already confirmed' }] } as GDPRDataRequestInfo], | ||
} as GDPRDataRequestData; | ||
const requestData = { hash: 'test_hash', requestID: 'test_ID' } as GDPRDataRequest; | ||
const dataRequest = GDPRDataRequestMapper.fromData(payloadData, requestData); | ||
|
||
expect(dataRequest.requestID).toEqual(requestData.requestID); | ||
expect(dataRequest.hash).toEqual(requestData.hash); | ||
expect(dataRequest.status).toEqual('already confirmed'); | ||
}); | ||
}); | ||
}); |
15 changes: 15 additions & 0 deletions
15
src/app/core/models/gdpr-data-request/gdpr-data-request.mapper.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { GDPRDataRequestData } from './gdpr-data-request.interface'; | ||
import { GDPRDataRequest } from './gdpr-data-request.model'; | ||
|
||
export class GDPRDataRequestMapper { | ||
/** | ||
* Map data request payload to data request model | ||
*/ | ||
static fromData(payload: GDPRDataRequestData, requestData: GDPRDataRequest): GDPRDataRequest { | ||
return { | ||
requestID: requestData.requestID, | ||
hash: requestData.hash, | ||
status: payload.infos[0].causes[0].code, | ||
}; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/app/core/models/gdpr-data-request/gdpr-data-request.model.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface GDPRDataRequest { | ||
requestID: string; | ||
hash: string; | ||
status?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
src/app/core/store/general/data-request/data-request.actions.ts
This file was deleted.
Oops, something went wrong.
72 changes: 0 additions & 72 deletions
72
src/app/core/store/general/data-request/data-request.effects.spec.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
25ea52a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Azure Demo Servers are available: