Mehmet Ergülcü

Meeting overlap rules, and Turkish case-insensitive matching

· 3 min

gorestapiturkishopenapi

BitMeet POC is a small meeting planner API. A planner creates meetings with guests, and the service says no to meetings that overlap another one of the same planner, that end before they begin, or that have a forbidden word in the subject. It started as a Spring Boot service; I rewrote it in Go with the same API. The rules are small, but each one has a trap.

Run it

git clone https://github.com/ergulcu/bit-meet-poc
cd bit-meet-poc
go run ./cmd/bitmeet            # meetings in memory, http://localhost:8088
docker compose up --build       # meetings in PostgreSQL

Without a database the meetings live in memory and are gone after a restart. Set BITMEET_DATABASE_URL to keep them in PostgreSQL.

curl -X POST localhost:8088/meetings -H 'Content-Type: application/json' -d '{
  "planner": "[email protected]",
  "subject": "Sprint planning",
  "guests": ["[email protected]"],
  "beginDate": "10-03-2026 14:00",
  "endDate": "10-03-2026 15:00"
}'
{"id":1,"planner":"[email protected]","subject":"Sprint planning","guests":["[email protected]"],
 "beginDate":"10-03-2026 14:00","endDate":"10-03-2026 15:00","status":"ACTIVE"}

Dates are written dd-MM-yyyy HH:mm, on a 24-hour clock.

Rule 1: what is an overlap?

Two meetings of the same planner overlap when each starts before the other ends. That one sentence settles the awkward case: a meeting that ends at 15:00 and one that begins at 15:00 do not overlap, because the second does not start before the first ends.

Starting with the 14:00–15:00 meeting above, I tried two more:

14:30–15:30  ->  409 Conflict   "The planner already has a meeting in this time range"
15:00–16:00  ->  201 Created

Cancelled meetings do not count, so cancelling a meeting frees its slot. After PUT /meetings/cancel/1, booking 14:00–15:00 again succeeded.

There is a second trap behind this one. Checking for an overlap and then saving is two steps, and two requests arriving together can both pass the check. The store interface has a Lock that runs the check and the write in one transaction while no one else can change that planner's meetings. The in-memory store and the PostgreSQL store are tested with the same shared test suite, so both obey the same rules.

Rule 2: a meeting cannot end before it begins

11-03-2026 15:00 -> 11-03-2026 14:00  ->  409 Conflict   "The meeting must end after it begins"

Rule 3: forbidden words, and the Turkish İ

The subject may not contain a forbidden word. The built-in list has four (küfür, xxx, gizli, yasak), and BITMEET_BAD_WORDS points to your own file, one word per line.

The interesting part is "ignoring case". The upper case of Turkish i is İ (with a dot), and the lower case of I is ı (without one). A comparison that uses English rules gets this wrong. So the matching uses Turkish rules, and these all behave as they should:

"Çok GİZLİ toplantı"   ->  409 "The subject contains a forbidden word"
"bu toplantı gizli"    ->  409 "The subject contains a forbidden word"
"gizlilik politikası"  ->  201 Created

The last line is the other half of the rule: words are matched as whole words. gizlilik ("privacy") contains gizli but is a different word, and blocking it would be the sort of bug that annoys people for years.

Errors are problem details

Every error is an RFC 9457 problem details document, with the content type application/problem+json. A client can rely on the shape:

{"type":"about:blank","title":"Conflict","status":409,
 "detail":"The planner already has a meeting in this time range","instance":"/meetings"}

The status codes mean one thing each: 400 for invalid input, 409 when a rule is broken, 404 for an unknown meeting. For 400, the errors list names every invalid field at once instead of making you fix them one by one:

{"type":"about:blank","title":"Bad Request","status":400,"detail":"Invalid request content.","instance":"/meetings",
 "errors":[{"field":"planner","message":"must be a well-formed email address"},
           {"field":"subject","message":"Subject must be between 5 to 100 characters long"},
           {"field":"guests[0]","message":"must be a well-formed email address"}]}

Documentation that is part of the program

The service serves its own documentation: Swagger UI at /docs and the OpenAPI document at /openapi.yaml. A health check at /healthz includes the database.

Source code: github.com/ergulcu/bit-meet-poc

© 2026 Mehmet Ergülcü SvelteKit · Tailwind · <1 KB JS