ores.refdata.calendar_exception

Table of Contents

One row per one-off override for a single calendar day. Mirrors ores::analytics::quant::domain::calendar_exception plus the usual refdata plumbing. Applies uniformly to any calendar – transcribed or user-authored, based or base-less: a based calendar's full override story is entirely calendar.base_calendar_code (which base) plus its own exception rows (what's different), no separate "adjustment" concept needed. QuantLib's own irregular, year-gated special dates (the UK's Jubilee bank holidays, the NYSE's special closings) are transcribed here, not folded into a calendar_rule row, so a rule stays a timeless, indefinitely-repeating pattern and the genuinely irregular part of a calendar stays flat, no-logic-at-all data.

Flags

:seed_country_sentinel:: the eventing integration test seeds a synthetic calendar (always country_code ZZ) as this entity's calendar_code parent, and the calendars insert trigger validates country_code against the countries table for the write tenant – the test must seed the ZZ sentinel country before the calendar insert (see refdata_calendars_create.sql's country_code_validation paste block).

Columns

id

UUID uniquely identifying this exception row.

Surrogate key – a calendar can have many exceptions, so there is no single natural key column.

calendar_code

The calendar this exception belongs to.

References ores_refdata_calendars_tbl.code (soft FK).

std::string("TARGET")

exception_date

The specific calendar date this exception applies to.

One exception per (calendar, date) pair.

std::chrono::year_month_day{std::chrono::floor<std::chrono::days>(ctx.past_timepoint())}

is_business_day

Whether exception_date is overridden to a business day.

true overrides a rule-generated holiday back to open; false adds an additional holiday not covered by any rule.

false

description

Free-text note explaining the exception (e.g. "Queen's Platinum Jubilee", "Hurricane Sandy").

Purely informational; never interpreted by the instantiation engine.

std::string("Test exception")

SQL

Flags

Foreign keys

calendar_code

Insert trigger

Validations

column validation_function

C++

Flags

Repository

Domain includes

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

Entity includes

#include <optional>
#include <string>
#include "sqlgen/Timestamp.hpp"
#include "sqlgen/PrimaryKey.hpp"

Conventions

Qt

Detail fields

field label widget type is_key is_required immutable placeholder combo_fetch_fn combo_fetch_include combo_allow_blank combo_domain_type combo_display_field combo_code_field combo_tooltip_field combo_sort_field combo_watcher_name combo_label
id Id idEdit line_edit true true   Calendar exception id                    
calendar_code Calendar calendarCombo dynamic_combo   true true   fetch_calendars ores.qt/LookupFetcher.hpp   refdata::domain::calendar name code code version calendarExceptionCalendarWatcher calendars
exception_date Date exceptionDateEdit line_edit   true true YYYY-MM-DD                    
is_business_day Business Day isBusinessDayCheckBox check_box                            
description Description descriptionEdit line_edit       Optional note                    

Columns (Qt model)

enum_name field header type width hidden_by_default
CalendarCode calendar_code Calendar string 100  
ExceptionDate exception_date Date date 100  
IsBusinessDay is_business_day Business Day bool 100  
Description description Description string auto  
Version version Version int 70  
ModifiedBy modified_by Modified By string auto  

Table display

column header
calendar_code Calendar
exception_date Date
is_business_day Business Day
description Description
modified_by Modified By
version Version

See also

Emacs 29.3 (Org mode 9.6.15)