Commit graph

16 commits

Author SHA1 Message Date
ade4e67541 feat(v2): satmachineclient maintenance pass — v2 admin schema (P7)
Updates the LP-facing client extension to work against the v2 admin schema
(per-machine dca_clients, leg_type-discriminated dca_payments, settlement
audit trail) and strips the dead v1 code paths.

Maintenance-mode framing: the richer LP UI is migrating to ~/dev/webapp.
This extension now provides a minimal stable read-mostly surface so
existing LP installs don't break against the v2 admin schema.

models.py — rewrite:
  + PerMachinePosition: LP's position at a single machine
  ~ ClientDashboardSummary: now aggregates across all the LP's machines
    and exposes per-machine breakdown in `positions` field
  ~ ClientTransaction: gains machine_id + machine_npub + settlement_id;
    drops transaction_type / lamassu_transaction_id (v1 fields)
  ~ leg_type discriminator on ClientTransaction so the LP can tell DCA,
    operator-initiated balance-settle, and auto-forward legs apart
  + UpdateClientAutoforward: LPs control their own autoforward setting
  - ClientDashboardSummaryAPI, ClientTransactionAPI: deleted (GTQ-only
    parallel "API" models that duplicated the internal ones)
  - ClientPreferences, ClientRegistrationData, UpdateClientSettings:
    deleted (registration + settings are operator-controlled in v2)

crud.py — rewrite:
  + _fetch_user_clients: all dca_clients rows for the LP, joined with
    dca_machines for display metadata
  + _position_for_client: per-machine aggregation helper
  + get_client_dashboard_summary: aggregates positions + sums sats/fiat
    + computes cost basis on fiat-spent (not gross deposits)
  + get_client_transactions: filters to LP-visible leg_types
    (dca / settlement / autoforward); optional machine_id filter
  + update_lp_autoforward: LP self-manages autoforward across all their
    machine positions
  - get_client_analytics (300+ lines of date-parsing pretzels): deleted;
    webapp will own analytics
  - register_dca_client: deleted (admin owns registration in v2)
  - update_client_dca_settings: deleted (admin owns DCA mode/limits)
  - Lamassu-era status='confirmed' (now 'completed'), transaction_type
    column refs, lamassu_transaction_id column refs: all gone

views_api.py — rewrite to 3 endpoints:
  GET /api/v1/dca-client/positions       (aggregated dashboard)
  GET /api/v1/dca-client/transactions    (filterable history)
  PUT /api/v1/dca-client/autoforward     (LP self-manages forwarding)

All require_admin_key on the LP's wallet. Old registration / settings
/ analytics endpoints removed.

Files deleted:
  tasks.py — empty stub ("No background tasks needed")
  transaction_processor.py — empty stub ("No transaction processing")

README.md gains a status banner pointing LP audience at webapp.

.gitignore gains `data/` + sqlite db files + __pycache__ to prevent
LNbits runtime artifacts (auth keys, dev DBs) from being committed.

4 routes registered. Zero ruff errors across the extension.

Refs: aiolabs/satmachineadmin#9 — completes P7

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 17:53:13 +02:00
3f9e3d47ed change DCA Admin to DCA Client 2025-10-12 14:36:12 +02:00
9b04d1af6c replace satmachineadmin varieties with satmachineclient; update pyprojec.toml 2025-10-12 14:36:12 +02:00
6db94179cc Replace [mM]yextension with [sS]at[mM]achine[aA]dmin 2025-06-20 22:16:58 +02:00
edca91579c Update README.md to provide comprehensive documentation for DCA Admin Extension: include detailed overview, features, installation instructions, configuration management, usage guidelines for administrators and end users, technical details, and troubleshooting tips. Enhance clarity and usability for developers integrating with Lamassu ATM transactions.
fix
2025-06-20 02:00:21 +02:00
dni ⚡
42b5edaf5d feat: code quality
format

add ci

fixup ci
2024-08-13 08:20:45 +02:00
Arc
c1c1702942 Update README.md 2024-02-02 02:41:31 +00:00
benarc
0711f583d6 changed name to myextension 2024-01-16 16:38:53 +00:00
arcbtc
aa77a764a4 improved caveat 2023-12-28 15:42:34 +00:00
arcbtc
ef74de813a removed confusing link 2023-12-28 15:37:06 +00:00
arcbtc
2a1184d806 tweak 2023-12-28 15:36:03 +00:00
arcbtc
eaef267529 proofed 2023-12-28 15:34:09 +00:00
arcbtc
ecc5fc2d16 updated readme 2023-12-28 15:01:14 +00:00
Arc
2261bb8452 Update README.md 2023-12-08 15:47:17 +00:00
Arc
84d6590ca9 Update README.md 2023-12-08 15:47:04 +00:00
Arc
aa560fd89d Add files via upload 2023-12-08 15:43:40 +00:00