Hüseyin Tunay Çelik
← All selected work

Engineering case study / Cloud & backend

data-stock.

Pricing that stays explainable.

My contributionBackend contributor · 5-person team
Project statusImplemented & tested

01 / The problem

What needed solving.

An inventory system replacing Excel needed percentage and fixed-amount discounts without ambiguous overlapping campaigns or negative prices. Price history also had to remain explainable after a campaign ended.

02 / How it fits together

  1. 01Base price
  2. 02Active campaigns
  3. 03Priority resolver
  4. 04Auditable price

03 / Engineering decisions

01

Keep price resolution deterministic

A pure resolver takes the variant and time, finds matching active campaigns and selects the highest-priority winner with a deterministic tie-break. Discounts do not stack implicitly, and the final price is clamped at zero.

02

Preserve history

Campaigns are soft-deleted so historical pricing remains auditable. Campaign writes are restricted to administrators while regular users can read the shared price result.

03

Test boundaries and prepare for growth

The feature shipped with 13 pytest cases covering authorization, discount arithmetic, date edges, priority conflicts and missing base prices. I also introduced a warehouse model and warehouse-scoped locations.

04 / Where it stands

Delivered the campaign engine and multi-warehouse foundation. The web admin, mobile app and remaining API are my teammates’ work; this case study focuses on my backend contribution.

Next case studyLocal intelligence