Skip to content

ajustes contraste#156

Merged
henri318 merged 1 commit into
mainfrom
task/better_contrasts
Jul 17, 2026
Merged

ajustes contraste#156
henri318 merged 1 commit into
mainfrom
task/better_contrasts

Conversation

@henri318

@henri318 henri318 commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Mejoras

    • Se refuerza la validación de acceso a los pedidos para clientes y vendedores.
    • Los pedidos inexistentes o no autorizados muestran ahora la página correspondiente de “no encontrado”.
    • La dirección de entrega muestra el nombre del cliente, el código postal y la ciudad en líneas separadas.
  • Pruebas

    • Se añaden comprobaciones para pedidos inexistentes, acceso no autorizado, vendedores inválidos y clientes sin cuenta.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

La carga de pedidos se traslada a casos de uso con validación de pertenencia. Se añade la resolución del nombre del cliente mediante un puerto y adaptador, se registra en el contenedor y se actualizan las vistas de detalle para mostrar la información de dirección.

Changes

Pedidos y resolución de nombres

Layer / File(s) Summary
Contratos, casos de uso y pruebas
modules/orders/application/*, modules/orders/domain/*, tests/unit/modules/orders/application/*, tests/doubles/*
Se añaden los casos de uso para pedidos de clientes y vendedores, el puerto de nombres de clientes, el doble en memoria y las pruebas de validación y resultados.
Adaptador y composición de dependencias
modules/orders/infrastructure/*, composition-root/container.ts
El adaptador consulta usuarios mediante UserRepository y el contenedor expone e inicializa getCustomerNameLookup().
Integración de páginas y dirección
app/[locale]/orders/[orderId]/page.tsx, app/[locale]/seller/orders/[orderId]/page.tsx, app/[locale]/seller/orders/[orderId]/page.module.css
Las páginas usan los casos de uso, convierten NotFoundError en notFound(), muestran el nombre del cliente dentro de la dirección y separan postalCode y city en líneas independientes.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SellerOrderDetailPage
  participant GetSellerOrderUseCase
  participant SellerLookup
  participant OrderRepository
  participant CustomerNameLookup
  SellerOrderDetailPage->>GetSellerOrderUseCase: execute(orderId, sellerUserId, locale)
  GetSellerOrderUseCase->>SellerLookup: findByUserId(sellerUserId)
  GetSellerOrderUseCase->>OrderRepository: findById(orderId, locale)
  GetSellerOrderUseCase->>CustomerNameLookup: findById(order.userId)
  CustomerNameLookup-->>GetSellerOrderUseCase: nombre o null
  GetSellerOrderUseCase-->>SellerOrderDetailPage: order y customerName
Loading

Possibly related PRs

Suggested labels: type:feature

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning El título sugiere cambios de contraste visual, pero el PR introduce use cases, adaptadores y ajustes en páginas de pedidos. Usa un título que refleje el cambio principal, por ejemplo: "Refactoriza la obtención de pedidos y añade customer name lookup".
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task/better_contrasts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
app/[locale]/seller/orders/[orderId]/page.tsx (1)

129-138: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Usa encadenamiento opcional (?.) para el diccionario de forma consistente.

En la vista del cliente (app/[locale]/orders/[orderId]/page.tsx) se utiliza dict.auth?.postalCode y dict.auth?.city para prevenir errores si la sección auth no estuviera disponible en el diccionario de traducciones. Se recomienda usar el mismo patrón aquí para mantener la consistencia y mejorar la seguridad en tiempo de ejecución.

♻️ Refactor propuesto
               {order.deliveryAddress.postalCode && (
                 <p className={styles.addressLine}>
-                  {dict.auth.postalCode}: {order.deliveryAddress.postalCode}
+                  {dict.auth?.postalCode}: {order.deliveryAddress.postalCode}
                 </p>
               )}
               {order.deliveryAddress.city && (
                 <p className={styles.addressLine}>
-                  {dict.auth.city}: {order.deliveryAddress.city}
+                  {dict.auth?.city}: {order.deliveryAddress.city}
                 </p>
               )}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/`[locale]/seller/orders/[orderId]/page.tsx around lines 129 - 138, Update
the postalCode and city labels in the order delivery-address rendering to access
the translation dictionary through optional chaining, matching the pattern used
by the customer order view. Apply this consistently to both dict.auth label
lookups while preserving the existing address rendering conditions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@app/`[locale]/seller/orders/[orderId]/page.tsx:
- Around line 129-138: Update the postalCode and city labels in the order
delivery-address rendering to access the translation dictionary through optional
chaining, matching the pattern used by the customer order view. Apply this
consistently to both dict.auth label lookups while preserving the existing
address rendering conditions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f11d0461-faf8-4e91-ad25-3ac603cb8d98

📥 Commits

Reviewing files that changed from the base of the PR and between b50e2a5 and 71f53c0.

📒 Files selected for processing (12)
  • app/[locale]/orders/[orderId]/page.tsx
  • app/[locale]/seller/orders/[orderId]/page.module.css
  • app/[locale]/seller/orders/[orderId]/page.tsx
  • composition-root/container.ts
  • modules/orders/application/get-customer-order-use-case.ts
  • modules/orders/application/get-seller-order-use-case.ts
  • modules/orders/domain/customer-name-lookup-port.ts
  • modules/orders/infrastructure/customer-name-lookup-adapter.ts
  • tests/doubles/memory-customer-name-lookup.ts
  • tests/unit/app/[locale]/orders/[orderId]/page.test.tsx
  • tests/unit/modules/orders/application/get-customer-order-use-case.test.ts
  • tests/unit/modules/orders/application/get-seller-order-use-case.test.ts
💤 Files with no reviewable changes (2)
  • app/[locale]/seller/orders/[orderId]/page.module.css
  • tests/unit/app/[locale]/orders/[orderId]/page.test.tsx

@henri318
henri318 merged commit 5d5b057 into main Jul 17, 2026
5 checks passed
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.

1 participant