cd /news/developer-tools/turkish-legal-algorithms-in-typescri… · home › topics › developer-tools › article
[ARTICLE · art-169276] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

Turkish Legal Algorithms in TypeScript: Modeling Law No. 7596 (MKK FIFO & PBLK), Balthazard Disability, and Law No. 6772

A developer at Koptay Hukuk Bürosu in Ankara released turk-hukuk-hesaplama, a zero-dependency npm package that implements deterministic Turkish legal and actuarial calculations in TypeScript. The package covers Law No. 7596 MKK FIFO net-principal fund liquidation with a TRY 1,000,000 interim cap, Balthazard disability rate calculation, and Law No. 6772 additional-payment payroll, and is accompanied by Sphinx documentation, a Hugging Face dataset, and a DOI-registered monograph.

read2 min views1 publishedNov 13, 2026

When building deterministic legal calculators in JavaScript and TypeScript, subtle statutory rules matter as much as arithmetic precision. While developing open-source calculation tools for Koptay Hukuk Bürosu in Ankara, we extracted the core deterministic formulas into a zero-dependency NPM package: turk-hukuk-hesaplama, accompanied by full Sphinx technical documentation on Read the Docs, an open dataset on Hugging Face, and a DOI-registered legal monograph (10.5281/zenodo.24119703).

In this article, we break down the TypeScript implementation of three heavily used Turkish statutory and actuarial algorithms.

npm install turk-hukuk-hesaplama

All browser-ready interactive calculators using these methodologies are also available live at Turkish Legal Calculation Tools (koptay.av.tr/hesaplama-araclari).

calculateLaw7596Fifo) Following the Capital Markets Board of Türkiye (SPK) suspension of 131 investment funds on 17 September 2026 and the enactment of Law No. 7596 (Tasfiyesine Karar Verilen Bazı Yatırım Fonları Hakkında Kanun), investor payouts shifted from unit share valuation to MKK FIFO Net Principal with a TRY 1,000,000 conditional interim cap per fund.

For investors whose pre-suspension redemption orders remained unsettled in PBLK blocked status at MKK/Takasbank, computing the litigation gap requires comparing net FIFO principal, the interim payment cap, and the 17.09.2026 accrued redemption/NAV baseline:

import { calculateLaw7596Fifo } from "turk-hukuk-hesaplama";

const result = calculateLaw7596Fifo({
  totalCashIn: 3_500_000,
  pastRedemptions: 500_000,
  navOrPblkValue: 5_200_000
});

console.log(result);
// {
//   fifoNetPrincipal: 3000000,
//   interimPayment: 1000000,
//   blockedPrincipal: 2000000,
//   totalLitigationClaim: 4200000,
//   ytm2026Cap: 2065145
// }

Further legal methodology and full interactive simulations (including TÜFE/Yİ-ÜFE indexation and withholding tax rules):

calculateBalthazard) Under the Turkish Adult Disability Assessment Regulation (Ek-2 Cetveli), multiple medical impairment percentages from traffic or workplace accidents are never summed linearly. Instead, each subsequent impairment reduces the remaining healthy capacity sequentially after sorting from highest to lowest, with an additional 10% Balthazard factor applied if age exceeds 60:

import { calculateBalthazard } from "turk-hukuk-hesaplama";

const disabilityRate = calculateBalthazard([25, 18], 42);
console.log(disabilityRate); // 38.5

calculateIlaveTediye6772) Permanent public-sector workers under Law No. 6772 receive 52 days of annual statutory bonus (İlave Tediye) paid in 4 installments of 13 days each, subject to 14% SGK employee premium, 1% unemployment insurance, cumulative income tax bracket, and 0.759% stamp tax:

import { calculateIlaveTediye6772 } from "turk-hukuk-hesaplama";

const payroll = calculateIlaveTediye6772(1450, 0.20, 13);
console.log(payroll.net); // 12674.93
── more in #developer-tools 4 stories · sorted by recency
── more on @koptay hukuk bürosu 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/turkish-legal-algori…] indexed:0 read:2min 2026-11-13 · —