feat: import #831
@ -177,6 +177,9 @@ export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<
 | 
			
		||||
| 
					
	
	
	
	
	
	
	
	 | 
			||||
            db[key] = client[key];
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    if (client.XPInfo) {
 | 
			
		||||
| 
					
	
	
	
	
	
	
	
	 🛠️ 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.XPInfo = client.XPInfo;
 | 
			
		||||
| 
					
	
	
	
	
	
	
	
	 🛠️ 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) {
 | 
			
		||||
        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.