history: payments hanya run terbaru, TANGGAL pindah ke judul, MEMO dihapus (DB+UI)

This commit is contained in:
proitlab committed 2026-08-05 20:37:50 +07:00
1 parent a3251eebc4
commit 344de409cd
10 files changed
+83 -41

No files matched your search

+12 -7
View File
@@ -150,9 +150,9 @@ def main():
calls['runs'].append((run_date, status))
return 7
def fake_record_payment(run_id, owner, amount, memo, status, created,
def fake_record_payment(run_id, owner, amount, status, created,
txid=None, error=None):
calls['pays'].append((owner, amount, memo, status))
calls['pays'].append((owner, amount, status))
return len(calls['pays'])
def fake_update(pid, status, txid=None, error=None, updated_at=None):
@@ -165,7 +165,13 @@ def main():
db.record_payment = fake_record_payment
db.update_payment_status = fake_update
db.update_run_status = fake_run_update
dist.build_signed_transfer = lambda to, amount, memo: FakeSigned('tx' + to)
signed = []
def fake_sign(to, amount, memo):
signed.append(memo)
return FakeSigned('tx' + to)
dist.build_signed_transfer = fake_sign
buf = io.StringIO()
with redirect_stdout(buf):
rc = dist.run_distribution(dry_run=False)
@@ -173,11 +179,10 @@ def main():
check('V21 run tercatat (run_date)', calls['runs'][0][0]
== datetime.now().strftime('%Y-%m-%d'))
check('V21 2 payment pending tercatat',
len([p for p in calls['pays'] if p[3] == 'pending']) == 2)
len([p for p in calls['pays'] if p[2] == 'pending']) == 2)
today = datetime.now().strftime('%Y-%m-%d')
check('V23 memo per run',
all(p[2] == f'DATABISNISID PROFIT SHARE {today}'
for p in calls['pays']))
check('V23 memo on-chain per run',
all(m == f'DATABISNISID PROFIT SHARE {today}' for m in signed))
check('V21 semua sent + txid',
all(u[1] == 'sent' and u[2].startswith('tx') for u in calls['updates']))
check('V24 status run ok + total_sent',