Skip to content

Commit

Permalink
fix: FinIns suica name
Browse files Browse the repository at this point in the history
  • Loading branch information
azuki774 committed Sep 2, 2024
1 parent 90e3d85 commit a6bdb93
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions internal/mawinter/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ func (m *mockMawinterClient) GetMawinterWeb(ctx context.Context, yyyymm string)
CategoryID: 100,
CategoryName: "cat1",
Datetime: time.Date(2010, 1, 23, 1, 2, 3, 0, time.Local),
From: fromMawinterWebText,
From: "手動",
Price: 1234,
},
{
ID: 5,
CategoryID: 500,
CategoryName: "cat5",
Datetime: time.Date(2010, 1, 24, 1, 2, 3, 0, time.Local),
From: fromMawinterWebText,
From: "手動",
Price: 5678,
},
}
Expand Down
2 changes: 0 additions & 2 deletions internal/mawinter/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ type MawinterClient interface {
Regist(ctx context.Context, c model.Detail, catID int) (err error)
}

const fromMawinterWebText = "mawinter-web"

type Mawinter struct {
Logger *zap.Logger
DBClient DBClient
Expand Down
4 changes: 2 additions & 2 deletions internal/model/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ func (e *ExtractRule) AddRule(ers []ExtractRuleDB) (err error) {

// そのレコードが Suica のものかを判定する
// 内容: '入 XXXX 出 YYYY'
// 保有金融機関: 'モバイルSuica (モバイルSuica ID)'
// 保有金融機関: 'モバイルSuica'
func IsSuicaDetail(d Detail) (ok bool) {
const mobileSuicaFinIns = "モバイルSuica (モバイルSuica ID)"
const mobileSuicaFinIns = "モバイルSuica"
if d.FinIns != mobileSuicaFinIns {
return false
}
Expand Down
6 changes: 3 additions & 3 deletions internal/model/extract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestIsSuicaDetail(t *testing.T) {
args: args{
d: Detail{
Name: "入 東京 出 大阪",
FinIns: "モバイルSuica (モバイルSuica ID)",
FinIns: "モバイルSuica",
},
},
wantOk: true,
Expand All @@ -36,7 +36,7 @@ func TestIsSuicaDetail(t *testing.T) {
args: args{
d: Detail{
Name: "出 東京 入 大阪",
FinIns: "モバイルSuica (モバイルSuica ID)",
FinIns: "モバイルSuica",
},
},
wantOk: false,
Expand All @@ -46,7 +46,7 @@ func TestIsSuicaDetail(t *testing.T) {
args: args{
d: Detail{
Name: "物販",
FinIns: "モバイルSuica (モバイルSuica ID)",
FinIns: "モバイルSuica",
},
},
wantOk: false,
Expand Down

0 comments on commit a6bdb93

Please sign in to comment.