require "#{__dir__}/setup"
ShareBoard.setup(force: true)
ShareBoard::Room.mock
tp ShareBoard::Roomship
tp ShareBoard::Room
tp ShareBoard::Battle
tp ShareBoard::User
user = ShareBoard::User["alice"]
tp roomship = ShareBoard::Room["dev_room1"].roomships.find_by(user: user)
roomship.win_count           # => 1

battle = ShareBoard::Room["dev_room1"].battles.first
battle.sfen # => "position sfen lnsgkgsnl/1r5b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL b - 1 moves 7g7f 3c3d 8h2b+ 3a2b"
battle.turn # => 4

# >> |----+---------+---------+-----------+------------+---------------+----------+-------+------+---------------------------+---------------------------|
# >> | id | room_id | user_id | win_count | lose_count | battles_count | win_rate | score | rank | created_at                | updated_at                |
# >> |----+---------+---------+-----------+------------+---------------+----------+-------+------+---------------------------+---------------------------|
# >> |  1 |       1 |       1 |         1 |          0 |             1 |      1.0 |     1 |    1 | 2025-10-05 20:04:28 +0900 | 2025-10-05 20:04:28 +0900 |
# >> |  3 |       1 |       3 |         1 |          0 |             1 |      1.0 |     1 |    1 | 2025-10-05 20:04:28 +0900 | 2025-10-05 20:04:28 +0900 |
# >> |  2 |       1 |       2 |         0 |          1 |             1 |      0.0 |     0 |    3 | 2025-10-05 20:04:28 +0900 | 2025-10-05 20:04:28 +0900 |
# >> |----+---------+---------+-----------+------------+---------------+----------+-------+------+---------------------------+---------------------------|
# >> |----+-----------+---------------+---------------------------+---------------------------+---------------------|
# >> | id | key       | battles_count | created_at                | updated_at                | chat_messages_count |
# >> |----+-----------+---------------+---------------------------+---------------------------+---------------------|
# >> |  1 | dev_room1 |             1 | 2025-10-05 20:04:28 +0900 | 2025-10-05 20:04:28 +0900 |                   0 |
# >> |----+-----------+---------------+---------------------------+---------------------------+---------------------|
# >> |----+---------+----------------------------------+-------+----------------------------------------------------------------------------------------------------------+------+-----------------+----------+---------------------------+---------------------------|
# >> | id | room_id | key                              | title | sfen                                                                                                     | turn | win_location_id | position | created_at                | updated_at                |
# >> |----+---------+----------------------------------+-------+----------------------------------------------------------------------------------------------------------+------+-----------------+----------+---------------------------+---------------------------|
# >> |  1 |       1 | 8750e8b7463fee0e2d69ab10766c7c0e |       | position sfen lnsgkgsnl/1r5b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL b - 1 moves 7g7f 3c3d 8h2b+ 3a2b |    4 |               1 |        0 | 2025-10-05 20:04:28 +0900 | 2025-10-05 20:04:28 +0900 |
# >> |----+---------+----------------------------------+-------+----------------------------------------------------------------------------------------------------------+------+-----------------+----------+---------------------------+---------------------------|
# >> |----+-------+-------------------+---------------------------+---------------------------+---------------------|
# >> | id | name  | memberships_count | created_at                | updated_at                | chat_messages_count |
# >> |----+-------+-------------------+---------------------------+---------------------------+---------------------|
# >> |  1 | alice |                 1 | 2025-10-05 20:04:28 +0900 | 2025-10-05 20:04:28 +0900 |                   0 |
# >> |  2 | bob   |                 1 | 2025-10-05 20:04:28 +0900 | 2025-10-05 20:04:28 +0900 |                   0 |
# >> |  3 | carol |                 1 | 2025-10-05 20:04:28 +0900 | 2025-10-05 20:04:28 +0900 |                   0 |
# >> |----+-------+-------------------+---------------------------+---------------------------+---------------------|
# >> |---------------+---------------------------|
# >> |            id | 1                         |
# >> |       room_id | 1                         |
# >> |       user_id | 1                         |
# >> |     win_count | 1                         |
# >> |    lose_count | 0                         |
# >> | battles_count | 1                         |
# >> |      win_rate | 1.0                       |
# >> |         score | 1                         |
# >> |          rank | 1                         |
# >> |    created_at | 2025-10-05 20:04:28 +0900 |
# >> |    updated_at | 2025-10-05 20:04:28 +0900 |
# >> |---------------+---------------------------|
