feat(account): 대출 계좌 loan_amount/loan_rate/loan_method/loan_months/loan_start 필드 추가
CI / build (push) Failing after 15m38s
CI / build (push) Failing after 15m38s
- wallet 테이블: loan_amount(실행금액), loan_rate(연이자율%), loan_method(상환방식), loan_months(기간), loan_start(시작일) ALTER TABLE 추가 - Wallet 도메인/DTO/Mapper/Service 동기화 - WalletResponse.from()에 대출 필드 반영 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,11 @@ ALTER TABLE wallet ADD COLUMN IF NOT EXISTS opening_balance BIGINT NOT NULL DEFA
|
||||
ALTER TABLE wallet ADD COLUMN IF NOT EXISTS opening_date DATE NULL;
|
||||
ALTER TABLE wallet ADD COLUMN IF NOT EXISTS current_value BIGINT NULL;
|
||||
ALTER TABLE wallet ADD COLUMN IF NOT EXISTS sort_order INT NOT NULL DEFAULT 0;
|
||||
ALTER TABLE wallet ADD COLUMN IF NOT EXISTS loan_rate DECIMAL(7,4) NULL COMMENT '연이자율(%) 예: 5.2500';
|
||||
ALTER TABLE wallet ADD COLUMN IF NOT EXISTS loan_method VARCHAR(20) NULL COMMENT '상환방식: EQUAL_PAYMENT/EQUAL_PRINCIPAL/BULLET';
|
||||
ALTER TABLE wallet ADD COLUMN IF NOT EXISTS loan_months INT NULL COMMENT '대출기간(개월)';
|
||||
ALTER TABLE wallet ADD COLUMN IF NOT EXISTS loan_start DATE NULL COMMENT '대출시작일';
|
||||
ALTER TABLE wallet ADD COLUMN IF NOT EXISTS loan_amount BIGINT NULL COMMENT '대출 실행 금액(원금, 처음 빌린 금액)';
|
||||
-- 계좌번호 암호화 저장(AES-GCM)으로 평문보다 길어 VARCHAR(255) 필요 — 운영 적용 완료(CREATE TABLE 정의에 반영).
|
||||
-- 매 기동 MODIFY 는 라이브 테이블 락 위험이 있어 제거. 기존 환경 확장이 필요하면 1회 수동 적용:
|
||||
-- ALTER TABLE wallet MODIFY account_number VARCHAR(255) NULL;
|
||||
|
||||
@@ -15,13 +15,20 @@
|
||||
<result property="openingBalance" column="opening_balance"/>
|
||||
<result property="openingDate" column="opening_date"/>
|
||||
<result property="currentValue" column="current_value"/>
|
||||
<result property="loanAmount" column="loan_amount"/>
|
||||
<result property="loanRate" column="loan_rate"/>
|
||||
<result property="loanMethod" column="loan_method"/>
|
||||
<result property="loanMonths" column="loan_months"/>
|
||||
<result property="loanStart" column="loan_start"/>
|
||||
<result property="sortOrder" column="sort_order"/>
|
||||
<result property="createdAt" column="created_at"/>
|
||||
<result property="updatedAt" column="updated_at"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="cols">id, member_id, type, name, issuer, account_number, card_type,
|
||||
opening_balance, opening_date, current_value, sort_order, created_at, updated_at</sql>
|
||||
opening_balance, opening_date, current_value,
|
||||
loan_amount, loan_rate, loan_method, loan_months, loan_start,
|
||||
sort_order, created_at, updated_at</sql>
|
||||
|
||||
<select id="findByMember" parameterType="long" resultMap="walletResultMap">
|
||||
SELECT <include refid="cols"/> FROM wallet
|
||||
@@ -37,10 +44,14 @@
|
||||
<insert id="insert" parameterType="com.sb.web.account.domain.Wallet"
|
||||
useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO wallet (member_id, type, name, issuer, account_number, card_type,
|
||||
opening_balance, opening_date, current_value, sort_order, created_at, updated_at)
|
||||
opening_balance, opening_date, current_value,
|
||||
loan_amount, loan_rate, loan_method, loan_months, loan_start,
|
||||
sort_order, created_at, updated_at)
|
||||
VALUES (#{memberId}, #{type}, #{name}, #{issuer},
|
||||
#{accountNumber, typeHandler=com.sb.web.common.crypto.EncryptedStringTypeHandler}, #{cardType},
|
||||
#{openingBalance}, #{openingDate}, #{currentValue}, #{sortOrder}, NOW(), NOW())
|
||||
#{openingBalance}, #{openingDate}, #{currentValue},
|
||||
#{loanAmount}, #{loanRate}, #{loanMethod}, #{loanMonths}, #{loanStart},
|
||||
#{sortOrder}, NOW(), NOW())
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.sb.web.account.domain.Wallet">
|
||||
@@ -49,7 +60,10 @@
|
||||
account_number = #{accountNumber, typeHandler=com.sb.web.common.crypto.EncryptedStringTypeHandler},
|
||||
card_type = #{cardType},
|
||||
opening_balance = #{openingBalance}, opening_date = #{openingDate},
|
||||
current_value = #{currentValue}
|
||||
current_value = #{currentValue},
|
||||
loan_amount = #{loanAmount},
|
||||
loan_rate = #{loanRate}, loan_method = #{loanMethod},
|
||||
loan_months = #{loanMonths}, loan_start = #{loanStart}
|
||||
WHERE id = #{id} AND member_id = #{memberId}
|
||||
</update>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user