@heyhru/business-dms-user
v0.3.0
Published
DMS user domain logic: service, model, sql
Readme
@heyhru/business-dms-user
DMS user domain logic: service, model, sql.
API
getUserByUsername(username: string)
Look up a user by username. Returns the full user row (including password_hash) or undefined.
Used by auth service for login and password change.
updateUserPassword(id: string, hash: string)
Update the password_hash for a user by ID.
Route handlers (Fastify)
The following functions are route-facing handlers with signature (req: FastifyRequest, reply: FastifyReply). Register them directly on a Fastify instance.
| Function | Route action | Description |
| ------------ | -------------------- | -------------------------------- |
| userList | POST /users/list | List all users |
| userGet | POST /users/get | Get a user by id in body |
| userCreate | POST /users/create | Create a user, hashes password |
| userUpdate | POST /users/update | Update email or role by id |
| userDelete | POST /users/delete | Delete a user by id |
