fix: missing vendor infos #565

Merged
VampireKitten merged 5 commits from add-vendor-info into main 2024-10-18 09:13:53 -07:00
Showing only changes of commit 008e75215c - Show all commits

View File

@ -53,7 +53,7 @@ export const getVendorInfoController: RequestHandler = (req, res) => {
coderabbitai[bot] commented 2024-10-18 06:38:26 -07:00 (Migrated from github.com)
Review

⚠️ Potential issue

Correct the import paths for Ostron manifests

The imports for OstronProspectorVendorManifest and OstronPetVendorManifest are both importing from the OstronFishmongerVendorManifest.json file. This seems incorrect. Each manifest should be imported from its corresponding JSON file.

Apply this diff to correct the import paths:

 import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
-import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
-import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
+import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json";
+import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json";
import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json";
_:warning: Potential issue_ **Correct the import paths for Ostron manifests** The imports for `OstronProspectorVendorManifest` and `OstronPetVendorManifest` are both importing from the `OstronFishmongerVendorManifest.json` file. This seems incorrect. Each manifest should be imported from its corresponding JSON file. Apply this diff to correct the import paths: ```diff import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; -import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; -import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; +import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json"; +import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json"; ``` <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. `````suggestion import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json"; import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json"; ````` </details> <!-- suggestion_end --> <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-10-18 06:38:26 -07:00 (Migrated from github.com)
Review

🛠️ Refactor suggestion

Consider refactoring the switch statement for better maintainability

The switch statement has grown significantly with many cases, which could impact maintainability and readability. Consider refactoring this logic by using a mapping object to associate vendor paths with their corresponding manifests.

Here's an example of how you might refactor the switch statement:

+const vendorManifestMap: { [key: string]: any } = {
+    "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest": OstronFishmongerVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest": OstronProspectorVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Ostron/PetVendorManifest": OstronPetVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Solaris/FishmongerVendorManifest": SolarisFishmongerVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Solaris/ProspectorVendorManifest": SolarisProspectorVendorManifest,
+    // Include all other vendor paths and their corresponding manifests
+};

export const getVendorInfoController: RequestHandler = (req, res) => {
-    switch (req.query.vendor as string) {
-        case "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest":
-            res.json(OstronFishmongerVendorManifest);
-            break;
-        case "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest":
-            res.json(OstronProspectorVendorManifest);
-            break;
-        // ... other cases ...
-        default:
-            throw new Error(`Unknown vendor: ${req.query.vendor}`);
-    }
+    const vendorPath = req.query.vendor as string;
+    const manifest = vendorManifestMap[vendorPath];
+    if (manifest) {
+        res.json(manifest);
+    } else {
+        throw new Error(`Unknown vendor: ${vendorPath}`);
+    }
};

This refactor simplifies the controller, enhances readability, and makes it easier to add or remove vendors in the future.

Committable suggestion was skipped due to low confidence.

_:hammer_and_wrench: Refactor suggestion_ **Consider refactoring the switch statement for better maintainability** The switch statement has grown significantly with many cases, which could impact maintainability and readability. Consider refactoring this logic by using a mapping object to associate vendor paths with their corresponding manifests. Here's an example of how you might refactor the switch statement: ```diff +const vendorManifestMap: { [key: string]: any } = { + "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest": OstronFishmongerVendorManifest, + "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest": OstronProspectorVendorManifest, + "/Lotus/Types/Game/VendorManifests/Ostron/PetVendorManifest": OstronPetVendorManifest, + "/Lotus/Types/Game/VendorManifests/Solaris/FishmongerVendorManifest": SolarisFishmongerVendorManifest, + "/Lotus/Types/Game/VendorManifests/Solaris/ProspectorVendorManifest": SolarisProspectorVendorManifest, + // Include all other vendor paths and their corresponding manifests +}; export const getVendorInfoController: RequestHandler = (req, res) => { - switch (req.query.vendor as string) { - case "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest": - res.json(OstronFishmongerVendorManifest); - break; - case "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest": - res.json(OstronProspectorVendorManifest); - break; - // ... other cases ... - default: - throw new Error(`Unknown vendor: ${req.query.vendor}`); - } + const vendorPath = req.query.vendor as string; + const manifest = vendorManifestMap[vendorPath]; + if (manifest) { + res.json(manifest); + } else { + throw new Error(`Unknown vendor: ${vendorPath}`); + } }; ``` This refactor simplifies the controller, enhances readability, and makes it easier to add or remove vendors in the future. > Committable suggestion was skipped due to low confidence. <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-10-18 06:38:26 -07:00 (Migrated from github.com)
Review

⚠️ Potential issue

Correct the import paths for Ostron manifests

The imports for OstronProspectorVendorManifest and OstronPetVendorManifest are both importing from the OstronFishmongerVendorManifest.json file. This seems incorrect. Each manifest should be imported from its corresponding JSON file.

Apply this diff to correct the import paths:

 import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
-import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
-import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
+import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json";
+import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json";
import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json";
_:warning: Potential issue_ **Correct the import paths for Ostron manifests** The imports for `OstronProspectorVendorManifest` and `OstronPetVendorManifest` are both importing from the `OstronFishmongerVendorManifest.json` file. This seems incorrect. Each manifest should be imported from its corresponding JSON file. Apply this diff to correct the import paths: ```diff import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; -import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; -import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; +import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json"; +import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json"; ``` <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. `````suggestion import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json"; import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json"; ````` </details> <!-- suggestion_end --> <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-10-18 06:38:26 -07:00 (Migrated from github.com)
Review

🛠️ Refactor suggestion

Consider refactoring the switch statement for better maintainability

The switch statement has grown significantly with many cases, which could impact maintainability and readability. Consider refactoring this logic by using a mapping object to associate vendor paths with their corresponding manifests.

Here's an example of how you might refactor the switch statement:

+const vendorManifestMap: { [key: string]: any } = {
+    "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest": OstronFishmongerVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest": OstronProspectorVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Ostron/PetVendorManifest": OstronPetVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Solaris/FishmongerVendorManifest": SolarisFishmongerVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Solaris/ProspectorVendorManifest": SolarisProspectorVendorManifest,
+    // Include all other vendor paths and their corresponding manifests
+};

export const getVendorInfoController: RequestHandler = (req, res) => {
-    switch (req.query.vendor as string) {
-        case "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest":
-            res.json(OstronFishmongerVendorManifest);
-            break;
-        case "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest":
-            res.json(OstronProspectorVendorManifest);
-            break;
-        // ... other cases ...
-        default:
-            throw new Error(`Unknown vendor: ${req.query.vendor}`);
-    }
+    const vendorPath = req.query.vendor as string;
+    const manifest = vendorManifestMap[vendorPath];
+    if (manifest) {
+        res.json(manifest);
+    } else {
+        throw new Error(`Unknown vendor: ${vendorPath}`);
+    }
};

This refactor simplifies the controller, enhances readability, and makes it easier to add or remove vendors in the future.

Committable suggestion was skipped due to low confidence.

_:hammer_and_wrench: Refactor suggestion_ **Consider refactoring the switch statement for better maintainability** The switch statement has grown significantly with many cases, which could impact maintainability and readability. Consider refactoring this logic by using a mapping object to associate vendor paths with their corresponding manifests. Here's an example of how you might refactor the switch statement: ```diff +const vendorManifestMap: { [key: string]: any } = { + "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest": OstronFishmongerVendorManifest, + "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest": OstronProspectorVendorManifest, + "/Lotus/Types/Game/VendorManifests/Ostron/PetVendorManifest": OstronPetVendorManifest, + "/Lotus/Types/Game/VendorManifests/Solaris/FishmongerVendorManifest": SolarisFishmongerVendorManifest, + "/Lotus/Types/Game/VendorManifests/Solaris/ProspectorVendorManifest": SolarisProspectorVendorManifest, + // Include all other vendor paths and their corresponding manifests +}; export const getVendorInfoController: RequestHandler = (req, res) => { - switch (req.query.vendor as string) { - case "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest": - res.json(OstronFishmongerVendorManifest); - break; - case "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest": - res.json(OstronProspectorVendorManifest); - break; - // ... other cases ... - default: - throw new Error(`Unknown vendor: ${req.query.vendor}`); - } + const vendorPath = req.query.vendor as string; + const manifest = vendorManifestMap[vendorPath]; + if (manifest) { + res.json(manifest); + } else { + throw new Error(`Unknown vendor: ${vendorPath}`); + } }; ``` This refactor simplifies the controller, enhances readability, and makes it easier to add or remove vendors in the future. > Committable suggestion was skipped due to low confidence. <!-- This is an auto-generated comment by CodeRabbit -->
case "/Lotus/Types/Game/VendorManifests/Solaris/DebtTokenVendorManifest": case "/Lotus/Types/Game/VendorManifests/Solaris/DebtTokenVendorManifest":
res.json(SolarisDebtTokenVendorManifest); res.json(SolarisDebtTokenVendorManifest);
break; break;
coderabbitai[bot] commented 2024-10-18 06:38:26 -07:00 (Migrated from github.com)
Review

⚠️ Potential issue

Correct the import paths for Ostron manifests

The imports for OstronProspectorVendorManifest and OstronPetVendorManifest are both importing from the OstronFishmongerVendorManifest.json file. This seems incorrect. Each manifest should be imported from its corresponding JSON file.

Apply this diff to correct the import paths:

 import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
-import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
-import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
+import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json";
+import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json";
import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json";
_:warning: Potential issue_ **Correct the import paths for Ostron manifests** The imports for `OstronProspectorVendorManifest` and `OstronPetVendorManifest` are both importing from the `OstronFishmongerVendorManifest.json` file. This seems incorrect. Each manifest should be imported from its corresponding JSON file. Apply this diff to correct the import paths: ```diff import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; -import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; -import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; +import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json"; +import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json"; ``` <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. `````suggestion import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json"; import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json"; ````` </details> <!-- suggestion_end --> <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-10-18 06:38:26 -07:00 (Migrated from github.com)
Review

🛠️ Refactor suggestion

Consider refactoring the switch statement for better maintainability

The switch statement has grown significantly with many cases, which could impact maintainability and readability. Consider refactoring this logic by using a mapping object to associate vendor paths with their corresponding manifests.

Here's an example of how you might refactor the switch statement:

+const vendorManifestMap: { [key: string]: any } = {
+    "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest": OstronFishmongerVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest": OstronProspectorVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Ostron/PetVendorManifest": OstronPetVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Solaris/FishmongerVendorManifest": SolarisFishmongerVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Solaris/ProspectorVendorManifest": SolarisProspectorVendorManifest,
+    // Include all other vendor paths and their corresponding manifests
+};

export const getVendorInfoController: RequestHandler = (req, res) => {
-    switch (req.query.vendor as string) {
-        case "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest":
-            res.json(OstronFishmongerVendorManifest);
-            break;
-        case "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest":
-            res.json(OstronProspectorVendorManifest);
-            break;
-        // ... other cases ...
-        default:
-            throw new Error(`Unknown vendor: ${req.query.vendor}`);
-    }
+    const vendorPath = req.query.vendor as string;
+    const manifest = vendorManifestMap[vendorPath];
+    if (manifest) {
+        res.json(manifest);
+    } else {
+        throw new Error(`Unknown vendor: ${vendorPath}`);
+    }
};

This refactor simplifies the controller, enhances readability, and makes it easier to add or remove vendors in the future.

Committable suggestion was skipped due to low confidence.

_:hammer_and_wrench: Refactor suggestion_ **Consider refactoring the switch statement for better maintainability** The switch statement has grown significantly with many cases, which could impact maintainability and readability. Consider refactoring this logic by using a mapping object to associate vendor paths with their corresponding manifests. Here's an example of how you might refactor the switch statement: ```diff +const vendorManifestMap: { [key: string]: any } = { + "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest": OstronFishmongerVendorManifest, + "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest": OstronProspectorVendorManifest, + "/Lotus/Types/Game/VendorManifests/Ostron/PetVendorManifest": OstronPetVendorManifest, + "/Lotus/Types/Game/VendorManifests/Solaris/FishmongerVendorManifest": SolarisFishmongerVendorManifest, + "/Lotus/Types/Game/VendorManifests/Solaris/ProspectorVendorManifest": SolarisProspectorVendorManifest, + // Include all other vendor paths and their corresponding manifests +}; export const getVendorInfoController: RequestHandler = (req, res) => { - switch (req.query.vendor as string) { - case "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest": - res.json(OstronFishmongerVendorManifest); - break; - case "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest": - res.json(OstronProspectorVendorManifest); - break; - // ... other cases ... - default: - throw new Error(`Unknown vendor: ${req.query.vendor}`); - } + const vendorPath = req.query.vendor as string; + const manifest = vendorManifestMap[vendorPath]; + if (manifest) { + res.json(manifest); + } else { + throw new Error(`Unknown vendor: ${vendorPath}`); + } }; ``` This refactor simplifies the controller, enhances readability, and makes it easier to add or remove vendors in the future. > Committable suggestion was skipped due to low confidence. <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-10-18 06:38:26 -07:00 (Migrated from github.com)
Review

⚠️ Potential issue

Correct the import paths for Ostron manifests

The imports for OstronProspectorVendorManifest and OstronPetVendorManifest are both importing from the OstronFishmongerVendorManifest.json file. This seems incorrect. Each manifest should be imported from its corresponding JSON file.

Apply this diff to correct the import paths:

 import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
-import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
-import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
+import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json";
+import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json";
import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json";
_:warning: Potential issue_ **Correct the import paths for Ostron manifests** The imports for `OstronProspectorVendorManifest` and `OstronPetVendorManifest` are both importing from the `OstronFishmongerVendorManifest.json` file. This seems incorrect. Each manifest should be imported from its corresponding JSON file. Apply this diff to correct the import paths: ```diff import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; -import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; -import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; +import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json"; +import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json"; ``` <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. `````suggestion import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json"; import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json"; ````` </details> <!-- suggestion_end --> <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-10-18 06:38:26 -07:00 (Migrated from github.com)
Review

🛠️ Refactor suggestion

Consider refactoring the switch statement for better maintainability

The switch statement has grown significantly with many cases, which could impact maintainability and readability. Consider refactoring this logic by using a mapping object to associate vendor paths with their corresponding manifests.

Here's an example of how you might refactor the switch statement:

+const vendorManifestMap: { [key: string]: any } = {
+    "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest": OstronFishmongerVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest": OstronProspectorVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Ostron/PetVendorManifest": OstronPetVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Solaris/FishmongerVendorManifest": SolarisFishmongerVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Solaris/ProspectorVendorManifest": SolarisProspectorVendorManifest,
+    // Include all other vendor paths and their corresponding manifests
+};

export const getVendorInfoController: RequestHandler = (req, res) => {
-    switch (req.query.vendor as string) {
-        case "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest":
-            res.json(OstronFishmongerVendorManifest);
-            break;
-        case "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest":
-            res.json(OstronProspectorVendorManifest);
-            break;
-        // ... other cases ...
-        default:
-            throw new Error(`Unknown vendor: ${req.query.vendor}`);
-    }
+    const vendorPath = req.query.vendor as string;
+    const manifest = vendorManifestMap[vendorPath];
+    if (manifest) {
+        res.json(manifest);
+    } else {
+        throw new Error(`Unknown vendor: ${vendorPath}`);
+    }
};

This refactor simplifies the controller, enhances readability, and makes it easier to add or remove vendors in the future.

Committable suggestion was skipped due to low confidence.

_:hammer_and_wrench: Refactor suggestion_ **Consider refactoring the switch statement for better maintainability** The switch statement has grown significantly with many cases, which could impact maintainability and readability. Consider refactoring this logic by using a mapping object to associate vendor paths with their corresponding manifests. Here's an example of how you might refactor the switch statement: ```diff +const vendorManifestMap: { [key: string]: any } = { + "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest": OstronFishmongerVendorManifest, + "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest": OstronProspectorVendorManifest, + "/Lotus/Types/Game/VendorManifests/Ostron/PetVendorManifest": OstronPetVendorManifest, + "/Lotus/Types/Game/VendorManifests/Solaris/FishmongerVendorManifest": SolarisFishmongerVendorManifest, + "/Lotus/Types/Game/VendorManifests/Solaris/ProspectorVendorManifest": SolarisProspectorVendorManifest, + // Include all other vendor paths and their corresponding manifests +}; export const getVendorInfoController: RequestHandler = (req, res) => { - switch (req.query.vendor as string) { - case "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest": - res.json(OstronFishmongerVendorManifest); - break; - case "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest": - res.json(OstronProspectorVendorManifest); - break; - // ... other cases ... - default: - throw new Error(`Unknown vendor: ${req.query.vendor}`); - } + const vendorPath = req.query.vendor as string; + const manifest = vendorManifestMap[vendorPath]; + if (manifest) { + res.json(manifest); + } else { + throw new Error(`Unknown vendor: ${vendorPath}`); + } }; ``` This refactor simplifies the controller, enhances readability, and makes it easier to add or remove vendors in the future. > Committable suggestion was skipped due to low confidence. <!-- This is an auto-generated comment by CodeRabbit -->
case "/Lotus/Types/Game/VendorManifests/Solaris/DebtTokenVendorRepossessionsManifest": case "/Lotus/Types/Game/VendorManifests/Solaris/DebtTokenVendorRepossessionsManifest":
res.json(SolarisDebtTokenVendorRepossessionsManifest); res.json(SolarisDebtTokenVendorRepossessionsManifest);
break; break;
coderabbitai[bot] commented 2024-10-18 08:47:36 -07:00 (Migrated from github.com)
Review

⚠️ Potential issue

Missing Vendor Manifest for 'Ticker'

According to issue #560, the vendor 'Ticker' does not have a vendor manifest included in the controller. It appears that 'Ticker' is still missing from the getVendorInfoController. To fully resolve the linked issue, please include the 'Ticker' vendor manifest.

Would you like assistance in adding the 'Ticker' vendor manifest to the controller?

_:warning: Potential issue_ **Missing Vendor Manifest for 'Ticker'** According to issue #560, the vendor 'Ticker' does not have a vendor manifest included in the controller. It appears that 'Ticker' is still missing from the `getVendorInfoController`. To fully resolve the linked issue, please include the 'Ticker' vendor manifest. Would you like assistance in adding the 'Ticker' vendor manifest to the controller? <!-- This is an auto-generated comment by CodeRabbit -->

coderabbitai[bot] commented 2024-10-18 06:38:26 -07:00 (Migrated from github.com)
Review

⚠️ Potential issue

Correct the import paths for Ostron manifests

The imports for OstronProspectorVendorManifest and OstronPetVendorManifest are both importing from the OstronFishmongerVendorManifest.json file. This seems incorrect. Each manifest should be imported from its corresponding JSON file.

Apply this diff to correct the import paths:

 import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
-import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
-import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
+import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json";
+import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json";
import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json";
_:warning: Potential issue_ **Correct the import paths for Ostron manifests** The imports for `OstronProspectorVendorManifest` and `OstronPetVendorManifest` are both importing from the `OstronFishmongerVendorManifest.json` file. This seems incorrect. Each manifest should be imported from its corresponding JSON file. Apply this diff to correct the import paths: ```diff import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; -import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; -import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; +import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json"; +import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json"; ``` <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. `````suggestion import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json"; import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json"; ````` </details> <!-- suggestion_end --> <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-10-18 06:38:26 -07:00 (Migrated from github.com)
Review

🛠️ Refactor suggestion

Consider refactoring the switch statement for better maintainability

The switch statement has grown significantly with many cases, which could impact maintainability and readability. Consider refactoring this logic by using a mapping object to associate vendor paths with their corresponding manifests.

Here's an example of how you might refactor the switch statement:

+const vendorManifestMap: { [key: string]: any } = {
+    "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest": OstronFishmongerVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest": OstronProspectorVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Ostron/PetVendorManifest": OstronPetVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Solaris/FishmongerVendorManifest": SolarisFishmongerVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Solaris/ProspectorVendorManifest": SolarisProspectorVendorManifest,
+    // Include all other vendor paths and their corresponding manifests
+};

export const getVendorInfoController: RequestHandler = (req, res) => {
-    switch (req.query.vendor as string) {
-        case "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest":
-            res.json(OstronFishmongerVendorManifest);
-            break;
-        case "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest":
-            res.json(OstronProspectorVendorManifest);
-            break;
-        // ... other cases ...
-        default:
-            throw new Error(`Unknown vendor: ${req.query.vendor}`);
-    }
+    const vendorPath = req.query.vendor as string;
+    const manifest = vendorManifestMap[vendorPath];
+    if (manifest) {
+        res.json(manifest);
+    } else {
+        throw new Error(`Unknown vendor: ${vendorPath}`);
+    }
};

This refactor simplifies the controller, enhances readability, and makes it easier to add or remove vendors in the future.

Committable suggestion was skipped due to low confidence.

_:hammer_and_wrench: Refactor suggestion_ **Consider refactoring the switch statement for better maintainability** The switch statement has grown significantly with many cases, which could impact maintainability and readability. Consider refactoring this logic by using a mapping object to associate vendor paths with their corresponding manifests. Here's an example of how you might refactor the switch statement: ```diff +const vendorManifestMap: { [key: string]: any } = { + "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest": OstronFishmongerVendorManifest, + "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest": OstronProspectorVendorManifest, + "/Lotus/Types/Game/VendorManifests/Ostron/PetVendorManifest": OstronPetVendorManifest, + "/Lotus/Types/Game/VendorManifests/Solaris/FishmongerVendorManifest": SolarisFishmongerVendorManifest, + "/Lotus/Types/Game/VendorManifests/Solaris/ProspectorVendorManifest": SolarisProspectorVendorManifest, + // Include all other vendor paths and their corresponding manifests +}; export const getVendorInfoController: RequestHandler = (req, res) => { - switch (req.query.vendor as string) { - case "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest": - res.json(OstronFishmongerVendorManifest); - break; - case "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest": - res.json(OstronProspectorVendorManifest); - break; - // ... other cases ... - default: - throw new Error(`Unknown vendor: ${req.query.vendor}`); - } + const vendorPath = req.query.vendor as string; + const manifest = vendorManifestMap[vendorPath]; + if (manifest) { + res.json(manifest); + } else { + throw new Error(`Unknown vendor: ${vendorPath}`); + } }; ``` This refactor simplifies the controller, enhances readability, and makes it easier to add or remove vendors in the future. > Committable suggestion was skipped due to low confidence. <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-10-18 06:38:26 -07:00 (Migrated from github.com)
Review

⚠️ Potential issue

Correct the import paths for Ostron manifests

The imports for OstronProspectorVendorManifest and OstronPetVendorManifest are both importing from the OstronFishmongerVendorManifest.json file. This seems incorrect. Each manifest should be imported from its corresponding JSON file.

Apply this diff to correct the import paths:

 import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
-import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
-import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
+import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json";
+import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json";
import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json";
import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json";
_:warning: Potential issue_ **Correct the import paths for Ostron manifests** The imports for `OstronProspectorVendorManifest` and `OstronPetVendorManifest` are both importing from the `OstronFishmongerVendorManifest.json` file. This seems incorrect. Each manifest should be imported from its corresponding JSON file. Apply this diff to correct the import paths: ```diff import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; -import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; -import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; +import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json"; +import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json"; ``` <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. `````suggestion import OstronFishmongerVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronFishmongerVendorManifest.json"; import OstronProspectorVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronProspectorVendorManifest.json"; import OstronPetVendorManifest from "@/static/fixed_responses/getVendorInfo/OstronPetVendorManifest.json"; ````` </details> <!-- suggestion_end --> <!-- This is an auto-generated comment by CodeRabbit -->
coderabbitai[bot] commented 2024-10-18 06:38:26 -07:00 (Migrated from github.com)
Review

🛠️ Refactor suggestion

Consider refactoring the switch statement for better maintainability

The switch statement has grown significantly with many cases, which could impact maintainability and readability. Consider refactoring this logic by using a mapping object to associate vendor paths with their corresponding manifests.

Here's an example of how you might refactor the switch statement:

+const vendorManifestMap: { [key: string]: any } = {
+    "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest": OstronFishmongerVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest": OstronProspectorVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Ostron/PetVendorManifest": OstronPetVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Solaris/FishmongerVendorManifest": SolarisFishmongerVendorManifest,
+    "/Lotus/Types/Game/VendorManifests/Solaris/ProspectorVendorManifest": SolarisProspectorVendorManifest,
+    // Include all other vendor paths and their corresponding manifests
+};

export const getVendorInfoController: RequestHandler = (req, res) => {
-    switch (req.query.vendor as string) {
-        case "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest":
-            res.json(OstronFishmongerVendorManifest);
-            break;
-        case "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest":
-            res.json(OstronProspectorVendorManifest);
-            break;
-        // ... other cases ...
-        default:
-            throw new Error(`Unknown vendor: ${req.query.vendor}`);
-    }
+    const vendorPath = req.query.vendor as string;
+    const manifest = vendorManifestMap[vendorPath];
+    if (manifest) {
+        res.json(manifest);
+    } else {
+        throw new Error(`Unknown vendor: ${vendorPath}`);
+    }
};

This refactor simplifies the controller, enhances readability, and makes it easier to add or remove vendors in the future.

Committable suggestion was skipped due to low confidence.

_:hammer_and_wrench: Refactor suggestion_ **Consider refactoring the switch statement for better maintainability** The switch statement has grown significantly with many cases, which could impact maintainability and readability. Consider refactoring this logic by using a mapping object to associate vendor paths with their corresponding manifests. Here's an example of how you might refactor the switch statement: ```diff +const vendorManifestMap: { [key: string]: any } = { + "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest": OstronFishmongerVendorManifest, + "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest": OstronProspectorVendorManifest, + "/Lotus/Types/Game/VendorManifests/Ostron/PetVendorManifest": OstronPetVendorManifest, + "/Lotus/Types/Game/VendorManifests/Solaris/FishmongerVendorManifest": SolarisFishmongerVendorManifest, + "/Lotus/Types/Game/VendorManifests/Solaris/ProspectorVendorManifest": SolarisProspectorVendorManifest, + // Include all other vendor paths and their corresponding manifests +}; export const getVendorInfoController: RequestHandler = (req, res) => { - switch (req.query.vendor as string) { - case "/Lotus/Types/Game/VendorManifests/Ostron/FishmongerVendorManifest": - res.json(OstronFishmongerVendorManifest); - break; - case "/Lotus/Types/Game/VendorManifests/Ostron/ProspectorVendorManifest": - res.json(OstronProspectorVendorManifest); - break; - // ... other cases ... - default: - throw new Error(`Unknown vendor: ${req.query.vendor}`); - } + const vendorPath = req.query.vendor as string; + const manifest = vendorManifestMap[vendorPath]; + if (manifest) { + res.json(manifest); + } else { + throw new Error(`Unknown vendor: ${vendorPath}`); + } }; ``` This refactor simplifies the controller, enhances readability, and makes it easier to add or remove vendors in the future. > Committable suggestion was skipped due to low confidence. <!-- This is an auto-generated comment by CodeRabbit -->