updateEntityMetadata updates the metadata for a specific entity. It routes the update operation to the appropriate datasource method based on the entity type. Parameters: - ctx: The context for the operation. - entityType: The type of entity being updated. - entityID: The ID of the entity being upd
(ctx context.Context, entityType, entityID string, metadata map[string]interface{})
| 206 | // Returns: |
| 207 | // - error: An error if the update operation fails. |
| 208 | func (l *LedgerForge) updateEntityMetadata(ctx context.Context, entityType, entityID string, metadata map[string]interface{}) error { |
| 209 | switch entityType { |
| 210 | case "ledgers": |
| 211 | return l.datasource.UpdateLedgerMetadata(entityID, metadata) |
| 212 | |
| 213 | case "transactions": |
| 214 | return l.datasource.UpdateTransactionMetadata(ctx, entityID, metadata) |
| 215 | |
| 216 | case "balances": |
| 217 | return l.datasource.UpdateBalanceMetadata(ctx, entityID, metadata) |
| 218 | |
| 219 | case "identities": |
| 220 | return l.datasource.UpdateIdentityMetadata(entityID, metadata) |
| 221 | |
| 222 | default: |
| 223 | return fmt.Errorf("unsupported entity type: %s", entityType) |
| 224 | } |
| 225 | } |
no test coverage detected