Commit Graph

766 Commits

Author SHA1 Message Date
Ho Ngoc Hai
3ac6b3cf61 Harden cafe loyalty flow and audit artifacts 2026-06-06 00:48:36 +07:00
Ho Ngoc Hai
474fcc6ce2 Expand cafe admin CRUD and staff workflow 2026-06-05 20:50:32 +07:00
Ho Ngoc Hai
c4092f6a0d Complete Cafe admin table and happy-hour CRUD 2026-06-05 20:14:04 +07:00
Ho Ngoc Hai
1e861d800a Refactor POS MVP checkout flow and cart state 2026-06-05 20:00:06 +07:00
Ho Ngoc Hai
f1ffccf107 Enhance admin menu CRUD forms and item metadata 2026-06-05 18:53:50 +07:00
Ho Ngoc Hai
e5bf34a379 Complete cafe admin metadata and pickup flow 2026-06-05 14:33:11 +07:00
Ho Ngoc Hai
5a87a8dde8 Add Drive metadata CRUD and refine admin UI 2026-06-05 13:28:56 +07:00
Ho Ngoc Hai
4025a9cc86 Add cafe CRUD audits and karaoke room timer 2026-06-05 12:54:06 +07:00
Ho Ngoc Hai
a1a459bd3a Fix Cafe POS flows and admin report formatting 2026-06-05 12:05:22 +07:00
Ho Ngoc Hai
bc2452f949 Refine auth layouts and add seed login shortcuts 2026-06-04 01:39:28 +07:00
Ho Ngoc Hai
25d375f8a9 Refactor TPOS MVP parity and public workflows 2026-06-03 21:55:36 +07:00
Ho Ngoc Hai
65cbc34467 Split global styles into smaller files 2026-06-03 19:46:47 +07:00
Ho Ngoc Hai
602ac18247 Refactor TPOS parity routes and split schema modules 2026-06-03 19:40:04 +07:00
Ho Ngoc Hai
d30976b184 Record recent TPOS UI and workflow fixes 2026-06-03 17:13:00 +07:00
Ho Ngoc Hai
1016d5f3db Refine TPOS MVP workflow and UI parity 2026-06-03 16:28:22 +07:00
Ho Ngoc Hai
d5bfbaf401 Refactor POS flow and update checkout UI 2026-06-03 15:00:50 +07:00
Ho Ngoc Hai
fae5d288f7 Return explicit errors for unsupported POS workflows 2026-06-03 13:18:16 +07:00
Ho Ngoc Hai
9a875643b4 Harden TPOS MVP payment, stock, and portal parity 2026-06-03 13:17:46 +07:00
Ho Ngoc Hai
f0dad8881a Harden staff and voucher isolation with TPOS parity UI fixes 2026-05-29 01:45:32 +07:00
Ho Ngoc Hai
e8951b783a Add TPOS parity admin dashboard and store wizard 2026-05-24 15:39:01 +07:00
Ho Ngoc Hai
34200a0e4e Refine POS history and dashboard layouts 2026-05-24 10:26:51 +07:00
Ho Ngoc Hai
0e99b1d654 Fix shop and POS route parity 2026-05-24 00:48:20 +07:00
Ho Ngoc Hai
481f07b31a Refactor TPOS shop and POS routes for parity 2026-05-24 00:48:06 +07:00
Ho Ngoc Hai
7f9434347f Refine TPOS typography and portal active states 2026-05-24 00:25:22 +07:00
Ho Ngoc Hai
7e647672c1 Implement TPOS parity UI and backend 2026-05-24 00:17:20 +07:00
Ho Ngoc Hai
76d75c753b Migrate 2026-05-23 18:37:02 +07:00
Ho Ngoc Hai
f15d91ee29 docs: dịch các file .claude MD sang tiếng Việt có dấu
All checks were successful
Build & Deploy to K8s / build-and-deploy (push) Successful in 11s
Dịch headings, section titles, và thuật ngữ chính trong 15 file
markdown (.claude/agents/ và .claude/*.md) sang tiếng Việt có dấu.
Giữ nguyên format markdown, code blocks, tên kỹ thuật và commands.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-19 00:28:07 +07:00
Ho Ngoc Hai
0fdc11de0f fix(blazor): resolve Lucide DOM conflict causing unhandled error banner on login
All checks were successful
Build & Deploy to K8s / build-and-deploy (push) Successful in 8m39s
Root cause: Lucide JS replaces <i data-lucide> with <svg>, breaking
Blazor's virtual DOM diffing (insertBefore/removeChild on null).
23 components + 2 MutationObservers were calling lucide.createIcons()
concurrently, amplifying the race condition.

Changes:
- Remove all 23 direct lucide.createIcons() JS interop calls from
  layouts and components (AdminLayout, AuthLayout, StaffLayout, etc.)
- Replace dual MutationObserver with single requestIdleCallback poller
  that only runs when browser is idle (after Blazor finishes rendering)
- Auto-suppress Blazor error banner for known harmless Lucide DOM
  mismatch errors (insertBefore/removeChild on null)
- Change login NavigateTo from forceLoad:true to forceLoad:false
  to avoid full WASM runtime reload after successful login
- Simplify launch.json to pos-web only for Claude Code preview

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 13:04:34 +07:00
Ho Ngoc Hai
529c92e0e1 feat(dev): hybrid local dev setup — remote PostgreSQL/MinIO, local Redis/RabbitMQ
Some checks are pending
Build & Deploy to K8s / build-and-deploy (push) Waiting to run
Configure all 24 services to connect to remote staging PostgreSQL
(212.28.186.239:30992) and MinIO (minio.techbi.org) while running
Redis and RabbitMQ locally on non-standard ports (16379, 25672)
to avoid conflicts with other projects.

- Add .env.remote with hybrid connection strings
- Add docker-compose.dev.yml (lightweight Redis + RabbitMQ only)
- Add scripts/dev/start-dev.sh for one-command infra startup
- Update all appsettings.Development.json with remote DB + timeout
- Add .claude/launch.json for Claude Code preview (pos-web only)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 12:27:01 +07:00
Ho Ngoc Hai
368a660e5f docs: add known issues, review checklist updates, and local dev investigation
All checks were successful
Build & Deploy to K8s / build-and-deploy (push) Successful in 23s
Add Known Issues & Gotchas section to CLAUDE.md covering role PascalCase
requirement, EF migration enforcement, and browser token cache behavior.
Update Tech Lead review checklist and naming conventions accordingly.
Include local development setup investigation and quick reference docs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 11:29:54 +07:00
Ho Ngoc Hai
5e2f20967d fix(merchant): wire up merchant registration in onboarding and settings
All checks were successful
Build & Deploy to K8s / build-and-deploy (push) Successful in 9m29s
OnboardingBusiness.razor was only navigating to the next step without
calling the merchant registration API, so no merchant record was ever
created in the database. This caused settings page updates to fail with
"Merchant not found" and the SuperAdmin panel to show zero merchants.

- Inject MerchantApiService and call RegisterMerchantAsync on "Tiếp tục"
- Remove hardcoded demo data from onboarding form fields
- Add fallback in AdminSettings SaveMerchant to auto-register if PUT fails
- Add BFF POST /api/bff/account/register-merchant endpoint

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 20:46:27 +07:00
Ho Ngoc Hai
54fbaeaffe chore: remove obsolete deployment reports, fix trackers, and project planning documents
All checks were successful
Build & Deploy to K8s / build-and-deploy (push) Successful in 25s
2026-04-12 16:00:41 +07:00
Ho Ngoc Hai
b5b717ed4b fix(k8s): add redis label to replication network policy for sentinel
All checks were successful
Build & Deploy to K8s / build-and-deploy (push) Successful in 56s
Redis StatefulSet pod uses label app=redis but allow-redis-replication
only listed redis-master/redis-replica/redis-sentinel. Sentinel could
not reach redis-0, causing infinite wait loop and CrashLoopBackOff.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 02:43:51 +07:00
Ho Ngoc Hai
0f18d9ad9d ci: trigger rebuild after rabbitmq probe fix on cluster
All checks were successful
Build & Deploy to K8s / build-and-deploy (push) Successful in 42s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 02:29:34 +07:00
Ho Ngoc Hai
b768c9dc31 fix(k8s): sync cluster fixes to source — JWT authority, secrets, Redis config
Some checks failed
Build & Deploy to K8s / build-and-deploy (push) Failing after 35s
1. ConfigMap: Jwt__Authority → http://iam-service:8080 (internal K8s DNS)
   Pods cannot reach external HTTPS for OIDC discovery.
   Token issuer remains https://api.techbi.org via IssuerUri.

2. Secrets: Add IdentityServer__ClientId/Secret for pos-web BFF auth.

3. Redis: Add redis-config.yaml ConfigMap with fixed start scripts.
   - start-redis.sh reads from /tmp (init container copies there)
   - start-sentinel.sh reads from /config (directly mounted)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 02:24:03 +07:00
Ho Ngoc Hai
b2a5bde40a fix(auth): allow HTTP OIDC discovery for K8s internal authority
Some checks failed
Build & Deploy to K8s / build-and-deploy (push) Failing after 12m20s
Services in K8s use `Jwt__Authority=http://iam-service:8080` (internal)
but RequireHttpsMetadata was hardcoded to `!IsDevelopment()` which
crashes in Staging with "The MetadataAddress or Authority must use HTTPS".

Fix: Read RequireHttpsMetadata from config + auto-detect HTTP authority.
Affected: merchant-service, ads-billing, ads-serving, ads-tracking.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 00:24:48 +07:00
Ho Ngoc Hai
8a5b25936d fix(auth): add bff-client to IdentityServer + fix pos-web auth
Some checks failed
Build & Deploy to K8s / build-and-deploy (push) Failing after 10m14s
Login was failing because:
1. IdentityServer Config.cs had no 'bff-client' client definition
   (pos-web uses bff-client for BFF authentication pattern)
2. pos-web had no IdentityServer__ClientSecret env var configured
3. Network policy blocked pos-web → iam-service egress

Fixes:
- Add bff-client to Config.Clients (ResourceOwnerPassword grant,
  8h access token, 7d refresh token for POS sessions)
- Add IdentityServer client credentials to pos-web.yaml from secrets
- Add pos-web to allow-inter-service-egress network policy

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 22:22:37 +07:00
Ho Ngoc Hai
5ce64b9a1c feat(infra): migrate POS System routing to Traefik v3
Some checks failed
Build & Deploy to K8s / build-and-deploy (push) Failing after 26s
Architecture: Nginx Ingress (TLS) → Traefik (routing) → Services

- Add traefik.yaml: Traefik v3.3 deployment with file provider config
  - 65+ route rules for api.techbi.org (25 backend services)
  - platform.techbi.org → pos-web
  - Middlewares: rate-limit (100/s), retry (3x), compress, secure-headers
  - WebSocket support for SignalR hubs (/hubs/pos, /hubs/kitchen, /hubs/chat)
- Update ingress.yaml: Nginx now proxies POS domains to Traefik ClusterIP
  (Nginx still handles TLS termination via cert-manager/Let's Encrypt)
- Update network-policy.yaml: Add Traefik ingress/egress/DNS policies
- Update deploy.yaml: Add traefik.yaml to CI/CD apply step
- Other services unaffected: Neon-UI, Rancher, Gitea, Harbor, Grafana, MinIO

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 21:40:12 +07:00
Ho Ngoc Hai
084771bfc5 fix(k8s): add inter-service ingress policy + reduce CPU requests
Some checks failed
Build & Deploy to K8s / build-and-deploy (push) Failing after 33s
Critical fixes applied to staging K8s manifests:

1. NetworkPolicy: Add allow-inter-service-ingress (services can receive
   requests from each other - fixes promotion→wallet health check timeout)
2. NetworkPolicy: Add allow-app-to-neon-egress (explicit DB access rule)
3. NetworkPolicy: Add ingress-nginx namespace to allow-traefik-ingress
4. Resources: Reduce CPU requests 250m→100m (cluster was at 99%)
5. IAM Service: Add signing certificate volume mount (required for
   IdentityServer in non-Development environments)

Without #1, any service calling another service via HTTP would timeout
because default-deny-all blocks all ingress and only egress was allowed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 20:19:03 +07:00
Ho Ngoc Hai
43a61874d3 docs: add deployment state docs and troubleshooting guide
- Update POS_DEPLOYMENT_STATE.md with live staging status
- Create TROUBLESHOOTING.md with common issues & fixes
- Add architecture visual, quick reference, and analysis docs
- Document Network Policy gap (inter-service ingress)
- Document DNS/ingress routing setup
- Document CI/CD pipeline (Gitea Actions + Kaniko)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 20:14:01 +07:00
Ho Ngoc Hai
5d432145d5 fix(cicd): fix pos-web root context + rebuild remaining 10 services
All checks were successful
Build & Deploy to K8s / build-and-deploy (push) Successful in 29m5s
pos-web Dockerfile uses root context (COPY apps/web-client-tpos-net/...)
so Kaniko needs --context=/workspace/repo --dockerfile=apps/.../Dockerfile

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 00:04:02 +07:00
Ho Ngoc Hai
6bd8377c04 build: rebuild remaining 10 services (ads, mkt, pos-web)
Some checks are pending
Build & Deploy to K8s / build-and-deploy (push) Has started running
Batch 1-3 complete (15/26). Building remaining: 5 ads services,
4 marketing services, 1 frontend.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 23:35:16 +07:00
Ho Ngoc Hai
01b246287e build: full rebuild v4 (Harbor ingress timeout 600s patched)
Some checks failed
Build & Deploy to K8s / build-and-deploy (push) Failing after 44m57s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 22:43:31 +07:00
Ho Ngoc Hai
014c5ee357 build: trigger full rebuild v3 (network policy fix applied on cluster)
Some checks failed
Build & Deploy to K8s / build-and-deploy (push) Failing after 20m38s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 22:14:05 +07:00
Ho Ngoc Hai
8dbf913792 build: trigger full rebuild all 26 services (v2 - with initContainer fix)
Some checks failed
Build & Deploy to K8s / build-and-deploy (push) Failing after 10m27s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 22:03:09 +07:00
Ho Ngoc Hai
19e914b5d8 fix(cicd): use initContainer clone + local Kaniko context
All checks were successful
Build & Deploy to K8s / build-and-deploy (push) Successful in 20s
Kaniko git:// context doesn't support HTTPS auth well.
Use alpine/git initContainer to clone repo into emptyDir,
then Kaniko builds from local /workspace/repo/{service} path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 21:55:21 +07:00
Ho Ngoc Hai
08c218ac3c build: trigger full rebuild of all 26 services via Kaniko
Some checks failed
Build & Deploy to K8s / build-and-deploy (push) Has been cancelled
Touch all Dockerfiles to force Gitea Actions to detect changes
and build all 25 backend services + 1 frontend via Kaniko → Harbor.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 21:51:04 +07:00
Ho Ngoc Hai
e32d13ecbc fix(cicd): trigger rebuild after fixing Gitea URL-encoded password
All checks were successful
Build & Deploy to K8s / build-and-deploy (push) Successful in 13s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 21:48:29 +07:00
Ho Ngoc Hai
84f21a4d1c feat(deploy): full staging deployment - 1 replica, parallel Kaniko, all 26 services
Some checks failed
Build & Deploy to K8s / build-and-deploy (push) Failing after 6s
- Scale all 26 services from 2→1 replicas (fit 8.4 available cores)
- HPA min 2→1, max 4→2 for staging
- Rewrite Gitea Actions: batch parallel Kaniko builds (5 per batch)
- Secure credentials via secrets (REPO_PASSWORD, HARBOR_*)
- Kaniko clones from Gitea (already mirrored from GitHub)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 21:44:46 +07:00
Ho Ngoc Hai
31d24c8c4d fix(k8s): switch domains from goodgo.vn to techbi.org
All checks were successful
Build & Deploy to K8s / build-and-deploy (push) Successful in 33s
- api.techbi.org (backend API)
- platform.techbi.org (frontend POS)
- Update JWT Authority, CORS, IdentityServer IssuerUri
- Update TLS secret names

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 20:30:08 +07:00