- Added new structured snapshot types for orders and order items to improve data integrity and clarity.
- Updated the Order and OrderItem models to use the new JSONType for snapshots.
- Refactored tests to accommodate the new snapshot structure, ensuring compatibility with legacy data.
- Enhanced the OrdersSnapshot struct to support multiple snapshot types and maintain backward compatibility.
- Introduced new fields for order items and orders to capture detailed snapshot information for auditing and historical display.
- Added MediaAssetVariant enum with values 'main' and 'preview'.
- Updated media asset service logic to utilize MediaAssetVariant for variant handling.
- Refactored database models and queries to include variant and source_asset_id fields.
- Enhanced validation for asset variants in upload and processing functions.
- Updated Swagger documentation to reflect new variant structure and descriptions.
- Implemented necessary database migrations to support the new variant constraints.
- Add TenantOptionalAuth middleware to allow access to public content without requiring authentication.
- Introduce ListPublicPublished and PublicDetail methods in the content service to retrieve publicly accessible content.
- Create tenant_public HTTP routes for listing and showing public content, including preview and main asset retrieval.
- Enhance content tests to cover scenarios for public content access and permissions.
- Update specifications to reflect the new public content access features and rules.
- Implemented MyBalance and MyLedgerPage methods in the ledger service to retrieve current user balance and transaction history for a specified tenant.
- Added corresponding test cases for MyBalance and MyLedgerPage methods in the ledger test suite.
- Created DTOs for balance response and ledger items to structure the response data.
- Updated Swagger documentation to include new endpoints for retrieving tenant balance and ledgers.
- Added HTTP tests for the new endpoints to ensure proper functionality.
- Updated user_test.go to remove FocusConvey and clean up commented-out code.
- Introduced content_test.go with comprehensive tests for content creation, updating, pricing, asset attachment, and access checks.
- Added order_test.go to implement tests for order management, including admin top-ups, order details, refunds, and content purchases with various scenarios.
- Introduced TenantLedger model with fields for managing tenant transactions, including ID, TenantID, UserID, OrderID, transaction Type, Amount, and balance details.
- Implemented CRUD operations for TenantLedger with methods for Create, Update, Delete, and Reload.
- Generated query methods for TenantLedger to facilitate database interactions, including filtering, pagination, and aggregation functions.
- Established relationships with Order model for foreign key references.