# 3.2.1

**Release Date:** February 26, 2026

---

## 🐛 Bug Fixes

### Terraform Modules

#### Cosmos DB `ttl_in_days` Validation — Null Safety Fix 🗄️

**Module:** `saif-api-service` (feature flags: `cosmosdb_nosql_serverless_settings`)

Fixed a runtime error in the `feature_flags` validation block that caused `terraform plan` and `terraform apply` to fail with `argument must not be null` when a Cosmos DB container omitted the optional `ttl_in_days` field.

**Root Cause:**

Terraform evaluates all operands of `||` eagerly. In the previous condition:

```hcl
c.ttl_in_days == null || c.ttl_in_days == -1 || (c.ttl_in_days > 0 && floor(c.ttl_in_days) == c.ttl_in_days)
```

`floor(null)` was being evaluated even when `c.ttl_in_days == null` was already `true`, causing the error.

**Fix:**

Replaced `||` with nested ternaries, which Terraform evaluates lazily:

```hcl
c.ttl_in_days == null ? true : (c.ttl_in_days == -1 ? true : (c.ttl_in_days > 0 && floor(c.ttl_in_days) == c.ttl_in_days))
```

**Impact:**

- ✅ Containers that omit `ttl_in_days` now correctly leave TTL disabled with no plan-time error
- ✅ Behaviour for `ttl_in_days = -1` and positive whole-number values is unchanged
- ✅ Fractional values (e.g. `1.5`) are still correctly rejected

**PR:** [#471](https://github.com/saif-corp/forge/pull/471) — Closes [#470](https://github.com/saif-corp/forge/issues/470)

---

### Documentation

#### Cosmos DB NoSQL Guide — Code Block Formatting Fix 📄

Fixed double-spaced code blocks in `docs/guides/development/data/cosmos-nosql.md` caused by spurious blank lines and non-breaking spaces (U+00A0) inside code fences. All `bash`, `yaml`, `csharp`, and `terraform` snippets now render single-spaced as intended, and code copied from the guide is syntactically valid.

**PR:** [#468](https://github.com/saif-corp/forge/pull/468)

---

## 📚 Documentation

### New Documentation

#### Mermaid Diagram Guidelines 📊

Added Mermaid diagram best practices and formatting guidelines to the contributing documentation. Covers diagram types (flowchart, sequence, entity-relationship), styling conventions, and integration with MkDocs.

---

## 📋 Additional Notes

- Total commits: 10
- Contributors: Brian Sheridan, Copilot

---
