#!/bin/bash

# Fix role_assignment_limit_test.go - add shopRoleStore declarations
cd /Users/break/csxjProject/junhong_cmp_fiber

# Add shopRoleStore for all test functions
sed -i.bak3 '74a\
	shopRoleStore := postgres.NewShopRoleStore(tx, rdb)
' tests/unit/role_assignment_limit_test.go

sed -i.bak4 '122a\
	shopRoleStore := postgres.NewShopRoleStore(tx, rdb)
' tests/unit/role_assignment_limit_test.go

sed -i.bak5 '170a\
	shopRoleStore := postgres.NewShopRoleStore(tx, rdb)
' tests/unit/role_assignment_limit_test.go

# Fix shop_service_test.go - add shopRoleStore and roleStore
sed -i.bak6 '26a\
	shopRoleStore := postgres.NewShopRoleStore(tx, rdb)\
	roleStore := postgres.NewRoleStore(tx)
' tests/unit/shop_service_test.go

echo "All test files fixed!"
