# app-settings Specification

## Purpose

A generic key/value settings store, keyed uniquely and grouped by `key_group`, so configurable application values (such as the near-expiry threshold) can be added and changed without a new migration for each one.

## Requirements

### Requirement: Generic key/value settings storage
The system SHALL provide a generic settings store, keyed by a unique `key` and grouped by `key_group`, so configurable values can be added without new migrations per value.

#### Scenario: Near-expiry threshold is available with a default value
- **WHEN** the application has not been explicitly configured by an admin
- **THEN** a setting with `key=near_expiry_days`, `key_group=product` exists with a default `content` of `30`

#### Scenario: Reading a setting that does not exist falls back to a default
- **WHEN** code requests a setting `key` that has no row in the settings table
- **THEN** the caller-provided default value is used instead of raising an error
