-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add infrastructure and domain layers for partner management Introduce MyBatis mappers, XML configurations, and domain models for managing partner data. These include CRUD operations, immutable domain representations, and repository integration to ensure scalability and maintainability.
- Loading branch information
Showing
10 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
app/backend/api/src/main/java/com/example/sms/domain/model/master/partner/Partner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.example.sms.domain.model.master.partner; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Value; | ||
|
||
/** | ||
* 取引先 | ||
*/ | ||
@Value | ||
@AllArgsConstructor | ||
@NoArgsConstructor(force = true) | ||
public class Partner { | ||
String partnerCode; // 取引先コード | ||
String partnerName; // 取引先名 | ||
String partnerNameKana; // 取引先名カナ | ||
Integer supplierType; // 仕入先区分 | ||
String postalCode; // 郵便番号 | ||
String prefecture; // 都道府県 | ||
String address1; // 住所1 | ||
String address2; // 住所2 | ||
Integer tradeProhibitedFlag; // 取引禁止フラグ | ||
Integer miscellaneousType; // 雑区分 | ||
String partnerGroupCode; // 取引先グループコード | ||
Integer creditLimit; // 与信限度額 | ||
Integer temporaryCreditIncrease; // 与信一時増加枠 | ||
} |
29 changes: 29 additions & 0 deletions
29
app/backend/api/src/main/java/com/example/sms/domain/model/master/partner/PartnerList.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.example.sms.domain.model.master.partner; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
/** | ||
* 取引先一覧 | ||
*/ | ||
public class PartnerList { | ||
List<Partner> value; | ||
|
||
public PartnerList(List<Partner> value) { | ||
this.value = Collections.unmodifiableList(value); | ||
} | ||
|
||
public int size() { | ||
return value.size(); | ||
} | ||
|
||
public PartnerList add(Partner partner) { | ||
List<Partner> newValue = value; | ||
newValue.add(partner); | ||
return new PartnerList(newValue); | ||
} | ||
|
||
public List<Partner> asList() { | ||
return value; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
app/backend/api/src/main/java/com/example/sms/domain/model/master/partner/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/** | ||
* 取引先 | ||
*/ | ||
package com.example.sms.domain.model.master.partner; |
10 changes: 10 additions & 0 deletions
10
...in/java/com/example/sms/infrastructure/datasource/master/partner/PartnerCustomEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.example.sms.infrastructure.datasource.master.partner; | ||
|
||
import com.example.sms.infrastructure.datasource.autogen.model.取引先マスタ; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
public class PartnerCustomEntity extends 取引先マスタ { | ||
} |
16 changes: 16 additions & 0 deletions
16
...in/java/com/example/sms/infrastructure/datasource/master/partner/PartnerCustomMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.example.sms.infrastructure.datasource.master.partner; | ||
|
||
import org.apache.ibatis.annotations.Delete; | ||
import org.apache.ibatis.annotations.Mapper; | ||
|
||
import java.util.List; | ||
|
||
@Mapper | ||
public interface PartnerCustomMapper { | ||
PartnerCustomEntity selectByPrimaryKey(String partnerCode); | ||
|
||
List<PartnerCustomEntity> selectAll(); | ||
|
||
@Delete("DELETE FROM public.取引先マスタ") | ||
void deleteAll(); | ||
} |
16 changes: 16 additions & 0 deletions
16
...ain/java/com/example/sms/infrastructure/datasource/master/partner/PartnerCustomMapper.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
<mapper namespace="com.example.sms.infrastructure.datasource.master.partner.PartnerCustomMapper"> | ||
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="com.example.sms.infrastructure.datasource.autogen.mapper.取引先マスタMapper.BaseResultMap"> | ||
select | ||
<include refid="com.example.sms.infrastructure.datasource.autogen.mapper.取引先マスタMapper.Base_Column_List" /> | ||
from public.取引先マスタ | ||
where 取引先コード = #{取引先コード,jdbcType=VARCHAR} | ||
</select> | ||
|
||
<select id="selectAll" parameterType="java.lang.String" resultMap="com.example.sms.infrastructure.datasource.autogen.mapper.取引先マスタMapper.BaseResultMap"> | ||
select | ||
<include refid="com.example.sms.infrastructure.datasource.autogen.mapper.取引先マスタMapper.Base_Column_List" /> | ||
from public.取引先マスタ | ||
</select> | ||
</mapper> |
8 changes: 8 additions & 0 deletions
8
...main/java/com/example/sms/infrastructure/datasource/master/partner/PartnerDataSource.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.example.sms.infrastructure.datasource.master.partner; | ||
|
||
import com.example.sms.service.master.partner.PartnerRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public class PartnerDataSource implements PartnerRepository { | ||
} |
7 changes: 7 additions & 0 deletions
7
...in/java/com/example/sms/infrastructure/datasource/master/partner/PartnerEntityMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.example.sms.infrastructure.datasource.master.partner; | ||
|
||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class PartnerEntityMapper { | ||
} |
1 change: 1 addition & 0 deletions
1
.../src/main/java/com/example/sms/infrastructure/datasource/master/partner/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package com.example.sms.infrastructure.datasource.master.partner; |
4 changes: 4 additions & 0 deletions
4
app/backend/api/src/main/java/com/example/sms/service/master/partner/PartnerRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package com.example.sms.service.master.partner; | ||
|
||
public interface PartnerRepository { | ||
} |