feat: improve inventory movement logic and user management security - #35
Merged
Merged
Conversation
Inventory module now uses dynamic movement types and reasons from the database. Added password reset with visibility toggle and improved sidebar organization.
There was a problem hiding this comment.
Pull request overview
This PR updates the inventory movement flow to rely on movement type/reason data coming from the database (passing IDs and using semantic name matching for “entrada/salida”), and enhances the user management UI with password visibility toggles plus a reset-password modal. It also reorganizes the sidebar and simplifies the products form layout.
Changes:
- Inventory: switch movement registration to use DB IDs and semantic matching on
TipoMovimiento.nombre; load movement reasons dynamically. - Users: add password visibility toggle for the create-user form and introduce a reset-password overlay + action button.
- UI: reorganize sidebar sections and remove the “stock mínimo” field from the product form layout/controller.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/com/utp/meditrackapp/features/inventory/service/InventarioService.java | Changes registrarMovimiento API to accept tipoId/motivoId and derives entrada/salida semantics from DB type name; adds listarMotivosMovimiento(). |
| src/main/java/com/utp/meditrackapp/features/inventory/ui/InventoryController.java | Updates modal/quick movement logic to use type-name semantics and DB motives. |
| src/test/java/com/utp/meditrackapp/features/inventory/service/InventarioServiceIntegrationTest.java | Adds integration tests validating semantic entrada/salida behavior with dynamic movement types. |
| src/main/java/com/utp/meditrackapp/features/users/ui/UsuarioController.java | Adds password visibility toggle, reset-password overlay support, and a reset action in the table. |
| src/main/resources/com/utp/meditrackapp/users-view.fxml | Adds password visibility UI and reset-password modal markup. |
| src/main/resources/com/utp/meditrackapp/sidebar.fxml | Reorganizes navigation into labeled sections. |
| src/main/java/com/utp/meditrackapp/features/products/ui/ProductoController.java | Removes spnStockMinimo wiring and adjusts form clearing. |
| src/main/resources/com/utp/meditrackapp/productos-view.fxml | Removes “stock mínimo” input and replaces it with layout spacing. |
Comment on lines
+175
to
+188
| protected void onTogglePasswordVisibility() { | ||
| boolean isVisible = passwordTextField.isVisible(); | ||
| if (isVisible) { | ||
| passwordField.setText(passwordTextField.getText()); | ||
| passwordTextField.setVisible(false); | ||
| passwordField.setVisible(true); | ||
| toggleIcon.setIconLiteral("fas-eye"); | ||
| } else { | ||
| passwordTextField.setText(passwordField.getText()); | ||
| passwordField.setVisible(false); | ||
| passwordTextField.setVisible(true); | ||
| toggleIcon.setIconLiteral("fas-eye-slash"); | ||
| } | ||
| } |
Comment on lines
274
to
279
| protected void onModalProductChanged() { | ||
| TipoMovimiento selectedType = cmbModalType.getValue(); | ||
| if (selectedType != null && TipoMovimientoEnum.SALIDA.getId().equals(selectedType.getId())) { | ||
| if (selectedType != null && selectedType.getNombre().toLowerCase().contains("salida")) { | ||
| loadBatchesForProduct(cmbModalProduct.getValue()); | ||
| } | ||
| } |
Comment on lines
+292
to
+295
| try { | ||
| List<MotivoMovimiento> motivos = inventarioService.listarMotivosMovimiento(); | ||
| cmbModalMotivo.setItems(FXCollections.observableArrayList(motivos)); | ||
| } catch (SQLException e) { e.printStackTrace(); } |
Comment on lines
+95
to
+97
| Optional<Lote> loteOpt = loteDAO.buscarPorId("LT-01"); | ||
| Lote lote = loteOpt.get(); | ||
| int initialStock = lote.getCantidad(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Inventory module now uses dynamic movement types and reasons from the database. Added password reset with visibility toggle and improved sidebar organization.