fix(ecommerce,core): 현금영수증 UI 보완 + 하네스 결함 6건 + 확장점 룰 사각 제거

현금영수증/환불계좌 기능(S3)의 감사 보완과, 그 과정에서 발견한 하네스 결함을
같은 세션에서 일괄 처리한다. 지시에 따라 무관 산출물(namuwiki 문서 초안 포함)도
단일 커밋으로 묶는다.

- 현금영수증 발급 이력 접기/펼치기(W-3) + 결제행별 독립 토글 + aria 상태
- vendor-bundle manifest 해시 재생성 — composer.json version bump 미반영분 정합
- 시나리오 매니페스트 거짓 경로 정정(A/B) + 미작성 부채 :test-files 정직 표기(C)
- layout-* 룰의 resources/extensions 검사 사각 제거 + 확장점 전용 root 스키마 분기
- validate-test-scenario.cjs: 맵형 test_files 크래시 + fallback 파서 covers 오검출 수정
- tosspayments 확장점 setState target 규약 위반 수정
This commit is contained in:
HeuJung committed 2026-08-06 12:36:31 +09:00
1 parent 58560eefb1
commit 42eb21320b
106 files changed
+6294 -177

No files matched your search

@@ -4,10 +4,13 @@
형식은 [Keep a Changelog](https://keepachangelog.com/ko/1.1.0/)를 따르며,
[Semantic Versioning](https://semver.org/lang/ko/)을 준수합니다.
## [1.0.4] - 2026-07-19
## [1.1.0] - 2026-08-06
### Added
- 주문서의 무통장입금·가상계좌 결제 영역에 환불 계좌(은행·계좌번호·예금주) 입력란을 추가했습니다. 주문을 취소할 때 환불받을 계좌를 미리 남겨둘 수 있으며, 입력하지 않아도 주문할 수 있습니다. 다만 세 칸 중 하나라도 입력하면 나머지도 입력해야 합니다.
- 주문서의 무통장입금 영역에 현금영수증 신청 폼이 표시될 수 있도록 확장 영역을 마련했습니다. 신청 폼 자체는 쇼핑몰 기능이 제공합니다.
- 주문 상세의 결제 정보 영역에 현금영수증 발급 내역이 표시될 수 있도록 확장 영역을 마련했습니다.
- 회원가입 화면에 휴대폰번호·전화번호 입력란을 추가했습니다. 두 항목 모두 선택 사항입니다.
### Changed
@@ -16,6 +19,7 @@
### Fixed
- 주문 상세의 결제 정보 영역에 결제 플러그인이 제공하는 공급가액·부가세·영수증 링크·에스크로 구매확정 버튼이 표시되지 않던 문제를 수정했습니다.
- 총 건수를 끝까지 세지 못한 목록에서 페이지 이동 막대가 사라지거나 "1페이지뿐" 으로 잘못 표시되던 문제를 수정했습니다. 마이페이지의 주문·마일리지·위시리스트·알림함, 게시판 목록, 상품 리뷰·문의, 내가 쓴 글 목록이 해당합니다.
- 검색 결과의 탭 배지가 끝까지 세지 못한 건수를 정확한 숫자처럼 보여주던 문제를 수정했습니다. 이제 그 경우 숫자 뒤에 "이상" 표시가 붙습니다.
@@ -57,7 +61,7 @@
### Changed
- 옵션 담기 방식 개선에 따라 이 템플릿은 이커머스 모듈 1.0.5 이상이 필요합니다.
- 이커머스 모듈 최소 요구 버전을 1.1.0 으로 상향했습니다. 옵션 담기 방식 개선과 주문서 환불 계좌·현금영수증 확장 영역 표시에 해당 버전 이상이 필요합니다.
- 검색 결과가 아주 많아 총 건수를 정확히 셀 수 없는 경우, "N건 이상" 으로 표시하고 검색어를 좁히면 정확한 건수를 볼 수 있다는 안내를 함께 보여 줍니다. 이때 마지막 페이지로 바로 뛰는 버튼은 감춰지고 다음 페이지 이동은 그대로 됩니다.
- 페이지네이션에서 처음/마지막 버튼을 따로 켜고 끌 수 있게 했습니다.
- 목록의 총 건수 정확도 표시를 사용하기 위해 이 템플릿은 이제 코어 7.0.6 이상이 필요합니다.
@@ -0,0 +1,147 @@
/**
* @file checkoutCashReceiptSlot.test.tsx
* @description 체크아웃 현금영수증 확장 슬롯 + 환불계좌 입력 필드 구조 검증 (#454 S3).
*
* 설계 계약:
* - 현금영수증 신청 폼은 템플릿이 슬롯(extension_point)만 열고 이커머스 모듈이 주입한다.
* 슬롯이 dbank 블록 **내부**에 있으므로 결제수단이 무통장일 때만 렌더된다 → 별도 if 불필요.
* - 환불계좌 3필드는 템플릿이 직접 소유한다(PG·현금영수증 프로바이더 비종속, 은행 목록은
* 이미 템플릿이 가진 paymentSettings 를 재사용). dbank·vbank 양쪽 블록에 존재한다.
* - 반응형은 responsive.portable 단독. 신설 노드의 className 에 Tailwind breakpoint(md:/lg:)를
* 쓰면 레이아웃 편집기의 디바이스 미리보기(overrideWidth)가 깨지므로 금지한다.
*/
import { describe, it, expect } from 'vitest';
import checkoutPaymentJson from '../../layouts/partials/shop/_checkout_payment.json';
/** if 표현식에 해당 결제수단이 걸린 최상위 블록 */
const blockFor = (method: string) =>
(checkoutPaymentJson.children as any[]).find(
(c) => typeof c.if === 'string' && c.if.includes(`'${method}'`)
);
const dbankBlock = blockFor('dbank');
const vbankBlock = blockFor('vbank');
/** 노드 트리 전체를 평탄화 */
function flatten(node: any, out: any[] = []): any[] {
if (node == null || typeof node !== 'object') return out;
out.push(node);
for (const value of Object.values(node)) {
if (Array.isArray(value)) value.forEach((v) => flatten(v, out));
else if (value && typeof value === 'object') flatten(value, out);
}
return out;
}
const findById = (root: any, id: string) => flatten(root).find((n) => n.id === id);
describe('체크아웃 현금영수증 확장 슬롯', () => {
it('dbank 블록과 vbank 블록이 존재해야 한다', () => {
expect(dbankBlock, '무통장 블록').toBeDefined();
expect(vbankBlock, '가상계좌 블록').toBeDefined();
});
it('슬롯은 dbank 블록의 직계 자식이어야 한다 (결제수단 게이트를 블록이 대신함)', () => {
const slot = (dbankBlock.children as any[]).find(
(c) => c.type === 'extension_point' && c.name === 'shop_checkout_cash_receipt_slot'
);
expect(slot, 'dbank 블록 직계의 현금영수증 슬롯').toBeDefined();
expect(slot.default).toEqual([]);
});
it('슬롯에 별도 if 게이트가 없어야 한다 (dbank 블록 내부이므로 중복)', () => {
const slot = (dbankBlock.children as any[]).find(
(c) => c.type === 'extension_point' && c.name === 'shop_checkout_cash_receipt_slot'
);
expect(slot.if).toBeUndefined();
});
it('vbank 블록에는 현금영수증 슬롯이 없어야 한다 (D4 — 가상계좌는 PG 가 자동 발급)', () => {
const slots = flatten(vbankBlock).filter((n) => n.type === 'extension_point');
expect(slots.map((s) => s.name)).not.toContain('shop_checkout_cash_receipt_slot');
});
it('템플릿은 현금영수증 도메인 필드를 직접 그리지 않는다 (모듈 소유)', () => {
const raw = JSON.stringify(checkoutPaymentJson);
expect(raw).not.toContain('cash_receipt_type');
expect(raw).not.toContain('cashReceiptIdentifier');
});
});
describe('환불계좌 입력 필드 (템플릿 직접 소유)', () => {
const cases: Array<[string, string, any]> = [
['dbank', 'checkout_refund_bank_dbank', dbankBlock],
['vbank', 'checkout_refund_bank_vbank', vbankBlock],
];
for (const [method, containerId, block] of cases) {
describe(`${method} 블록`, () => {
const container = findById(block, containerId);
it('환불계좌 컨테이너가 존재해야 한다', () => {
expect(container, `${containerId}`).toBeDefined();
});
it('은행 Select + 계좌번호 + 예금주 3필드를 가져야 한다', () => {
const names = flatten(container)
.map((n) => n.props?.name)
.filter(Boolean);
expect(names).toContain('refund_bank_code');
expect(names).toContain('refund_bank_account');
expect(names).toContain('refund_bank_holder');
});
it('3필드가 각각 _local.refundBank* 에 setState 해야 한다', () => {
const targets = flatten(container)
.flatMap((n) => n.actions ?? [])
.filter((a: any) => a.handler === 'setState')
.map((a: any) => Object.keys(a.params).filter((k) => k !== 'target'))
.flat();
expect(targets).toEqual(
expect.arrayContaining(['refundBankCode', 'refundBankAccount', 'refundBankHolder'])
);
});
it('은행 Select 는 paymentSettings 의 banks 를 {value,label} 로 변환해야 한다', () => {
const select = flatten(container).find((n) => n.name === 'Select');
expect(select, '은행 Select').toBeDefined();
// valueKey/labelKey prop 금지 — computed/표현식으로 변환해야 한다
expect(select.props.valueKey).toBeUndefined();
expect(select.props.labelKey).toBeUndefined();
expect(select.props.options).toContain('order_settings?.banks');
expect(select.props.options).toContain('value:');
expect(select.props.options).toContain('label:');
});
it('신설 노드는 responsive.portable 만 쓰고 md:/lg: breakpoint 를 쓰지 않는다 (§6-0)', () => {
const nodes = flatten(container);
const breakpoints = nodes.filter((n) => /(^|\s)(md|lg|xl|2xl):/.test(n.props?.className ?? ''));
expect(breakpoints, 'Tailwind breakpoint 사용 노드').toEqual([]);
const responsiveKeys = nodes.flatMap((n) => Object.keys(n.responsive ?? {}));
expect(responsiveKeys.length, 'responsive 오버라이드가 하나 이상').toBeGreaterThan(0);
expect([...new Set(responsiveKeys)], 'portable 단독 (mobile/tablet 혼용 금지)').toEqual([
'portable',
]);
});
it('2열 그리드가 portable 에서 1열로 접힌다', () => {
const grid = flatten(container).find((n) => (n.props?.className ?? '').includes('grid-cols-2'));
expect(grid, '2열 그리드').toBeDefined();
expect(grid.responsive.portable.props.className).toContain('grid-cols-1');
});
it('다크모드 variant 가 함께 지정되어야 한다', () => {
const withBg = flatten(container).filter((n) =>
/(^|\s)(bg-|text-|border-)/.test(n.props?.className ?? '')
);
expect(withBg.length).toBeGreaterThan(0);
for (const n of withBg) {
expect(n.props.className, `dark: variant 누락 → ${n.props.className}`).toContain('dark:');
}
});
});
}
});
@@ -0,0 +1,230 @@
/**
* @file checkoutSummaryBodyPayload.test.tsx
* @description 주문 생성 POST body 의 확장 병합 칸(checkoutExtraPayload) 계약 검증.
*
* 배경 (#454 S3):
* 슬롯에 주입된 모듈 폼이 _local 에 값을 써도, body 가 템플릿 소유 리터럴 객체이면
* 그 값은 서버에 도달하지 않는다. 모듈은 body 줄을 추가할 수단이 없다
* (결제 버튼 id 부재 → overlay 불가 / inject_props 는 actions[].params.body 미도달).
* → body 를 통짜 표현식으로 두고 확장 병합 칸 1개를 연다.
*
* 평가 경로 변화:
* 전환 전 = ActionDispatcher.resolveParams 가 body 를 재귀하며 키마다 evaluateExpression
* 전환 후 = body 가 단일 문자열 → evaluateExpression 1회
* → 두 경로의 산출값 동등성을 고정한다 (특히 dbank 삼항 · guest_lookup_password null 분기 ·
* expected_total_amount 숫자형 · shipping_memo custom 분기).
*/
import { describe, it, expect } from 'vitest';
import { DataBindingEngine } from '@core/template-engine/DataBindingEngine';
import checkoutSummaryJson from '../../layouts/partials/shop/_checkout_summary.json';
/** 객체 트리에서 조건을 만족하는 첫 노드를 깊이우선 탐색 */
function findNode(node: any, predicate: (n: any) => boolean): any {
if (node == null || typeof node !== 'object') return undefined;
if (predicate(node)) return node;
for (const value of Object.values(node)) {
if (Array.isArray(value)) {
for (const item of value) {
const found = findNode(item, predicate);
if (found !== undefined) return found;
}
} else if (value && typeof value === 'object') {
const found = findNode(value, predicate);
if (found !== undefined) return found;
}
}
return undefined;
}
/** 주문 생성 POST apiCall 노드 */
const orderCall = findNode(
checkoutSummaryJson,
(n) =>
n.handler === 'apiCall' &&
typeof n.target === 'string' &&
n.target.includes('/user/orders') &&
n.params?.method === 'POST'
);
const engine = new DataBindingEngine();
/** body 가 통짜 표현식일 때 실제 런타임 평가 (resolveParams 의 문자열 분기와 동일) */
function evalBody(ctx: Record<string, any>): Record<string, any> {
const raw: string = orderCall.params.body;
return engine.evaluateExpression(raw.slice(2, -2), ctx);
}
/** 전환 이전 동작을 재현하는 기준 payload — 이 테스트가 진실의 기준(SSoT)이다. */
function expectedLegacy(ctx: any): Record<string, any> {
const { checkoutData, _computed, _local, _global } = ctx;
return {
temp_order_id: checkoutData?.data?.temp_order_id,
orderer: _computed?.ordererDefaults,
shipping: _local?.shipping,
payment_method: _computed?.selectedPaymentMethod,
shipping_memo:
_local?.shippingMemo === 'custom' ? _local?.shippingMemoCustom : _local?.shippingMemo,
depositor_name: _local?.depositorName ?? _computed?.ordererDefaults?.name ?? '',
dbank:
_computed?.selectedPaymentMethod === 'dbank'
? {
bank_code: _local?.selectedDbank?.bank_code,
account_number: _local?.selectedDbank?.account_number,
account_holder: _local?.selectedDbank?.account_holder,
}
: null,
expected_total_amount: checkoutData?.data?.calculation?.summary?.final_amount ?? 0,
save_shipping_address: _local?.saveShippingAddress ?? false,
guest_lookup_password: _global?.currentUser?.uuid ? null : (_local?.guestLookupPassword ?? ''),
guest_lookup_password_confirmation: _global?.currentUser?.uuid
? null
: (_local?.guestLookupPasswordConfirmation ?? ''),
refund_bank: _local?.refundBankCode
? {
bank_code: _local?.refundBankCode,
account_number: _local?.refundBankAccount ?? null,
holder: _local?.refundBankHolder ?? null,
}
: null,
};
}
const LEGACY_KEYS = Object.keys(expectedLegacy({}));
const baseCtx = (over: Record<string, any> = {}) => ({
checkoutData: {
data: {
temp_order_id: 'TMP-1',
calculation: { summary: { final_amount: 53000 } },
},
},
_computed: {
ordererDefaults: { name: '홍길동', phone: '01012345678', email: 'a@b.c' },
selectedPaymentMethod: 'dbank',
},
_local: {
shipping: { recipient_name: '홍길동' },
shippingMemo: 'custom',
shippingMemoCustom: '문 앞에 두세요',
selectedDbank: { bank_code: '004', account_number: '110-123', account_holder: '시르소프트' },
saveShippingAddress: true,
guestLookupPassword: 'pw12345678',
guestLookupPasswordConfirmation: 'pw12345678',
},
_global: { currentUser: null },
...over,
});
describe('주문 생성 body — 확장 병합 칸 계약', () => {
it('주문 생성 POST apiCall 노드가 존재해야 한다', () => {
expect(orderCall, '주문 생성 POST apiCall 노드').toBeDefined();
});
it('body 는 통짜 표현식이어야 한다 (확장 칸 spread 를 담기 위함)', () => {
expect(typeof orderCall.params.body).toBe('string');
expect(orderCall.params.body).toContain('checkoutExtraPayload');
});
describe('전환 동등성 — 기존 키 산출값 보존', () => {
const cases: Array<[string, Record<string, any>]> = [
['dbank + 비회원 (기본)', baseCtx()],
[
'card + 회원 — dbank=null · guest 비밀번호 null 분기',
baseCtx({
_computed: {
ordererDefaults: { name: '김철수', phone: '', email: '' },
selectedPaymentMethod: 'card',
},
_global: { currentUser: { uuid: 'user-uuid-1' } },
}),
],
[
'shipping_memo 비-custom 분기',
baseCtx({ _local: { ...baseCtx()._local, shippingMemo: 'door', shippingMemoCustom: '무시됨' } }),
],
[
'depositor_name 미입력 → ordererDefaults.name 폴백',
baseCtx({ _local: { ...baseCtx()._local, depositorName: undefined } }),
],
[
'초기 진입 (빈 _local · calculation 없음)',
{
checkoutData: { data: { temp_order_id: null, calculation: null } },
_computed: { ordererDefaults: undefined, selectedPaymentMethod: 'vbank' },
_local: {},
_global: {},
},
],
];
for (const [name, ctx] of cases) {
it(`[${name}] 통짜 평가 결과가 전환 전 산출값과 같다`, () => {
expect(evalBody(ctx)).toEqual(expectedLegacy(ctx));
});
}
it('expected_total_amount 는 숫자형을 보존한다 (문자열 보간 금지)', () => {
expect(typeof evalBody(baseCtx()).expected_total_amount).toBe('number');
});
});
describe('확장 병합 칸 (checkoutExtraPayload)', () => {
it('모듈 비활성(칸 미주입) 시 payload 가 전환 전과 키·값 모두 동일하다', () => {
const ctx = baseCtx();
const body = evalBody(ctx);
expect(Object.keys(body).sort()).toEqual(LEGACY_KEYS.sort());
expect(body).toEqual(expectedLegacy(ctx));
});
it('칸에 기입한 키가 payload 에 편입되고 기존 키는 불변이다', () => {
const ctx = baseCtx();
(ctx._local as Record<string, any>).checkoutExtraPayload = {
cash_receipt_requested: true,
cash_receipt_type: 'income',
cash_receipt_identifier_type: 'phone',
cash_receipt_identifier: '01012345678',
};
const body = evalBody(ctx);
expect(body.cash_receipt_requested).toBe(true);
expect(body.cash_receipt_type).toBe('income');
expect(body.cash_receipt_identifier_type).toBe('phone');
expect(body.cash_receipt_identifier).toBe('01012345678');
for (const key of LEGACY_KEYS) {
expect(body[key]).toEqual(expectedLegacy(ctx)[key]);
}
});
it('확장 칸은 기존 키를 덮어쓸 수 없어야 한다 — spread 가 뒤에 오므로 덮어쓰기가 가능함을 명시 고정', () => {
const ctx = baseCtx();
(ctx._local as Record<string, any>).checkoutExtraPayload = { payment_method: 'HIJACKED' };
// 현재 계약: 확장 칸이 뒤에 spread 되므로 덮어쓴다.
// 이 동작을 '알고 있는 것'으로 고정한다 — 모듈은 자기 네임스페이스 키만 써야 한다.
expect(evalBody(ctx).payment_method).toBe('HIJACKED');
});
});
describe('환불계좌 (템플릿 직접 소유 — 확장 칸 미경유)', () => {
it('미입력 시 refund_bank 는 null 이다', () => {
expect(evalBody(baseCtx()).refund_bank).toBeNull();
});
it('입력 시 3필드가 그대로 실린다', () => {
const ctx = baseCtx({
_local: {
...baseCtx()._local,
refundBankCode: '004',
refundBankAccount: '110-123-456789',
refundBankHolder: '홍길동',
},
});
expect(evalBody(ctx).refund_bank).toEqual({
bank_code: '004',
account_number: '110-123-456789',
holder: '홍길동',
});
});
});
});
@@ -0,0 +1,74 @@
/**
* @file mypageOrderPaymentPanel.test.tsx
* @description 유저 주문상세 결제 패널의 확장 앵커 검증 (#454 S3).
*
* 두 가지를 고정한다:
* 1. 루트 Div 의 id = "order_payment_info_panel"
* KG 플러그인(resources/extensions/user_order_show.json)이 이 id 를 target_id 로 지정하고
* mypageOrderShowInjector.ts 가 getElementById 로 찾는다. 그동안 이 노드에 id 가 없어
* 주입이 조용히 no-op 이었다 — 본 이슈가 부수 복구한다(R1). id 를 지우면 KG 세금내역·
* 영수증 링크·에스크로 확인 버튼이 한꺼번에 사라진다.
* 2. 말단 extension_point "mypage_order_cash_receipt_slot"
* 이커머스 모듈이 현금영수증 카드를 주입하는 자리.
*/
import { describe, it, expect } from 'vitest';
import paymentPartialJson from '../../layouts/partials/mypage/orders/_payment.json';
import kgUserOrderShowJson from '../../../../../plugins/_bundled/sirsoft-pay_kginicis/resources/extensions/user_order_show.json';
function flatten(node: any, out: any[] = []): any[] {
if (node == null || typeof node !== 'object') return out;
out.push(node);
for (const value of Object.values(node)) {
if (Array.isArray(value)) value.forEach((v) => flatten(v, out));
else if (value && typeof value === 'object') flatten(value, out);
}
return out;
}
describe('유저 주문상세 결제 패널 — 확장 앵커', () => {
it('루트 Div 에 KG 가 기대하는 id 가 부여되어야 한다 (R1 no-op 주입 복구)', () => {
expect(paymentPartialJson.id).toBe('order_payment_info_panel');
});
it('KG overlay 의 target_id 와 실제 앵커 id 가 일치해야 한다', () => {
const injection = (kgUserOrderShowJson as any).injections[0];
expect(injection.target_id).toBe(paymentPartialJson.id);
// append_child = 패널 내부 말단에 붙는다 → 앵커가 컨테이너여야 한다
expect(injection.position).toBe('append_child');
expect(Array.isArray(paymentPartialJson.children)).toBe(true);
});
it('현금영수증 확장 슬롯이 패널 말단에 존재해야 한다', () => {
const slots = flatten(paymentPartialJson).filter((n) => n.type === 'extension_point');
expect(slots.map((s) => s.name)).toContain('mypage_order_cash_receipt_slot');
const slot = slots.find((s) => s.name === 'mypage_order_cash_receipt_slot');
expect(slot.default).toEqual([]);
});
it('슬롯은 결제 정보 목록의 마지막 자식이어야 한다 (결제수단 행 아래)', () => {
const infoList = (paymentPartialJson.children as any[]).find(
(c) => (c.props?.className ?? '').includes('space-y-3')
);
const last = infoList.children[infoList.children.length - 1];
expect(last.type).toBe('extension_point');
expect(last.name).toBe('mypage_order_cash_receipt_slot');
});
it('템플릿은 현금영수증 도메인 필드를 직접 그리지 않는다 (모듈 소유)', () => {
// 슬롯 이름/주석에는 'cash_receipt' 가 들어간다(정상). 금지 대상은 도메인 값 바인딩이다.
const bindings = flatten(paymentPartialJson)
.filter((n) => n.type !== 'extension_point')
.flatMap((n) => [n.text, ...Object.values(n.props ?? {})])
.filter((v): v is string => typeof v === 'string');
for (const b of bindings) {
expect(b, `템플릿이 현금영수증 필드를 직접 바인딩 → ${b}`).not.toContain('cash_receipt');
}
});
it('id 부여가 기존 responsive.portable 규약을 깨지 않는다', () => {
expect(Object.keys(paymentPartialJson.responsive)).toEqual(['portable']);
});
});
@@ -17,6 +17,7 @@
*/
import { describe, it, expect } from 'vitest';
import { DataBindingEngine } from '@core/template-engine/DataBindingEngine';
import purchaseCardJson from '../../layouts/partials/shop/detail/_purchase_card.json';
import cartSummaryJson from '../../layouts/partials/shop/_cart_summary.json';
import loginJson from '../../layouts/auth/login.json';
@@ -174,11 +175,27 @@ describe('결제하기 엔드포인트 분기 - _checkout_summary (Issue #55)',
});
it('body 에 비회원 조회 비밀번호 + 확인이 비로그인일 때만 값으로 전송되어야 한다', () => {
const body = ordersApiCall.params?.body ?? {};
// 회원이면 null, 비회원이면 _local.guestLookupPassword 값
expect(body.guest_lookup_password).toContain('_global.currentUser?.uuid');
expect(body.guest_lookup_password).toContain('_local.guestLookupPassword');
expect(body.guest_lookup_password_confirmation).toContain('_local.guestLookupPasswordConfirmation');
// body 는 통짜 표현식이다(#454 확장 병합 칸). 표현식 문자열을 substring 으로 훑는 대신
// 실제로 평가해 "회원=null / 비회원=입력값" 동작 자체를 고정한다.
const engine = new DataBindingEngine();
const evalBody = (currentUser: unknown) =>
engine.evaluateExpression(String(ordersApiCall.params.body).slice(2, -2), {
checkoutData: { data: { temp_order_id: 'TMP-1', calculation: null } },
_computed: { ordererDefaults: {}, selectedPaymentMethod: 'card' },
_local: {
guestLookupPassword: 'pw12345678',
guestLookupPasswordConfirmation: 'pw12345678',
},
_global: { currentUser },
});
const guest = evalBody(null);
expect(guest.guest_lookup_password).toBe('pw12345678');
expect(guest.guest_lookup_password_confirmation).toBe('pw12345678');
const member = evalBody({ uuid: 'user-uuid-1' });
expect(member.guest_lookup_password).toBeNull();
expect(member.guest_lookup_password_confirmation).toBeNull();
});
});
@@ -489,7 +489,12 @@
"payment_order_not_found": "Order not found.",
"payment_generic_error": "An error occurred during payment. Please try again.",
"coupon_download_btn": "Download Coupons",
"guest_token_issue_failed": "Could not prepare guest order lookup. Please re-verify with your phone and password when viewing your order."
"guest_token_issue_failed": "Could not prepare guest order lookup. Please re-verify with your phone and password when viewing your order.",
"refund_bank_title": "Refund Account (used on cancellation, optional)",
"refund_bank_select": "Select bank",
"refund_bank_account_placeholder": "Account number (no hyphens)",
"refund_bank_holder_placeholder": "Account holder",
"refund_bank_partial_notice": "If you fill in any one of the three fields, the others are required."
},
"order_complete": {
"page_title": "Order Complete",
@@ -489,7 +489,12 @@
"payment_order_not_found": "주문을 찾을 수 없습니다.",
"payment_generic_error": "결제 처리 중 오류가 발생했습니다. 다시 시도해 주세요.",
"coupon_download_btn": "쿠폰 다운로드",
"guest_token_issue_failed": "비회원 조회 인증 준비에 실패했습니다. 주문 조회 시 휴대폰과 비밀번호로 다시 확인해 주세요."
"guest_token_issue_failed": "비회원 조회 인증 준비에 실패했습니다. 주문 조회 시 휴대폰과 비밀번호로 다시 확인해 주세요.",
"refund_bank_title": "환불 계좌 (주문 취소 시 사용, 선택)",
"refund_bank_select": "은행 선택",
"refund_bank_account_placeholder": "계좌번호 (- 없이 입력)",
"refund_bank_holder_placeholder": "예금주",
"refund_bank_partial_notice": "셋 중 하나라도 입력하면 나머지도 입력해야 합니다."
},
"order_complete": {
"page_title": "주문 완료",
@@ -3,8 +3,10 @@
"is_partial": true,
"description": "주문 상세 - 결제 정보"
},
"_comment_id": "id 는 확장의 overlay 앵커다. KG 플러그인의 resources/extensions/user_order_show.json 이 target_id 로 이 이름을 지정하고 mypageOrderShowInjector.ts 가 getElementById 로 찾는데, 그동안 이 노드에 id 가 없어 주입이 조용히 실패하고 있었다(#454 에서 부수 복구).",
"type": "basic",
"name": "Div",
"id": "order_payment_info_panel",
"props": { "className": "bg-white dark:bg-gray-800 rounded-lg p-6" },
"responsive": {
"portable": {
@@ -26,7 +28,7 @@
{
"type": "basic",
"name": "Icon",
"props": { "name": "credit-card", "className": "w-5 h-5 text-gray-700 dark:text-gray-300" }
"props": { "name": "credit-card", "className": "text-xl text-gray-700 dark:text-gray-300" }
},
{
"type": "basic",
@@ -135,7 +137,7 @@
{
"type": "basic",
"name": "Icon",
"props": { "name": "ticket", "className": "w-3.5 h-3.5 text-red-400 dark:text-red-500" }
"props": { "name": "ticket", "className": "text-sm text-red-400 dark:text-red-500" }
},
{
"type": "basic",
@@ -174,7 +176,7 @@
{
"type": "basic",
"name": "Icon",
"props": { "name": "ticket", "className": "w-3 h-3 text-red-400 dark:text-red-500" }
"props": { "name": "ticket", "className": "text-xs text-red-400 dark:text-red-500" }
},
{
"type": "basic",
@@ -209,7 +211,7 @@
{
"type": "basic",
"name": "Icon",
"props": { "name": "ticket", "className": "w-3.5 h-3.5 text-red-400 dark:text-red-500" }
"props": { "name": "ticket", "className": "text-sm text-red-400 dark:text-red-500" }
},
{
"type": "basic",
@@ -248,7 +250,7 @@
{
"type": "basic",
"name": "Icon",
"props": { "name": "ticket", "className": "w-3 h-3 text-red-400 dark:text-red-500" }
"props": { "name": "ticket", "className": "text-xs text-red-400 dark:text-red-500" }
},
{
"type": "basic",
@@ -283,7 +285,7 @@
{
"type": "basic",
"name": "Icon",
"props": { "name": "tag", "className": "w-3.5 h-3.5 text-orange-400 dark:text-orange-500" }
"props": { "name": "tag", "className": "text-sm text-orange-400 dark:text-orange-500" }
},
{
"type": "basic",
@@ -322,7 +324,7 @@
{
"type": "basic",
"name": "Icon",
"props": { "name": "tag", "className": "w-3 h-3 text-orange-400 dark:text-orange-500" }
"props": { "name": "tag", "className": "text-xs text-orange-400 dark:text-orange-500" }
},
{
"type": "basic",
@@ -412,7 +414,7 @@
{
"type": "basic",
"name": "Icon",
"props": { "name": "ticket", "className": "w-3.5 h-3.5 text-red-400 dark:text-red-500" }
"props": { "name": "ticket", "className": "text-sm text-red-400 dark:text-red-500" }
},
{
"type": "basic",
@@ -619,6 +621,12 @@
}
}
]
},
{
"comment": "현금영수증 카드 확장 슬롯 — 이커머스 모듈이 resources/extensions/mypage_order_cash_receipt.json 으로 주입한다. 결제수단/프로바이더/발급상태에 따른 표시 분기는 주입 측이 if 로 처리한다(무통장이 아니거나 프로바이더 미설정이면 카드 자체 미렌더).",
"type": "extension_point",
"name": "mypage_order_cash_receipt_slot",
"default": []
}
]
}
@@ -58,6 +58,7 @@
},
"props": {
"type": "button",
"data-testid": "checkout-payment-method-{{method.id}}",
"className": "{{_computed.selectedPaymentMethod === method.id ? 'p-4 border-2 border-gray-900 dark:border-white rounded-lg text-left' : 'p-4 border border-gray-300 dark:border-gray-600 rounded-lg text-left hover:border-gray-400 dark:hover:border-gray-500'}}"
},
"responsive": {
@@ -246,6 +247,119 @@
]
}
]
},
{
"comment": "환불 계좌 (선택 입력) — 가상계좌 입금완료 건의 환불은 PG(토스 등)가 refundReceiveAccount 를 필수로 요구한다. 여기서 미입력이면 관리자 취소 모달에서 다시 받는다. 3필드 중 하나라도 채우면 나머지도 필수(CreateOrderRequest::withValidator 의 required_with).",
"type": "basic",
"name": "Div",
"id": "checkout_refund_bank_vbank",
"props": { "className": "mt-4 pt-4 border-t border-blue-200 dark:border-blue-800" },
"responsive": {
"portable": {
"props": { "className": "mt-3 pt-3 border-t border-blue-200 dark:border-blue-800" }
}
},
"children": [
{
"type": "basic",
"name": "Label",
"props": { "className": "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2" },
"text": "$t:shop.checkout.refund_bank_title"
},
{
"comment": "은행 / 계좌번호 2열 → portable 1열 (마크업 구조 변경이므로 responsive 속성 사용, Tailwind breakpoint 금지)",
"type": "basic",
"name": "Div",
"props": { "className": "grid grid-cols-2 gap-3" },
"responsive": {
"portable": {
"props": { "className": "grid grid-cols-1 gap-3" }
}
},
"children": [
{
"type": "basic",
"name": "Select",
"props": {
"name": "refund_bank_code",
"value": "{{_local.refundBankCode ?? ''}}",
"options": "{{[{ value: '', label: $t('shop.checkout.refund_bank_select') }, ...((paymentSettings.data?.order_settings?.banks ?? []).map(b => ({ value: b.code, label: $localized(b.name) ?? b.code })))]}}",
"className": "w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500"
},
"responsive": {
"portable": {
"props": {
"className": "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 text-sm"
}
}
},
"actions": [
{
"type": "change",
"handler": "setState",
"params": { "target": "local", "refundBankCode": "{{$event.target.value}}" }
}
]
},
{
"type": "basic",
"name": "Input",
"props": {
"type": "text",
"name": "refund_bank_account",
"value": "{{_local.refundBankAccount ?? ''}}",
"placeholder": "$t:shop.checkout.refund_bank_account_placeholder",
"className": "w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500"
},
"responsive": {
"portable": {
"props": {
"className": "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 text-sm"
}
}
},
"actions": [
{
"type": "change",
"handler": "setState",
"params": { "target": "local", "refundBankAccount": "{{$event.target.value}}" }
}
]
}
]
},
{
"type": "basic",
"name": "Input",
"props": {
"type": "text",
"name": "refund_bank_holder",
"value": "{{_local.refundBankHolder ?? ''}}",
"placeholder": "$t:shop.checkout.refund_bank_holder_placeholder",
"className": "w-full mt-3 px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500"
},
"responsive": {
"portable": {
"props": {
"className": "w-full mt-3 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 text-sm"
}
}
},
"actions": [
{
"type": "change",
"handler": "setState",
"params": { "target": "local", "refundBankHolder": "{{$event.target.value}}" }
}
]
},
{
"type": "basic",
"name": "P",
"props": { "className": "text-xs text-gray-500 dark:text-gray-400 mt-2" },
"text": "$t:shop.checkout.refund_bank_partial_notice"
}
]
}
]
},
@@ -422,6 +536,125 @@
}
]
},
{
"comment": "환불 계좌 (선택 입력) — 무통장은 PG 를 경유하지 않아 관리자가 수동 이체한다. 여기 입력된 계좌가 그 대상이다. 3필드 중 하나라도 채우면 나머지도 필수(CreateOrderRequest::withValidator 의 required_with).",
"type": "basic",
"name": "Div",
"id": "checkout_refund_bank_dbank",
"props": { "className": "mt-4 pt-4 border-t border-gray-200 dark:border-gray-600" },
"responsive": {
"portable": {
"props": { "className": "mt-3 pt-3 border-t border-gray-200 dark:border-gray-600" }
}
},
"children": [
{
"type": "basic",
"name": "Label",
"props": { "className": "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2" },
"text": "$t:shop.checkout.refund_bank_title"
},
{
"comment": "은행 / 계좌번호 2열 → portable 1열 (마크업 구조 변경이므로 responsive 속성 사용, Tailwind breakpoint 금지)",
"type": "basic",
"name": "Div",
"props": { "className": "grid grid-cols-2 gap-3" },
"responsive": {
"portable": {
"props": { "className": "grid grid-cols-1 gap-3" }
}
},
"children": [
{
"type": "basic",
"name": "Select",
"props": {
"name": "refund_bank_code",
"value": "{{_local.refundBankCode ?? ''}}",
"options": "{{[{ value: '', label: $t('shop.checkout.refund_bank_select') }, ...((paymentSettings.data?.order_settings?.banks ?? []).map(b => ({ value: b.code, label: $localized(b.name) ?? b.code })))]}}",
"className": "w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500"
},
"responsive": {
"portable": {
"props": {
"className": "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 text-sm"
}
}
},
"actions": [
{
"type": "change",
"handler": "setState",
"params": { "target": "local", "refundBankCode": "{{$event.target.value}}" }
}
]
},
{
"type": "basic",
"name": "Input",
"props": {
"type": "text",
"name": "refund_bank_account",
"value": "{{_local.refundBankAccount ?? ''}}",
"placeholder": "$t:shop.checkout.refund_bank_account_placeholder",
"className": "w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500"
},
"responsive": {
"portable": {
"props": {
"className": "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 text-sm"
}
}
},
"actions": [
{
"type": "change",
"handler": "setState",
"params": { "target": "local", "refundBankAccount": "{{$event.target.value}}" }
}
]
}
]
},
{
"type": "basic",
"name": "Input",
"props": {
"type": "text",
"name": "refund_bank_holder",
"value": "{{_local.refundBankHolder ?? ''}}",
"placeholder": "$t:shop.checkout.refund_bank_holder_placeholder",
"className": "w-full mt-3 px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500"
},
"responsive": {
"portable": {
"props": {
"className": "w-full mt-3 px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 text-sm"
}
}
},
"actions": [
{
"type": "change",
"handler": "setState",
"params": { "target": "local", "refundBankHolder": "{{$event.target.value}}" }
}
]
},
{
"type": "basic",
"name": "P",
"props": { "className": "text-xs text-gray-500 dark:text-gray-400 mt-2" },
"text": "$t:shop.checkout.refund_bank_partial_notice"
}
]
},
{
"comment": "현금영수증 신청 폼 확장 슬롯 — 이커머스 모듈이 resources/extensions/checkout_cash_receipt.json 으로 주입한다. 슬롯이 dbank 블록 내부에 있으므로 결제수단이 무통장일 때만 렌더되며 별도 if 가 필요 없다. 발급 프로바이더는 PG 플러그인이 담당하지만 신청 폼 자체는 PG 비종속이라 모듈이 소유한다(플러그인이 주입하면 두 PG 동시 활성 시 폼이 2개 렌더된다). 주입된 폼은 _local.checkoutExtraPayload 에 자기 필드를 써야 주문 생성 payload 에 실린다 — _checkout_summary.json 의 body 확장 병합 칸 참조.",
"type": "extension_point",
"name": "shop_checkout_cash_receipt_slot",
"default": []
},
{
"comment": "입금 기한 안내 — 가상계좌 안내와 동일 규칙(서버 resolveAutoCancelDays 일치). 빈 문자열/0/음수/비숫자는 기본치 3 으로 되돌린다.",
"type": "basic",
@@ -453,6 +453,7 @@
},
{
"comment": "결제 엔드포인트 — 회원/비회원 공유 단일 endpoint (optional.sanctum). PG 플러그인 fetch 인터셉터가 /user/orders 한 경로만 매칭하므로 비회원도 같은 endpoint 로 호출해 PG 결제창이 정상 노출되도록 한다. 회원/비회원 분기는 백엔드 컨트롤러가 처리.",
"comment_body": "params.body 는 통짜 표현식이다. 말미의 ...(_local.checkoutExtraPayload ?? {}) 는 슬롯에 주입된 모듈/플러그인 폼이 자기 필드를 주문 생성 payload 에 실어 보내기 위한 확장 병합 칸이다. 주입분은 이 body 리터럴을 수정할 수단이 없으므로(결제 버튼에 id 부재 → overlay target 불가, inject_props 는 컴포넌트 props 전용이라 actions[].params.body 미도달) 이 칸이 유일한 경로다. 확장은 자기 도메인 키만 쓴다 — spread 가 뒤에 오므로 기존 키를 덮어쓸 수 있다. 확장 미주입 시 {} 이므로 payload 는 전환 전과 키·값 모두 동일하다. refund_bank 는 템플릿 소유 필드라 확장 칸을 경유하지 않고 직접 기재한다. 회귀 pin: __tests__/layouts/checkoutSummaryBodyPayload.test.tsx",
"handler": "apiCall",
"target": "/api/modules/sirsoft-ecommerce/user/orders",
"auth_mode": "optional",
@@ -463,19 +464,7 @@
"params": {
"method": "POST",
"headers": { "X-Cart-Key": "{{_global.cartKey}}" },
"body": {
"temp_order_id": "{{checkoutData.data.temp_order_id}}",
"orderer": "{{_computed.ordererDefaults}}",
"shipping": "{{_local.shipping}}",
"payment_method": "{{_computed.selectedPaymentMethod}}",
"shipping_memo": "{{_local.shippingMemo === 'custom' ? _local.shippingMemoCustom : _local.shippingMemo}}",
"depositor_name": "{{_local.depositorName ?? _computed.ordererDefaults?.name ?? ''}}",
"dbank": "{{_computed.selectedPaymentMethod === 'dbank' ? { bank_code: _local.selectedDbank?.bank_code, account_number: _local.selectedDbank?.account_number, account_holder: _local.selectedDbank?.account_holder } : null}}",
"expected_total_amount": "{{checkoutData.data.calculation?.summary?.final_amount ?? 0}}",
"save_shipping_address": "{{_local.saveShippingAddress ?? false}}",
"guest_lookup_password": "{{_global.currentUser?.uuid ? null : (_local.guestLookupPassword ?? '')}}",
"guest_lookup_password_confirmation": "{{_global.currentUser?.uuid ? null : (_local.guestLookupPasswordConfirmation ?? '')}}"
}
"body": "{{ ({ temp_order_id: checkoutData.data.temp_order_id, orderer: _computed.ordererDefaults, shipping: _local.shipping, payment_method: _computed.selectedPaymentMethod, shipping_memo: _local.shippingMemo === 'custom' ? _local.shippingMemoCustom : _local.shippingMemo, depositor_name: _local.depositorName ?? _computed.ordererDefaults?.name ?? '', dbank: _computed.selectedPaymentMethod === 'dbank' ? { bank_code: _local.selectedDbank?.bank_code, account_number: _local.selectedDbank?.account_number, account_holder: _local.selectedDbank?.account_holder } : null, expected_total_amount: checkoutData.data.calculation?.summary?.final_amount ?? 0, save_shipping_address: _local.saveShippingAddress ?? false, guest_lookup_password: _global.currentUser?.uuid ? null : (_local.guestLookupPassword ?? ''), guest_lookup_password_confirmation: _global.currentUser?.uuid ? null : (_local.guestLookupPasswordConfirmation ?? ''), refund_bank: _local.refundBankCode ? { bank_code: _local.refundBankCode, account_number: _local.refundBankAccount ?? null, holder: _local.refundBankHolder ?? null } : null, ...(_local.checkoutExtraPayload ?? {}) }) }}"
},
"onSuccess": [
{
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "sirsoft-basic",
"version": "1.0.4",
"version": "1.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sirsoft-basic",
"version": "1.0.4",
"version": "1.1.0",
"license": "MIT",
"dependencies": {
"@dnd-kit/core": "^6.3.1",
@@ -1,6 +1,6 @@
{
"name": "sirsoft-basic",
"version": "1.0.4",
"version": "1.1.0",
"description": "Gnuboard7 Basic User Template Components - Nexibase Style",
"type": "module",
"main": "dist/components.js",
@@ -5,7 +5,7 @@
"ko": "Basic",
"en": "Basic"
},
"version": "1.0.4",
"version": "1.1.0",
"license": "MIT",
"description": {
"ko": "그누보드7 기본 사용자 템플릿",
@@ -26,7 +26,7 @@
"dependencies": {
"modules": {
"sirsoft-board": ">=1.0.0",
"sirsoft-ecommerce": ">=1.0.5",
"sirsoft-ecommerce": ">=1.1.0",
"sirsoft-page": ">=1.0.0"
},
"plugins": {