Urgent.News

What's breaking now, across thousands of outlets.

Tech

Modelling a Custom Jewellery Order as a State Machine (with Human Approval Gates)

Custom jewellery orders are a nice, small example of why "add a chatbot" is the wrong first move for retail automation. The real problem is state: the customer wants to know where their order is, and the answer lives in someone's head or a paper order book. This post shows a tiny state machine for a custom order, with approval gates on the steps that touch money or promises. It is the pattern we…

Custom jewellery orders pose challenges for retail automation due to the state of the order and the human approvals required. This state machine outlines the progression of a custom jewellery order, with gates that require human approval before certain steps involving money or promises. The states in the machine include ENQUIRY, DESIGN_SHARED, DESIGN_APPROVED, ADVANCE_RECEIVED, IN_MAKING, READY_FOR_TRIAL, ALTERATION (optional), READY_FOR_PICKUP, and DELIVERED. Additionally, there are two side exits: DELAYED (needing a human message) and CANCELLED.

The rules governing the transitions between states require that every transition is made by a named staff member. Some transitions automatically trigger a customer message using an approved template, while others only draft a message that must be approved by a person before proceeding. The approvals apply to any message about price, balance due, or delay.

The code utilizes dataclasses for the Order object, a dictionary for the transition rules, and defines two sets: AUTO_SEND for states that automatically send customer messages, and NEEDS_APPROVAL for states that require human approval. The Order class maintains a history of state transitions and allows for moving between states through the move method, which checks for valid transitions, updates the order's state and history, and formats customer messages for appropriate actions.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

What a URL-Only Brand Audit Can Actually See: Build a Tiny Checker in Python

There are a lot of "free AI brand audit" tools now. Before trusting any of them, it helps to know what a tool can actually see when all you give it is a URL.

  • Tool cannot retrieve computed colours, mobile layout, or JavaScript-injected content.
  • Python script uses regex to identify CTA words, hype words, distinct CTA buttons, and Google fonts.

What I Had to Think About When Building a Product Launch Platform

Building a product launch platform sounds relatively straightforward. You need products. You need users. You need voting. You need a leaderboard. Done, right? Not quite.

  • LaunchStall platform tackles community rules and lifecycle complexities
  • Weekly edition system with predictable phases from Monday to Sunday
  • Free path offers LaunchStall badge, paid plans remove requirement

Write the Acceptance Tests Before the Agency Writes the Automation

If you are the technical person asked to "work with the agency", here is the one thing I would do before kickoff: write the acceptance tests yourself, in plain language, and attach them to the…

  • Write acceptance tests before agency writes automation.
  • Tests describe system response to specific real-world inputs.
  • Include unique identifier, condition, outcome, and human approval flag.

More from Wednesday 7 October →