Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB Documentation Improvement #167

Open
jjeroch opened this issue May 30, 2024 · 0 comments
Open

DB Documentation Improvement #167

jjeroch opened this issue May 30, 2024 · 0 comments
Assignees

Comments

@jjeroch
Copy link
Contributor

jjeroch commented May 30, 2024

Enhancement of the documentation of https://github.com/eclipse-tractusx/ssi-credential-issuer/blob/main/docs/database/db-view.md needed.

  • Attribute description (example see below)
  • Enum description (example see below)

...more to be added....note the current content of the ticket only describes the immediate identified missing details - not all > topics which need to get added.
To be explored by developer and PO

#### Attributes:

- `id` (SERIAL): A unique identifier for the document. This is the primary key of the table.
- `name` (VARCHAR(255)): The name of the document. This field is required and cannot be null.
- `content` (BYTEA): The binary content of the document. This field is required and cannot be null.
- `hash` (BYTEA): A hash of the document content, used for verification purposes. This field is required and cannot be null.
- `media_type_id` (INT): An identifier for the media type of the document. This field is required and cannot be null.
- `document_type_id` (document_type_id): An enumeration that specifies the type of the document. This field is required and cannot be null.
- `created_at` (TIMESTAMP): The timestamp when the document was created. It defaults to the current timestamp at the time of document creation.
- `updated_at` (TIMESTAMP): The timestamp when the document was last updated. It defaults to the current timestamp at the time of the update.

## Enumeration Types

### `document_type_id`

An enumeration type that defines the possible categories for documents in the `documents` table.

#### Possible Values:

- `PRESENTATION`: Represents a presentation document uploaded by the customer/requester to present a proof of certification etc.
- `CREDENTIAL`: Represents a credential document created by the issuer (unsigned).
- `VERIFIED_CREDENTIAL`: Represents a verified credential document (signed by the issuer wallet and official credential document).

## Relationships

- Each document in the `documents` table can be associated to only one company SSI detail records through the `document_company_ssi_details` table. // @Phil91  please check once if this is implemented like described
- The `document_id` in the `document_company_ssi_details` table is a foreign key that references the `id` in the `documents` table.

## Notes

- The `media_type_id` attribute in the `documents` table should correspond to a valid media type defined elsewhere in the database or application logic.
- The `document_type_id` enumeration should be kept up-to-date with any changes to the types of documents that the system needs to handle.
- Timestamps are automatically managed by the database to ensure accuracy in creation and modification times.
@Phil91 Phil91 added this to the Release 1.1.0 milestone Jun 18, 2024
Phil91 added a commit that referenced this issue Jun 18, 2024
@Phil91 Phil91 mentioned this issue Jun 18, 2024
9 tasks
Phil91 added a commit that referenced this issue Jun 19, 2024
Refs: #167
Reviewed-By: Evelyn Gurschler <evelyn.gurschler@bmw.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: IN REVIEW
Development

No branches or pull requests

2 participants