ores.inbox.notification_delivery

Table of Contents

One attempt to reach one recipient through one channel, and its outcome. A recipient has many: a failed mail is retried, and each attempt is a row of its own, so "were they told?" has an answer. A failed delivery never fails the activity that raised the notification.

outcome is pending, delivered or failed, the C++ enum domain::delivery_outcome. failure_reason says why a failed attempt failed, and is null otherwise.

1. Flags

2. Columns

2.1. id

UUID primary key for the delivery.

2.2. notification_id

The notification delivered. FK reference to ores_inbox_notifications_tbl.

2.3. account_id

The recipient reached. FK reference to ores_iam_accounts_tbl.

2.4. channel_code

The channel used. FK reference to ores_inbox_notification_channels_tbl, which the system tenant holds.

2.5. attempted_at

When the attempt was made.

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

2.6. outcome

What came of the attempt: pending, delivered or failed.

domain::delivery_outcome::delivered

2.7. failure_reason

Why a failed attempt failed, or null when it did not fail.

std::nullopt

3. Foreign keys

3.1. notification_id

3.2. account_id

3.3. channel_code

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

3.4. outcome

A database foreign key: the lookup is immutable and has no tenant.

4. SQL

4.1. Flags

4.2. Checks

A failed attempt says why; any other outcome carries no reason.

expression
("outcome" = 'failed') = ("failure_reason" is not null)

5. C++

5.1. Flags

5.2. Repository

5.3. Domain includes

#include <optional>
#include <string>
#include <boost/uuid/uuid.hpp>
#include "ores.inbox.api/domain/delivery_outcome.hpp"

5.4. Conventions

5.5. Table display

column header
id ID
notification_id Notification
account_id Account
channel_code Channel
attempted_at Attempted At
outcome Outcome
modified_by Modified By
version Version

5.6. Custom repository methods

6. See also

Emacs 29.3 (Org mode 9.6.15)