01 · Making changes
Only product logic.
Working at any scale.
You decide how a feature should work. Fluxzero keeps its rules intact when many customers act at once. The same logic continues to work as usage grows, without engineering work for your agent.
record ReserveTicket(
@NotNull ReservationId reservationId,
@NotNull TicketId ticketId) {
@AssertLegal
void assertAvailable(Ticket ticket) {
if (ticket.status() != AVAILABLE) {
throw TicketErrors.notAvailable;
}
}
@Apply
Ticket reserve(Ticket ticket) {
return ticket.withStatus(RESERVED);
}
@Apply
Reservation createReservation(User user) {
return Reservation.awaitingPayment(
reservationId, ticketId, user.id());
}
} - State loads automatically
- Fluxzero provides the product state and which customer is making the change.
- Everything changes together
- If something changes while the rule runs, it runs again before the changes are saved.
- Many people, one safe result
- Each decision is kept correct even when many customers act at once.