-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1985 protocols extend t model (#1993)
* Add protocols to territory model * Add more details to T protocol interface * add TerritoryProtocol implementation * protocol -> validation * Remove Tie level --------- Co-authored-by: adammertel <[email protected]>
- Loading branch information
1 parent
d133146
commit ab66970
Showing
2 changed files
with
71 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,38 @@ | ||
import { IEntity } from "./entity"; | ||
import { EntityEnums } from "../enums"; | ||
import { IEntity } from "./entity"; | ||
|
||
export interface ITerritory extends IEntity { | ||
class: EntityEnums.Class.Territory; | ||
data: ITerritoryData; | ||
} | ||
|
||
export interface ITerritoryData { | ||
parent: IParentTerritory | false; | ||
parent: IParentTerritory | false; // TODO should be optional instead of false | ||
validations?: ITerritoryValidation[]; | ||
} | ||
|
||
export interface IParentTerritory { | ||
territoryId: string; // '' in case of root | ||
territoryId: string; | ||
order: number; | ||
} | ||
|
||
export interface ITerritoryValidation { | ||
entityClasses: EntityEnums.Class[]; | ||
classifications: string[]; | ||
tieType: EProtocolTieType; // default is property | ||
tieLevel?: { | ||
// relevant only in case of Classification or Property is selected as a tie | ||
levelStatement: boolean; // default is true | ||
levelMeta: boolean; // default is true | ||
}; | ||
propType?: string[]; // relevant only in case of Property is selected as a tie | ||
allowedClasses?: EntityEnums.Class[]; // not relevant if allowedEntities is set | ||
allowedEntities?: string[]; // | ||
detail: string; | ||
} | ||
|
||
export enum EProtocolTieType { | ||
Property = "Property", | ||
Classification = "Classification", | ||
Reference = "Reference", | ||
} |