Commit Graph

183 Commits

Author SHA1 Message Date
Ho Ngoc Hai
e74527dc8f feat(web-client-tpos): implement POS order creation via BFF API
- Add POST /api/bff/pos/orders endpoint (Dapper, order+items+payment_method)
- Add CreatePosOrderAsync to PosDataService with camelCase JSON serialization
- Wire CafeDesktop ConfirmPayment to API (async, ProductId tracking, fallback)
- Add TryRestoreSessionAsync to POS page init for JWT auth
- Replace Forbid() with Unauthorized() + diagnostic logging
2026-03-03 15:23:12 +07:00
Ho Ngoc Hai
d969f3dda8 feat(web-client-tpos): replace hardcoded POS data with API-driven endpoints 2026-03-03 11:27:34 +07:00
Ho Ngoc Hai
fe6e14ce85 feat(web-client-tpos): unify POS with inline payment and tabs (path fix) 2026-03-03 11:13:27 +07:00
Ho Ngoc Hai
15404a859f feat(web-client-tpos): unify POS page with tabs and inline payment 2026-03-03 11:12:48 +07:00
Ho Ngoc Hai
ad6fe03b70 feat(web-client): add users management page and enhance roles CRUD
- Expand IamApiService with Users CRUD, Role mutations, role assignment methods
- Create UserManagement.razor page at /admin/users with user list + role assignment
- Enhance RolePermissions.razor with create/edit/delete role dialogs
- Add Users nav item to AdminLayout sidebar
- Add localization keys (vi-VN, en-US) for Users navigation
2026-03-03 10:19:22 +07:00
Ho Ngoc Hai
f3bfcc87f8 fix(web-client-tpos): fix roles API response parsing and property mapping 2026-03-01 06:31:47 +07:00
Ho Ngoc Hai
f353f8843e feat(web-client-tpos): redesign Home/NotFound pages, localize Dashboard 2026-03-01 06:02:20 +07:00
Ho Ngoc Hai
33e0bab4f7 refactor(web-client-tpos): centralize theme, fix layout bugs, cleanup dead code 2026-03-01 05:58:58 +07:00
Ho Ngoc Hai
9c51d268c6 feat(web-client-tpos): internationalize sidebar and admin labels with i18n keys 2026-03-01 05:44:10 +07:00
Ho Ngoc Hai
cc0e642c43 feat(admin): P6 — Zones, Combo services, Shift management
- R4: Zone management (Restaurant) — 4 zones with table counts, status, actions
- S6: Combo services (Spa) — 3 combo cards with pricing, duration, sold count
- C5: Shift management (Café) — weekly shift grid (S/C/—) with legend + stats
2026-03-01 05:22:32 +07:00
Ho Ngoc Hai
8ec9e2a45a feat(admin): P5 — Recipes, Reservations, Happy Hour, Packages, Consent, Doctors, Follow-up
- C2: Ingredient/recipe management (Café) — 8 demo items with stock status
- R3: Reservation management (Restaurant) — booking table with 5 demo entries
- K3: Happy Hour config (Karaoke) — time slots, discounts, day picker, combos
- S4: Service packages (Spa) — 3 package cards with pricing/savings
- B5: Consent forms (Beauty) — 4 template cards with field counts
- B6: Doctor management (Beauty) — 4 specialist cards with credentials
- B7: Follow-up scheduler (Beauty) — re-exam table with status tracking
2026-03-01 05:01:57 +07:00
Ho Ngoc Hai
81e357d226 feat(admin): P4 — Notifications, Customer detail, Photo upload
- G9: Notification bell with dropdown panel (4 demo alerts)
- G6+: Customer detail expandable rows + action buttons
- B4: Before/After photo upload with dual dropzones + history grid
2026-03-01 04:43:18 +07:00
Ho Ngoc Hai
644751be7b feat(admin): P3 — Karaoke hourly pricing + product type badges
- K2+K5: Room hourly rate (VIP 200k, Party 350k, Standard 120k/h)
- K2+K5: Active session billing calculator (elapsed hours × rate)
- C3-C4: Product type badge (Đồ uống/Dịch vụ/Vật lý)
- C3-C4: Variant/topping tag parsing from product description
2026-03-01 04:32:13 +07:00
Ho Ngoc Hai
8ea22b22b9 feat(admin): P2 features — Calendar, KDS, Room types, Medical, Receipt
- S5: Appointment calendar view (7-day grid, week nav, today highlight)
- R2: Kitchen Display demo with station tabs (Bếp/Bar/Nướng)
- K4: Room type badges (VIP/Standard/Party) from zone field
- B2: Treatments tabbed view (Liệu trình/Hồ sơ y tế/Ảnh Before-After)
- G10: Receipt settings panel (header/footer, paper size, logo, QR code)
- Added _calendarWeekOffset, _kdsStation, _treatmentTab state vars
2026-03-01 04:24:47 +07:00
Ho Ngoc Hai
0959f594bd fix(bff): add try-catch to GetWallets and GetWalletTransactions
- Prevent 500 errors when wallet_service tables are missing
- Return empty arrays on failure for graceful Finance page display
- Now 7 total BFF endpoints hardened against missing tables
2026-03-01 04:14:36 +07:00
Ho Ngoc Hai
f045dbf5ed feat(admin): enhance Customer search + Finance date filter (G6, G8)
- Customers: add search bar (filter by ID, membership level)
- Customers: membership level displays as badge
- Customers: show count header with search input
- Finance: add date range tabs (7 ngày / 30 ngày / Tất cả)
- Finance: revenue/order stats update based on selected period
2026-03-01 04:08:38 +07:00
Ho Ngoc Hai
a6e85d0451 feat(admin): add Staff Schedule UI for Spa/Beauty (S3)
- Add "Lịch làm việc" menu item to Spa & Beauty sidebars
- Add case "schedule": section with stat cards + weekly table
- Display employee code, role, day (T2-CN), start/end time
- Add DayLabel helper for Vietnamese day names
- Add LoadData case + section title config
2026-03-01 04:02:55 +07:00
Ho Ngoc Hai
e5b3aa58fb fix(admin-layout): fix Guest display, error bar, empty shops
- Subscribe to AuthState.OnChange to refresh user info after login
- Call TryRestoreSessionAsync on first render to restore from localStorage
- Wrap Body in ErrorBoundary with custom UI (replaces red error bar)
- Properly unsubscribe OnChange in Dispose to prevent memory leaks
2026-03-01 00:11:23 +07:00
Ho Ngoc Hai
59521f6fd6 fix(bff): add try-catch to prevent 500 on missing DB tables
- Members, MembershipLevels: membership_service tables
- Promotions: promotion_service campaigns table
- StaffRoles, StaffSchedules: booking_service tables
- All return empty array instead of 500 Internal Server Error
2026-02-28 23:52:18 +07:00
Ho Ngoc Hai
d8b65a368f feat(multi-vertical): P2 — resources real data, treatments enhanced, inv txns
- Resources: real table from booking_service (stats + capacity + status)
- Treatments: enhanced UI with Before/After, tái khám, hồ sơ y tế chips
- Inventory: transactions loading wired to GetInventoryTransactionsAsync
- PosDataService: added GetResourcesAsync for booking resources
- LoadData: resources, inventory txns cases added
2026-02-28 23:35:47 +07:00
Ho Ngoc Hai
549bfcb038 feat(multi-vertical): P1 — promotions real data, finance wallets, customer levels
- Promotions: real table from GetPromotionsAsync (stats: total, active, vouchers, used)
- Finance: wallet balance + recent wallet transactions from GetWalletsAsync
- Customers: membership levels table from GetMembershipLevelsAsync
- Staff: schedules data wired from GetStaffSchedulesAsync
- Data vars: wallets, walletTxns, promotions, memberLevels, staffSchedules, invTxns
2026-02-28 23:18:12 +07:00
Ho Ngoc Hai
6d6d6a9f3b feat(multi-vertical): staff CRUD, enhanced reports, ShopInfo MerchantId
- G5: Staff CRUD — add form (employee code, role, phone, email) + AddStaff method
- G7: Reports enhanced with Top Products table (ranked by price)
- Added MerchantId to ShopInfo record for staff creation
- Staff table shows SĐT column instead of Cửa hàng
2026-02-28 23:08:38 +07:00
Ho Ngoc Hai
3f89e1b490 feat(multi-vertical): phases 1-3 — overview dashboard, product CRUD, beauty vertical, settings
- G1: Overview Dashboard with vertical-specific KPIs (tables/rooms/appointments)
- G2: Settings page (shop info, business hours, tax/VAT config)
- G3: Promotions placeholder section
- G4: Product CRUD (add form + delete button per product)
- B1: Beauty separated as its own vertical (icon: scissors, color: #A855F7)
- B3: Treatments placeholder for beauty liệu trình
- S2: Resources placeholder for spa/beauty
- All verticals now have Settings + Khuyến mãi in sidebar
2026-02-28 22:41:06 +07:00
Ho Ngoc Hai
cd553a1497 fix(web-client-tpos): fix Lucide icon rendering and setup button navigation
- Add MutationObserver to auto-call lucide.createIcons() when Blazor adds DOM nodes
- Pin Lucide CDN to v0.468.0 for stability (was @latest)
- Fix "Hoàn tất thiết lập" button: navigate to /admin/shop/{id}/overview (was non-existent /admin/stores/{id}/settings)
- All sidebar, dashboard, store list, and store create icons now render correctly
2026-02-28 22:06:32 +07:00
Ho Ngoc Hai
c838d3627b fix(web-client-tpos): add multi-tenant data isolation to BFF controller
- Implement manual JWT parsing from Authorization header in BffDataController
- Add GetUserIdFromToken() and GetCurrentMerchantIdAsync() helpers
- Scope all 15 BFF endpoints by merchant ownership (shops, products, orders, staff, inventory, wallets, stats)
- Validate ownership on write operations (CreateProduct, CreateStaff, DeleteProduct)
- Add AttachToken() to all 23 PosDataService methods to forward auth token to BFF
- Add JwtSecurityTokenHandler NuGet package for token decoding
2026-02-28 12:20:17 +07:00
Ho Ngoc Hai
f8c2e65d2b fix(admin): update remaining hardcoded /pos links to use dynamic ShopId in ShopOverview and ShopPage 2026-02-28 11:39:39 +07:00
Ho Ngoc Hai
75bcff209b refactor(pos): replace hardcoded shop IDs with dynamic ShopId route parameter across all POS files 2026-02-28 11:22:46 +07:00
Ho Ngoc Hai
364ba541ea feat(web-client): fix category mapping for multi-vertical sidebars
- StoreCreate: use vertical names (Cafe/Restaurant/Karaoke/Spa/Beauty)
- StoreCreate: add 5th store type (Thẩm mỹ viện), 3-column grid
- NormalizeVertical: handle Services category for Spa vertical
- Categories now properly distinguish each vertical type
2026-02-28 08:50:08 +07:00
Ho Ngoc Hai
ee33075ada feat(web-client): implement all vertical-specific sections in ShopPage
- Tables (Restaurant): grid UI with status colors and session info
- Rooms (Karaoke): reuses tables structure with purple theme
- Appointments (Spa): KPI cards + calendar list with status colors
- Services (Spa): products filtered by type=Service
- POS: redirect prompt to /pos page
- Reports: aggregate KPIs (revenue, orders, avg value, products)
- Kitchen: KDS placeholder with description
2026-02-28 07:12:40 +07:00
Ho Ngoc Hai
ceed3b7def chore(web-client): delete 9 orphaned pages replaced by ShopPage sections 2026-02-28 07:04:32 +07:00
Ho Ngoc Hai
abd709d31c fix(web-client): audit fixes — real shop stats, dynamic CTA links, shared helpers
- C1: StoreList shows real per-shop stats (revenue/orders/staff/products) via new BFF endpoint
- C2: RenderEmpty CTA links now route to correct section (finance→/pos, inventory→/menu, etc.)
- C3+M5: ShopOverview right column shows real recent orders instead of always-empty
- C4: AdminSettings expanded from 5 hardcoded services to 11 with icons
- M1-M3: Consolidated duplicate helpers (GetShopIcon, GetStatusBadgeClass, GetStatusLabel) into ShopVerticalHelper
- M2: Added proper error state UI for StoreList data loading failures
- Added GET /api/bff/shops/stats BFF endpoint for aggregated per-shop statistics
2026-02-28 06:56:27 +07:00
Ho Ngoc Hai
d703109096 refactor(web-client): audit shop sidebar — fix bugs, DRY code, enhance UX
P1 Bug Fixes:
- Fix Finance stat spacing (0₫ → 0 ₫)
- Replace 3 empty catch blocks with error state UI + logging
- Make POS button functional (navigate to /pos)
- Add @implements IDisposable to AdminLayout

P2 Code Quality:
- Create ShopVerticalHelper.cs (DRY icon/label/normalize)
- Remove dead overview case from ShopPage.razor
- Delete 15 orphaned admin pages (moved to shop-scope)
- ShopSidebarConfig delegates to ShopVerticalHelper

P3 UX Enhancement:
- Add CTA buttons to all empty states
- Real KPIs in ShopOverview (orders, products, revenue)
- User role from auth token (Admin/Khách)
- Responsive CSS for stat cards, tables, mobile sidebar
2026-02-28 06:36:41 +07:00
Ho Ngoc Hai
f7e431fd01 refactor(web-client-tpos): move business pages to shop-scoped sidebar
- AdminLayout: removed Sản phẩm, Kho hàng, Tài chính, Nhân sự, Khách hàng from admin sidebar
- ShopSidebarConfig: added Finance to all 4 verticals (Café, Restaurant, Karaoke, Spa)
- ShopPage: rewritten with real API data for menu/inventory/finance/staff/customers sections
- Each section filtered by shopId, loads only required data
2026-02-28 06:19:41 +07:00
Ho Ngoc Hai
545bc1f519 feat(web-client-tpos): connect all remaining admin pages to real backend APIs
- BFF: Added 10 new endpoints (staff roles/schedules, orders, wallets, devices, promotions, inventory transactions, membership levels)
- PosDataService: Added 14 new client methods with DTOs
- Rewrote 19 admin pages from hardcoded to real API:
  Staff: Create, Schedule, Attendance, Payroll
  Finance: Overview, Revenue, Expenses, Tax
  Inventory: PurchaseOrders, StockTransfer, SupplierMgmt
  Product: MenuBuilder, ModifierGroups, PricingRules
  Customer: Feedback, LoyaltyProgram
  System: DeviceManagement, NotificationCenter, IntegrationHub
2026-02-28 06:05:50 +07:00
Ho Ngoc Hai
e0d7567cf0 feat(web-client-tpos): connect inventory and customer pages to real API data 2026-02-28 05:48:54 +07:00
Ho Ngoc Hai
5a81fee85a feat(web-client-tpos): connect product catalog and create to catalog-service API 2026-02-28 05:42:52 +07:00
Ho Ngoc Hai
51cc8b249c feat(web-client-tpos): add shop-level pages and per-vertical sidebar switching 2026-02-28 05:24:07 +07:00
Ho Ngoc Hai
fa0efbd669 refactor(web-client-tpos): restructure sidebar from 5 to 12 items across 4 logical groups 2026-02-28 05:07:28 +07:00
Ho Ngoc Hai
0379de323c feat(web-client-tpos): rewrite staff, roles, audit, settings pages with real API data 2026-02-28 04:51:28 +07:00
Ho Ngoc Hai
1f0d11490e feat(web-client-tpos): add IamApiService, StaffInfo DTO, and DI registration 2026-02-28 04:51:21 +07:00
Ho Ngoc Hai
53fda4935c feat(web-client-tpos): add BFF staff endpoint for admin staff directory 2026-02-28 04:51:11 +07:00
Ho Ngoc Hai
12be9737d9 feat(web-client-tpos): replace hardcoded store pages with real API data
- Rewrite StoreList.razor with real data from PosDataService
- Rewrite StoreDetail.razor with real shop data from BFF
- Rewrite StoreSettings.razor with editable form bound to real data
- Add GetShopByIdAsync to PosDataService and BFF endpoint
- Add UpdateShopAsync to MerchantApiService
- Add ShopUpdateDto to MerchantDtos
- Fix BFF DB connection: configurable via env vars (BFF_DB_HOST)
- Add BFF_DB env vars to docker-compose.yml
2026-02-28 04:23:11 +07:00
Ho Ngoc Hai
1e211dec27 fix(web-client): split DisplayName into FirstName/LastName for registration 2026-02-28 04:03:04 +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
a1e27aca46 refactor(web-client-tpos): dashboard data-driven, 2-level sidebar, fix YARP 502 in Docker 2026-02-28 03:51:51 +07:00
Ho Ngoc Hai
07dc82ad49 feat(web-client-tpos): integrate UI with backend APIs for register, login, and shop creation flows 2026-02-28 03:28:21 +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
Ho Ngoc Hai
c9894c5e9d feat: remove Eggymon Landing Page application and its associated design files. 2026-02-27 23:48:01 +07:00
Cursor Agent
d0f05328a2 fix(ux): landing page + login selector fully working
- Landing Page at /home renders correctly (GoodGo POS branding)
- Server middleware redirects / → /home (302)
- Login Type Selector at /login with 4 role cards
- All navbar links point to /login
- Simplified Home.razor (removed @layout override that caused routing issue)
- Fixed /auth/login route conflict

Co-authored-by: Velik <hongochai10@users.noreply.github.com>
2026-02-27 09:39:57 +00: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