-
-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(#9065): add api support for getting a person with lineage by uuid (
- Loading branch information
Showing
24 changed files
with
1,234 additions
and
112 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
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
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 |
---|---|---|
@@ -1,16 +1,22 @@ | ||
import { Doc } from './doc'; | ||
import { DataObject } from './core'; | ||
import { DataObject, Identifiable, isDataObject, isIdentifiable } from './core'; | ||
|
||
interface NormalizedParent extends DataObject { | ||
readonly _id: string; | ||
/** @internal */ | ||
export interface NormalizedParent extends DataObject, Identifiable { | ||
readonly parent?: NormalizedParent; | ||
} | ||
|
||
/** @internal */ | ||
export interface Contact extends Doc { | ||
export const isNormalizedParent = (value: unknown): value is NormalizedParent => { | ||
return isDataObject(value) | ||
&& isIdentifiable(value) | ||
&& (!value.parent || isNormalizedParent(value.parent)); | ||
}; | ||
|
||
/** @internal */ | ||
export interface Contact extends Doc, NormalizedParent { | ||
readonly contact_type?: string; | ||
readonly name?: string; | ||
readonly parent?: NormalizedParent; | ||
readonly reported_date?: Date; | ||
readonly type: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
import { DataObject, hasFields, isRecord } from './core'; | ||
import { DataObject, hasField, Identifiable, isIdentifiable, isRecord } from './core'; | ||
|
||
/** | ||
* A document from the database. | ||
*/ | ||
export interface Doc extends DataObject { | ||
readonly _id: string; | ||
export interface Doc extends DataObject, Identifiable { | ||
readonly _rev: string; | ||
} | ||
|
||
/** @internal */ | ||
export const isDoc = (value: unknown): value is Doc => { | ||
return isRecord(value) && hasFields(value, [ | ||
{ name: '_id', type: 'string' }, | ||
{ name: '_rev', type: 'string' } | ||
]); | ||
}; | ||
export const isDoc = (value: unknown): value is Doc => isRecord(value) | ||
&& isIdentifiable(value) | ||
&& hasField(value, { name: '_rev', type: '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
Oops, something went wrong.