feat(watcher): add Flip transfer receipt provider
Match no-reply@flip.id transfer success mail (direct or forwarded), parse stacked Nominal/ID Transaksi fields, and map spendings with source=flip. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -12,6 +12,8 @@ import {
|
||||
briQrisForwardedBody,
|
||||
briTransferDirectBody,
|
||||
briTransferForwardedBody,
|
||||
flipDirectBody,
|
||||
flipForwardedBody,
|
||||
grabBody,
|
||||
grabForwardedBody,
|
||||
livinDirectBody,
|
||||
@@ -223,6 +225,32 @@ describe("matchRule", () => {
|
||||
assert.equal(result.pass.rule.kind, "tokopedia.order.completed");
|
||||
});
|
||||
|
||||
it("matches direct Flip transfer", async () => {
|
||||
const result = await matchRule({
|
||||
messageId: "flip-direct",
|
||||
log: silentLog,
|
||||
message: {
|
||||
from: "Flip <no-reply@flip.id>",
|
||||
subject: "Transfer ke Rwen Ibrahim berhasil",
|
||||
body: flipDirectBody,
|
||||
},
|
||||
});
|
||||
assert.equal(result.pass.rule.kind, "flip.transfer.success");
|
||||
});
|
||||
|
||||
it("matches forwarded Flip transfer via original header", async () => {
|
||||
const result = await matchRule({
|
||||
messageId: "1a0c704164e0cd54",
|
||||
log: silentLog,
|
||||
message: {
|
||||
from: "NSRB <nasyarobby@gmail.com>",
|
||||
subject: "Fwd: Transfer ke Rwen Ibrahim berhasil",
|
||||
body: flipForwardedBody,
|
||||
},
|
||||
});
|
||||
assert.equal(result.pass.rule.kind, "flip.transfer.success");
|
||||
});
|
||||
|
||||
it("breaks on unknown from/subject", async () => {
|
||||
const result = await matchRule({
|
||||
messageId: "x",
|
||||
|
||||
Reference in New Issue
Block a user