Skip to content

Commit

Permalink
feat: expose event relations
Browse files Browse the repository at this point in the history
  • Loading branch information
lykmapipo committed Dec 18, 2019
1 parent e30f8a9 commit a990b22
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,15 @@ export const PREDEFINE_RELATIONS = {
custodians: { ref: 'Party', array: true },
};

// event relations
export const EVENT_RELATIONS = {
group: { ref: 'Predefine', namespace: 'EventGroup' },
type: { ref: 'Predefine', namespace: 'EventType' },
certainty: { ref: 'Predefine', namespace: 'EventCertainty' },
severity: { ref: 'Predefine', namespace: 'EventSeverity' },
areas: { ref: 'Predefine', namespace: 'AdministrativeArea', array: true },
};

// population options
export const POPULATION_MAX_DEPTH = 1;
export const POPULATION_DEFAULT = { maxDepth: POPULATION_MAX_DEPTH };
10 changes: 10 additions & 0 deletions test/unit.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ import {
PATH_NAME_EVENTCHANGELOG,
PATH_NAME_EVENTCHANGELOGS,
PREDEFINE_RELATIONS,
EVENT_RELATIONS,
} from '../src';

describe('internals', () => {
Expand Down Expand Up @@ -330,4 +331,13 @@ describe('internals', () => {
expect(PREDEFINE_RELATIONS.agencies).to.exist.and.be.an('object');
expect(PREDEFINE_RELATIONS.custodians).to.exist.and.be.an('object');
});

it('should expose event relations definition', () => {
expect(EVENT_RELATIONS).to.exist.and.be.an('object');
expect(EVENT_RELATIONS.group).to.exist.and.be.an('object');
expect(EVENT_RELATIONS.type).to.exist.and.be.an('object');
expect(EVENT_RELATIONS.certainty).to.exist.and.be.an('object');
expect(EVENT_RELATIONS.severity).to.exist.and.be.an('object');
expect(EVENT_RELATIONS.areas).to.exist.and.be.an('object');
});
});

0 comments on commit a990b22

Please sign in to comment.