ccnl_engine.events¶
The work events of a run: pass them in PeriodFacts.events. Each changes
gross, net and employer cost according to its treatment; see
Work rules for the rules and the CCNL bands.
ccnl_engine.events.AbsenceEvent
dataclass
¶
Unpaid absence: deducted via EMPLOYEE_DEDUCTIONS; reduces INPS and TFR base.
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
Start date (or sole date) of the absence. |
hours |
Decimal
|
Number of absent hours. Must be > 0. |
hourly_rate |
Decimal | None
|
Rate at which the pay is deducted in EUR, above 0;
reported as caller-supplied. |
end_date |
date | None
|
Last day of the absence range. |
suspends_accrual |
bool | None
|
|
no_pay_due |
bool | None
|
|
working_days |
int | None
|
Whole working days of the absence, at least 1 and at
most its calendar days; a CCNL with a daily divisor ( |
days
property
¶
Calendar days of the absence, first to last.
ccnl_engine.events.ArrearsEvent
dataclass
¶
Contract renewal arrears, taxed by the year they refer to.
Arrears of a tax year earlier than the run are taxed separately (art. 17
c. 1 lett. b TUIR; art. 19 c. 1 lett. b D.Lgs. 117/2026 from 2027) at
:attr:separate_tax_rate; arrears of the tax year
of the run are ordinary income of the run and the rate is not used.
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
Date the arrears are attributed to. |
amount |
Decimal
|
Gross arrears amount in EUR. Must be >= 0. |
separate_tax_rate |
Decimal | None
|
Rate of the separate taxation: the rate on half
the income of the two years before the year of receipt (art. 21
c. 1 TUIR; art. 23 c. 1 D.Lgs. 117/2026 from 2027), in [0, 1].
|
reference_period |
PeriodId | None
|
The competence period the arrears refer to. An
earlier tax year selects the separate taxation, the tax year of
the run the ordinary one, a later year is rejected. |
unused_deductions |
Decimal | None
|
The deductions of art. 12 and art. 13 cc. 1-2
TUIR not used in the years the arrears refer to, which reduce
the separate tax (art. 21 c. 4 TUIR), from the worker's
declaration of those used. |
on_termination |
bool
|
Whether the sum is paid once because of the end of
the employment (art. 17 c. 1 lett. a TUIR: Federturismo
Allegato 9, the ratei of the premio di anzianità): taxed
separately at :attr: |
ccnl_engine.events.BilateralFundEvent
dataclass
¶
Bilateral or health fund contribution (fondi bilaterali/sanitari).
Both employee and employer portions are expressed as gross amounts. The employee portion reduces net pay; the employer portion increases employer cost.
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
Date the contribution is attributed to. |
employee_amount |
Decimal
|
Employee-side contribution in EUR. Must be >= 0. |
employer_amount |
Decimal
|
EmployerProfile-side contribution in EUR. Must be >= 0. |
ccnl_engine.events.BonusEvent
dataclass
¶
One-off bonus: INPS + IRPEF (ordinary or substitute) + TFR excluded.
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
Date the bonus is attributed to. |
amount |
Decimal
|
Gross bonus amount in EUR. Must be >= 0. |
kind |
Literal['bonus', 'productivity_bonus', 'contract_renewal', 'commission']
|
|
agreement_signed_on |
date | None
|
Signing date of the CCNL renewal a
|
The prior-year income and the written waiver the regimes check are
declared once in
:class:~ccnl_engine.irpef.declaration.inputs.PriorYearTaxFacts.
ccnl_engine.events.DisabilityPermitEvent
dataclass
¶
Days and hours of permit to assist a person with a serious disability.
INPS pays them in full and the employer advances the indemnity (art. 43 D.Lgs. 151/2001, which art. 33 c. 4 L. 104/1992 applies); they are covered by figurative contributions (art. 44). A worker who assists more than one person has three days for each. Hours a month are at most the three days as hours: the weekly hours over the working days of the week, times three (INPS msg. 16866/2007); the engine pays the hours stated and does not check that limit.
Attributes:
| Name | Type | Description |
|---|---|---|
days |
tuple[date, ...]
|
The whole days of permit, in order, each once; |
hours |
tuple[LeaveHours, ...]
|
The days of permit taken in hours, in order, each once and none of them a whole day of permit. |
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When neither |
event_date
property
¶
First day of permit, whole or in hours.
within(first, last)
¶
Return the first and last day of permit within first-last.
Returns:
| Type | Description |
|---|---|
tuple[date, date] | None
|
The first and last day of permit, whole or in hours, in the |
tuple[date, date] | None
|
span; |
days_within(first, last)
¶
Return the whole days of permit within first-last.
Returns:
| Type | Description |
|---|---|
tuple[date, ...]
|
Those days, in order. |
hours_within(first, last)
¶
Return the hours of permit within first-last.
Returns:
| Type | Description |
|---|---|
Decimal
|
Their sum, zero when none. |
ccnl_engine.events.ExtraordinaryLeaveEvent
dataclass
¶
A span of extraordinary leave (D.Lgs. 151/2001 art. 42 c. 5).
INPS pays an indemnity equal to the last pay of fixed and continuous items, the employer advancing it, up to a yearly maximum (c. 5-ter); the span accrues no leave, 13th or TFR (c. 5-quinquies).
Attributes:
| Name | Type | Description |
|---|---|---|
started_on |
date
|
First day of the leave. |
ended_on |
date
|
Last day of the leave. |
last_fixed_pay |
Decimal | None
|
The pay of the fixed and continuous items of the
last month before the leave; |
last_month_paid_days |
int | None
|
The days paid in that month, rest days
included, the divisor of a vertical or mixed part time (INPS
circ. 64/2001 par. 4); |
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When a day is not a date, the leave ends before
it starts, |
ccnl_engine.events.FringeEvent
dataclass
¶
Fringe benefit (art. 51 co. 3 TUIR).
The annual exemption threshold is resolved by calculate_period from
the year-level VariablePayRules.fringe_benefit policy — it is not
carried on the event itself. Taxability is determined cumulatively
across all fringe events in the year (YTD + current period).
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
Date the benefit is attributed to. |
amount |
Decimal
|
Value of the fringe benefit in EUR. Must be >= 0. |
ccnl_engine.events.HolidayWorkEvent
dataclass
¶
Holiday or weekly rest-day supplement: INPS + IRPEF on the supplement.
Covers the maggiorazioni and indennita for work on public holidays and on weekly rest days as identified by the CCNL, eligible for the 15% substitute tax within the 1,500 EUR annual cap. TFR is not accrued on holiday supplements under the standard Italian treatment (art. 2120 c.c. excludes accidental pay). Where the CCNL also pays the hours themselves, the engine does not post them: the run reports it.
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
Calendar date the holiday or rest day was worked. |
supplement_amount |
Decimal | None
|
Supplement for the day in EUR, >= 0; reported as
caller-supplied. |
hours |
Decimal | None
|
Hours worked that day, above 0 and at most 744. |
kind |
HolidayWorkKind
|
Which holiday or rest-day work the hours are. |
in_periodic_shift |
bool | None
|
Whether the worker is a turnista (rotating-shift
worker); |
shifts |
int | None
|
Turns worked that day, for a CCNL that pays the turn (scuola
Tabella E1.8); |
ccnl_engine.events.HolidayWorkKind
¶
Bases: StrEnum
Which holiday or rest-day work a :class:HolidayWorkEvent pays.
Attributes:
| Name | Type | Description |
|---|---|---|
HOLIDAY |
Hours worked on a public holiday (festività). |
|
HOLIDAY_COMPENSATORY_REST |
Hours worked on a public holiday or rest day for which the worker takes a compensatory rest day. |
|
SUNDAY |
Ordinary hours worked on a Sunday by a worker whose weekly rest falls on another day. |
|
REST_DAY |
Hours worked on the weekly rest day. |
|
NIGHT_HOLIDAY |
Hours worked on a public holiday at night (lavoro festivo notturno), which a CCNL may pay at a rate of its own. |
|
NIGHT_HOLIDAY_COMPENSATORY_REST |
The same hours with a compensatory rest day (metalmeccanici: notturno festivo con riposo compensativo). |
|
NIGHT_HOLIDAY_SHIFT |
Night hours on a public holiday of a rotating
shift worker, from 22:00 to 6:00, where the CCNL pays them apart
(Federmeccanica art. 7 row h, shift column); hours before 22:00
are |
|
NIGHT_HOLIDAY_SHIFT_COMPENSATORY_REST |
The same shift hours with a compensatory rest day (row i, shift column). |
|
SATURDAY_SIXTH_DAY |
Ordinary hours worked on Saturday or the sixth day of the week (Alimentari art. 31). |
|
NIGHT_SUNDAY |
Ordinary hours worked on a Sunday at night, where the
CCNL pays them at a rate of its own (Vigilanza ASSIV, servizi
fiduciari, art. 11: lavoro domenicale notturno); the Sunday
hours before 22:00 are |
ccnl_engine.events.HourlyParentalLeaveEvent
dataclass
¶
Days of parental leave taken by the hour, for one child.
Attributes:
| Name | Type | Description |
|---|---|---|
hours |
tuple[LeaveHours, ...]
|
The hours of leave of each day, in order, each day once, an
even number of days; each half of |
child_born_on |
date
|
Birth day of the child. |
taken |
ParentalLeaveTaken
|
The indemnified leave taken for the child before the event. |
entered_family_on |
date | None
|
Day an adopted or fostered child entered the
family, from which the leave and its rates are counted in place
of the birth (art. 36 D.Lgs. 151/2001); |
average_daily_hours |
Decimal
|
Average daily hours the contract sets in the pay period before the leave. No default: an assumed day would take more or fewer hours of leave than the worker's. |
protection_ended_on |
date | None
|
Last day of the maternity or paternity leave
that ended last; |
single_parent |
bool
|
Whether the parent is the only one. |
parental_base_pay |
InpsSicknessBase | None
|
Pay of the month before the leave; |
topped_up_days_before |
Decimal | None
|
Equivalent days of employer-supplemented leave
before this event, including earlier hourly leave. |
individual_income |
Decimal | None
|
Individual income of the parent in the year the
leave starts, for the months beyond the indemnified ones: art.
34 c. 3 D.Lgs. 151/2001 pays them 30% below 2.5 times the
trattamento minimo; |
local_hourly_agreement |
bool | None
|
Whether a company or territorial agreement
regulates the leave by the hour, in place of the general
criterion of art. 32 c. 1-ter D.Lgs. 151/2001; |
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When a field is of the wrong type, the days are not in order, are odd in number or precede the birth, or a day is not half the average daily hours. |
event_date
property
¶
First day of leave.
within(first, last)
¶
Return the first and last day of leave within first-last.
Returns:
| Type | Description |
|---|---|
tuple[date, date] | None
|
Those days, |
hours_within(first, last)
¶
Return the hours of leave within first-last.
Returns:
| Type | Description |
|---|---|
Decimal
|
Their sum, zero when none. |
ccnl_engine.events.LeaveBucket
¶
Bases: StrEnum
A bucket of paid leave a CCNL grants every year.
Attributes:
| Name | Type | Description |
|---|---|---|
FERIE |
Annual leave (ferie, art. 2109 c.c. and D.Lgs. 66/2003 art. 10), counted in working days. |
|
ROL |
Paid hours of the reduction of the working time (riduzione dell'orario di lavoro, permessi annui retribuiti), counted in hours. A CCNL that pools the hours of the abolished festivities with them (the PAR of the metalmeccanici, the 104 hours of the Turismo) keeps the pool here. |
|
EX_FESTIVITA |
Paid hours in place of the festivities abolished by L. 54/1977, counted in hours, when the CCNL keeps them apart from the ROL. |
|
FLESSIBILITA |
Paid hours a flexible working time adds (Studi professionali art. 92), counted in hours, keyed by the year the yearly programme of flexibility starts. |
unit
property
¶
Unit the bucket is counted in: "days" or "hours".
ccnl_engine.events.LeaveTakenEvent
dataclass
¶
Paid leave taken in the period: ferie in days, permits in hours.
The time off is paid at the normal rate: the monthly pay of the period
already holds it, so the event adds no pay and deducts none; it
consumes the balance of its bucket
(:class:~ccnl_engine.leave.balance.models.LeaveAccount). An unpaid
absence is an :class:~ccnl_engine.absence.inputs.AbsenceEvent.
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
First day of the leave, within the period. |
bucket |
LeaveBucket
|
Bucket the leave is taken from. |
quantity |
Decimal
|
Working days of ferie, on the week of the CCNL (six days for a CCNL that counts the week on six whatever the schedule), or hours of a permit bucket. Must be > 0. |
ccnl_engine.events.FlexibilityWeekEvent
dataclass
¶
A week of the employer's programme of flexibility and its hours.
The hours of the week are paid as the normal week (the pay of the month
does not change); a week over the normal hours earns the permit of the
CCNL band it falls in (LeaveRules.flexibility), credited to the
flessibilita bucket of the programme year
(EmployerProfile.flexibility_programme_month).
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
First day of the week, within the period. |
hours_worked |
Decimal
|
Hours worked in the week. Must be > 0. |
ccnl_engine.events.MaternityLeaveEvent
dataclass
¶
A compulsory maternity leave (congedo di maternità).
Attributes:
| Name | Type | Description |
|---|---|---|
started_on |
date
|
First day of the leave. |
ended_on |
date
|
Last day of the leave. |
maternity_base_pay |
InpsSicknessBase | None
|
Pay of the month before the leave, which the INPS
indemnity is computed on (art. 23 D.Lgs. 151/2001: the pay of
that month and the daily rateo of the 13th and of the other
payments, over 30); |
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When a day is not a date, the leave ends before
it starts or |
ccnl_engine.events.NoticeIndemnityEvent
dataclass
¶
The act that ends the employment, for the notice it opens.
Attributes:
| Name | Type | Description |
|---|---|---|
received_on |
date
|
Day the act of dismissal or resignation was received, or the day of death; the notice runs from the day after. |
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When |
event_date
property
¶
Day the act was received.
ccnl_engine.events.NursingRestEvent
dataclass
¶
Hours of daily rest in the first year of a child.
INPS pays them in full and the employer advances the indemnity (art. 43 c. 1); they count as hours worked for the pay (art. 39 c. 2) and are covered by figurative contributions (art. 44 c. 1).
Attributes:
| Name | Type | Description |
|---|---|---|
hours |
tuple[LeaveHours, ...]
|
The hours of rest of each day, in order, each day once. |
child_born_on |
date
|
Birth day of the child. |
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When |
event_date
property
¶
First day of rest.
within(first, last)
¶
Return the first and last day of rest within first-last.
Returns:
| Type | Description |
|---|---|
tuple[date, date] | None
|
Those days, |
hours_within(first, last)
¶
Return the hours of rest within first-last.
Returns:
| Type | Description |
|---|---|
Decimal
|
Their sum, zero when none. |
ccnl_engine.events.BoardLodgingEvent
dataclass
¶
Days of the run month without the board and lodging provided in kind.
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
A day of the month the days fall in. |
days |
int
|
Days of that month on which the worker did not take the board and lodging and is owed their value in cash, from 1 to the days of the month. |
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When |
ccnl_engine.events.MealIndennityEvent
dataclass
¶
Days of the run month owed a meal the employer did not give.
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
A day of the month the days fall in. |
days |
int
|
Days of that month on which the worker, on 6 or more hours with continuous presence, was owed the meal and did not have it, from 1 to the days of the month. |
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When |
ccnl_engine.events.NightShiftEvent
dataclass
¶
Night-work supplement: INPS + IRPEF on the supplement amount.
Covers the maggiorazioni and indennita for ordinary night work (D.Lgs.
66/2003 art. 1 c. 2 and the CCNL), eligible for the 15% substitute tax
within the 1,500 EUR annual cap. Night overtime is an
:class:OvertimeEvent.
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
Calendar date the night hours were worked. |
supplement_amount |
Decimal | None
|
Supplement for the night hours in EUR, >= 0;
reported as caller-supplied. |
hours |
Decimal | None
|
Ordinary night hours, above 0 and at most 744. |
before_22 |
bool
|
Whether the hours fall before 22:00, which a CCNL may pay at a lower night rate (Confapi art. 29 row b). |
shifts |
int | None
|
Night turns worked, for a CCNL that pays the turn (scuola
Tabella E1.8); |
service |
str | None
|
The kind of night service, by the code of the CCNL band
(Farmacie art. 19: |
ccnl_engine.events.OvertimeEvent
dataclass
¶
Overtime hours: INPS + IRPEF + TFR on computed gross.
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
Calendar date the overtime was worked. |
hours |
Decimal
|
Overtime hours, above 0 and at most 744 (a month of 31 days). |
hourly_rate |
Decimal | None
|
Base hourly rate in EUR, above 0; |
multiplier |
Decimal | None
|
Overtime multiplier applied to the hourly rate (e.g.
|
kind |
OvertimeKind
|
When the hours were worked, selecting the CCNL band. |
non_occasional |
bool
|
Whether the overtime is worked 'a titolo non
occasionale', which a CCNL may count in the TFR (operai agricoli
OTD: 10%); |
banked |
bool
|
Whether the worker elected compensatory rest for these hours. Only an agreement with an overtime bank rule can pay the premium alone; the hours remain a separate rest balance outside this event. |
weekly_hours_before |
Decimal | None
|
Total hours already worked in the week before this event; when supplied, weekly overtime tiers can be split across the event. Does not include the hours of this event. |
exempt_quota_hours_before |
Decimal | None
|
Overtime hours worked earlier in the
calendar year under the CCNL regime of the 'quote esenti'
(Federmeccanica art. 7); stating it places the event in that
regime, |
in_periodic_shift |
bool | None
|
Whether the worker is a turnista, which chooses
the yearly exempt quota; |
supplementary_hours_before |
Decimal | None
|
Part-time supplementary hours worked earlier in the calendar year, for a CCNL whose rate rises past a share of the agreed annual hours. |
agreed_annual_hours |
Decimal | None
|
Annual hours of the part-time contract that share is taken of. |
multiweek_hours_before |
Decimal | None
|
Hours of the multi-week schedule worked earlier in its period (at most 12 months from its activation), for a CCNL whose premiums rise past a threshold of hours. |
ccnl_engine.events.OvertimeKind
¶
Bases: StrEnum
When overtime was worked, selecting the CCNL band of the same work kind.
Attributes:
| Name | Type | Description |
|---|---|---|
WEEKDAY |
Daytime overtime on a working day (straordinario diurno). |
|
NIGHT |
Night overtime (straordinario notturno). |
|
HOLIDAY |
Overtime on a public holiday or rest day (straordinario festivo). |
|
REST_DAY |
Overtime on the weekly rest day where the CCNL pays it
apart from the holidays; without a rest-day band, as |
|
SATURDAY |
Overtime on Saturday where the CCNL pays it apart
(Metalmeccanico artigianato); without a band, as |
|
SUNDAY |
Daytime overtime on a Sunday that is not the weekly rest day
nor a holiday, where the CCNL pays it apart (Commercio art. 149:
"le ore straordinarie di lavoro prestato nei giorni festivi o la
domenica", 30%); without a band, as |
|
NIGHT_HOLIDAY |
Night overtime on a public holiday (festivo notturno). |
|
SUPPLEMENTARY |
Part-time hours beyond the agreed ones within the full week (D.Lgs. 81/2015 art. 6 c. 2), at the supplementare band. |
|
ELASTIC_PLACEMENT |
Part-time hours moved to another time under an elastic clause (D.Lgs. 81/2015 art. 6 c. 4): already in the pay, they take the premium of their band only. |
|
ELASTIC_INCREASE |
Part-time hours added under an elastic clause, paid with the premium of their band. |
|
MULTIWEEK |
Hours above the normal week of a multi-week schedule (orario plurisettimanale), Monday to Friday: already in the pay of the normal week, they take the premium of their band only. |
|
MULTIWEEK_SATURDAY |
The same hours on a Saturday. |
|
MULTIWEEK_SUDDEN |
Hours of a multi-week schedule for sudden needs, Monday to Friday, premium only. |
|
MULTIWEEK_SUDDEN_SATURDAY |
The same hours on a Saturday. |
|
RECOVERY_COURSE |
Hours of a teacher's recovery course beyond the orario d'obbligo (scuola, Tabella E1.6), paid at their band. |
|
EXTRA_TEACHING |
Additional teaching hours of a teacher. |
|
EXTRA_NON_TEACHING |
Additional non-teaching hours of a teacher. |
ccnl_engine.events.ParentalLeaveEvent
dataclass
¶
A span of parental leave of an employee (art. 32 D.Lgs. 151/2001).
Attributes:
| Name | Type | Description |
|---|---|---|
started_on |
date
|
First day of the leave. |
ended_on |
date
|
Last day of the leave. |
child_born_on |
date
|
Birth day of the child. |
taken |
ParentalLeaveTaken
|
The indemnified leave taken for the child before the event. |
entered_family_on |
date | None
|
Day an adopted or fostered child entered the
family, from which the leave and its rates are counted in place
of the birth (art. 36 D.Lgs. 151/2001); |
protection_ended_on |
date | None
|
Last day of the maternity or paternity leave of
either parent that ended last, which sets the months paid at
the enhanced rate; |
single_parent |
bool
|
Whether the parent is the only one (art. 32 c. 1 letter c), with nine indemnified months. |
parental_base_pay |
InpsSicknessBase | None
|
Pay of the month before the leave, which the
INPS indemnity is computed on (art. 23, which art. 34 c. 1
applies); |
topped_up_days_before |
int | None
|
Days of the CCNL top-up already paid for the
child by EARLIER leave events; the earlier months of this event
are counted by the run from |
individual_income |
Decimal | None
|
Individual income of the parent in the year the
leave starts, for the months beyond the indemnified ones: art.
34 c. 3 D.Lgs. 151/2001 pays them 30% below 2.5 times the
trattamento minimo; |
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When a day is not a date, the leave ends before it starts or starts before the birth, or a field is of the wrong type. |
ccnl_engine.events.ParentalLeaveTaken
dataclass
¶
The indemnified parental leave taken for the child before the event.
The counters are in days, thirty a month, as INPS keeps them (the contatori of the congedo parentale): a calendar month of a span is thirty days. They have no default: a counter left at zero would pay days at a higher rate than INPS does.
Attributes:
| Name | Type | Description |
|---|---|---|
own_days |
int
|
Days the parent took of their months not transferable to the other parent (of the nine months of a sole parent). |
enhanced_days |
int
|
Days of the couple paid at the enhanced rate. |
shared_days |
int
|
Days the couple took of the further months they share. |
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When a counter is not a non-negative |
ccnl_engine.events.PaternityLeaveEvent
dataclass
¶
A compulsory paternity leave (congedo di paternità obbligatorio).
Ten working days, twenty for a multiple birth, taken whole and even apart, within two months before and five months after the birth (art. 27-bis D.Lgs. 151/2001); INPS pays them in full on the pay of the month before (art. 29). Pass the event to the run of every month that holds one of its days; each run pays the days of its month.
Attributes:
| Name | Type | Description |
|---|---|---|
days |
tuple[date, ...]
|
The working days of leave, in order, each once. |
paternity_base_pay |
InpsSicknessBase | None
|
Pay of the month before the leave, which the
INPS indemnity is computed on (art. 23, which art. 29 applies);
|
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When |
event_date
property
¶
First day of the leave.
started_on
property
¶
First day of the leave: the month before it gives the base.
within(first, last)
¶
Return the first and last day of leave within first-last.
Returns:
| Type | Description |
|---|---|
tuple[date, date] | None
|
The first and last day of leave in the span, |
days_within(first, last)
¶
Return the days of leave within first-last.
Returns:
| Type | Description |
|---|---|
tuple[date, ...]
|
Those days, in order. |
ccnl_engine.events.PeriodId
dataclass
¶
Identifies a single payroll period by calendar year and month.
Use this instead of relying on structural.employment.as_of to
identify the competence period. Both the period calculation request and
:class:~ccnl_engine.period.results.PeriodResult carry a
period_id so consumers can match requests to results without parsing
dates.
Attributes:
| Name | Type | Description |
|---|---|---|
year |
int
|
Calendar year (e.g. |
month |
int
|
Month of competence, 1-12. |
ccnl_engine.events.LeaveHours
dataclass
¶
Hours of a permit or a rest taken on one day.
Attributes:
| Name | Type | Description |
|---|---|---|
day |
date
|
The day of the hours. |
hours |
Decimal
|
The hours taken, above 0 and at most 24. |
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When |
ccnl_engine.events.ShiftKind
¶
Bases: StrEnum
Rotating shift a :class:ShiftWorkEvent pays.
Attributes:
| Name | Type | Description |
|---|---|---|
DAY |
A day shift of a rotation (turno diurno). |
|
NIGHT |
A night shift of a rotation (turno notturno). |
ccnl_engine.events.ShiftWorkEvent
dataclass
¶
Shift-work allowance: INPS + IRPEF on the supplement amount.
Covers the indennita di turno and the other shift-work pay set by the CCNL, eligible for the 15% substitute tax within the 1,500 EUR annual cap. TFR is not accrued, as for the other work-time supplements.
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
Calendar date the shift was worked. |
supplement_amount |
Decimal | None
|
Shift allowance in EUR, >= 0; reported as
caller-supplied. |
hours |
Decimal | None
|
Hours of the shift, above 0 and at most 744. |
kind |
ShiftKind | None
|
The shift of the rotation; |
shifts |
int | None
|
Days of shift worked, for a CCNL that pays the day of shift (Sanità art. 67 c. 2: "per ogni giornata di effettivo lavoro"). |
service |
str | None
|
The kind of rotation, by the code of the CCNL band, for a CCNL that pays it by the rotation (Mobilità AF art. 30). |
ccnl_engine.events.SickLeaveEvent
dataclass
¶
Sick pay amount set by the caller: an explicit, never payable override.
The engine computes sickness from a
:class:~ccnl_engine.sickness.models.SicknessEpisode. This
event overrides that computation with an employer-paid amount the
caller computed; the run records a caller-supplied decision for the
sickness capability, so its result is not payable. The amount is
subject to INPS and IRPEF but not TFR accrual.
The engine deducts the carenza (waiting-period) portion from amount:
net = amount - (amount / sick_days * waiting_period_days).
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
First day of the sick-leave period. |
amount |
Decimal
|
Total employer-liable sick-leave gross in EUR, before carenza deduction. |
sick_days |
int
|
Total working days of the sick-leave spell. Must be >= 1. Used to compute the daily rate for the carenza deduction. Defaults to 1. |
waiting_period_days |
int
|
Number of carenza days (waiting period) at the start of the sick-leave period. Must not exceed sick_days. Defaults to 0 (no carenza). |
ccnl_engine.events.SicknessEpisode
dataclass
¶
One sickness episode, a work event of every run whose month it touches.
Attributes:
| Name | Type | Description |
|---|---|---|
episode_id |
str
|
Stable identifier of the episode, the same in every run (e.g. the protocol number of the first certificate). |
started_on |
date
|
First day of illness. |
ended_on |
date
|
Last day of illness on the certificates known so far. A later run may pass a later day when the illness is extended. |
relapse_of |
str | None
|
Identifier of the episode this one continues, when the certificate marks it as a relapse (ricaduta): the days of both count as one episode, so no new waiting period applies. |
short_absence_exempt |
bool | None
|
Whether the CCNL exempts the absence from the
lower pay of repeated absences (for Federmeccanica: a hospital
stay or day hospital, sickness during a certified pregnancy, or
one of the diseases the CCNL lists; for Commercio, Art. 187: a
hospital stay, day hospital or dialysis, an initial prognosis of
at least 12 days, the listed diseases, or a pregnancy); |
hospital_stays |
tuple[tuple[date, date], ...] | None
|
Hospital stays within the episode, each its first
and last day; |
serious_illness |
bool | None
|
Whether the illness is one the CCNL treats as
particularly serious (Logistica: INPS circ. 95/2016); |
serious_illness_kind |
SeriousIllnessKind | None
|
A documented condition qualifying for the
agreement's extended sickness limits (ABI Art. 66 c. 4 or 5, or
Art. 41 II: a listed grave pathology with current certification,
certified L. 68/99 disability, or certified life-saving therapy
related to either condition); |
excluded_comporto_days |
tuple[date, ...] | None
|
Dates of day hospital or life-saving therapy
(Studi) or necessary dialysis (ABI), within this episode. |
periodic_check |
bool | None
|
Whether the absence is a periodic check of a worker
who had an invalidating illness (Concia art. 60 B), which a CCNL
may leave out of the comporto; |
daily_contributions |
int | None
|
Daily contributions of the worker from 1
January of the year before the episode, every employer counted
(spettacolo: art. 66 D.L. 73/2021); |
prior_worked_days |
int | None
|
Days of work activity of a fixed-term worker in
the 12 months before the episode, with every employer (D.L.
463/1983 art. 5 c. 1); |
inps_base |
InpsSicknessBase | SpettacoloSicknessBase | None
|
Pay the INPS share of the sick days is computed on: of
the month before the illness, or of the last daily contributions
for a lavoratore dello spettacolo; |
inps_recognized |
bool | None
|
Whether INPS recognized this illness; read only by a CCNL whose employer supplement requires recognition. |
contractual_daily_wage_by_year |
dict[int, Decimal] | None
|
Contractual daily wage on the rule's reference date in each calendar year of the episode; not the statutory INPS base. Read only for a reference-date supplement. Supply the wage applicable to this worker: for part-time work, supply the contractual reference wage already prorated by the worker's reduced-hours ratio (not the full-time profile wage). The engine does not prorate this input again. |
agricultural_days |
AgriculturalDays | None
|
Days of registration in the elenchi of an operaio
agricolo a tempo determinato, the year before and the current
one; |
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When the identifier is blank, a day is not a
date, |
event_date
property
¶
First day of the episode: the date of the event.
days
property
¶
Calendar days from :attr:started_on to :attr:ended_on.
long_stay_days(more_than, day)
¶
Return the days up to day of the stays longer than more_than.
Returns:
| Type | Description |
|---|---|
int
|
The days from the start of each such stay to |
int
|
of |
within(first, last)
¶
Return the days of the episode from first to last.
Returns:
| Type | Description |
|---|---|
tuple[date, date] | None
|
The first and last sick day of the interval, |
tuple[date, date] | None
|
episode does not touch it. |
through(day)
¶
Return the episode cut at day, the last day processed.
Returns:
| Type | Description |
|---|---|
SicknessEpisode
|
The episode ending on |
before(day)
¶
Return the part of the episode before day.
Returns:
| Type | Description |
|---|---|
SicknessEpisode | None
|
The episode cut on the day before |
SicknessEpisode | None
|
starts on or after |
ccnl_engine.events.SeriousIllnessKind
¶
Bases: StrEnum
Documented conditions used by agreement-specific sickness rules.
ONCOLOGICAL has its own ABI art. 66 c. 5 limit; the other ABI
diagnoses share the serious-illness limit of the seniority band.
CERTIFIED_LISTED_GRAVE_PATHOLOGY requires a current specialist
certificate identifying a condition in the agreement's exhaustive list.
CERTIFIED_L68_99_DISABILITY requires certified civil disability under
L. 68/99; CERTIFIED_RELATED_LIFE_SAVING_THERAPY requires a certificate
of therapy related to one of those two qualifying conditions.
CHRONIC_DEGENERATIVE is a chronic degenerative illness ascertained
by a public health structure (AIA art. 26).
A sickness episode's serious_illness_kind records a documented condition, not
an agreement-specific eligibility flag. The agreement selects eligible kinds
through SicknessCumulation.qualifying_kinds; with an empty set, the existing
serious_illness flag determines extended limits. For Art. 41 II, use a current
specialist certificate for a listed grave pathology, certified L. 68/99 civil
disability, or certified life-saving therapy related to either condition.
ccnl_engine.events.InpsSicknessBase
dataclass
¶
The pay of the month before a sickness episode, as INPS reads it.
Attributes:
| Name | Type | Description |
|---|---|---|
theoretical_pay |
Decimal
|
Gross pay of the month immediately before the first day of illness, the retribuzione teorica of its UniEmens flow: the monthly pay and the components normally in it (contractual overtime, shift allowances, in their monthly share), without overtime that is not contractual, amounts monetised whatever the illness (holidays not taken), the notice indemnity and the employer's integration of an earlier sickness (circ. 134368/1981 point 11.1; circ. 55/2024 Allegato 1). |
paid_days |
int | None
|
Days worked or paid in that month (paid holidays and
leave, the sixth day of a short week; never the sick days), which
the base of an operaio divides by (point 11.3), and that of an
impiegato who did not work the whole month, Sundays and paid
holidays included (point 11.2 letters d-f). |
recurring_annual |
Decimal
|
Recurring payments of the year that are neither
part of the monthly pay nor an additional month of the CCNL
(annual or periodic bonuses, point 11.2 letter b); the engine
adds the additional months of the CCNL itself. |
full_month_pay |
Decimal | None
|
Monthly pay of a whole month of the employment in
that month, when the worker was not employed all of it (a hire
during the month): the additional months accrue on it, not on
the pay of the days (point 11.2 letter e). Required for an
impiegato who did not work the whole month; |
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When |
ccnl_engine.events.SpettacoloSicknessBase
dataclass
¶
The pay of the last daily contributions of a lavoratore dello spettacolo.
The indemnity of a worker insured with the Fondo pensioni lavoratori dello spettacolo is computed on the average pay of the last 40 daily contributions in the sector, the 13th and the other contributed payments included (art. 13 D.Lgs. C.P.S. 708/1947 as amended by art. 66 D.L. 73/2021; INPS circ. 132/2021 par. 2.4).
Attributes:
| Name | Type | Description |
|---|---|---|
pay |
Decimal
|
Gross pay of those contributions, the rateo of the 13th and the bonuses subject to contributions included. |
contributions |
int
|
Number of daily contributions the pay covers, every employer of the sector counted. |
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When |
ccnl_engine.events.AgriculturalDays
dataclass
¶
The days an operaio agricolo a tempo determinato is registered for.
INPS pays the sickness for as many days as the registration in the elenchi nominativi, at most 180 a year, with 51 days of the year before or 51 of the current year before the illness (then at most 30).
Attributes:
| Name | Type | Description |
|---|---|---|
previous_year |
int
|
Days of registration in the elenchi of the year before the illness. |
current_year |
int
|
Days of registration of the year of the illness, before its first day. |
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When a count is not an int in [0, 366]. |
ccnl_engine.events.StandbyEvent
dataclass
¶
Standby (reperibilità) paid at the CCNL rates of the worker's level.
The time of the calls and of the intervention is not standby: it is paid as overtime or ordinary hours with their own events.
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
Date the standby is attributed to: the rates in force on it apply. |
kind |
StandbyKind
|
Unit of the standby. |
quantity |
Decimal
|
Hours, days or weeks of the unit, above 0. |
calls |
int
|
Calls followed by an intervention, each paid the CCNL fee. |
ccnl_engine.events.IntermittentAvailabilityEvent
dataclass
¶
Availability of an intermittent worker who binds to answer a call.
D.Lgs. 81/2015 art. 16: the allowance is monthly and divisible; it is not due for the time worked, nor while illness or another cause keeps the worker from answering.
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
Date the availability is attributed to: the rule and the pay in force on it apply. |
month_share |
Decimal
|
Share of the month the worker was available and not working, above 0 and at most 1. |
ccnl_engine.events.StandbyKind
¶
Bases: StrEnum
Unit of a standby period, selecting the CCNL rate.
Attributes:
| Name | Type | Description |
|---|---|---|
HOURS |
Hours of standby, paid at the working-day rate per hour. |
|
WORKED_DAY |
Day of 16 hours on a working day. |
|
REST_DAY |
Day of 24 hours on a rest day. |
|
HOLIDAY |
Day of 24 hours on a public holiday. |
|
WEEK |
Week of 6 days. |
|
WEEK_HOLIDAY |
Week of 6 days with a public holiday. |
|
WEEK_HOLIDAY_REST_DAY |
Week of 6 days with a public holiday and a rest day. |
ccnl_engine.events.TerminationTFREvent
dataclass
¶
TFR settlement at cessazione (art. 19 TUIR, tassazione separata).
Without amount the engine computes the TFR due and its separate
tax (:mod:~ccnl_engine.severance.settlement.services): the fund at 31
December of the year before (Employment.tfr_fund), the TFR accrued
in the year by the runs of the employment and the revaluation of the
year, taxed at the average IRPEF rate of the reference income of art.
19 c. 1 TUIR. A separate_tax_rate without amount overrides
that rate on the taxable the engine computes.
With amount the caller states the payout and must state its rate
too: the engine cannot split a payout it did not compute into the TFR
accrued and the revaluations art. 19 c. 1 leaves out of the taxable,
so the rate applies to the whole amount. Every value the caller
states is reported as a caller_supplied decision.
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
Date of cessazione. |
amount |
Decimal | None
|
Total TFR payout in EUR, |
separate_tax_rate |
Decimal | None
|
Applicable tassazione separata rate, |
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When a value is out of range, or |
computed
property
¶
Whether the engine computes the payout (no caller amount).
ccnl_engine.events.TravelAllowanceEvent
dataclass
¶
Daily travel allowance (indennità di trasferta) of a block of days.
The allowance outside the comune is income only above the daily cap of art. 51 c. 5 TUIR, for IRPEF and INPS alike (art. 12 c. 2 L. 153/1969); within the comune it is income in full. One event covers days with the same daily amount and the same conditions. Analytic reimbursements and travel costs are not pay and are not events.
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
Date the block of days is attributed to. |
days |
int
|
Days of trasferta, at least 1. |
outside_municipality |
bool
|
Whether the trasferta is outside the comune of the place of work: within it no part is exempt. |
meals_lodging |
Literal['none', 'one', 'both']
|
|
daily_amount |
Decimal | None
|
Allowance paid for each day in EUR, above 0; |
hours_away |
Decimal | None
|
Hours away of each day, read with |
tfr_base |
Literal['none', 'whole', 'above_exempt'] | None
|
What enters the TFR base: |
abroad |
bool
|
Whether the trasferta is abroad, with the higher cap. |
trasfertista |
bool
|
Whether the worker is bound by contract to work in places always different (art. 51 c. 6 TUIR, 50% exempt): not supported, the event is rejected. |
mission_hours |
Decimal | None
|
Total hours of a mission, for CCNLs with mission-duration rather than daily-hours bands; may exceed 24. |
habitual_travel |
bool
|
Whether duties require habitual travel for CCNL rates;
distinct from the fiscal status |
mission_over_month |
bool
|
Whether the mission exceeds one calendar month; determined by the caller from the actual start and end dates. |
mission_over_two_months |
bool
|
Whether it exceeds two calendar months. |
meals |
int | None
|
Meals of each day the CCNL quota is due for (0 to 2), for a
CCNL that pays by meals and lodging; |
overnight |
bool | None
|
Whether the day, or the mission, has an overnight stay
away: the overnight quota with |
agreed_at_hiring |
bool | None
|
Whether the hiring letter provides for the duty to
travel, read by a CCNL that pays a share of the daily minimum
(Lavoro domestico art. 33 c. 2: no diaria "nel caso in cui il
relativo obbligo fosse stato contrattualmente previsto nella
lettera di assunzione"); |
mission_days |
int | None
|
Calendar days of the whole mission, read by a CCNL that
pays only a mission of several days (AGIDAE Scuola art. 36 c. 2),
which rejects |
distance_km |
Decimal | None
|
Kilometres of the trip, read by a CCNL with bands by
distance (Contoterzismo art. 25), which rejects |
board_in_kind |
bool | None
|
Whether board and lodging are agreed in kind, at par
with those of the travellers, read by a CCNL that then pays
bands of hours away in place of its quotas (Autorimesse art.
22); |
rest_day_part |
bool | None
|
Whether the mission starts before 18.00 or ends after 13.00 on a non-working day (Energia art. 42: one more quota). |
documented_expenses |
Decimal | None
|
Documented board and lodging of each day, of which a CCNL pays a share (Tabacco art. 36: 20%). |
travel_hours |
Decimal | None
|
Hours of travel outside the working hours of the day (Laterizi art. 89 lett. a: 35% of the hourly pay). |
night_overlap |
bool | None
|
Whether the absence of the day overlaps, even in part, the night hours (Logistica art. 16: the night allowance). |
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When a field is invalid, or |
ccnl_engine.events.WelfareEvent
dataclass
¶
Welfare benefit: exempt from INPS and IRPEF, no TFR accrual.
Attributes:
| Name | Type | Description |
|---|---|---|
event_date |
date
|
Date the benefit is attributed to. |
amount |
Decimal
|
Value of the welfare benefit in EUR. Must be >= 0. |
ccnl_engine.events.WorkEvent = OvertimeEvent | NightShiftEvent | HolidayWorkEvent | ShiftWorkEvent | StandbyEvent | IntermittentAvailabilityEvent | AbsenceEvent | SickLeaveEvent | SicknessEpisode | MaternityLeaveEvent | PaternityLeaveEvent | ParentalLeaveEvent | DisabilityPermitEvent | NursingRestEvent | HourlyParentalLeaveEvent | NoticeIndemnityEvent | ExtraordinaryLeaveEvent | WorkInjuryEvent | BonusEvent | FringeEvent | TravelAllowanceEvent | WelfareEvent | ArrearsEvent | BilateralFundEvent | TerminationTFREvent | LeaveTakenEvent | FlexibilityWeekEvent | BoardLodgingEvent | MealIndennityEvent
module-attribute
¶
ccnl_engine.events.WorkInjuryEvent
dataclass
¶
A temporary absolute inability after a work injury.
Attributes:
| Name | Type | Description |
|---|---|---|
injury_on |
date
|
Day of the injury, paid in full by the employer. |
ended_on |
date
|
Last day of the inability. |
Raises:
| Type | Description |
|---|---|
InvalidInputError
|
When a day is not a date or the inability ends before the injury. |