SShortSingh.
Back to feed

Hypothetical case study: month-end billing job charged 300 customers for the wrong month

0
·1 views

The article describes a hypothetical case study about an API company that bills customers monthly for usage plus a base fee. Its month-end job, scheduled via cron on a UTC worker server, selected the wrong billing period because the query for "last month" depended on the server's time zone and current time. As a result, roughly 300 customers were charged for the wrong month. The author outlines fixes: pinning session time zones to UTC, enforcing one invoice per customer per period with database constraints and idempotency keys, processing each customer as a separate job, and running a pre-flight check that pauses billing if totals swing more than 50%. The core lesson is that billing periods should be explicit data rather than values derived from the current time.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Over 1.97 Million Websites Use Next.js, Tracker Says, Yet Few Reveal Their Version

As of November 16, 2026, the webatla tracker counts 1,973,502 websites running Next.js, about 0.61% of the 325.8 million sites it monitors. Only around 750 of those sites expose which release they run, so detection shows the framework's presence rather than its version. Common markers such as /_next/static/ asset paths and the X-Powered-By header can reveal Next.js, but configuration options like assetPrefix, basePath, and disabled headers can hide them. Inside the static site generator category, Next.js accounts for 56.6% of sites. The article stresses that these signals are not definitive proof, since teams can remove or alter each one.

0
ProgrammingDEV Community ·

How to Implement Design Tokens in a Tailwind CSS Project

Hardcoded values such as fixed hex colors and pixel sizes scattered across a codebase often lead to color drift, painful rebranding, and mismatches between design and development. Design tokens address this by storing values like colors, spacing, and typography as named variables that act as a single source of truth. The approach typically separates primitive tokens holding raw values from semantic tokens that describe purpose, with optional component-level tokens. Defining these variables in a global CSS file and mapping them into the Tailwind config enables features like dark mode and multi-platform output. The guide recommends starting with a small set of 20-30 tokens, aliasing primitives to semantic names, documenting token purpose, and using identical names in both design tools and code.

0
ProgrammingDEV Community ·

Shipping systemd journald logs to Dynatrace with OneAgent

Linux systemd stores logs in binary journald files that stay on the machine and disappear with it unless they are forwarded elsewhere. The article compares three ways to collect them: third-party agents or syslog forwarding, the OneAgent log module, and the ingestion API. It focuses on the OneAgent log module, which reads the journal through the systemd API and maps fields such as MESSAGE, UNIT and PRIORITY into log attributes. Setup requires OneAgent 1.307 or later plus two separate tenant settings: enabling the Journald log detector and an ingest rule. The author notes that the Managed deployment procedure could not be verified.

0
ProgrammingDEV Community ·

Flutter 3.50 deprecates bundled Material and Cupertino libraries in favor of standalone packages

Flutter 3.50 was released on 11 November alongside Dart 3.14. Its most significant change is structural: the Material and Cupertino libraries bundled with the framework are now formally deprecated. They are being replaced by the standalone material_ui and cupertino_ui packages, which are versioned independently of Flutter. This separation lets design-library updates ship without waiting for framework releases. The migration is largely automated through dart fix and includes a MaterialUiCompatibilityBridge for code that spans both versions, and the deprecation is not a removal, so existing apps will continue to build.