Skip to content

feat: improve inventory movement logic and user management security - #35

Merged
iJosueeh merged 1 commit into
devfrom
feature/inventory-user-management-fixes
Jun 4, 2026
Merged

feat: improve inventory movement logic and user management security#35
iJosueeh merged 1 commit into
devfrom
feature/inventory-user-management-fixes

Conversation

@iJosueeh

@iJosueeh iJosueeh commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Inventory module now uses dynamic movement types and reasons from the database. Added password reset with visibility toggle and improved sidebar organization.

Inventory module now uses dynamic movement types and reasons from the database. Added password reset with visibility toggle and improved sidebar organization.
Copilot AI review requested due to automatic review settings June 4, 2026 19:12
@iJosueeh
iJosueeh merged commit 18fd23d into dev Jun 4, 2026
2 checks passed
@iJosueeh
iJosueeh deleted the feature/inventory-user-management-fixes branch June 4, 2026 19:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants