@startuml uc-01-register autonumber title UC-01 Register Account (design sequence) actor Guest participant "AuthBoundary\n«POST /api/auth/register»" as boundary <> participant "AccountRegistry\nsb-api::routes::register" as control <> participant "UserAccount\nsb-shared::user::User" as entity <> == Register == Guest -> boundary : name (3-32), password (>= 6) boundary -> control : register(name, password) alt name invalid / password too short control --> boundary : 400 else name taken control --> boundary : 409 CONFLICT else valid control -> entity : hash password (argon2, sb-auth) control -> entity : assign player role + next id control -> entity : persist (sb-db) control --> boundary : JWT HS256 (player role) boundary --> Guest : {token, user_id, name, role} end @enduml