From 6f009724d21ff58c6d1ba2ceb5bbde7077988170 Mon Sep 17 00:00:00 2001
From: jjeroch <94133633+jjeroch@users.noreply.github.com>
Date: Thu, 29 Feb 2024 14:36:18 +0100
Subject: [PATCH] docs(developer): add certificate management implementation
details (#269)
---
.../08. Certificate Management/00. Summary.md | 19 +++++
.../01. Certificate Upload.md | 56 +++++++++++++
.../02. Certificate Deletion.md | 48 +++++++++++
.../03. Certificate Publishing.md | 83 +++++++++++++++++++
4 files changed, 206 insertions(+)
create mode 100644 docs/developer/08. Certificate Management/00. Summary.md
create mode 100644 docs/developer/08. Certificate Management/01. Certificate Upload.md
create mode 100644 docs/developer/08. Certificate Management/02. Certificate Deletion.md
create mode 100644 docs/developer/08. Certificate Management/03. Certificate Publishing.md
diff --git a/docs/developer/08. Certificate Management/00. Summary.md b/docs/developer/08. Certificate Management/00. Summary.md
new file mode 100644
index 000000000..d98754442
--- /dev/null
+++ b/docs/developer/08. Certificate Management/00. Summary.md
@@ -0,0 +1,19 @@
+## Summary
+
+The _Certificate Management_ feature got designed to support certificate holder as well as certificate requesters to reduce efforts generated to share certificates in any of the following processes:
+
+- audits
+- purchasing processes
+- etc.
+
+The certificate holder is getting enabled to store and access all your important certificates in one place.
+
+
+
+## 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: 2021-2024 Contributors to the Eclipse Foundation
+- Source URL: https://github.com/eclipse-tractusx/portal-assets
diff --git a/docs/developer/08. Certificate Management/01. Certificate Upload.md b/docs/developer/08. Certificate Management/01. Certificate Upload.md
new file mode 100644
index 000000000..ca5a0abfd
--- /dev/null
+++ b/docs/developer/08. Certificate Management/01. Certificate Upload.md
@@ -0,0 +1,56 @@
+## Company Certificate Upload
+
+To upload a certificate, simply navigate to the "Certificates" section in your account settings. From there, click on the "Upload Certificate" button and select the type as well as the file you want to upload. Our system supports currently PDF only with up to 2MB size.
+
+Once uploaded, you can easily view and download your certificates whenever you need them. You can also organize them into different categories or search for specific certificates via the search function.
+
+The details view enables you to view the certificate as well as getting a couple of details such as "Upload date" and "Expiry".
+
+This new feature not only helps you stay organized but also ensures that your company's certificates are easily accessible whenever you need them. Whether it's a business license, ISO certification, or any other important document, you can now keep them all in one secure location.
+
+
+
+
+### Upload of an Company Certificate (Implementation)
+
+**Endpoint:** `/api/administration/companydata/companyCertificate`
+
+**Method:** `POST`
+
+**Request Body:**
+
+```json
+ "CertificateType":"string"
+ "Document":"file($binary)"
+ "ExpiryDate":"string($date-time)"
+```
+
+**Response:**
+
+```json
+204 successfully created
+400 in case credentialType doesn't exist
+401 authentication issue
+500 system error
+```
+
+Via the upload action, user data are fetched from the jwt and used to link the document to the correct company.
+The linkage to the company subsidiary is currently not yet supported but planned shortly.
+
+
+
+
+#### Linked Functions
+
+- [Certificate Deletion](/docs/user/08.%20Certificate%20Management/02.%20Certificate%20Deletion.md)
+- [Certificate Publishing](/docs/user/08.%20Certificate%20Management/03.%20Certificate%20Publishing.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: 2021-2024 Contributors to the Eclipse Foundation
+- Source URL: https://github.com/eclipse-tractusx/portal-assets
diff --git a/docs/developer/08. Certificate Management/02. Certificate Deletion.md b/docs/developer/08. Certificate Management/02. Certificate Deletion.md
new file mode 100644
index 000000000..b8ae49b18
--- /dev/null
+++ b/docs/developer/08. Certificate Management/02. Certificate Deletion.md
@@ -0,0 +1,48 @@
+## Company Certificate Deletion
+
+In addition to the ability to upload and manage your company certificates, a certificate deletion function is enabled - allowing you to easily remove any outdated or no longer relevant certificates from your company account.
+
+To delete a certificate, simply locate the certificate you wish to remove in the "Certificates" section of your account settings. Click on the card element with the three dots to open the sub-menu, and then click on the "Delete" option. A confirmation prompt will appear to ensure you want to proceed with the deletion.
+
+Please note that once a certificate is deleted, it cannot be recovered. Therefore, it is important to double-check and ensure that you are deleting the correct certificate.
+
+The deletion function provides you with the flexibility to keep your certificate repository up-to-date and clutter-free; as well as giving you complete sovereign responsibility to decide which certificate you wanna share. By removing unnecessary certificates, you can maintain a streamlined and organized collection of only the most relevant and current documents.
+
+
+
+
+### Deletion of a Company Certificate (Implementation)
+
+**Endpoint:** `not yet supported`
+
+**Method:** `??`
+
+**Request Body:**
+
+```json
+
+```
+
+**Response:**
+
+```json
+
+```
+
+
+
+
+#### Linked Functions
+
+- [Upload Certificates](/docs/user/08.%20Certificate%20Management/01.%20Certificate%20Upload.md)
+- [Certificate Publishing](/docs/user/08.%20Certificate%20Management/03.%20Certificate%20Publishing.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: 2021-2024 Contributors to the Eclipse Foundation
+- Source URL: https://github.com/eclipse-tractusx/portal-assets
diff --git a/docs/developer/08. Certificate Management/03. Certificate Publishing.md b/docs/developer/08. Certificate Management/03. Certificate Publishing.md
new file mode 100644
index 000000000..be5e90711
--- /dev/null
+++ b/docs/developer/08. Certificate Management/03. Certificate Publishing.md
@@ -0,0 +1,83 @@
+## Company Certificate Publishing
+
+Your previously uploaded company certificates are published inside the network.
+Either via the _company account page_ which is enabled for all CX members via the partner network OR via an API endpoint which can get accessed/called by CX members as well to retrieve certificates for the collaboration processes - e.g. purchasing processes.
+
+Company certificates shared to others are only those which are in status "active".
+
+
+
+
+#### Publish/View my certificates (Implementation)
+
+**Endpoint:** `/api/administration/companydata/companyCertificates`
+
+**Method:** `GET`
+
+**Response Body:**
+
+```json
+{
+ "meta": {
+ "totalElements": 1,
+ "totalPages": 1,
+ "page": 0,
+ "contentSize": 1
+ },
+ "content": [
+ {
+ "companyCertificateType": "AEO_CTPAT_Security_Declaration",
+ "companyCertificateStatus": "ACTIVE",
+ "documentId": "9262b17e-fd51-4d05-887d-68fe9513a519",
+ "validFrom": "2024-02-27T06:55:33.076916+00:00",
+ "validTill": "2025-05-30T18:30:00+00:00"
+ }
+ ]
+}
+```
+
+Endpoint is supporting pagination, sorting, filtering.
+Displays all my owned certificates no matter which status they might have.
+
+
+
+
+#### Publish/View other business partner certificates (Implementation)
+
+**Endpoint:** `/api/administration/companydata/company/{businessPartnerNumber}/companyCertificates`
+
+**Method:** `GET`
+
+**Response Body:**
+
+```json
+[
+ {
+ "companyCertificateType": "AEO_CTPAT_Security_Declaration",
+ "companyCertificateStatus": "ACTIVE",
+ "documentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
+ "validFrom": "2024-02-29T06:13:38.634Z",
+ "validTill": "2024-02-29T06:13:38.634Z"
+ }
+]
+```
+
+Only response wih those certificates which are active. Any other states wont be shown/shared.
+
+
+
+
+#### Linked Functions
+
+- [Upload Certificates](/docs/user/08.%20Certificate%20Management/01.%20Certificate%20Upload.md)
+- [Delete Certificates](/docs/user/08.%20Certificate%20Management/02.%20Certificate%20Deletion.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: 2021-2024 Contributors to the Eclipse Foundation
+- Source URL: https://github.com/eclipse-tractusx/portal-assets