Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Consignment Sales Logic #11

Open
jnccloud opened this issue Dec 15, 2023 · 0 comments
Open

Refactor Consignment Sales Logic #11

jnccloud opened this issue Dec 15, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@jnccloud
Copy link

jnccloud commented Dec 15, 2023

The problem

Many servers end up using custom scripts that add new columns to the player_vehicles table. This data, such as fake plates, NOS, mileage, stolen/vinscratched, etc always gets lost without customization to the SQL whenever there are changes in player_vehicles. This happens because the vehicle is deleted and only basic information is transferred over to the consignment table.

Ideal solution

Refactor the occasions_vehicles table and rename to consignment_vehicles. Heck, rename the entire resource to qbx_consignment

  • Drop seller, plate, model, mods columns
  • Create a new column player_vehicle_id
  • Add foreign key relationship to player_vehicles id column

When a used vehicle is marked for sale, use the player_vehicles id to and change the status to a status not in use - such as 100 (thinking of this in terms of firewall rules, giving room for existing servers that may have more statuses in use).

Use a JOIN to pull in relevant information from the player_vehicle table to populate the contract/load the used car dealership.

Whenever a car is purchase, just update the owners info instead of this hodgepodge of moving data between tables.

Garage scripts will have to exclude this from their lists just like they should do for impounded vehicles. Phone could be modified to show "For Sale" status.

Alternative solutions

  • Remove the consignment lot and only offer the buyback.
  • Create vehicle contracts to sell cars between players.

Additional context

No response

@jnccloud jnccloud added the enhancement New feature or request label Dec 15, 2023
@qbox-duck qbox-duck bot added this to Issues Dec 15, 2023
@github-project-automation github-project-automation bot moved this to Todo in Issues Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

1 participant