Asset
Overview
The Asset domain in comby is designed to manage digital assets, such as files, documents, or media, along with their associated metadata and storage information. It provides a structured framework for tracking asset lifecycle events, including creation, updates, and removal. The Asset aggregate is at the core of this domain, encapsulating the properties and behaviors of assets while maintaining consistency through event sourcing.
Structure
The Asset aggregate extends the BaseAggregate, leveraging comby's event-sourcing capabilities for managing state and tracking changes. It defines several fields to represent asset-specific and storage-related attributes:
- References:
- IdentityUuid: Links the asset to the identity that owns or created it.
- Entities: Reserved for nested data structures (not included in the default implementation).
- Value Objects:
- Asset Metadata:
- Name: The name of the asset.
- Size: The size of the asset in bytes.
- ContentType: The MIME type of the asset (e.g., image/png, application/pdf).
- Path: The logical or relative path of the asset.
- Storage Metadata:
- BucketName: The storage bucket where the asset is stored.
- ObjectName: The unique identifier for the asset in the storage system.
- Tags: A list of tags for categorizing or labeling the asset.
- Public: A boolean indicating whether the asset is publicly accessible.
- Additionals: A map for storing custom metadata or additional attributes.
- Asset Metadata:
This structure provides flexibility for managing diverse types of assets and their storage configurations.