Search by

adachsoft / calendar-contracts

Arkadiusz Adach

PHP contracts and immutable models for calendars, entries, recurrence-aware queries, repositories, access policies, and change notifications.

Package info

gitlab.com/a.adach/calendar-contracts

Issues

pkg:composer/adachsoft/calendar-contracts

Statistics

Installs: 13

Dependents: 1

Suggesters: 0

Stars: 0

v0.1.0 2026-11-23 16:21 UTC

This package is auto-updated.

Last update: 2026-11-23 15:21:21 UTC


README

This library defines PHP contracts and immutable models for calendars and their entries. It provides repository interfaces, in-memory repositories for tests and development, access-policy and change-listener contracts, and recurrence-aware date ranges. It does not include a production storage adapter or calendar-service implementation.

Features

  • Calendar and entry DTOs, identifiers, and validated collections.
  • Repository contracts with optimistic concurrency and range queries.
  • Access policy, service, and change notification interfaces.
  • Reusable repository contract test suites for adapter packages.
  • Compatibility with adachsoft/reference-contracts and adachsoft/recurrence-contracts.

Requirements

  • PHP 8.3 or later
  • adachsoft/reference-contracts
  • adachsoft/recurrence-contracts

Installation

Install with Composer:

composer require adachsoft/calendar-contracts

Usage

Create calendar and entry models and persist them through CalendarRepositoryInterface and EntryRepositoryInterface. Use DateRange to query repository candidates for a local day, week, or month. The in-memory repositories are useful for tests and lightweight development, but do not persist data beyond the current process.

See Basic usage for a complete example. Application services and occurrence expansion are provided by adachsoft/calendar. Adapter packages can extend the contract suites under testing/.