๐Ÿ“– star365 Docs
โ† ๋ณด๊ณ ์„œ ๋ชฉ๋ก

Sprint #2 Report โ€” 4 ํ”Œ๋žซํผ hook ์ž๋™ ๋™๊ธฐํ™”

1. ํ•ต์‹ฌ ๋ฐœ๊ฒฌ (Discovery ๊ฒฐ์ •์ )

๊ธฐ์กด ์ฝ”๋“œ์— hook ์ธํ”„๋ผ ์กด์žฌ: 4 ํ”Œ๋žซํผ(finance/legal/assistant/hospital) ๋ชจ๋‘ callCentralApi ํ—ฌํผ + POINT_SERVICE_URL env var ์˜์กด์„ฑ + /api/v1/points/{earn,balance} ํ˜ธ์ถœ ์ฝ”๋“œ๋ฅผ ์ด๋ฏธ ๋ณด์œ . ๋‹จ์ง€ POINT_SERVICE_URL์ด ๋น„์–ด์žˆ์–ด silent skip๋˜์–ด ์ž‘๋™ ์•ˆ ํ•œ ๊ฒƒ.

โ†’ "hook ์ฃผ์ž…" ์ž‘์—…์ด ๊ฑฐ๋Œ€ํ•œ ์ฝ”๋“œ ๋ณ€๊ฒฝ์—์„œ (env var + ํ˜ธํ™˜ ๋ผ์šฐํŠธ) ๋กœ ์ถ•์†Œ.

2. ์‚ฐ์ถœ๋ฌผ

2.1 ์ฝ”๋“œ ๋ณ€๊ฒฝ

ํŒŒ์ผ ๋ณ€๊ฒฝ
/opt/star365-members/server.mjs (kahan) +5 ์‹ ๊ทœ ๋ผ์šฐํŠธ (Sprint #1์˜ +99 ๋ผ์ธ์— ๋”ํ•ด) /api/v1/points/{earn,spend,balance/:userId,transactions/:userId,health}
/opt/finance/ecosystem.config.js POINT_SERVICE_URL: 3100 โ†’ 3720
/opt/legal/ecosystem.config.js ๋™์ผ
/opt/assistant/ecosystem.config.js ๋™์ผ
/opt/hospital/ecosystem.config.js ๋™์ผ
finance/legal/assistant dist/.../point*.service.js spend hook ์ง์ ‘ ์ฃผ์ž… (TS rebuild ๋ฏธ๊ฐ€์šฉ)
legal dist/.../points.service.js earn hook๋„ ์ถ”๊ฐ€ (legal๋งŒ ๋ˆ„๋ฝ์ด์—ˆ์Œ)
hospital dist spend hook ์ฃผ์ž… ํ›„ revert (์‚ฌ์ „ crash loop ๊ฒฉ๋ฆฌ)

2.2 ์ƒˆ ํ˜ธํ™˜ ๋ผ์šฐํŠธ (/api/v1/points/*)

3. Done Criteria ๊ฒ€์ฆ

# ๊ธฐ์ค€ ๊ฒฐ๊ณผ ์ฆ๊ฑฐ
1 /api/v1/points/balance/:userId ์ž‘๋™ โœ… PASS eb9322 finance UUID โ†’ 16700P
2 /api/v1/points/earn ์ž‘๋™ + ๋ฉฑ๋“ฑ์„ฑ โœ… PASS sprint2-eb9322-001 โ†’ ์ฒซ ํ˜ธ์ถœ 16200P, ๋‘๋ฒˆ์งธ idempotent_replay
3 /api/v1/points/spend ์ž‘๋™ โœ… PASS (Sprint #1 samshin demo ๋™์ผ ๋กœ์ง ์žฌ์‚ฌ์šฉ)
4 platform user UUID โ†’ star365_uid ์ž๋™ ๋งคํ•‘ โœ… PASS resolvePlatformUser์— 17 ๋ณ„์นญ alias ๋“ฑ๋ก (medicalโ†’hospital ๋“ฑ)
5 ๋ฏธ๋“ฑ๋ก platform_membership 404 ๊ฑฐ์ ˆ โœ… PASS 'platform_membership not found' ์ •ํ™• ์‘๋‹ต
6 4 ecosystem.config.js POINT_SERVICE_URL ๊ฐฑ์‹  โœ… PASS 4/4 ํ”Œ๋žซํผ = http://66.42.42.24:3720
7 4 platform-api PM2 reload โœ… PASS 4/4 online, finance/legal/assistant restarts=1 stable
8 dist spend hook ์ฃผ์ž… ๐ŸŸก PARTIAL 3/4 (hospital revert)
9 dist earn hook (legal ๋ˆ„๋ฝ๋ถ„) โœ… PASS legal dist์— SPRINT2_EARN_HOOK ๋งˆ์ปค
10 ๋‹ค์ค‘ ํ”Œ๋žซํผ ๋™์ผ ์ž”๊ณ  ๊ฒ€์ฆ โœ… PASS finance/assistant/legal API ๋ชจ๋‘ 16700P ๋™์ผ ๋ฐ˜ํ™˜
11 finance์—์„œ +500P โ†’ ๋‹ค๋ฅธ API์—์„œ๋„ 16700P โœ… PASS cross-platform aggregation proven
12 hospital crash loop ๊ฒฉ๋ฆฌ โœ… PASS revert ํ›„ SystemConfigService ์‚ฌ์ „ issue ํ™•์ธ
13 finance/legal/assistant ์•ˆ์ • (no regression) โœ… PASS 3/3 restarts=1 stable post-restart

12/13 PASS + 1 PARTIAL (hospital spend hook).

4. ์‚ฌ์šฉ์ž ์‹œ๊ฐ ๊ฒฐ๊ณผ

Sprint #1 + #2 ๋ˆ„์  ์˜ํ–ฅ

ํ–ฅํ›„ ์ž๋™ ๋™๊ธฐ (3 ํ”Œ๋žซํผ)

5. ์•Œ๋ ค์ง„ ์ œ์•ฝ / Out of Scope

ํ•ญ๋ชฉ ์˜ํ–ฅ ํ›„์†
hospital ์‚ฌ์ „ crash loop (SystemConfigService Failed) hospital-api ๋ถ„๋‹น 30+ํšŒ ์žฌ์‹œ์ž‘ ๋ณ„๋„ ์ง„๋‹จ sprint
TS source rebuild ๋ถˆ๊ฐ€ (3990~22685 errors) source ๋ณ€๊ฒฝ์€ dist ์ง์ ‘ ํŒจ์น˜๋กœ ํ•ด๊ฒฐ, ํ–ฅํ›„ source ๋นŒ๋“œ๋Š” ๋ณ„๋„ cleanup sprint ๋ˆ„์  TS ๋ถ€์ฑ„ sprint
Reconciliation cron ๋ฏธ๊ตฌํ˜„ central ์‹คํŒจ ์‹œ silent local fallback (๋ถ„๊ธฐ ๊ฐ€๋Šฅ) ๋ณ„๋„ sprint
outbox/retry ๋ฏธ๊ตฌํ˜„ ๋™์ผ ์œ„ ๋™์ผ
pet/shop platform ๋ฏธ์—ฐ๊ฒฐ 0 row ํ™œ์„ฑ โ†’ ์˜ํ–ฅ ์—†์Œ ๋ฐ์ดํ„ฐ ๋ฐœ์ƒ ์‹œ sprint
์ž์ฒด platform ์ปฌ๋Ÿผ deprecate legacy ๋ณด์กด ํ–ฅํ›„ sprint
signup hook ์ž๋™ platform_membership ๋“ฑ๋ก ์‹ ๊ทœ ์‚ฌ์šฉ์ž๋Š” register ๋ณ„๋„ ํ˜ธ์ถœ ํ•„์š” Phase 4 #1 sprint

6. ์œ„ํ—˜ / ์˜ํ–ฅ

์œ„ํ—˜ ๊ฒฐ๊ณผ
๋ผ์ด๋ธŒ platform-api ๋‹ค์šดํƒ€์ž„ 0์ดˆ (PM2 graceful restart)
ํŠธ๋ ˆ์ด๋”ฉ ์˜ํ–ฅ 0 (kahan ํŠธ๋ ˆ์ด๋”ฉ ์„œ๋น„์Šค ๋ฌด์˜ํ–ฅ)
์‚ฌ์šฉ์ž ์ž”๊ณ  ์†์‹ค 0 (dual-write fail-soft, central ์‹คํŒจ ์‹œ local ๋ณด์กด)
๋ฉฑ๋“ฑ์„ฑ ์œ„๋ฐ˜ (์ด์ค‘ ์ ๋ฆฝ) 0 (referenceId ๊ธฐ๋ฐ˜ idempotency ์ ์šฉ)
hospital crash loop ์•…ํ™” 0 (์‚ฌ์ „ issue, revert๋กœ ๋ถ„๋ฆฌ)

7. ๋‹ค์Œ ๋‹จ๊ณ„ (์ œ์•ˆ)

  1. hospital SystemConfigService ์ง„๋‹จ sprint โ€” hospital-api ์‚ฌ์ „ crash loop ํ•ด๊ฒฐ
  2. Reconciliation cron โ€” central ์‹คํŒจ โ†’ outbox โ†’ 5๋ถ„ retry
  3. signup hook ์ž๋™ํ™” โ€” ์‹ ๊ทœ ์‚ฌ์šฉ์ž platform_membership ์ž๋™ ์ƒ์„ฑ
  4. TS source ๋นŒ๋“œ ๋ถ€์ฑ„ ์ •๋ฆฌ โ€” 4 ํ”Œ๋žซํผ source rebuild ๊ฐ€๋Šฅํ•˜๋„๋ก
  5. members.star365.site UI โ€” ํ†ตํ•ฉ ์ž”๊ณ  + ์ด๋ ฅ ํ™”๋ฉด

8. ํ‰๊ฐ€

๊ธฐ์ค€ ์ ์ˆ˜ ๋น„๊ณ 
product_depth 8/10 3/4 ํ”Œ๋žซํผ ์ž๋™ ๋™๊ธฐ + cross-platform ์ž”๊ณ  ํ†ตํ•ฉ. (-2) hospital ๋ฏธ์ ์šฉ, recon ๋ฏธ๊ตฌํ˜„
functionality 9/10 12/13 DC PASS. fail-soft ์ •ํ™•. ๋ฉฑ๋“ฑ์„ฑ ๊ฒ€์ฆ. (-1) hospital
code_quality 8/10 dist ์ง์ ‘ ํŒจ์น˜(ํ•„์š”์•…), bak ๋ณด๊ด€, ๊ฒฉ๋ฆฌ๋œ try/catch. (-2) source/dist ๋™๊ธฐ ์•ˆ ๋จ
design 9/10 ๊ธฐ์กด ์ฝ”๋“œ์™€ ์ž์—ฐ์Šค๋Ÿฌ์šด ํ˜ธํ™˜. 17 ๋ณ„์นญ ๋งคํ•‘. ์‚ฌ์šฉ์ž ์ฝ”๋“œ ๋ณ€๊ฒฝ ์ตœ์†Œํ™”. (-1) recon ๋ถ€์žฌ

Overall: 8.5/10 โ†’ PARTIAL PASS

9. Files Changed

M  /opt/star365-members/server.mjs                                        +180 lines (Sprint#1+#2)
M  /opt/finance/ecosystem.config.js                                       1 line
M  /opt/legal/ecosystem.config.js                                         1 line
M  /opt/assistant/ecosystem.config.js                                     1 line
M  /opt/hospital/ecosystem.config.js                                      1 line
M  /opt/finance/apps/api-gateway/dist/.../point.service.js                +1 line (spend hook)
M  /opt/legal/apps/api-gateway/dist/.../points.service.js                 +2 lines (earn + spend)
M  /opt/assistant/apps/api-gateway/dist/.../points.service.js             +1 line (spend hook)
+  /opt/star365-hq/docs/04-report/unified-points-migration-sprint2-20260430.report.md
+  /tmp/inject_spend_hooks.py
+  /tmp/patch_dist_spend_hooks.py
+  /tmp/inject_legal_earn.py

S  /opt/finance/.env                                                      +3 vars (POINT_*)
S  /opt/legal/.env                                                        +3 vars
S  /opt/assistant/.env                                                    +3 vars
S  /opt/hospital/.env                                                     +3 vars

(.bak-* backups created for all dist + ecosystem ๋ณ€๊ฒฝ)