feat: import #831
@ -172,6 +172,11 @@ export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<
 | 
				
			|||||||
| 
						
							
	
	
	
	
	
	
	
	 | 
				|||||||
            db[key] = client[key];
 | 
					            db[key] = client[key];
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    for (const key of ["EquippedGear", "EquippedEmotes"] as const) {
 | 
				
			||||||
| 
						
							
	
	
	
	
	
	
	
	 🛠️ Refactor suggestion Consider using transactions for atomic operations. The  Additionally, the function should validate the client object structure before processing. 
 _:hammer_and_wrench: Refactor suggestion_
**Consider using transactions for atomic operations.**
The `importInventory` function performs multiple updates that should be atomic. Consider wrapping the operations in a transaction.
Additionally, the function should validate the client object structure before processing.
```diff
 export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<IInventoryClient>): void => {
+    if (!db || !client) {
+        throw new Error('Invalid arguments: db and client are required');
+    }
+
+    // Validate required client properties
+    const requiredKeys = ['WeaponSkins', 'Upgrades'];
+    for (const key of requiredKeys) {
+        if (client[key] && !Array.isArray(client[key])) {
+            throw new Error(`Invalid ${key} format: expected array`);
+        }
+    }
```
> Committable suggestion skipped: line range outside the PR's diff.
<!-- This is an auto-generated comment by CodeRabbit --> 
			
			
		 | 
				|||||||
 | 
					        if (client[key]) {
 | 
				
			||||||
| 
						
							
	
	
	
	
	
	
	
	 🛠️ Refactor suggestion Consider using transactions for atomic operations. The  Additionally, the function should validate the client object structure before processing. 
 _:hammer_and_wrench: Refactor suggestion_
**Consider using transactions for atomic operations.**
The `importInventory` function performs multiple updates that should be atomic. Consider wrapping the operations in a transaction.
Additionally, the function should validate the client object structure before processing.
```diff
 export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<IInventoryClient>): void => {
+    if (!db || !client) {
+        throw new Error('Invalid arguments: db and client are required');
+    }
+
+    // Validate required client properties
+    const requiredKeys = ['WeaponSkins', 'Upgrades'];
+    for (const key of requiredKeys) {
+        if (client[key] && !Array.isArray(client[key])) {
+            throw new Error(`Invalid ${key} format: expected array`);
+        }
+    }
```
> Committable suggestion skipped: line range outside the PR's diff.
<!-- This is an auto-generated comment by CodeRabbit --> 
			
			
		 | 
				|||||||
 | 
					            db[key] = client[key];
 | 
				
			||||||
| 
						
							
	
	
	
	
	
	
	
	 🛠️ Refactor suggestion Consider using transactions for atomic operations. The  Additionally, the function should validate the client object structure before processing. 
 _:hammer_and_wrench: Refactor suggestion_
**Consider using transactions for atomic operations.**
The `importInventory` function performs multiple updates that should be atomic. Consider wrapping the operations in a transaction.
Additionally, the function should validate the client object structure before processing.
```diff
 export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<IInventoryClient>): void => {
+    if (!db || !client) {
+        throw new Error('Invalid arguments: db and client are required');
+    }
+
+    // Validate required client properties
+    const requiredKeys = ['WeaponSkins', 'Upgrades'];
+    for (const key of requiredKeys) {
+        if (client[key] && !Array.isArray(client[key])) {
+            throw new Error(`Invalid ${key} format: expected array`);
+        }
+    }
```
> Committable suggestion skipped: line range outside the PR's diff.
<!-- This is an auto-generated comment by CodeRabbit --> 
			
			
		 | 
				|||||||
 | 
					        }
 | 
				
			||||||
| 
						
							
	
	
	
	
	
	
	
	 🛠️ Refactor suggestion Consider using transactions for atomic operations. The  Additionally, the function should validate the client object structure before processing. 
 _:hammer_and_wrench: Refactor suggestion_
**Consider using transactions for atomic operations.**
The `importInventory` function performs multiple updates that should be atomic. Consider wrapping the operations in a transaction.
Additionally, the function should validate the client object structure before processing.
```diff
 export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<IInventoryClient>): void => {
+    if (!db || !client) {
+        throw new Error('Invalid arguments: db and client are required');
+    }
+
+    // Validate required client properties
+    const requiredKeys = ['WeaponSkins', 'Upgrades'];
+    for (const key of requiredKeys) {
+        if (client[key] && !Array.isArray(client[key])) {
+            throw new Error(`Invalid ${key} format: expected array`);
+        }
+    }
```
> Committable suggestion skipped: line range outside the PR's diff.
<!-- This is an auto-generated comment by CodeRabbit --> 
			
			
		 | 
				|||||||
 | 
					    }
 | 
				
			||||||
| 
						
							
	
	
	
	
	
	
	
	 🛠️ Refactor suggestion Consider using transactions for atomic operations. The  Additionally, the function should validate the client object structure before processing. 
 _:hammer_and_wrench: Refactor suggestion_
**Consider using transactions for atomic operations.**
The `importInventory` function performs multiple updates that should be atomic. Consider wrapping the operations in a transaction.
Additionally, the function should validate the client object structure before processing.
```diff
 export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<IInventoryClient>): void => {
+    if (!db || !client) {
+        throw new Error('Invalid arguments: db and client are required');
+    }
+
+    // Validate required client properties
+    const requiredKeys = ['WeaponSkins', 'Upgrades'];
+    for (const key of requiredKeys) {
+        if (client[key] && !Array.isArray(client[key])) {
+            throw new Error(`Invalid ${key} format: expected array`);
+        }
+    }
```
> Committable suggestion skipped: line range outside the PR's diff.
<!-- This is an auto-generated comment by CodeRabbit --> 
			
			
		 | 
				|||||||
    if (client.CurrentLoadOutIds) {
 | 
					    if (client.CurrentLoadOutIds) {
 | 
				
			||||||
        db.CurrentLoadOutIds = client.CurrentLoadOutIds;
 | 
					        db.CurrentLoadOutIds = client.CurrentLoadOutIds;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
| 
						
							
	
	
	
	
	
	
	
	 🛠️ Refactor suggestion Consider using transactions for atomic operations. The  Additionally, the function should validate the client object structure before processing. 
 _:hammer_and_wrench: Refactor suggestion_
**Consider using transactions for atomic operations.**
The `importInventory` function performs multiple updates that should be atomic. Consider wrapping the operations in a transaction.
Additionally, the function should validate the client object structure before processing.
```diff
 export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<IInventoryClient>): void => {
+    if (!db || !client) {
+        throw new Error('Invalid arguments: db and client are required');
+    }
+
+    // Validate required client properties
+    const requiredKeys = ['WeaponSkins', 'Upgrades'];
+    for (const key of requiredKeys) {
+        if (client[key] && !Array.isArray(client[key])) {
+            throw new Error(`Invalid ${key} format: expected array`);
+        }
+    }
```
> Committable suggestion skipped: line range outside the PR's diff.
<!-- This is an auto-generated comment by CodeRabbit --> 
			
			
		🛠️ Refactor suggestion Consider using transactions for atomic operations. The  Additionally, the function should validate the client object structure before processing. 
 _:hammer_and_wrench: Refactor suggestion_
**Consider using transactions for atomic operations.**
The `importInventory` function performs multiple updates that should be atomic. Consider wrapping the operations in a transaction.
Additionally, the function should validate the client object structure before processing.
```diff
 export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<IInventoryClient>): void => {
+    if (!db || !client) {
+        throw new Error('Invalid arguments: db and client are required');
+    }
+
+    // Validate required client properties
+    const requiredKeys = ['WeaponSkins', 'Upgrades'];
+    for (const key of requiredKeys) {
+        if (client[key] && !Array.isArray(client[key])) {
+            throw new Error(`Invalid ${key} format: expected array`);
+        }
+    }
```
> Committable suggestion skipped: line range outside the PR's diff.
<!-- This is an auto-generated comment by CodeRabbit --> 
			
			
		 | 
				|||||||
🛠️ Refactor suggestion
Consider using transactions for atomic operations.
The
importInventoryfunction performs multiple updates that should be atomic. Consider wrapping the operations in a transaction.Additionally, the function should validate the client object structure before processing.
🛠️ Refactor suggestion
Consider using transactions for atomic operations.
The
importInventoryfunction performs multiple updates that should be atomic. Consider wrapping the operations in a transaction.Additionally, the function should validate the client object structure before processing.