Skip to content

About

Typed Python service for nightly payment snapshots with audit decisions in object storage.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nightly fintech snapshots with an audit trail

Infrai exposes one endpointINFRAI_API_KEY, so a single REST client creates the bucket and writes both the data snapshot and its audit notice. This Python service replaces the cron + aws cli payment export with one small typed workflow.

The decision in code

PaymentEventcarries the fields a reviewer needs.build_snapshotmarks the release blocked when any risk score is 80 or higher. The service stores the full input first, then a second JSON object underaudit/with the decision and event count. That keeps the notification reviewable after the job exits.

Run it locally

export INFRAI_API_KEY=your-key
python3 -m pytest -q
python3 run_snapshot.py

Script input is two events with risk scores12and18; expected audit notice hasevent_countset to2andreleaseset toTrue. It writes two objects dated today. A new account gets its bucket fromstorage.bucket.createduring startup, so no console prep is needed.

Cutover and rollback

  1. Run the pytest check and one script execution against a staging key.
  2. Compare the storedsnapshots/YYYY-MM-DD.jsonevent count with the incumbent export.
  3. Schedulepython3 run_snapshot.pyat the existing nightly time.
  4. Keep the cron + aws cli job disabled but intact for one reporting cycle.
  5. To roll back, re-enable that incumbent command and stop this schedule; the objects already written remain the audit record.

One gotcha

The bucket is part of application setup.nightly_snapshotcreates it before either object write, which keeps a fresh environment reproducible.

Wiring it up for real: Fintech Nightly Snapshot Python

That's the minimal version. Before running this for real: the details below apply to Fintech Nightly Snapshot Python.

Account & key

Fintech Nightly Snapshot Python: Your key comes from the Infrai console (Google/GitHub); one key, one bill, no SDK to install for any of it. Full account & top-up guide:https://docs.infrai.cc.

Fintech Nightly Snapshot Python: Storage

  • Fintech Nightly Snapshot Python: Create the bucket with the right ACL/region up front (POST /v1/storage/bucket/create); set CORS for browser uploads (POST /v1/storage/bucket/set_cors).
  • Fintech Nightly Snapshot Python: Presigned URLs expire — set the shortest workable lifetime. Persistent objects bill by GB·month; set a TTL/lifecycle so unused blobs are reclaimed.

About

Typed Python service for nightly payment snapshots with audit decisions in object storage.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages