Skip to content

Commit

Permalink
:spakles:新增适配微信新数据,调整测试用例命名 AutoAccountingOrg#71
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Jones committed Apr 14, 2024
1 parent 7139834 commit 2647960
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/rule/app/com.tencent.mm/微信支付/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ const regexMap = new Map([
[/(\d+\.\d{2})\n(.*?)\n(.*?)\n(.*?)\n.*/, (match) => ({
money: parseFloat(match[1]),
accountNameFrom: match[4],
shopName: match[2],
shopItem: match[3],
shopItem: `${match[2]} - ${match[3]}`,
type: BillType.Expend
})],
[/(\d+\.\d{2})\n(.*?)\n.*/, (match) => ({
Expand Down Expand Up @@ -70,7 +69,7 @@ export function get(data) {
return new RuleObject(
parsedText.type,
parsedText.money,
parsedText.shopName,
mapItem.display_name,
parsedText.shopItem,
parsedText.accountNameFrom,
"",
Expand Down
24 changes: 18 additions & 6 deletions src/rule/app/com.tencent.mm/微信支付/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const {testAnkioInit, testAnkio} = require("../../../../tests/TestUtils");
const {DataType} = require("../../../../utils/DataType");

testAnkioInit(get,__dirname,DataType.App,"com.tencent.mm")
test("微信支付扫码付款(商家收款码)", () => testAnkio('微信支付扫码付款(商家收款码)',[
test("微信支付消费(商家收款)", () => testAnkio('微信支付消费(商家收款)',[
{
type: 0,
money: 14.00,
Expand All @@ -20,7 +20,7 @@ test("微信支付扫码付款(商家收款码)", () => testAnkio('微信支
}
]))

test("微信支付扫码付款(第三方收款码)", () => testAnkio('微信支付扫码付款(第三方收款码)',[
test("微信支付消费(第三方收款)", () => testAnkio('微信支付消费(第三方收款)',[
{
type: 0,
money: 2.00,
Expand Down Expand Up @@ -56,6 +56,18 @@ test("微信支付扫码付款(第三方收款码)", () => testAnkio('微信
currency: 'CNY',
time: 0,
channel: '微信[微信支付]'
},
{
type: 0,
money: 35.41,
fee: 0,
shopName: '京东',
shopItem: '',
accountNameFrom: '中国银行储蓄卡(7575)',
accountNameTo: '',
currency: 'CNY',
time: 0,
channel: '微信[微信支付]'
}
]))

Expand All @@ -64,8 +76,8 @@ test("微信支付自动扣费", () => testAnkio('微信支付自动扣费',[
type: 0,
money: 53.72,
fee: 0,
shopName: '滴滴出行',
shopItem: '先乘后付',
shopName: '',
shopItem: '滴滴出行 - 先乘后付',
accountNameFrom: '零钱通',
accountNameTo: '',
currency: 'CNY',
Expand All @@ -76,8 +88,8 @@ test("微信支付自动扣费", () => testAnkio('微信支付自动扣费',[
type: 0,
money: 51.70,
fee: 0,
shopName: '滴滴出行',
shopItem: '先乘后付',
shopName: '',
shopItem: '滴滴出行 - 先乘后付',
accountNameFrom: '零钱通',
accountNameTo: '',
currency: 'CNY',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"mMap":{"description":"付款金额¥35.41\n付款方式中国银行储蓄卡(7575)\n收单机构财付通支付科技有限公司","source":"微信支付","type":5,"appId":"","msgId":99064,"title":"已支付¥35.41","display_name":"京东"}}

0 comments on commit 2647960

Please sign in to comment.