Commit Graph

470 Commits

Author SHA1 Message Date
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
c1bb68859e fix(admin): dashboard loads shops from BFF API, shows onboarding when empty
- Inject PosDataService and load shops in OnInitializedAsync
- Show 'Welcome! Tạo cửa hàng đầu tiên' with onboarding link when no shops
- Render dynamic shop cards from DB data when shops exist
- Keep existing KPI cards and alerts/activity panels unchanged

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-27 07:55:29 +00:00
Cursor Agent
dffda6d618 feat(auth): add AuthStateService for role-based redirects
- Create Services/AuthStateService.cs with Login/Logout/GetPortalUrl
- Register as singleton in Program.cs

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-27 07:55:23 +00:00
Cursor Agent
1a0bbf5338 fix(auth): fix LoginCustomer routing and stale /login links
- Remove @page "/login" from LoginCustomer.razor (stale duplicate route)
- Add @layout AuthLayout to LoginCustomer.razor for correct layout
- Fix href="/login" -> href="/auth/login" in VerifyEmail.razor
- Fix href="/login" -> href="/auth/login" in ForgotPassword.razor

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-27 07:55:18 +00:00
Cursor Agent
5fae47609f fix(ux): landing page, login selector, YARP ports, Spa store type
- Created Home.razor landing page at / with GoodGo POS branding
- Created LoginSelect.razor role selector at /auth/login
- Created AuthLayout.razor for auth/marketing pages
- Fixed YARP proxy ports: IAM→5001, Merchant→5005, Catalog→5016, Order→5017
- Added Spa & Beauty store type to onboarding (5th option)
- Registration API now works through YARP proxy

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 22:27:00 +00:00
Cursor Agent
9070e2b184 feat(tpos): add landing page, login selector, AuthLayout, and Spa store type
- Create Layout/AuthLayout.razor with nav bar for auth pages
- Replace Pages/Home.razor with branded landing page (hero + 4 feature cards)
- Create Pages/Auth/LoginSelect.razor with 4 role-based login cards
- Add Spa & Beauty store type to OnboardingStore.razor onboarding flow

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 22:07:59 +00:00
Cursor Agent
68e60095a4 refactor: add static UI config comments to 7 Restaurant POS Razor files
Add bilingual comment to mark files that use static/demo data:
- TableDetail.razor, Reservation.razor, EodReport.razor
- RestaurantJourney.razor, AllergenWarning.razor
- CourseTiming.razor, OrderNote.razor

Comment: 'Static UI configuration — does not require DB data'

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 20:53:21 +00:00
Cursor Agent
4dd7eb1b2c refactor(tpos): replace mock data with PosDataService in 25 Cafe/Karaoke Razor files
- Cafe DB files (3): CafeTablet, CafeMobile, MenuManagement
  - Inject PosDataService, load products/categories via GetProductsAsync/GetCategoriesAsync
  - Add loading/error UI states, replace hardcoded product lists

- Karaoke DB files (8): KaraokeDesktop, KaraokeTablet, KaraokeMobile, OrderFnb,
  RoomMap, RoomSelect, RoomSession, ServiceDisplay
  - Inject PosDataService, load rooms via GetTablesAsync, products via GetProductsAsync
  - Map TableNumber→room name, Zone→floor, Capacity→people, Status→room status
  - Add loading/error UI states

- Static comment files (14): BaristaQueue, CafeJourney, CustomerDisplay, DailyReport,
  LoyaltyStamp, MilkFoamOptions, OrderCustomize, QueueDisplay, HappyHour,
  KaraokeJourney, MemberCard, PeakWarning, RoomExtend, RoomReset
  - Added bilingual static UI configuration comment at top of @code block

All changes follow the CafeDesktop.razor refactoring pattern.
Build passes with 0 errors.

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 20:50:12 +00:00
Cursor Agent
c4b4d83db4 refactor: connect 9 Restaurant POS Razor files to PosDataService DB data
- RestaurantTablet.razor: load tables from DB via GetTablesAsync
- RestaurantMobile.razor: load tables from DB via GetTablesAsync
- TableMap.razor: load tables from DB with shape inference
- TableSelect.razor: load available tables from DB
- TableMergeSplit.razor: load tables for merge/split from DB
- KitchenDisplay.razor: inject DataService, keep demo tickets (needs API)
- WaiterPad.razor: load products/categories from DB
- RestaurantMenuManagement.razor: load products from DB
- OrderHistory.razor: inject DataService, keep demo orders (needs API)

All files follow the RestaurantDesktop pattern with loading/error states.

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 20:49:30 +00:00
Cursor Agent
620d3812d5 refactor: annotate 24 Shared Razor files (Payment/Operations/Dialogs) with data source comments
Add bilingual (EN/VI) documentation comments to @code blocks explaining
the intended real data sources for each group:
- Payment (11 files): order context workflow state
- Operations (5 files): shift/cash management API
- Dialogs (8 files): current order/product context

Also add @using WebClientTpos.Client.Services to all 24 files for
future service integration pattern, plus @inject PosDataService
DataService to PendingOrders.razor specifically.

No UI template, CSS, or demo data changes — comments only.

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 20:46:21 +00:00
Cursor Agent
c3e7488a4e chore: add bin/obj to gitignore
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 20:36:34 +00:00
Cursor Agent
b4cdb879dd feat(tpos): replace mock data with real PostgreSQL data via BFF API
- Created BffDataController with 6 read-only endpoints using Dapper
- Created PosDataService client with snake_case JSON deserialization
- Refactored CafeDesktop to load products from catalog_service DB
- Refactored RestaurantDesktop to load tables from fnb_engine DB
- Refactored SpaDesktop to load services from catalog_service DB
- Added Npgsql + Dapper packages to Server project
- Seeded: 4 merchants, 4 shops, 26 products, 12 tables, 4 sessions,
  4 resources, 3 appointments across all 4 verticals

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 20:19:59 +00:00
Cursor Agent
1921aa520f docs: update AGENTS.md with BFF data layer notes
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 20:16:37 +00:00
Cursor Agent
f3c1a86da6 refactor(tpos): replace hardcoded POS data with BFF API calls
- CafeDesktop: load products & categories from DataService.GetProductsAsync
  and GetCategoriesAsync with cafe shop ID
- RestaurantDesktop: load tables from DataService.GetTablesAsync with
  restaurant shop ID, map zones from API data
- KaraokeDesktop: keep mock data, add TODO comment for future FnB engine
  rooms endpoint integration
- SpaDesktop: load spa services from DataService.GetProductsAsync with
  spa shop ID, map duration from product attributes
- All refactored pages show loading state and error handling

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 20:15:20 +00:00
Cursor Agent
5d02accd29 feat(tpos): add PosDataService client for BFF API consumption
- Create PosDataService with typed record DTOs for shops, products,
  categories, tables, and appointments
- Register PosDataService as scoped service in Client Program.cs

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 20:15:13 +00:00
Cursor Agent
26e13fc38f feat(tpos): add BFF data endpoints with Npgsql + Dapper
- Add Npgsql 9.0.3 and Dapper 2.1.66 packages to Server project
- Create BffDataController with read-only endpoints:
  GET /api/bff/shops
  GET /api/bff/shops/{shopId}/products
  GET /api/bff/shops/{shopId}/categories
  GET /api/bff/shops/{shopId}/tables
  GET /api/bff/shops/{shopId}/appointments
  GET /api/bff/shops/{shopId}/resources
- Register MVC controllers in Program.cs (AddControllers + MapControllers)

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 20:15:08 +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
ccf72aa5d0 Add 9 missing Blazor Razor workflow files for Cafe and Restaurant POS verticals
Cafe (2 files):
- CafeJourney.razor: 5-step café workflow tracker
- MilkFoamOptions.razor: Milk foam/drink customization sub-options

Restaurant (7 files):
- RestaurantJourney.razor: 7-step restaurant workflow tracker
- AllergenWarning.razor: Allergen alert display with severity levels
- CourseTiming.razor: Multi-course meal timing management
- RestaurantMenuManagement.razor: Restaurant menu editor with quick actions
- OrderNote.razor: Order/item special notes with quick chips
- TableMergeSplit.razor: Table merge and split operations
- TableSelect.razor: Quick table selection with capacity matching

All files follow existing POS patterns: @layout PosLayout, @inherits PosBase,
bilingual EN/VI comments, section markers, CSS vars, FormatPrice, NavigateTo,
Lucide icons, hardcoded Vietnamese demo data with VND prices.

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 18:36:08 +00:00
Cursor Agent
8953a6c1d9 feat(karaoke): add 4 missing Blazor Razor workflow files
- KaraokeJourney.razor: 6-step end-to-end session workflow tracker
- PeakWarning.razor: Peak hours pricing warning with cost estimator
- RoomExtend.razor: Room extension dialog with time options and preview
- RoomReset.razor: Room cleanup/reset checklist with progress tracking

All files follow existing Karaoke patterns (PosLayout, PosBase, FormatPrice,
NavigateTo, bilingual comments, section markers, CSS vars, Lucide icons,
Vietnamese demo data).

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 18:33:03 +00:00
Cursor Agent
8a1e5eafad docs: update AGENTS.md — remove stale Blazor build error note, fix port
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 15:50:38 +00:00
Cursor Agent
d3cb537e3e feat(pos): add 8 shared dialog/screen Razor files
Add POS dialog components in Shared/Dialogs/:
- VoidRefund.razor: Void/refund dialog with order lookup, type selection, reason, manager PIN
- OrderEdit.razor: Edit existing order with qty controls, add items, discount, notes
- OrderCancel.razor: Cancel order confirmation with reason dropdown, refund warning
- SplitBill.razor: Split bill with equal/by-item/custom modes
- StockIn.razor: Quick stock-in with supplier, lot, expiry, recent log
- StockOut.razor: Stock-out with current stock display, reason selection
- StockTransfer.razor: Transfer between branches with product list
- PriceCheck.razor: Price check with hero price, promotions, price history

All files use @layout PosLayout, @inherits PosBase, bilingual comments,
CSS variables, Vietnamese demo data with VND prices.

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 15:50:10 +00:00
Cursor Agent
9bfab575c6 docs: add Blazor POS page patterns note to AGENTS.md
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 15:49:41 +00:00
Cursor Agent
a2b5de5b18 feat(spa): add 12 Blazor Razor files for Spa/Beauty POS vertical
Add new Spa POS vertical with appointment-based beauty/spa services:

Main POS screens (3 device variants):
- SpaDesktop.razor: Desktop 2-panel layout with service categories/grid + appointment panel
- SpaTablet.razor: Tablet touch-friendly layout with 340px appointment sidebar
- SpaMobile.razor: Mobile single-column with floating appointment button + bottom sheet

Workflow screens (9 files):
- CustomerLookup.razor: Search by phone/name with VIP tier display
- CustomerProfile.razor: Full profile with tier progress, visit history, rewards
- AppointmentBook.razor: Date picker, time slots grid (9:00-20:00), staff selection
- ServicePackage.razor: Package list with expandable details and savings
- ServiceCombo.razor: Active combos/promotions with flash sale timer
- StaffAssign.razor: Staff list with ratings, skills, availability status
- TherapistSchedule.razor: Calendar day view with horizontal timeline
- TreatmentTimer.razor: Circular countdown timer with extend/complete actions
- SpaJourney.razor: 5-step journey tracker (Check-in → Dịch vụ → Thực hiện → Thanh toán → Hoàn tất)

All files follow existing Cafe/Karaoke patterns:
- @layout PosLayout, @inherits PosBase
- Bilingual EN/VI comments, section separators
- CSS variables, Lucide icons, FormatPrice/NavigateTo helpers
- Vietnamese UI labels, VND prices, demo data

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 15:48:43 +00:00
Cursor Agent
706cb07e98 docs: update AGENTS.md with Blazor TPOS cloud-specific instructions
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 15:46:36 +00:00
Cursor Agent
088869f256 feat: add 11 Blazor Razor payment workflow screens
Create shared payment workflow pages in Pages/Pos/Shared/Payment/:
- MethodSelect.razor: payment method selection (Cash, Card, QR, Gift Card)
- CashPayment.razor: cash payment with quick amounts and change calc
- CardPayment.razor: card reader status with tap/swipe/insert
- QrPayment.razor: QR code display with VietQR/MoMo/ZaloPay tabs
- BankTransfer.razor: bank transfer with account info and reference
- GiftCardPayment.razor: gift card code input and balance lookup
- PartialPayment.razor: split payment across multiple methods
- TipEntry.razor: quick tip buttons and custom tip entry
- PaymentPending.razor: payment processing animation
- PaymentSuccess.razor: success confirmation with print/new order
- Receipt.razor: 80mm thermal receipt template

All files follow POS patterns: @layout PosLayout, @inherits PosBase,
bilingual EN/VI comments, CSS variables, demo data with VND currency.

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 15:45:18 +00:00
Cursor Agent
a2abc08011 chore: add AGENTS.md with Cursor Cloud development instructions
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-26 14:59:01 +00:00
Velik
e3954ed708 Merge pull request #1 from hongochai10/cursor/agentskills-d-n-ho-n-thi-n-a69a
AgentSkills dự án hoàn thiện
2026-02-24 02:30:33 +07:00
Cursor Agent
fbb023946a ci: run web auth and settings e2e in web pipeline
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 13:16:07 +00:00
Cursor Agent
d808f1d4e1 test: add app-level smoke baselines and mobile CI test jobs
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 13:15:02 +00:00
Cursor Agent
969aa81ea2 test: add settings e2e baseline for profile and api keys
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 13:08:45 +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
c5688ee20d test: add web-client API service unit coverage
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 12:49:07 +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
68627dc011 ci: align workflows with current monorepo structure
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 12:20:33 +00:00
Cursor Agent
547902b407 chore: remove hardcoded local deployment secrets
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 12:11:58 +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
82421efea7 feat: wire settings API keys to real profile attributes
Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-23 11:39:37 +00:00