Skip to content

feat(admin): catalog & logistics management screens - #14

Merged
laithanhhung merged 1 commit into
devfrom
UC-ADMIN-01/fe-web-admin-management
Jul 14, 2026
Merged

feat(admin): catalog & logistics management screens#14
laithanhhung merged 1 commit into
devfrom
UC-ADMIN-01/fe-web-admin-management

Conversation

@laithanhhung

@laithanhhung laithanhhung commented Jul 14, 2026

Copy link
Copy Markdown
Member

Add full CRUD management for the master data the admin role owns (ROLE_MATRIX = Full): catalog (categories, units, products, markets + per-market pricing) and logistics (hubs, vehicles, delivery zones). Simple resources share a config-driven ResourceCrudComponent; markets and pricing get bespoke screens. Wires admin routes, two nav groups and vi/en i18n.

Also:

  • fix(auth): resolve the post-login landing in the sign-in / unlock-session components and drop the async-racy signed-in-redirect route (admins were bounced to /home on cold loads)
  • chore(config): add production environment (environment.production.ts) wired via angular.json fileReplacements; default codegen spec URL to localhost

Summary by CodeRabbit

  • New Features

    • Added admin management screens for categories, units, products, markets, market pricing, hubs, vehicles, and delivery zones.
    • Added reusable search, create, edit, delete, and deactivate workflows for administrative data.
    • Added English and Vietnamese translations for the new admin areas.
    • Admin users now land on the admin area after sign-in, while other users go to the home area.
  • Bug Fixes

    • Improved handling of varied or empty API responses.
    • Updated development and production API endpoint configuration for more reliable builds and local testing.
  • Documentation

    • Updated navigation and runtime verification guidance to reflect the new routing and API configuration.

Add full CRUD management for the master data the admin role owns
(ROLE_MATRIX = Full): catalog (categories, units, products, markets +
per-market pricing) and logistics (hubs, vehicles, delivery zones). Simple
resources share a config-driven ResourceCrudComponent; markets and pricing
get bespoke screens. Wires admin routes, two nav groups and vi/en i18n.

Also:
- fix(auth): resolve the post-login landing in the sign-in / unlock-session
  components and drop the async-racy signed-in-redirect route (admins were
  bounced to /home on cold loads)
- chore(config): add production environment (environment.production.ts) wired
  via angular.json fileReplacements; default codegen spec URL to localhost

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@kody-ai

kody-ai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Code Review Could Not Complete ⚠️

The review failed before suggestions could be generated.

Reason: The configured API key (google_gemini) is out of credits or has hit its billing limit. Top up the account or adjust the plan.

After fixing the issue, comment @kody review on this PR to re-run the review.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug
Performance
Security
Business Logic

Access your configuration settings here.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 74aa7d28-c765-4a59-9ed0-eb348dcf360a

📥 Commits

Reviewing files that changed from the base of the PR and between b31d335 and 7e60933.

📒 Files selected for processing (29)
  • .claude/skills/verify/SKILL.md
  • angular.json
  • public/i18n/en.json
  • public/i18n/vi.json
  • scripts/generate-api.mjs
  • specs/ux/NAVIGATION.md
  • src/app/app.routes.ts
  • src/app/core/api/envelope.ts
  • src/app/core/auth/permissions/permissions.service.ts
  • src/app/core/navigation/navigation.data.ts
  • src/app/modules/admin/admin.routes.ts
  • src/app/modules/admin/catalog/catalog-admin.service.ts
  • src/app/modules/admin/catalog/categories.component.ts
  • src/app/modules/admin/catalog/market-products.component.html
  • src/app/modules/admin/catalog/market-products.component.ts
  • src/app/modules/admin/catalog/markets.component.ts
  • src/app/modules/admin/catalog/products.component.ts
  • src/app/modules/admin/catalog/units.component.ts
  • src/app/modules/admin/logistics/delivery-zones.component.ts
  • src/app/modules/admin/logistics/hubs.component.ts
  • src/app/modules/admin/logistics/logistics-admin.service.ts
  • src/app/modules/admin/logistics/vehicles.component.ts
  • src/app/modules/admin/shared/resource-crud.component.html
  • src/app/modules/admin/shared/resource-crud.component.ts
  • src/app/modules/admin/shared/resource-crud.types.ts
  • src/app/modules/auth/sign-in/sign-in.component.ts
  • src/app/modules/auth/unlock-session/unlock-session.component.ts
  • src/environments/environment.production.ts
  • src/environments/environment.ts

📝 Walkthrough

Walkthrough

This PR adds a configurable admin CRUD framework and new catalog, market-pricing, and logistics management screens. It also updates role-based landing navigation, environment-specific API configuration, response parsing helpers, translations, routes, API generation defaults, and verification guidance.

Changes

Admin management platform

Layer / File(s) Summary
Runtime configuration, API envelopes, and role landing
angular.json, src/environments/..., src/app/core/api/envelope.ts, src/app/core/auth/..., src/app/modules/auth/...
Production environment replacement, defensive API response parsing, and role-based /admin or /home landing are added.
Declarative CRUD framework
src/app/modules/admin/shared/...
Shared CRUD types and a configurable component now support searching, dynamic forms, create/edit flows, removal confirmation, loading states, and notifications.
Catalog and market management
src/app/modules/admin/catalog/...
Categories, units, products, markets, and market-specific pricing and quantity management are added through CatalogAdminService and standalone screens.
Logistics management
src/app/modules/admin/logistics/...
CRUD screens and API access are added for hubs, vehicles, and delivery zones.
Admin routing, navigation, and localization
src/app/modules/admin/admin.routes.ts, src/app/core/navigation/navigation.data.ts, public/i18n/*.json
New catalog and logistics routes, navigation groups, and English/Vietnamese translations are registered.

Supporting runtime and tooling updates

Layer / File(s) Summary
Local API defaults and verification guidance
scripts/generate-api.mjs, .claude/skills/verify/SKILL.md, specs/ux/NAVIGATION.md
API generation defaults to the local OpenAPI endpoint, Playwright stubbing uses configured API origins, and navigation documentation reflects component-level role routing.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AdminUser
  participant ResourceCrudComponent
  participant CatalogAdminService
  participant OpenAPIClient
  AdminUser->>ResourceCrudComponent: open catalog or logistics screen
  ResourceCrudComponent->>CatalogAdminService: list resource rows
  CatalogAdminService->>OpenAPIClient: request API data
  OpenAPIClient-->>CatalogAdminService: response body
  CatalogAdminService-->>ResourceCrudComponent: normalized rows
  AdminUser->>ResourceCrudComponent: submit create, edit, or remove action
  ResourceCrudComponent->>CatalogAdminService: invoke configured operation
  CatalogAdminService->>OpenAPIClient: send normalized payload
  OpenAPIClient-->>CatalogAdminService: operation result
  CatalogAdminService-->>ResourceCrudComponent: completion
  ResourceCrudComponent-->>AdminUser: reload rows and show notification
Loading

Possibly related PRs

Suggested reviewers: kody-ai

Poem

I’m a rabbit with routes in a neat little row,
Catalogs and hubs now have places to go.
Forms hop to APIs, responses unwrap,
Markets save prices with one tidy tap.
/admin or /home, the right landing is near—
Fresh CRUD blooms brightly, carrots cheer! 🐇

✨ 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 UC-ADMIN-01/fe-web-admin-management

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


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.

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