### Backend Sync Process – `SyncAllAssetsFromInnomaint()`

**Location:** `cmms_import.go` (Line 1780)

#### Process Flow

1. **Retrieve Asset Records**

   * Fetch assets from `ic3_asset_master`.
   * Only process records where `cmms_asset_id` is available.
   * Support filtering by `customer_id` when manual sync is requested.

2. **Sequential Processing**

   * Process assets **one by one** in a single execution flow.
   * No worker pool, goroutines, or parallel processing required.

3. **Asset Synchronization**

   * For each asset:

     * Read `cmms_asset_id`.
     * Call the Innomaint API.
     * Retrieve complete asset details.
     * Execute `EnrichAssetFromAPI()`.
     * Update all related master tables and `ic3_asset_master`.
     * Commit changes immediately after each successful asset update.

4. **Error Handling**

   * If an API call fails:

     * Log the error.
     * Mark the asset as failed.
     * Continue with the next asset.
   * Do not stop the entire synchronization process because of a single asset failure.

5. **Sync Logging**

   * Record each asset synchronization result in `cmms_sync_log`.
   * Capture:

     * customer_id
     * cmms_asset_id
     * status (Success/Failed)
     * error_message
     * synced_at
     * duration_ms

6. **Summary Generation**

   * After all assets are processed, generate a final summary:

     * Total Assets
     * Successful Syncs
     * Failed Syncs
     * Total Duration

#### Expected Processing Logic

```text
Load Asset List
      ↓
For Each Asset
      ↓
Call Innomaint API
      ↓
Update Master Tables
      ↓
Update ic3_asset_master
      ↓
Commit Transaction
      ↓
Write Sync Log
      ↓
Next Asset
      ↓
Generate Summary
```

#### Requirements

* Process records sequentially (one asset at a time).
* No worker pool or concurrent goroutines.
* Commit after each asset update.
* Continue processing remaining assets even if one asset fails.
* Maintain complete synchronization audit logs.
* Support manual execution by customer_id.
