fix: missing vendor infos #565
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "add-vendor-info"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If there's any missing, please do mention it, but I think I got them all. Fixes #562. Fixes #560.
Walkthrough
The recent changes to the
getVendorInfoController
enhance its functionality by adding support for multiple new vendor manifests from various regions, including Deimos, Solaris, Ostron, and Duviri. This update involves the addition of several JSON files that contain structured data regarding vendor offerings, which include identifiers, type names, and item manifests detailing available products. The controller's switch statement has been modified to include new cases for these vendors, allowing it to return the appropriate JSON data based on the vendor specified in the request. The existing case for the Archimedean vendor remains but has been repositioned to accommodate the new vendor cases. This expansion allows for a broader range of vendor information retrieval and improves the overall capability of the API.Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
❤️ Share
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
I pushed a fix in commit <commit_id>, please review it.
Generate unit testing code for this file.
Open a follow-up GitHub issue for this discussion.
@coderabbitai
in a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.
@coderabbitai modularize this function.
@coderabbitai
in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
@coderabbitai read src/utils.ts and generate unit testing code.
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
@coderabbitai help me debug CodeRabbit configuration file.
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (Invoked using PR comments)
@coderabbitai pause
to pause the reviews on a PR.@coderabbitai resume
to resume the paused reviews.@coderabbitai review
to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full review
to do a full review from scratch and review all the files again.@coderabbitai summary
to regenerate the summary of the PR.@coderabbitai resolve
resolve all the CodeRabbit review comments.@coderabbitai configuration
to show the current CodeRabbit configuration for the repository.@coderabbitai help
to get help.Other keywords and placeholders
@coderabbitai ignore
anywhere in the PR description to prevent this PR from being reviewed.@coderabbitai summary
to generate the high-level summary at a specific location in the PR description.@coderabbitai
anywhere in the PR title to generate the title automatically.Documentation and Community
Actionable comments posted: 12
🧹 Outside diff range and nitpick comments (41)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📥 Commits
Files that changed from the base of the PR and between
76964585eb
and008e75215c
.📒 Files selected for processing (22)
🧰 Additional context used
🔇 Additional comments (51)
⚠️ Potential issue
Correct the import paths for Ostron manifests
The imports for
OstronProspectorVendorManifest
andOstronPetVendorManifest
are both importing from theOstronFishmongerVendorManifest.json
file. This seems incorrect. Each manifest should be imported from its corresponding JSON file.Apply this diff to correct the import paths:
📝 Committable suggestion
🛠️ 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:
This refactor simplifies the controller, enhances readability, and makes it easier to add or remove vendors in the future.
@ -16,0 +96,4 @@
break;
case "/Lotus/Types/Game/VendorManifests/Deimos/EntratiFragmentVendorProductsManifest":
res.json(DeimosEntratiFragmentVendorProductsManifest);
💡 Codebase verification
Typographical Error in "Commisions"
Detected inconsistent usage of "HivemindCommisionsManifest" in
src/controllers/api/getVendorInfoController.ts
. It appears "Commisions" is a typo and should be "Commissions". Please update all relevant filenames, imports, and references accordingly.🔗 Analysis chain
Check for consistency in vendor manifest filenames and imports
Several imports and case statements use "HivemindCommisionsManifest" with potential typos in "Commisions". Ensure that all filenames, imports, and references are consistently named and free of typographical errors.
Run the following script to identify all occurrences of "Commisions" to verify spelling:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 627
@ -0,0 +94,4 @@
"Id": {
"$oid": "66fd60b20ba592c4c95e91be"
}
}
💡 Codebase verification
Inconsistencies found in vendor manifest properties.
The
AllowMultipurchase
property is not consistently set totrue
across all items, with 300 instances deviating. Additionally, bothExpiry
andBin
properties have multiple unique values, indicating varying configurations. Please review these properties to ensure they align with the intended behavior and consider documenting their purposes for clarity.🔗 Analysis chain
Consider optimizing redundant properties and clarify the use of certain fields.
The store items are well-structured and provide comprehensive information. However, there are a few points to consider:
AllowMultipurchase
is set totrue
for all items. If this is always the case for this vendor, consider moving it to theVendorInfo
level to reduce redundancy.All
Expiry
dates are set to a far-future date. If this is a default value meaning "never expires", consider using a more explicit representation or moving it to theVendorInfo
level if it applies to all items.The use of "BIN_0" and "BIN_1" for the
Bin
property is not immediately clear. Please add a comment explaining the significance of these values.To verify the consistency of these properties across other vendor manifests, please run the following script:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 2527
Script:
Length of output: 1023
@ -0,0 +299,4 @@
"Id": {
"$oid": "66fd60b20ba592c4c95e8f03"
}
}
💡 Codebase verification
Duplicate
StoreItem
andBin
Combinations FoundThe
ItemManifest
contains 3 instances where the combination ofStoreItem
andBin
is not unique. This duplication may cause conflicts or unexpected behavior in the vendor system's dynamic pricing and availability mechanisms.StoreItem
is uniquely associated with a singleBin
to maintain data integrity.🔗 Analysis chain
LGTM! Clarify the purpose of repeated
StoreItem
values.The content of the
ItemManifest
array provides a diverse range of items with varying prices and bins, which allows for a flexible and dynamic vendor system.Could you please clarify the purpose of having multiple entries with the same
StoreItem
value but differentBin
values andItemPrices
? This structure suggests a dynamic pricing or availability system, but it would be helpful to understand the specific use case. For example, how are these different entries for the sameStoreItem
used in the application?To verify the uniqueness of combinations, you can run the following script:
This script will return the number of non-unique combinations of
StoreItem
andBin
. If the result is 0, all combinations are unique.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 183
@ -0,0 +318,4 @@
}
}
}
}
💡 Codebase verification
Duplicate "Kuva" Entry Detected in DuviriAcrithisVendorManifest.json
The
DuviriAcrithisVendorManifest.json
contains two entries for the "Kuva" item, whereas other vendor manifests have at most one or none. This duplication appears to be unintended and may require correction to maintain consistency across all vendor manifests.DuviriAcrithisVendorManifest.json
unless there's a documented reason for having duplicates.This adjustment will ensure uniformity and prevent potential issues related to item pricing or availability.
🔗 Analysis chain
Overall LGTM: Acrithis vendor manifest addresses PR objectives with minor verification needed.
This new JSON file successfully provides the missing Acrithis vendor manifest, directly addressing the issue #562 mentioned in the PR objectives. The structure is consistent and well-formed, offering a diverse range of items with appropriate pricing and purchase rules.
However, there's one point that requires verification:
Once this point is addressed, the file will fully meet the requirements for the Acrithis vendor manifest.
To assist in verifying the duplicate Kuva entry, you can run the following command to check if this pattern exists in other vendor manifests:
This script will output the count of Kuva entries for each vendor manifest. If other manifests also have multiple Kuva entries, it might indicate that this is an intentional design choice.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 10535
@ -0,0 +231,4 @@
"Id": {
"$oid": "670daf92d21f34757a5e73e2"
}
}
💡 Codebase verification
⚠️ Potential issue
Address inconsistency in pricing structure across items.
There's an inconsistency in how prices are specified across different items in the manifest:
ItemPrices
andRegularPrice
.RegularPrice
.This inconsistency could lead to confusion or potential bugs in the pricing logic. Consider standardizing the pricing structure across all items or documenting the reason for the differences.
Currency usage for different syndicate items has been verified.
Different syndicate items use various currencies:
The usage of multiple currencies appears intentional and aligns with the game's economy design, supporting balanced and diverse syndicate interactions.
🔗 Analysis chain
Address inconsistency in pricing structure across items.
There's an inconsistency in how prices are specified across different items in the manifest:
ItemPrices
andRegularPrice
.RegularPrice
.This inconsistency could lead to confusion or potential bugs in the pricing logic. Consider standardizing the pricing structure across all items or documenting the reason for the differences.
Verify the currency usage for different syndicate items.
Different syndicate items use various currencies:
While this diversity can be good for game balance, please verify that the currency assignments are intentional and align with the game's economy design.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 720
@ -0,0 +14,4 @@
"$date": {
"$numberLong": "9999999000000"
}
},
🛠️ Refactor suggestion
Reconsider the expiry strategy for individual items
Similar to the main
VendorInfo
object, each item in theItemManifest
has anExpiry
field set to a very distant future date. This approach might lead to maintenance issues in the long run.Consider implementing one of these alternatives:
Expiry
field from individual items if it's always the same as the mainVendorInfo
object's expiry.null
or a specific flag to indicate "never expires" instead of an extremely far future date.Example implementation for option 3:
Where
null
could be interpreted as "never expires" in your application logic.Also applies to: 28-32, 43-47, 58-62, 73-77, 88-92
@ -0,0 +101,4 @@
"$date": {
"$numberLong": "9999999000000"
}
}
🛠️ Refactor suggestion
Consider adjusting the vendor expiry date
The current expiry date is set to a very distant future (
9999999000000
). While this effectively means "never expires", it might be more maintainable to use a more reasonable timeframe or implement a different mechanism for permanent items.Consider one of these alternatives:
Example implementation for option 2:
Where
null
could be interpreted as "never expires" in your application logic.@ -0,0 +50,4 @@
"$oid": "66fd60b20ba592c4c95e98f2"
}
}
],
🛠️ Refactor suggestion
Consider optimizing the
PremiumPrice
structureIn the
ItemManifest
, each item'sPremiumPrice
is represented as an array with two identical values (e.g.,[19, 19]
,[8, 8]
,[5, 5]
). This structure seems redundant. Consider simplifying it to a single value if there's no specific reason for the duplication. For example:This change would make the data more concise and easier to maintain. If there's a particular reason for the current structure, please add a comment explaining its purpose.
@ -0,0 +123,4 @@
}
}
}
}
🛠️ Refactor suggestion
Consider reviewing uniform values across items.
The file structure is consistently maintained, which is excellent for readability and maintainability. However, there are some uniform values across all items that might benefit from review:
While these uniform values might be intentional, consider if any of these properties should vary between items:
To verify the usage of these properties across all vendor manifests, you can run:
This will help you understand if these properties are used consistently across all vendors or if there's already some variation in place.
@ -0,0 +94,4 @@
"Id": {
"$oid": "66fd60b20ba592c4c95e951a"
}
}
💡 Codebase verification
Inconsistent Bin values detected in ItemManifest.
Several items have Bin values outside the expected "BIN_0" and "BIN_1":
Please verify if these Bin assignments are intentional and ensure they align with the categorization logic for store items.
🔗 Analysis chain
Good structure, but clarify PremiumPrice and Bin usage.
The ItemManifest array is well-structured with consistent properties across all items. However, there are a few points to consider:
All items have the same far-future Expiry date. Is this intentional, or should some items have different expiration dates?
The PremiumPrice is always an array with two identical values (e.g., [15, 15], [8, 8]). Is this intentional, or should it be a single value?
The Bin values are either "BIN_0" or "BIN_1". Could you clarify the purpose of these bins and if there's a specific logic behind their assignment?
To ensure consistency across other vendor manifests, please run the following script:
This script will help identify any inconsistencies or unusual patterns across all vendor manifests.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 109202
Palladino (
/Lotus/Types/Game/VendorManifests/Hubs/IronwakeDondaVendorManifest
) is missing right now.Actionable comments posted: 3
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📥 Commits
Files that changed from the base of the PR and between
008e75215c
and20a2aa2afe
.📒 Files selected for processing (2)
🧰 Additional context used
🔇 Additional comments (6)
@ -3,0 +6,4 @@
import DeimosHivemindCommisionsManifestPetVendor from "@/static/fixed_responses/getVendorInfo/DeimosHivemindCommisionsManifestPetVendor.json";
import DeimosHivemindCommisionsManifestProspector from "@/static/fixed_responses/getVendorInfo/DeimosHivemindCommisionsManifestProspector.json";
import DeimosHivemindCommisionsManifestTokenVendor from "@/static/fixed_responses/getVendorInfo/DeimosHivemindCommisionsManifestTokenVendor.json";
import DeimosHivemindCommisionsManifestWeaponsmith from "@/static/fixed_responses/getVendorInfo/DeimosHivemindCommisionsManifestWeaponsmith.json";
⚠️ Potential issue
Correct the spelling of 'Commisions' to 'Commissions' in import statements
The word 'Commisions' is misspelled in the import statements on lines 5 to 9. It should be 'Commissions'. Correcting the spelling will ensure consistency and prevent potential import errors.
Apply this diff to correct the spelling:
@ -16,0 +56,4 @@
break;
case "/Lotus/Types/Game/VendorManifests/Solaris/DebtTokenVendorRepossessionsManifest":
res.json(SolarisDebtTokenVendorRepossessionsManifest);
⚠️ 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?
@ -0,0 +47,4 @@
"Id": {
"$oid": "66fd60b20ba592c4c95e9468"
}
},
⚠️ Potential issue
Remove duplicate RivenModPack entry.
There are two identical entries for the RivenModPack item in the ItemManifest. This appears to be a duplication error. Please remove one of these entries to avoid confusion and potential issues with the vendor's inventory.
To fix this, remove one of the RivenModPack entries (lines 29-50 or lines 96-116).
Also applies to: 96-116