Skip to content

Commit

Permalink
feat: create portfolios namespace for Identity
Browse files Browse the repository at this point in the history
  • Loading branch information
monitz87 committed Oct 15, 2020
1 parent a79e47e commit 40e3c9d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/api/entities/Identity/Portfolios.ts
@@ -0,0 +1,6 @@
import { Identity, Namespace } from '~/api/entities';

/**
* Handles all Portfolio related functionality on the Identity side
*/
export class Portfolios extends Namespace<Identity> {}
9 changes: 9 additions & 0 deletions src/api/entities/Identity/__tests__/Portfolios.ts
@@ -0,0 +1,9 @@
import { Namespace } from '~/api/entities';

import { Portfolios } from '../Portfolios';

describe('Portfolios class', () => {
test('should extend namespace', () => {
expect(Portfolios.prototype instanceof Namespace).toBe(true);
});
});
3 changes: 3 additions & 0 deletions src/api/entities/Identity/index.ts
Expand Up @@ -32,6 +32,7 @@ import {
} from '~/utils';

import { IdentityAuthorizations } from './IdentityAuthorizations';
import { Portfolios } from './Portfolios';

/**
* Properties that uniquely identify an Identity
Expand Down Expand Up @@ -61,6 +62,7 @@ export class Identity extends Entity<UniqueIdentifiers> {

// Namespaces
public authorizations: IdentityAuthorizations;
public portfolios: Portfolios;

/**
* Create an Identity entity
Expand All @@ -72,6 +74,7 @@ export class Identity extends Entity<UniqueIdentifiers> {

this.did = did;
this.authorizations = new IdentityAuthorizations(this, context);
this.portfolios = new Portfolios(this, context);
}

/**
Expand Down

0 comments on commit 40e3c9d

Please sign in to comment.