/shop delete destroys the store's stock instead of returning it

Abierto
#62 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
java
Área
backend

Línea de trabajo

Start with DeleteCommand, where the issue says the inventory check and unfinished TODO already exist, then inspect the delete command tests and the wiki's Commands page. Trace how finite stock and negative quantities are handled, and run the relevant tests. Done when a plain delete returns finite stock or leaves the store unchanged if inventory is insufficient, force flags still discard stock, and the wiki matches.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

Problem

DeleteCommand checks that the player has room for the store's items, then deletes the store without giving them the items. All remaining stock is lost, even on a plain /shop delete <store> with no flags.

The inventory check implies the items should be returned, and so does STORE_DELETE_INSUFFICIENT_INV_PLAYER, which tells players to clear space or use -f to ignore inventory. A TODO in DeleteCommand also notes that removing all items is unfinished. The balance is refunded correctly unless -F is used.

The existing -f and -F tests only cover the forced paths, where an empty inventory is expected.

Steps to reproduce

  1. Create a store and add items to it.
  2. Run /shop delete <store> with enough free inventory space.
  3. The store is deleted, but the items aren't in the player's inventory.

Scope

  • Give the store's stock to the player when deleting without a force flag.
  • Keep -f and -F discarding stock, and make sure the behavior is clear in the command's messages.
  • Handle items with infinite stock (negative quantity) so they don't create items or fail the inventory check.

Done when

  • A plain delete moves all finite stock to the player's inventory.
  • A plain delete with too little space is refused and the store is unchanged.
  • Tests cover the plain delete with stock, and -f and -F still discard it.
  • The wiki's Commands page, which currently warns that stock isn't returned, matches the fix.
  • Fixed before the 0.4.0 full release.
Lenguaje dominante
Java
Estrellas
1
Forks
0
Merge medio
2 h 35 min
PR fusionados (30 d)
14

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de BrendonButler/Shops

Todos los issues de BrendonButler/Shops

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.