Carta Operum

Journal ◆ Money

A discount that starts on time

Scheduled promotions decided by the server, not by the clock on a phone.

A sale that starts a few minutes early is a pricing error. A sale that starts a few minutes late is a missed Friday. Pinafore schedules its discounts, and the one rule I hold to is that the phone never decides whether a discount is on.

A promotion is a row with a start, an end and a rule. The server applies it when it builds the product, so the price in the response is already the price that applies now. The app shows that number and, when the promotion has an end, the end. It does not compare dates, which means a phone with the wrong clock cannot show the wrong price.

The one place time does reach the client is the home feed, where promo banners go live and expire. There the server sends only the banners that are running, and the feed refreshes when the app returns to the foreground. Checkout asks the server for the total one last time before paying, so the price a parent confirmed and the price they are charged are the same number.