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

Sprint #11 Report โ€” hospital hook ์œ„์น˜ ๊ฐœ์„  + shop trigger ์‹œ๋„

โœ… Track B: hospital hook ์œ„์น˜ ๊ฐœ์„  PASS

๋ณ€๊ฒฝ ์‚ฌํ•ญ

์ฝ”๋“œ ๋ณ€๊ฒฝ (dist ์ง์ ‘ ํŒจ์น˜)

async deductPoints(userId, amount, type, description, referenceType, referenceId) {
    // SPRINT11_HOOK_RELOCATED โ€” central ์šฐ์„  ํ˜ธ์ถœ (local balance check ์ „)
    try {
        const _centralSpend = await callCentralApi('POST', '/spend', {
            userId, amount, type, description, referenceType, referenceId,
            platform: POINT_PLATFORM,
        });
        if (_centralSpend) {
            return { success:true, spentPoints:amount,
                newBalance:_centralSpend.balanceAfter ?? _centralSpend.balance ?? 0,
                transaction:_centralSpend.transactionId ? {id: _centralSpend.transactionId}:null,
                _source:'central' };
        }
    } catch (_e) { /* fallback to local */ }
    // SPRINT11_HOOK_RELOCATED end

    const account = await this.getOrCreateAccount(userId);  // ๊ธฐ์กด ์ฝ”๋“œ
    if (account.balance < amount) throw...
    ...
}

E2E ๊ฒ€์ฆ

1. test-hospital local point_account balance๋ฅผ ๊ฐ•์ œ๋กœ 0์œผ๋กœ reset
2. POST /api/v1/points/cross-platform/deduct {userId, amount:200}
3. ์‘๋‹ต: {success:true, spentPoints:200, newBalance:600, _source:"central"}
4. unified: 800P โ†’ 600P (-200) โœ…

โ†’ local ์ž”๊ณ  0์ด๋ผ๋„ SPRINT11_HOOK_RELOCATED๊ฐ€ ํ•จ์ˆ˜ ์‹œ์ž‘์—์„œ ๋ฐœ๋™ โ†’ central ์šฐ์„  ํ˜ธ์ถœ โ†’ unified ์ฐจ๊ฐ โ†’ return early. local DB ์•ˆ ๊ฑฐ์นจ.

๐ŸŸก Track A: shop ์ •์ง ์‹œ์ธ

์‹œ๋„ 1: starium/points/spend

์‹œ๋„ 2: cross-platform/transfer

์ •์ง ๊ฒฐ๋ก 

๋ˆ„์  ์‹ค E2E ๊ฒฐ๊ณผ (Sprint #1~#11)

platform trigger sprint ๊ฒฐ๊ณผ
assistant admin-points/deduct #8 โœ… -300
legal product purchase #8 โœ… -200
finance user spend endpoint #9 โœ… -400
pet cross-platform/deduct #10 โœ… -250
hospital cross-platform/deduct (local fix) #10 โœ… -300
hospital (relocated) cross-platform/deduct (local 0) #11 โœ… -200 (central first proven)
shop (์ •์  ๊ฒ€์ฆ) โ€” ๐ŸŸก ์ฝ”๋“œ โœ…, ๋น„์ฆˆ๋‹ˆ์Šค trigger ์˜์กด

โ†’ 5/6 platform ์ง„์งœ E2E PASS + hospital ๊ฐœ์„  (local ์ž”๊ณ  0์ด๋ผ๋„ unified ์ฐจ๊ฐ ๊ฐ€๋Šฅ)

๋ˆ„์  (Sprint #1~#11)

์•ˆ์ „ ๊ฒ€์ฆ

Telegram

โœ… MCO ๋ธ”๋กœ๊ทธ โ†’ message_id 10174

ํ‰๊ฐ€ 8.75/10 (Track B PASS, Track A ์ •์ง ์‹œ์ธ)

๊ถŒ์žฅ ํ›„์† (deferred)