sql table to store status
CREATE TABLE status
(
id integer PRIMARY KEY,
name TEXT NOT NULL,
next_status Integer references status
);
insert into status(id, name, next_status)
values
(1,'init', 2),
(2,'waiting ror price approve', 3),
(3,'sent', 4),
(4,'accepted', 5),
(5,'finished', null);