CRM and Business Operations Manager

Master Ledger

Vivenu's own reporting classifies tickets and transactions in ways that break normal reporting, so I built a database that records every Vivenu transaction and attaches what the club needs to report on it, including the HubSpot account owner and the commission owner. Any of those can be overridden, and an override stays with the record permanently.

My role
Designed it, wrote its rules, run it
Status
In use
Period
2026, ongoing
Systems
Vivenu, HubSpot, Python, SQLite

Why it was needed

Every report pulled from Vivenu on its own and answered the same questions in its own way: what counts as a sale rather than a refund, transfer, or upgrade; who gets credit; whether a buyer is a group, a company, or an individual; and what the club actually kept. The same question got different numbers depending on which report asked it.

The ledger answers each of those questions once, in code, and every report reads the answer instead of working it out again.

What I built

A process that pulls new and changed Vivenu transactions every few minutes and stores each one once, keyed by its Vivenu id. A set of rules then labels every row: paid or not, buyer type, account owner, and commission owner. Each row records the version of the rules that labeled it.

Some calls need a person. Those go in an override table, and an override is applied on every later refresh, so a decision made once is never guessed again.

A Vivenu export of sixteen made-up transactions with raw status and payment status columns
Made-up dataBefore.The Vivenu export: a status and a payment status per order, which a report has to interpret itself.
The same sixteen made-up transactions in the ledger, each labeled paid or not paid with a buyer type and two owners
Made-up dataAfter.The same orders in the ledger: paid or not, buyer type, account owner, and commission owner on every row.

How it is used

Rep pay reports are built from the ledger. The commission owner on each row decides who is credited for a sale, and when a sale is split or reassigned by hand, the override carries into every later report.

Made-up dataTwo overrides applied by hand: a buyer type and a commission owner. 11 seconds, no sound.

What changed

Reports that read the ledger return the same number for the same question. Time saved has not been measured.

The rest of this page is technical.

How it works

Vivenu feeds the ledger through pull and labeling steps; overrides join at labeling; dashboards, rep pay reports, and filings read the ledger. Vivenuorders, payments Pullevery few minutes Labelrules, versioned Overridesset by hand, kept Ledgerone row per order Dashboards Rep pay reports Filings
Vivenu feeds the ledger through pull and labeling steps; overrides join at labeling; dashboards, rep pay reports, and filings read the ledger. Vivenuorders, payments Pullevery few minutes Labelrules, versioned Overridesset by hand,kept Ledgerone row per order Dashboards Rep pay reports Filings
DiagramThe ledger is the one place a report reads ticket data from.

The rules are plain functions: the same order in gives the same labels out. No step asks an AI model to judge a transaction. When an order changes in Vivenu (a refund, a transfer, a payment arriving) its row is updated and labeled again.

Before a refresh is published, a check confirms that every report counts paid orders the same way. If the check fails, the refresh stops and the previous data stays in place.

Code

def is_paid(status, payment_status, real_price=None,
            require_price=False, txn_id=None):
    # A canceled order keeps its old payment status in Vivenu,
    # so the order status is checked first.
    if status not in COMPLETE_STATUSES:
        return False
    if payment_status not in PAID_STATUSES:
        # A card dispute the club won keeps Vivenu's CHARGEBACK flag.
        if not (payment_status == "CHARGEBACK"
                and txn_id in WON_DISPUTE_TXN_IDS):
            return False
    if require_price and float(real_price or 0) <= 0:
        return False
    return True
CodeThe one definition of a paid order. Both halves are required: the order is complete, and its payment status is one that means the money is the club's. An order paid by check or invoice counts as paid; a canceled order never does, whatever its payment status says.

Access and data protection

The ledger holds buyer records, so it runs on a private server that is not reachable from the public internet. Dashboards read a read-only copy, and nothing outside the server can write to the ledger.

Decisions and limits

  • Rules in code rather than judgment per transaction, so a report gives the same answer every time it runs.
  • A disputed card payment counts as unpaid until the club confirms it won the dispute.
  • Built with AI coding tools from rules I wrote and tested against club records.