Commit Graph

230 Commits

Author SHA1 Message Date
Ho Ngoc Hai
629fed8a55 commit 2026-03-05 01:39:40 +07:00
Ho Ngoc Hai
df7eec1ec2 feat(web-client-tpos, inventory-service): implement percentage-based campaigns and enrich inventory with product names 2026-03-04 20:22:54 +07:00
Ho Ngoc Hai
051261accd feat: implement recipe management, inventory operations, voucher integration, and order discounts 2026-03-04 20:05:38 +07:00
Ho Ngoc Hai
65f3da53ae refactor(merchant-service): standardize enumeration name resolution in shop queries using a new helper method. 2026-03-04 16:11:55 +07:00
Ho Ngoc Hai
028ef4c1cd feat: implement user-based wallet and transaction retrieval by parsing JWT sub claim and adjust JWT validation parameters across services. 2026-03-04 13:08:08 +07:00
Ho Ngoc Hai
7baba14fad refactor(web-client-tpos, order-service): improve API deserialization, update DTO types for Dapper compatibility, and refine API proxying for staff schedules and order cancellations. 2026-03-04 12:53:43 +07:00
Ho Ngoc Hai
64e7b4e00d refactor: update EF Core backing field mapping and ignore DDD enumeration types 2026-03-04 12:36:19 +07:00
Ho Ngoc Hai
2d74f53f0d refactor: update DTO numeric types, refactor EF Core entity configurations to use HasField, and enable JsonDocument change tracking. 2026-03-04 11:44:43 +07:00
Ho Ngoc Hai
89bd8232a8 feat: Implement Blazor lifecycle improvements, enhance navigation with browser history, and update EF Core entity configurations for backing fields 2026-03-04 11:35:41 +07:00
Ho Ngoc Hai
ce61b4d3db feat(fnb-engine): add shopId and status filters to kitchen tickets
Add shopId and status query params to GET /api/v1/kitchen/tickets.
Joins through Session to resolve shopId since KitchenTicket only
has SessionId. Backward-compatible: without shopId falls back to
existing pending-by-station behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 10:37:55 +07:00
Ho Ngoc Hai
4cd172bee5 feat(booking-service): add shop-wide staff schedules endpoint
Add GET /api/v1/schedules?shopId= to return all staff schedules
for a shop. Existing per-staff endpoint unchanged. BFF needs this
to display all schedules on the admin dashboard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 10:36:43 +07:00
Ho Ngoc Hai
9b44e88a6a feat(order-service): add dashboard and reporting endpoints
- GET /api/v1/orders/dashboard — POS dashboard stats (revenue, orders,
  items sold, popular items, payment breakdown, hourly revenue, recent orders)
- GET /api/v1/reports/revenue — Revenue report grouped by daily/weekly/monthly
- GET /api/v1/reports/top-products — Top selling products by quantity

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 10:36:09 +07:00
Ho Ngoc Hai
37042b48b7 feat(inventory-service): add shopId filter to transactions endpoint
BFF needs to query inventory transactions by shopId. The existing
endpoint only supported inventoryItemId. Now accepts either shopId
or inventoryItemId as query parameters.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 10:35:54 +07:00
Ho Ngoc Hai
617a7caf81 fix(iam-service): resolve 500 error on GET /api/v1/users endpoint 2026-03-03 10:48:13 +07:00
Ho Ngoc Hai
ea59326658 fix(iam-service): add try-catch to role seeding for visible error logging 2026-03-01 06:17:08 +07:00
Ho Ngoc Hai
cb6337cb7c test(merchant-service): add 38 unit tests for Shop aggregate and ShopFeatures 2026-03-01 05:50:58 +07:00
Ho Ngoc Hai
1acc0c399b fix(merchant-service): add vertical-specific categories to ShopFeatures.ForCategory() 2026-03-01 05:39:16 +07:00
Ho Ngoc Hai
36da982386 fix(merchant-service): resolve MapToDetailDto NullRef on shop detail API
- Add null-safe access for Type, Category, Status, ContactInfo, Branches
- Fixes 500 error when loading shop details in admin UI
2026-02-28 22:53:38 +07:00
Ho Ngoc Hai
4e91c96c97 feat(multi-vertical): phase 0 — seed data script + fix GetShopsQueryHandler NullRef
- Add scripts/seed-demo-data.sh: creates user, merchant, 5 shops, 47 products, 15 categories, 18 tables/rooms, 13 booking resources
- Fix NullReferenceException in GetShopsQueryHandler (null-safe Enumeration access)
- Default account: hongochai10@icloud.com / Velik@2026
2026-02-28 22:32:51 +07:00
Ho Ngoc Hai
fd9173237f feat(merchant-service): add Cafe/Restaurant/Karaoke/Spa business categories
Add vertical-specific BusinessCategory enum values:
- Cafe (11), Restaurant (12), Karaoke (13), Spa (14)
Update CreateShopCommandHandler to map vertical names to new categories
Update EF Core seed data with new categories
2026-02-28 08:49:58 +07:00
Ho Ngoc Hai
1caaf5e1e4 fix(web-client-tpos): auto-register merchant before shop creation 2026-02-28 04:00:09 +07:00
Ho Ngoc Hai
57afe213e4 fix(merchant-service): fix EF Core unmapped property errors in repositories
- Changed repository LINQ queries to use EF.Property<T>() for backing fields
- Expression-bodied properties cannot be auto-mapped by EF Core
- Fixed StatusId comparison in CreateShopCommandHandler (Status nav is null)
- Updated EntityTypeConfiguration comments explaining Ignore pattern
2026-02-28 03:12:42 +07:00
Ho Ngoc Hai
68a6c4a81e fix(iam-service): add custom ResourceOwnerPasswordValidator for Duende password grant
- Created ResourceOwnerPasswordValidator using UserManager.CheckPasswordAsync
- Registered with .AddResourceOwnerValidator<ResourceOwnerPasswordValidator>()
- Added comments explaining EF.Property pattern for DDD backing fields
2026-02-28 03:12:31 +07:00
Ho Ngoc Hai
b9e5c4e31e fix(merchant_service): PendingModelChangesWarning 2026-02-28 02:04:03 +07:00
Ho Ngoc Hai
751f90c365 feat: Log EF Core migration errors instead of crashing the application at startup across all services. 2026-02-28 01:03:43 +07:00
Ho Ngoc Hai
be86e48de6 feat: automatically apply EF Core database migrations on service startup across all services 2026-02-28 00:51:35 +07:00
Ho Ngoc Hai
f521cc0a91 chore: Remove the web-client application, add a local database initialization script, and update service Dockerfiles. 2026-02-28 00:41:17 +07:00
Cursor Agent
783d95cbcc fix(ux): auth workflow fixes — customer login, dashboard, auth service, YARP ports
Some checks failed
IAM Service CI / build-and-test (push) Failing after 33s
Mobile Apps CI / dotnet-client-apps (apps/web-client-base-net/src/WebClientBase.Server/WebClientBase.Server.csproj) (push) Failing after 5s
Mobile Apps CI / dotnet-client-apps (apps/web-client-eggymon-landipage-net/src/EggymonLandingPage.Server/EggymonLandingPage.Server.csproj) (push) Failing after 9s
Mobile Apps CI / dotnet-client-apps (apps/web-client-tpos-net/src/WebClientTpos.Server/WebClientTpos.Server.csproj) (push) Failing after 8s
Mobile Apps CI / dotnet-client-app-tests (apps/app-client-base-net/tests/AppClientBase.UnitTests/AppClientBase.UnitTests.csproj) (push) Failing after 7s
Mobile Apps CI / dotnet-client-app-tests (apps/web-client-base-net/tests/WebClientBase.SmokeTests/WebClientBase.SmokeTests.csproj) (push) Failing after 11s
Mobile Apps CI / dotnet-client-app-tests (apps/web-client-eggymon-landipage-net/tests/EggymonLandingPage.SmokeTests/EggymonLandingPage.SmokeTests.csproj) (push) Failing after 9s
Mobile Apps CI / dotnet-client-app-tests (apps/web-client-tpos-net/tests/WebClientTpos.SmokeTests/WebClientTpos.SmokeTests.csproj) (push) Failing after 5s
Mobile Apps CI / maui-project-validation (push) Failing after 3s
Mobile Apps CI / swift-client-app (push) Has been cancelled
Phase 1 fixes:
- Fixed Customer Login route (/auth/login/customer now renders correctly)
- Fixed YARP proxy ports for all microservices
- Fixed login links across all auth pages (/login → /auth/login)
- Created AuthStateService for role-based portal redirects
- Dashboard loads real shop data from BFF API
- Reverted UseBlazorFrameworkFiles (breaks .NET 10 MapStaticAssets)
- Created Home.razor landing page and LoginSelect.razor (compiled in DLL,
  Blazor client routing needs investigation for / and /auth/login routes)

Verified working:
- Customer Login: phone/OTP with social login
- Staff Login: green theme with role hints
- Admin Login: blue theme with security warning
- Branch Login: orange theme with stats
- Registration: form + API via YARP proxy
- Store Onboarding: 5 types (Café/Nhà hàng/Karaoke/Spa/Bán lẻ)

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-27 08:35:07 +00:00
Cursor Agent
d586563c60 fix(services): add JWT Bearer auth middleware and OIDC discovery to 6 microservices
- Added UseAuthentication() + UseAuthorization() middleware after UseRouting()
- Added AddAuthentication().AddJwtBearer() with OIDC authority discovery
- Added Microsoft.AspNetCore.Authentication.JwtBearer NuGet package
- Affected: Merchant, Catalog, Order, Inventory, FnB Engine, Booking services
- Tokens validated via IAM IdentityServer OIDC discovery endpoint

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 19:32:58 +00:00
Cursor Agent
d406540215 fix: switch JWT Bearer auth from symmetric key to OIDC discovery in 5 microservices
Replace manual SymmetricSecurityKey validation with Authority-based OIDC
discovery so tokens are validated against RSA keys published by the IAM
IdentityServer's discovery endpoint.

Services updated:
- CatalogService.API
- OrderService.API
- InventoryService.API
- FnbEngine.API
- BookingService.API

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 19:31:22 +00:00
Cursor Agent
0727a5c41e Add JWT Bearer authentication registration to 5 microservice Program.cs files
Add AddAuthentication(JwtBearerDefaults.AuthenticationScheme) and
AddJwtBearer() service registration before CORS configuration in:
- CatalogService.API
- OrderService.API
- InventoryService.API
- FnbEngine.API
- BookingService.API

Also add Microsoft.AspNetCore.Authentication.JwtBearer v10.0.1 NuGet
package reference to each service's .csproj file.

This fixes the runtime error caused by UseAuthentication() being called
without a registered authentication scheme.

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 19:26:51 +00:00
Cursor Agent
aed16d4059 Add UseAuthentication and UseAuthorization middleware after UseRouting in 5 microservices
Added app.UseAuthentication() and app.UseAuthorization() after
app.UseRouting() in the middleware pipeline for:
- CatalogService.API
- OrderService.API
- InventoryService.API
- FnbEngine.API
- BookingService.API

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 19:21:36 +00:00
Cursor Agent
8f557bd106 test: replace booking sample suites with appointment coverage
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 13:04:13 +00:00
Cursor Agent
0adcaadae3 test: replace sample suites in mkt and commerce services
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 13:02:38 +00:00
Cursor Agent
d1cfef93cf test: replace mission and commerce sample functional suites
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 12:56:57 +00:00
Cursor Agent
d288320cf3 test: replace ads sample functional tests with endpoint coverage
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 12:53:11 +00:00
Cursor Agent
0d35f144ab test: replace whatsapp sample suites with account and webhook coverage
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 12:51:17 +00:00
Cursor Agent
0f828dafb0 test: replace sample tests with service-specific order and ads suites
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 12:47:21 +00:00
Cursor Agent
9e5b1018b4 feat: implement admin order stats export and mining overview
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 12:42:55 +00:00
Cursor Agent
d68a47f93a feat: complete ads billing command and credit workflows
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 12:38:59 +00:00
Cursor Agent
1e131adbf3 feat: implement ads serving statistics and event pipeline
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 12:35:08 +00:00
Cursor Agent
6baca17249 feat: secure whatsapp token handling and keyword trigger parsing
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 12:27:39 +00:00
Cursor Agent
22dcc97ba9 feat: implement Aliyun multipart storage operations
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 11:50:40 +00:00
Cursor Agent
f4f5d9d576 fix: enforce booking admin auth and clean membership TODO
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 11:46:23 +00:00
Cursor Agent
a414d7d528 feat: implement IAM OTP dispatch abstractions
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 11:43:30 +00:00
Cursor Agent
7c616d412d fix: stabilize web workspace quality gates
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 11:25:27 +00:00
Ho Ngoc Hai
8e0cbbd346 feat: Implement command handlers and validators for Conversation, Twitter Account, Contact, Template, and Campaign management. 2026-01-19 01:28:00 +07:00
Ho Ngoc Hai
8ace5025d9 feat: Introduce MktXService with API controllers for campaigns, contacts, conversations, templates, and webhooks, and add chatbot rule deletion and status toggling to MktZaloService. 2026-01-19 01:24:57 +07:00
Ho Ngoc Hai
37db21fbc0 feat: Implement Zalo and MktX services with API controllers, add web client pages for Auth and Products, and update client navigation and styling. 2026-01-19 01:23:09 +07:00
Ho Ngoc Hai
d285f1f9eb feat: Add new WebClientBase Blazor application and MktZaloService API, and update WhatsAppService and MktXService infrastructure. 2026-01-19 01:19:00 +07:00