feat: 예상 수입 월별 저장 + 계좌 순서변경 API
CI / build (push) Failing after 12m2s

- 예상 수입: budget_income(연·월별) 로 변경, GET/PUT 에 year·month
- 계좌: wallet.sort_order + reorder 엔드포인트, 생성 시 맨 뒤 배치

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ByungCheol
2026-06-01 22:54:23 +09:00
parent cac9919cc5
commit f5e9b78a14
11 changed files with 93 additions and 24 deletions
@@ -4,12 +4,13 @@
<mapper namespace="com.sb.web.account.mapper.AccountSettingMapper">
<select id="findExpectedIncome" resultType="java.lang.Long">
SELECT expected_income FROM account_setting WHERE member_id = #{memberId}
SELECT expected_income FROM budget_income
WHERE member_id = #{memberId} AND `year` = #{year} AND `month` = #{month}
</select>
<update id="upsertExpectedIncome">
INSERT INTO account_setting (member_id, expected_income, updated_at)
VALUES (#{memberId}, #{expectedIncome}, NOW())
INSERT INTO budget_income (member_id, `year`, `month`, expected_income, updated_at)
VALUES (#{memberId}, #{year}, #{month}, #{expectedIncome}, NOW())
ON DUPLICATE KEY UPDATE expected_income = #{expectedIncome}, updated_at = NOW()
</update>
+14 -4
View File
@@ -14,17 +14,18 @@
<result property="openingBalance" column="opening_balance"/>
<result property="openingDate" column="opening_date"/>
<result property="currentValue" column="current_value"/>
<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, created_at, updated_at</sql>
opening_balance, opening_date, current_value, sort_order, created_at, updated_at</sql>
<select id="findByMember" parameterType="long" resultMap="walletResultMap">
SELECT <include refid="cols"/> FROM wallet
WHERE member_id = #{memberId}
ORDER BY type, name
ORDER BY type, sort_order, name
</select>
<select id="findByIdAndMember" resultMap="walletResultMap">
@@ -35,9 +36,9 @@
<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, created_at, updated_at)
opening_balance, opening_date, current_value, sort_order, created_at, updated_at)
VALUES (#{memberId}, #{type}, #{name}, #{issuer}, #{accountNumber}, #{cardType},
#{openingBalance}, #{openingDate}, #{currentValue}, NOW(), NOW())
#{openingBalance}, #{openingDate}, #{currentValue}, #{sortOrder}, NOW(), NOW())
</insert>
<update id="update" parameterType="com.sb.web.account.domain.Wallet">
@@ -70,4 +71,13 @@
DELETE FROM wallet WHERE id = #{id} AND member_id = #{memberId}
</delete>
<update id="updateSortOrder">
UPDATE wallet SET sort_order = #{sortOrder}
WHERE id = #{id} AND member_id = #{memberId}
</update>
<select id="maxSortOrder" resultType="java.lang.Integer">
SELECT MAX(sort_order) FROM wallet WHERE member_id = #{memberId} AND type = #{type}
</select>
</mapper>