ores.inbox.approval_request

Table of Contents

The header every kind of approval request shares: what is asked, who asked, when and why, where the request is, and when it closes unanswered. What the request is about lives in the kind's own detail table, owned by the component that owns the kind and keyed by this request's id.

state_code is the state the request's decisions have reached. The decisions themselves are rows of ores.inbox.approval_decision, many per request.

The record is bitemporal, so every change of state is a version and the history is the audit trail an auditor reads.

1. Flags

2. Columns

2.1. id

UUID primary key for the request.

2.2. kind_code

What is asked. FK reference to ores_inbox_approval_kinds_tbl, which the system tenant holds.

2.3. state_code

Where the request is. FK reference to ores_inbox_approval_request_states_tbl, which the system tenant holds.

2.4. auto_approval_code

Which rule closed this request without a person, or empty when a person decided it or nobody has yet.

It is empty for every request a person answers, and for one still waiting. It names the rule that closed the request as it was raised: deployment when the installation does not enforce approvals, system_tenant when the kind accepts a raise in the system tenant, and every_request when the kind accepts every raise. The decision the close wrote says the same thing in words, and this column is what a screen filters on and a report counts by.

The column is the record's, not the kind's: a kind whose policy changes later leaves every request it closed stating the rule that closed it.

2.5. requested_by

The account that asked. A system may ask on a person's behalf, through its own service account. FK reference to ores_iam_accounts_tbl.

2.6. requested_at

When the request was made.

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

2.7. reason

Why the person asks, in their words.

std::string(faker::lorem::sentence())

2.8. expires_at

When the request closes unanswered, or null when it does not expire.

std::nullopt

3. Foreign keys

3.1. kind_code

The lookup is system reference data, so the check reads the system tenant.

3.2. state_code

The lookup is system reference data, so the check reads the system tenant.

3.3. requested_by

4. SQL

4.1. Flags

5. C++

5.1. Flags

5.2. Repository

5.3. Domain includes

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

5.4. Conventions

5.5. Table display

column header
id ID
kind_code Kind
state_code State
requested_by Requested By
requested_at Requested At
modified_by Modified By
version Version

5.6. Custom repository methods

6. See also

Emacs 29.3 (Org mode 9.6.15)