SShortSingh.
Back to feed

Storing Delivery Fees and Store Settings in the Database Instead of Code with Next.js

0
·21 views

The author argues that business-driven values such as delivery fees, free-delivery thresholds, and opening hours should not be hardcoded but kept in a database. They describe ramo.co.il, a Next.js garden-tools store, where settings live in a key/value table with a JSON column while secrets stay in environment variables. Reads are wrapped in a cached loader that converts raw data into typed objects and falls back to safe defaults if the database fails. Saving a setting through an admin screen triggers tag-based revalidation so changes take effect without a deployment. The approach also includes schema validation of values and an audit trail, with the server computing fees so the cart and checkout use the same source of truth.

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
ProgrammingHacker News ·

Pentagon fails ninth consecutive financial audit

The U.S. Department of Defense has once again failed a financial audit, marking the ninth year in a row it has not passed. The failure was reported in coverage by The Hill, which linked the story on Hacker News. The article text available is limited to links and engagement metrics, so specific audit findings, officials' responses, and remediation plans cannot be confirmed from the source provided. Readers seeking details on the causes of the failure or the agency's corrective steps should consult the original reporting.

0
ProgrammingHacker News ·

Essay argues open source should improve rather than multiply new apps

A blog post by Jordan Krueger contends that the software ecosystem needs stronger existing open source projects more than it needs additional applications. The essay was shared on Hacker News, where it gathered 72 points and 25 comments. The discussion reflects a broader debate among developers about fragmentation and the value of consolidating effort. The article text available is limited to the link and metadata, so the specific arguments are not detailed here.

0
ProgrammingDEV Community ·

Masttro Launches Read-Only MCP Server for Wealth Data Access by AI Tools

Masttro launched a Model Context Protocol server on November 16, 2026, letting eligible family offices, wealth owners, and advisors connect their wealth records to compatible external AI applications. The server is strictly read-only and exposes holdings, transactions, performance, and entity and ownership structures, while offering no write operations. Access is disabled by default and requires explicit client activation, with administrators able to revoke permissions at any time. Masttro states that once data reaches an external AI provider, its processing and protection fall under that provider's arrangements rather than Masttro's. The article, which is partly promotional for a third-party decision-scoring service, argues that per-read decision controls are not part of Masttro's offering.

0
ProgrammingDEV Community ·

Checking Romanian supplier VAT and inactive status via the ANAF API

Under Romanian tax law, buying from a supplier listed as inactive in ANAF's register blocks the deduction of both the expense and its VAT, subject to certain exceptions. A supplier whose VAT registration was cancelled on specified grounds triggers a narrower rule, costing only the VAT deduction from the day after cancellation. Because a supplier can switch to inactive after a contract is signed, a one-time check at onboarding may not be enough. The article describes ANAF's free keyless endpoint, which checks up to 100 company tax IDs per call, and outlines how to monitor changes while avoiding false alerts from errors or transient 'not found' results. The author notes the content is not tax advice and recommends confirming details with an accountant.