Commit Graph

225 Commits

Author SHA1 Message Date
Ho Ngoc Hai
81c5be9e37 fix(staff): Vấn đề trạng thái nhân viên "Invited" 2026-03-05 15:56:37 +07:00
Ho Ngoc Hai
e4bedf2cd3 feat(allPos): upgrad frontend 2026-03-05 15:33:23 +07:00
Ho Ngoc Hai
91a219d65f feat: implement hourly rates for tables/rooms, add shop publishing, and introduce system health checks. 2026-03-05 12:09:28 +07:00
Ho Ngoc Hai
c70248fdec feat(karaoke-pos): integrate session management and F&B ordering with backend APIs across the workflow pages. 2026-03-05 11:15:46 +07:00
Ho Ngoc Hai
e748c43b22 feat(shop-admin): add happy hour and promotion configuration UI and enhance room management with add/edit/delete functionality. 2026-03-05 08:44:47 +07:00
Ho Ngoc Hai
cd979970e7 feat(fnb, tpos): implement table QR code scanning for customer menu and reservation management 2026-03-05 08:28:32 +07:00
Ho Ngoc Hai
cfcdbd069d feat(pos): implement order payment flow and update order aggregate status handling. 2026-03-05 08:05:19 +07:00
Ho Ngoc Hai
0901e91673 feat(pos): implement table-based ordering, kitchen ticket workflow, and table floor plan management 2026-03-05 07:53:00 +07:00
Ho Ngoc Hai
7102b89ef1 refactor(web-client-tpos): extract shop admin sections into dedicated Blazor components and centralize helpers 2026-03-05 07:16:16 +07:00
Ho Ngoc Hai
926d4ee83c feat(tpos-client): implement send to kitchen workflow, table reservations, and enhanced admin zone management. 2026-03-05 06:00:21 +07:00
Ho Ngoc Hai
a4f4c4755e feat(fnb-reservation): implement reservation management with API, infrastructure, and TPOS client UI. 2026-03-05 05:39:02 +07:00
Ho Ngoc Hai
c0301a22e5 feat(pos): Display empty state messages for resource grids and implement shop-specific staff management in POS views. 2026-03-05 05:03:28 +07:00
Ho Ngoc Hai
88cd45c3a8 feat(pos-cafe): implement payment method settings, add detailed order history view, and update payment icons to Lucide 2026-03-05 04:40:06 +07:00
Ho Ngoc Hai
b041ba5449 feat(web-client-tpos): integrate StorageService API and adapt client data handling while removing multi-vertical architecture plan documentation. 2026-03-05 04:25:53 +07:00
Ho Ngoc Hai
14f6ddea77 feat(web-client-tpos): implement shop storage management and enhance revenue charts with membership level improvements 2026-03-05 04:16:49 +07:00
Ho Ngoc Hai
c86500214b feat: implement category CRUD with image upload, extend staff profile fields, and add membership level/EXP management 2026-03-05 03:03:48 +07:00
Ho Ngoc Hai
4d6c9c6ba3 feat: enhance error handling for staff and member creation, update IAM token lifetime, and refine staff query enumeration. 2026-03-05 02:10:52 +07:00
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
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
ba11317293 refactor(web-client-tpos): unify JSON serialization for API client, streamline authentication flows, and update UI layouts and navigation. 2026-03-04 11:21:22 +07:00
Ho Ngoc Hai
4a1094b080 fix(web-client-tpos): restore JWT from localStorage before admin API calls
Root cause: AdminBase had no auth initialization. AuthStateService is
in-memory Singleton — token is null after page refresh. Admin pages
called PosDataService without token → BFF forwarded requests without
Authorization header → microservices returned 401.

Fix:
- AdminBase.cs: inject AuthService, call TryRestoreSessionAsync()
- 9 admin pages: add await base.OnInitializedAsync() calls
- BffHttpClient.cs: add debug logging for auth forwarding
2026-03-04 10:27:56 +07:00
Ho Ngoc Hai
9be3450ab9 refactor(web-client-tpos): convert BFF from direct DB to HTTP proxy
- Replace Dapper/Npgsql direct DB access with HttpClient proxy to microservice APIs
- Create BffHttpClient.cs with AuthForwardingHandler (forwards JWT tokens)
- Register 9 named HttpClients: Merchant, Catalog, Order, Inventory, Membership, Wallet, Promotion, Booking, FnbEngine
- Delete BffDbConnectionFactory.cs and TenantContext.cs (no more direct DB)
- Remove Dapper and Npgsql package references from .csproj
- All 10 controllers are now thin HTTP proxy bridges
- Zero breaking changes: all api/bff/ routes preserved
2026-03-04 10:13:28 +07:00
Ho Ngoc Hai
0a5e1a9271 refactor(web-client-tpos): split monolithic BffDataController into 10 module controllers
- Extract shared infrastructure: BffDbConnectionFactory, TenantContext (per-request cache)
- Extract 19 DTOs to Models/BffDtos.cs
- Create 10 controllers: Shop, Catalog, Staff, Order, Inventory, Financial, Booking, Fnb, Reports, Membership
- Register DI services in Program.cs
- Delete monolithic BffDataController.cs (1831 lines)
- All API routes preserved under api/bff prefix (zero breaking changes)
2026-03-04 09:36:57 +07:00
Ho Ngoc Hai
b8b8bf1336 fix(web-client-tpos): fix all build errors — add CRUD methods, fix type bindings
- Added missing CRUD methods: DeleteRecipeItem, SaveRecipe, AddTable, SaveTable,
  EditTable, DeleteTableItem, AddAppointment, AddResource, SaveResource,
  DeleteResourceItem, DeleteScheduleItem, MarkTicketDone, LoadKitchenTickets
- Fixed CS1654: recipe ingredient foreach mutation → index-based for loop
- Fixed CS1503: schedule time input type=time → type=text (Blazor binding)
- Fixed CS1061: Guid.HasValue/Value → direct Guid in BFF kitchen/recipes
2026-03-04 08:18:07 +07:00
Ho Ngoc Hai
cf68aee67f fix(web-client-tpos): remove duplicate case recipes — fix CS0152 Docker build failure 2026-03-04 08:02:33 +07:00
Ho Ngoc Hai
6548b5babf fix(web-client-tpos): fix kitchen/recipes BFF routes — SPA fallback intercepted short routes
Changed BFF routes to use shops/{shopId}/ prefix pattern:
- kitchen/tickets → shops/{shopId}/kitchen-tickets
- recipes → shops/{shopId}/recipes
Updated PosDataService client URLs to match.
Added missing kitchen/recipes data loading cases in ShopPage.
2026-03-04 07:52:45 +07:00
Ho Ngoc Hai
d9fda3f54f fix(web-client-tpos): add missing kitchen/recipes data loading in ShopPage
ShopPage LoadSectionData switch was missing cases for kitchen and recipes sections. Added data fetch calls for GetKitchenTicketsAsync and GetRecipesAsync on section navigation.
2026-03-04 07:49:26 +07:00
Ho Ngoc Hai
d95e80f274 feat(web-client-tpos): tables, appointments, resources, schedules, kitchen, recipes CRUD
DB Migration:
- Created recipes + recipe_ingredients tables in catalog_service

BFF Endpoints (18 new):
- POST/PUT/DELETE tables — F&B table management (fnb_engine)
- POST/PUT/DELETE appointments — booking CRUD (booking_service)
- POST/PUT/DELETE resources — room/equipment CRUD (booking_service)
- POST/PUT/DELETE schedules — staff schedules (booking_service)
- GET/PUT kitchen/tickets — KDS ticket management (fnb_engine)
- GET/POST/PUT/DELETE recipes — recipe + ingredients CRUD (catalog_service)

PosDataService (12 new methods + DTOs)
ShopPage UI (325 lines): real UI for all 6 sections replacing placeholders
2026-03-04 05:12:48 +07:00
Ho Ngoc Hai
33047afa75 feat(web-client-tpos): Phase C-E — shop settings, top products report, enhanced placeholders
BFF Endpoints (3 new):
- GET/PUT shops/{id}/settings — shop features config, hours, days
- GET reports/top-products — bestselling products by quantity + revenue

PosDataService (3 new methods):
- GetShopSettings, UpdateShopSettings, GetTopProducts

ShopPage UI (149 lines):
- Settings tab: opening hours, business days, features config form
- Reports tab: top products table alongside revenue report
- Enhanced default placeholder for sections without DB tables
2026-03-03 21:36:52 +07:00
Ho Ngoc Hai
96301831f1 feat(web-client-tpos): Phase B — campaigns CRUD, customer CRUD, fixed promotions query
BFF Endpoints (6 new):
- POST/PUT/DELETE campaigns — CRUD with merchant ownership validation
- POST/PUT/DELETE members — customer CRUD with soft-delete
- Fixed GetPromotions: promotions → campaigns table

PosDataService (6 new methods):
- CreateCampaign, UpdateCampaign, DeleteCampaign
- CreateMember, UpdateMember, DeleteMember

ShopPage UI (191 lines):
- Promotions tab: campaign table with add/edit/delete + form
- Customers tab: add/edit/delete buttons on member rows
2026-03-03 21:30:27 +07:00
Ho Ngoc Hai
14d6c4012c feat(web-client-tpos): Phase A — categories CRUD, order management, shop update, reports
BFF Endpoints (6 new):
- POST/PUT/DELETE categories — full CRUD with shop ownership validation
- GET orders/{id} — order detail with items
- PUT orders/{id}/cancel — cancel non-completed orders (status=6)
- PUT shops/{id} — update name, phone, email, hours
- GET reports/revenue — daily/weekly/monthly revenue aggregation

PosDataService (8 new methods):
- CreateCategory, UpdateCategory, DeleteCategory
- GetOrderDetail, CancelOrder
- UpdateShop
- GetRevenueReport

ShopPage UI (222 lines):
- Menu tab: categories table with add/edit/delete
- Finance tab: expandable order rows with items + cancel button
- Overview tab: shop info edit form
- Reports tab: period selector (Ngày/Tuần/Tháng) + revenue table
2026-03-03 21:22:25 +07:00
Ho Ngoc Hai
aab80fd697 fix(web-client-tpos): add permissions and user_id to CreateStaff INSERT
Fix NOT NULL constraint violations in merchant_staff table:
- Add permissions = 0 (default no permissions)
- Add user_id = Guid.Empty (placeholder until linked)
- Verified: CREATE→UPDATE→DELETE all working
2026-03-03 20:46:49 +07:00
Ho Ngoc Hai
15b17f54ca feat(web-client-tpos): add staff update/delete and inventory update CRUD
BFF Endpoints:
- PUT /api/bff/staff/{id} — update employee code, role, phone, email
- DELETE /api/bff/staff/{id} — soft-delete (set status=Terminated)
- PUT /api/bff/inventory/{id} — update quantity and reorder level
- Fix CreateStaff: Forbid→Unauthorized, add created_at to INSERT

PosDataService Methods:
- UpdateStaffAsync(Guid, CreateStaffRequest)
- DeleteStaffAsync(Guid)
- UpdateInventoryAsync(Guid, UpdateInventoryRequest)

ShopPage.razor UI:
- Staff table: new Hành động column with edit/delete buttons
- Staff form: switches between Thêm/Chỉnh sửa mode
- EditStaff, SaveStaffEdit, DeleteStaffMember methods
2026-03-03 20:34:56 +07:00
Ho Ngoc Hai
8cba9021d0 feat(web-client-tpos): add product update (PUT) endpoint and edit UI
- Add PUT /api/bff/products/{id} endpoint with ownership validation
- Add UpdateProductAsync to PosDataService
- Add edit button (pencil icon) on each product card
- Form supports edit mode: title/button text changes, pre-fills values
- Add EditProduct and SaveProduct methods in ShopPage.razor
- Full CRUD: Create, Read, Update, Delete all functional
2026-03-03 20:18:09 +07:00
Ho Ngoc Hai
a791830012 feat(web-client-tpos): add date filter to order history and payment method display
- Add filter param (today/week/month) to BFF GetOrders endpoint
- Update PosDataService.GetOrdersAsync with filter parameter
- Wire History tab filter buttons to reload API with date range
- Add payment_method and notes to OrderInfo DTO
- Add MapPaymentMethodLabel helper for Vietnamese labels
- Include payment_method in API order history cards
2026-03-03 20:08:30 +07:00
Ho Ngoc Hai
7562fc1e1f feat(web-client-tpos): add receipt print with thermal 80mm layout
- Create pos-helpers.js with printPosReceipt JS function
- Add PrintReceipt method to CafeDesktop.razor (thermal receipt HTML)
- Save receipt items/payment data before cart reset
- Register pos-helpers.js in index.html
- Inject IJSRuntime for print popup
2026-03-03 20:02:15 +07:00
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