@startuml top to bottom direction skinparam packageStyle rectangle skinparam linetype ortho package "Database" { class DbConfig { +CONNECTION_STRING : string } class DatabaseManager { +CreateConnection() : NpgsqlConnection } } package "Models" { class User { +Id : int +Username : string +PasswordHash : string +Email : string +CreatedAt : DateTime } class Book { +Id : int +Title : string +Author : string +PublicationYear : int +OwnerId : int +CreatedAt : DateTime } } package "Repositories" { interface IUserRepository { +Create(user : User) : int +GetAll() : IEnumerable +GetById(id : int) : User +Update(user : User) : bool +Delete(id : int) : bool } interface IBookRepository { +Create(book : Book) : int +GetAll() : IEnumerable +GetById(id : int) : Book +Update(book : Book) : bool +Delete(id : int) : bool } class UserRepository { -_databaseManager : DatabaseManager +Create(user : User) : int +GetAll() : IEnumerable +GetById(id : int) : User +Update(user : User) : bool +Delete(id : int) : bool } class BookRepository { -_databaseManager : DatabaseManager +Create(book : Book) : int +GetAll() : IEnumerable +GetById(id : int) : Book +Update(book : Book) : bool +Delete(id : int) : bool } } package "Utils" { class PasswordHasher { +HashPassword(password : string) : string +VerifyPassword(password : string, hash : string) : bool } class LoggerConfigurator { +Configure() } } package "Tests" { class DatabaseTests { +Database_Should_Connect_Successfully() } class UserRepositoryTests { +Create_Should_Add_User() +GetAll_Should_Return_Users() +Update_Should_Modify_User() +Delete_Should_Remove_User() } class TestHelper { +CleanupUsers() } } UserRepository --> DatabaseManager BookRepository --> DatabaseManager UserRepository ..|> IUserRepository BookRepository ..|> IBookRepository Book --> User : owner_id UserRepository --> User BookRepository --> Book UserRepositoryTests --> IUserRepository DatabaseTests --> DatabaseManager TestHelper --> DatabaseManager DbConfig <-- DatabaseManager @enduml