From 602ac18247288b628bf237e7bade5654b80d40cf Mon Sep 17 00:00:00 2001 From: Ho Ngoc Hai Date: Wed, 3 Jun 2026 19:40:04 +0700 Subject: [PATCH] Refactor TPOS parity routes and split schema modules --- .../console-2026-05-28T20-32-31-535Z.log | 266 ++++ .../console-2026-06-03T08-52-56-732Z.log | 267 ++++ microservices/apps/tpos-mvp-next/package.json | 6 +- .../apps/tpos-mvp-next/scripts/seed.ts | 351 +++-- .../tpos-mvp-next/scripts/smoke-runtime.ts | 278 ++++ .../apps/tpos-mvp-next/scripts/verify-seed.ts | 83 ++ .../src/app/admin/[...path]/page.tsx | 20 +- .../src/app/api/bff/[...path]/route.ts | 128 +- .../src/app/auth/[...path]/page.tsx | 35 +- .../src/app/menu/[shopId]/page.tsx | 2 +- .../tpos-mvp-next/src/app/orders/page.tsx | 2 +- .../apps/tpos-mvp-next/src/app/pos/page.tsx | 1 + .../src/app/pos/pos-experience.tsx | 8 +- .../tpos-mvp-next/src/app/tables/page.tsx | 6 + .../tpos-mvp-next/src/components/TposAuth.tsx | 82 +- .../src/components/TposLoginPortal.tsx | 3 +- .../src/components/TposPortal.tsx | 10 +- .../src/components/TposPosExperience.tsx | 104 +- .../src/components/tpos-config.ts | 2 +- .../tpos-mvp-next/src/server/db/queries.ts | 123 +- .../src/server/db/schema-sql-part-1.ts | 390 ++++++ .../src/server/db/schema-sql-part-2.ts | 390 ++++++ .../src/server/db/schema-sql-part-3.ts | 376 ++++++ .../src/server/db/schema-statements.ts | 9 + .../tpos-mvp-next/src/server/db/schema.ts | 1157 +---------------- .../src/server/integrations/external.ts | 99 +- .../src/server/services/order.ts | 10 +- .../src/server/services/parity.ts | 19 +- 28 files changed, 2835 insertions(+), 1392 deletions(-) create mode 100644 microservices/apps/tpos-mvp-next/scripts/smoke-runtime.ts create mode 100644 microservices/apps/tpos-mvp-next/scripts/verify-seed.ts create mode 100644 microservices/apps/tpos-mvp-next/src/server/db/schema-sql-part-1.ts create mode 100644 microservices/apps/tpos-mvp-next/src/server/db/schema-sql-part-2.ts create mode 100644 microservices/apps/tpos-mvp-next/src/server/db/schema-sql-part-3.ts create mode 100644 microservices/apps/tpos-mvp-next/src/server/db/schema-statements.ts diff --git a/.playwright-cli/console-2026-05-28T20-32-31-535Z.log b/.playwright-cli/console-2026-05-28T20-32-31-535Z.log index 90de99e7..c6e0476c 100644 --- a/.playwright-cli/console-2026-05-28T20-32-31-535Z.log +++ b/.playwright-cli/console-2026-05-28T20-32-31-535Z.log @@ -984,3 +984,269 @@ [481053021ms] [LOG] [Fast Refresh] done in 118ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 [481202820ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 [481202909ms] [LOG] [Fast Refresh] done in 17ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481359578ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481359639ms] [LOG] [Fast Refresh] done in 49ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481429317ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481429627ms] [LOG] [Fast Refresh] done in 19ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481435843ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481435903ms] [LOG] [Fast Refresh] done in 25ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481436021ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481436049ms] [LOG] [Fast Refresh] done in 130ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481444618ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481444619ms] [LOG] [Fast Refresh] done in 102ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481642495ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481642510ms] [LOG] [Fast Refresh] done in 110ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481660658ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481660710ms] [LOG] [Fast Refresh] done in 34ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481676710ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481676754ms] [LOG] [Fast Refresh] done in 15ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481691971ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481692033ms] [LOG] [Fast Refresh] done in 8ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481704347ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481704385ms] [LOG] [Fast Refresh] done in 10ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481725246ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481725320ms] [LOG] [Fast Refresh] done in 175ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481803750ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[481803831ms] [LOG] [Fast Refresh] done in 21ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[485287838ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[485288143ms] [LOG] [Fast Refresh] done in 406ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[485558376ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[485558428ms] [LOG] [Fast Refresh] done in 15ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[485600202ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[485600275ms] [LOG] [Fast Refresh] done in 36ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[485600382ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[485600542ms] [LOG] [Fast Refresh] done in 261ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[485610514ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[485610566ms] [LOG] [Fast Refresh] done in 8ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[485758694ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[485758812ms] [LOG] [Fast Refresh] done in 13ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[485775671ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[485775698ms] [LOG] [Fast Refresh] done in 128ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[488756496ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[488756566ms] [LOG] [Fast Refresh] done in 113ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[488756700ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[488756787ms] [LOG] [Fast Refresh] done in 190ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[488756889ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[488756934ms] [LOG] [Fast Refresh] done in 147ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[488764747ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[488764867ms] [LOG] [Fast Refresh] done in 77ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[488821579ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[488821636ms] [LOG] [Fast Refresh] done in 46ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[488821809ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[488821952ms] [LOG] [Fast Refresh] done in 244ms @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[488862711ms] [LOG] [Fast Refresh] rebuilding @ http://localhost:3010/_next/static/chunks/0x~w_next_dist_0c-ghxa._.js:2477 +[488862821ms] [ERROR] ./apps/tpos-mvp-next/src/components/TposPosExperience.tsx:1577:36 +Nullish coalescing operator(??) requires parens when mixing with logical operators + 1575 | ...label> + 1576 | ... {vertical === "karaoke" ? "Phòng đích" : "Bàn đích"} +> 1577 | ... ( + 1579 | ...