Skip to content

Commit

Permalink
✨ (微信公众号中国银行微银行): 添加工资入账测试用例及正则表达式支持 #463
Browse files Browse the repository at this point in the history
新增工资入账测试用例,更新正则表达式以支持工资交易类型的匹配。
  • Loading branch information
AnkioTomas committed Dec 18, 2024
1 parent 5335c0a commit edf59d0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ const rules = [
)
}
],
[
//交易时间:09月26日19:05\n交易类型:电子钱包取现(尾号0464)\n交易金额:人民币 36.00\n账户余额:61.04元\n交易说明:点击查看更多详情
/交易时间:(.*?)\n交易类型:(.*入账|.*转入|.*提现|.*取现)(尾号(\d+))\n交易金额:(.*?) ([\d\,]+.\d{2})\n账户余额:.*元\n交易说明:点击查看更多详情/,
[//交易时间:09月26日19:05\n交易类型:电子钱包取现(尾号0464)\n交易金额:人民币 36.00\n账户余额:61.04元\n交易说明:点击查看更多详情
//交易时间:10月25日14:54\n交易类型:工资(尾号xxxx)\n交易金额:人民币 123,4\n账户余额:123,45.69元\n交易说明:点击查看更多详情
/交易时间:(.*?)\n交易类型:(.*入账|.*转入|.*提现|.*取现|工资)(尾号(\d+))\n交易金额:(.*?) ([\d,]+(.\d{2})?)\n账户余额:.*元\n交易说明:点击查看更多详情/,
match => {
const [, time, type, number, currency, money] = match;
let billType = BillType.Income;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ test('中国银行入账', () =>
"time": formatDate('04月12日18:12', 'M月D日h:i'),
"channel": '微信[中国银行-入账]',
},
{
"type": "Income",
"money": 1234.0,
"fee": 0,
"shopName": '',
"shopItem": '工资',
"accountNameFrom": '中国银行(1234)',
"accountNameTo": '',
"currency": 'CNY',
"time": formatDate('10月25日14:54', 'M月D日h:i'),
"channel": '微信[中国银行-入账]',
},
]));

test('中国银行跨行转入', () =>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"mMap": {
"tableName": "AppMessage",
"description": "交易时间:10月25日14:54\n交易类型:工资(尾号1234)\n交易金额:人民币 123,4\n账户余额:123,45.69元\n交易说明:点击查看更多详情",
"source": "中国银行微银行",
"t": 1729839300080,
"arg": "msgId",
"type": 5,
"appId": "",
"msgId": 962528,
"title": "交易成功提醒"
}
}

0 comments on commit edf59d0

Please sign in to comment.