ores.trading.trade_activity

Table of Contents

One business event on a trade: what kind of event it was, who did it, when it happened, why, and whether it corrects an operational error. An activity is written once and never changed. Every component version names the activity that caused it, so a version's cause is a row rather than a code copied onto each table, and the axes the activity type states (economic, confirmable, real, priority) are read from one place.

A null amend is an activity like any other: it is recorded, and because its type is not real it versions nothing.

1. Flags

2. Columns

2.1. id

The activity id.

2.2. party_id

The firm's legal entity on whose trades the activity happened. Party isolation reads it, as it reads the trade's.

2.3. activity_type_code

What kind of event this was.

std::string("new_booking")

2.4. actor

Who did it: an account username, or the service that acted for one.

2.5. occurred_at

When the event happened. The time it was recorded is the row's own.

std::chrono::system_clock::now()

2.6. comment

Why it happened, in the actor's words.

2.7. is_operational_error

True when the activity corrects a mistake made in operating the trade rather than a change the business asked for.

3. Foreign keys

3.1. party_id

3.2. activity_type_code

4. SQL

4.1. Flags

4.2. Indexes

name columns unique current_only where_extra
party tenant_id, party_id false false  
activity_type tenant_id, activity_type_code false false  
occurred_at tenant_id, occurred_at false false  

5. C++

5.1. Flags

5.2. Repository

5.3. Domain includes

#include <string>
#include <boost/uuid/uuid.hpp>

5.4. Conventions

5.5. Table display

column header
id Activity Id
activity_type_code Activity Type
actor Actor
occurred_at Occurred At

6. See also

Emacs 29.3 (Org mode 9.6.15)