-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add documentation to add policies and attributes
* adjust documentation structure to align with TRG1 * add documentation to add policies and policy attributes Refs: #178 #197
- Loading branch information
Showing
29 changed files
with
246 additions
and
15 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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Introduction | ||
|
||
This repository provides the backend code for the Policy Hub. | ||
|
||
The following table links you to the respective documentations. | ||
|
||
| Documentation | Purpose | | ||
| ----------------------------------------------------------------- | ---------------------------------------------------------------------- | | ||
| [Arc42](architecture/Index.md) | Architecture Documentation for the Policy Hub. | | ||
| [How to contribute](./admin/dev-process/How%20to%20contribute.md) | Information relevant, if you contribute in the policy hub development. | | ||
| [Administration Guide](admin/Admin_Guide.md) | Information relevant, if you want to use the policy hub application. | | ||
| [API Documentation](api/API_Doc.md) | Information about the endpoints. | | ||
|
||
## NOTICE | ||
|
||
This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). | ||
|
||
- SPDX-License-Identifier: Apache-2.0 | ||
- SPDX-FileCopyrightText: 2024 Contributors to the Eclipse Foundation | ||
- Source URL: https://github.com/eclipse-tractusx/policy-hub |
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,14 @@ | ||
# Admin Guide | ||
|
||
## Getting started | ||
|
||
To start the application refer to the [Installation Guide](../../charts/policy-hub/README.md). | ||
It provides information on deployment via helm. | ||
|
||
## NOTICE | ||
|
||
This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). | ||
|
||
- SPDX-License-Identifier: Apache-2.0 | ||
- SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation | ||
- Source URL: https://github.com/eclipse-tractusx/policy-hub |
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,142 @@ | ||
# Summary | ||
|
||
The following documentation gives an overview of how to add additional data to the Policy Hub. | ||
|
||
## Adding new Policies | ||
|
||
To add new policies the following steps must be executed: | ||
|
||
### Add Policy | ||
|
||
To add new Attributes you need to add an entry to the [policies](/src/database/PolicyHub.Migrations/Seeder/Data/policies.json) Seeding file. | ||
|
||
The entry should look like the following: | ||
|
||
```json | ||
{ | ||
"id": "uuid for the policy, this is needed in the process later on", | ||
"kind_id": "one of the policy kinds mentioned below (as number)", | ||
"technical_key": "the technical key which is used to query it later in the process", | ||
"description": "a description of the policy", | ||
"is_active": "either true if the attribute should be active or false if the attribute shouldn't be active", | ||
"attribute_key_id": "one of the attribute keys mentioned below (as number)", | ||
}, | ||
``` | ||
|
||
**PolicyKindId** | ||
|
||
```c# | ||
public enum PolicyKindId | ||
{ | ||
BusinessPartnerNumber = 1, | ||
Membership = 2, | ||
Framework = 3, | ||
Purpose = 4, | ||
Dismantler = 5, | ||
ContractReference = 6 | ||
} | ||
``` | ||
|
||
**Attribute Keys** | ||
|
||
```c# | ||
public enum AttributeKeyId | ||
{ | ||
Regex = 1, | ||
Static = 2, | ||
DynamicValue = 3, | ||
Brands = 4, | ||
Version = 5 | ||
} | ||
``` | ||
|
||
### Assign policy to type | ||
|
||
The created policy must be assigned to at least one policy type. To assign the policy to a type you need to add an entry to the [policy_assigned_types](/src/database/PolicyHub.Migrations/Seeder/Data/policy_assigned_types.json) Seeding file. | ||
|
||
The entry should look like the following: | ||
|
||
```json | ||
{ | ||
"policy_id": "value of the id column of the newly added policy", | ||
"policy_type_id": "one of the policy type ids mentioned below (as number)", | ||
"is_active": "either true if the attribute should be active or false if the attribute shouldn't be active" | ||
} | ||
``` | ||
|
||
**PolicyTypeId** | ||
|
||
```c# | ||
public enum PolicyTypeId | ||
{ | ||
Access = 1, | ||
Usage = 2 | ||
} | ||
``` | ||
|
||
### Assign policy to use case | ||
|
||
The created policy must be assigned to at least one use case. To assign the policy to a use case you need to add an entry to the [policy_assigned_use_cases](/src/database/PolicyHub.Migrations/Seeder/Data/policy_assigned_use_cases.json) Seeding file. | ||
|
||
The entry should look like the following: | ||
|
||
```json | ||
{ | ||
"policy_id": "value of the id column of the newly added policy", | ||
"use_case_id": "one of the use case ids mentioned below (as number)", | ||
"is_active": "either true if the attribute should be active or false if the attribute shouldn't be active" | ||
} | ||
``` | ||
|
||
**UseCaseId** | ||
|
||
```c# | ||
public enum UseCaseId | ||
{ | ||
Traceability = 1, | ||
Quality = 2, | ||
PCF = 3, | ||
Behavioraltwin = 4, | ||
Businesspartner = 5, | ||
CircularEconomy = 6, | ||
DemandCapacity = 7 | ||
} | ||
``` | ||
|
||
## Adding new Attributes | ||
|
||
To add new Attributes you need to add an entry to the [policy_attributes](/src/database/PolicyHub.Migrations/Seeder/Data/policy_attributes.json) Seeding file. | ||
|
||
The entry should look like the following: | ||
|
||
```json | ||
{ | ||
"id": "uuid", | ||
"policy_id": "id of an policy you want to link the attribute to", | ||
"key": "one of the attribute keys mentioned above (as number)", | ||
"attribute_value": "the specific value of the attribute you want to set", | ||
"is_active": "either true if the attribute should be active or false if the attribute shouldn't be active" | ||
} | ||
``` | ||
|
||
Depending on the attribute key which is set the output will slightly change. A regex Attribute will check the set value of a policy if it matches the regex. A dynamic value will take the user input of the value field. If non is set by the user `{dynamicValue}` is taken. For `Static`, `Brands` and `Version` Attributes the value will just render the content of the `attribute_value` column. | ||
|
||
To make a Attribute available it must be set to `is_active` = `true` and a link to a use case must be added. For that a new entry in the [policy_attribute_assigned_use_cases](/src/database/PolicyHub.Migrations/Seeder/Data/policy_attribute_assigned_use_cases.json) must be added. The entry should look like the following: | ||
|
||
```json | ||
{ | ||
"attribute_id": "value of the id column of the newly added policy_attribute", | ||
"use_case_id": "one of the use case ids mentioned above (as number)", | ||
"is_active": "either true if the attribute should be active or false if the attribute shouldn't be active" | ||
} | ||
``` | ||
|
||
It is possible to link an attribute to multiple UseCases. | ||
|
||
## NOTICE | ||
|
||
This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). | ||
|
||
- SPDX-License-Identifier: Apache-2.0 | ||
- SPDX-FileCopyrightText: 2024 Contributors to the Eclipse Foundation | ||
- Source URL: https://github.com/eclipse-tractusx/policy-hub |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...wn-knowns/known-issues-and-limitations.md → docs/admin/known-issues-and-limitations.md
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# API Documentation | ||
|
||
This document provides information on the endpoints. | ||
|
||
## OpenAPI Specifications | ||
|
||
There is an [OpenAPI 3.0.1 specification document](./hub-service.yaml) available. | ||
|
||
## Postman | ||
|
||
There is a [postman collection](./postman) containing information on how to provide master data and some basic data to test the application. | ||
|
||
## NOTICE | ||
|
||
This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). | ||
|
||
- SPDX-License-Identifier: Apache-2.0 | ||
- SPDX-FileCopyrightText: 2024 Contributors to the Eclipse Foundation | ||
- Source URL: https://github.com/eclipse-tractusx/policy-hub |
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
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ntation/architecture/Context and scope.md → ...chitecture/03_system_scope_and_context.md
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,4 +1,4 @@ | ||
# Content and Scope | ||
# System Context and Scope | ||
|
||
## Business Context | ||
|
||
|
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...n/architecture/Whitebox Overall System.md → docs/architecture/05_building_block_view.md
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,4 +1,4 @@ | ||
# Whitebox Overall System | ||
# Building Block View | ||
|
||
## Summary | ||
|
||
|
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Cross-cutting Concepts | ||
|
||
## Table of Content | ||
|
||
- [Operational concepts](./08_01_operational_concept.md) | ||
- [Developer concepts](./08_02_development_concept.md) | ||
- [Security Concept](./08_03_security_concept.md) | ||
|
||
## NOTICE | ||
|
||
This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). | ||
|
||
- SPDX-License-Identifier: Apache-2.0 | ||
- SPDX-FileCopyrightText: 2024 Contributors to the Eclipse Foundation | ||
- Source URL: <https://github.com/eclipse-tractusx/policy-hub |
2 changes: 1 addition & 1 deletion
2
...ocumentation/architecture/Requirements.md → docs/architecture/09_quality_requirements.md
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,4 +1,4 @@ | ||
# Requirements overview | ||
# Quality Requirements | ||
|
||
## What is the Policy Hub Product? | ||
|
||
|
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,21 @@ | ||
# Arc42 | ||
|
||
This documentation follows the arc42 template to provide a comprehensive overview of the Policy Hub. | ||
|
||
## Table of Content | ||
|
||
- [02. Architecture Constraints](./02_architecture_constraints.md) | ||
- [03. Context and Scope](./03_system_scope_and_context.md) | ||
- [04. Solution Strategy](./04_solution_strategy.md) | ||
- [05. Building Block View](./05_building_block_view.md) | ||
- [08. Concepts](./08_concepts.md) | ||
- [10. Quality Requirements](./10_quality_requirements.md) | ||
- [12. Glossary](12_glossary.md) | ||
|
||
## NOTICE | ||
|
||
This work is licensed under the [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0). | ||
|
||
- SPDX-License-Identifier: Apache-2.0 | ||
- SPDX-FileCopyrightText: 2024 Contributors to the Eclipse Foundation | ||
- Source URL: https://github.com/eclipse-tractusx/policy-hub |
File renamed without changes.
File renamed without changes.
File renamed without changes.