What I Learned from Yeppeun Contract: Contract State Came Before the Screens
Working on 21N's e-contract platform, where the app, hospital admin, and central admin all handled the same contract, and how I split per-user screens from shared state rules.
Joohwan Yu · Founder, Full Stack Developer
Toris · Published
Contents
When I built the e-contract platform at 21N, I worked on the user app, the hospital admin web, and the central admin web together. The three screens had different purposes, but they were all looking at the same contract. Making any one screen feel natural wasn’t enough to make the whole flow fit together.
Three roles see one contract differently
A user wants to know whether they need to sign. A hospital admin needs to check progress and the documents required. A central admin has to look across many contracts and the settlement flow. The presentation each screen needs differs, but the meaning of a contract’s state must not.
At the time, I was the full-stack owner of a domain where contracts, points, and settlement interlock. Looking back, what mattered more than deciding how many APIs to have was explaining, in one place, the conditions under which state changes. Even when a button has the same name, the moment it can be run differs by role.
Transition conditions mattered more than state names
A list of states isn’t enough. You also need to know who can move from which state to the next, whether an external signature must be completed, and whether the previous state is kept on failure. If I designed it again now, I would review each transition with its actor, preconditions, and side effects attached.
For example, if you treat contract completion and settlement completion as the same thing, it’s hard to express a failure in follow-up processing. A finished document and finished payment handling are different events. You have to distinguish the requirement that the two be linked from the requirement that they be the same state.
Frontend convenience and the server’s final call
The frontend should show which buttons are available and guide the next action. The server has to judge again whether the request is actually allowed, because a screen left open for a long time may not know the latest state. Today I would treat the case where another admin has already changed the state as a normal conflict and show the user the new state.
This project made the strengths of full-stack work clear. Because the same person could see multiple screens and APIs, it was easy to spot mismatched terminology. At the same time, there was a risk of sharing the rules only in my head. Next time, I’ll treat a state transition table not as a side document of the implementation but as the starting point that the screens and the server look at together.
Related post: 21N e-contract platform case study
Advertisement