feat: async pytest, testcases for starting and finishing shifts

This commit is contained in:
2025-11-26 15:58:59 +04:00
parent c71a460170
commit ed00d1483d
14 changed files with 1933 additions and 1393 deletions

18
tests/fixtures/pay_rates.json vendored Normal file
View File

@@ -0,0 +1,18 @@
[
{
"id": 1,
"name": "Старший упаковщик",
"payroll_scheme_key": "hourly",
"base_rate": 350,
"overtime_rate": 450,
"overtime_threshold": 8
},
{
"id": 2,
"name": "Менеджер по продажам",
"payroll_scheme_key": "hourly",
"base_rate": 450,
"overtime_rate": 550,
"overtime_threshold": 8
}
]

14
tests/fixtures/payroll_schemas.json vendored Normal file
View File

@@ -0,0 +1,14 @@
[
{
"key": "hourly",
"name": "Почасовая"
},
{
"key": "daily",
"name": "Подневная"
},
{
"key": "monthly",
"name": "Помесячная"
}
]

14
tests/fixtures/roles.json vendored Normal file
View File

@@ -0,0 +1,14 @@
[
{
"key": "admin",
"name": "Админ"
},
{
"key": "user",
"name": "Базовый пользователь"
},
{
"key": "employee",
"name": "Сотрудник"
}
]

10
tests/fixtures/user_pay_rates.json vendored Normal file
View File

@@ -0,0 +1,10 @@
[
{
"pay_rate_id": 1,
"user_id": 2
},
{
"pay_rate_id": 2,
"user_id": 1
}
]

30
tests/fixtures/users.json vendored Normal file
View File

@@ -0,0 +1,30 @@
[
{
"id": 1,
"first_name": "Алексей",
"second_name": "Васильев",
"patronymic": "Алексеевич",
"comment": "First admin user",
"telegram_id": 123123123,
"phone_number": "88005553535",
"passport_data": "3443556677",
"is_admin": true,
"is_blocked": false,
"is_deleted": false,
"role_key": "admin"
},
{
"id": 2,
"first_name": "Магаджан",
"second_name": "Хузургалиев",
"patronymic": "Татариевич",
"comment": "First employee user",
"telegram_id": 33322211122,
"phone_number": "88005553536",
"passport_data": "8899123321",
"is_admin": false,
"is_blocked": false,
"is_deleted": false,
"role_key": "employee"
}
]

20
tests/fixtures/work_shift_pauses.json vendored Normal file
View File

@@ -0,0 +1,20 @@
[
{
"id": 100,
"started_at": "2024-11-21 18:55:00",
"finished_at": "2024-11-21 19:25:00",
"work_shift_id": 100
},
{
"id": 101,
"started_at": "2024-11-11 23:30:00",
"finished_at": "2024-11-12 00:30:00",
"work_shift_id": 101
},
{
"id": 102,
"started_at": "2024-11-13 09:30:00",
"finished_at": null,
"work_shift_id": 101
}
]

16
tests/fixtures/work_shifts.json vendored Normal file
View File

@@ -0,0 +1,16 @@
[
{
"id": 100,
"started_at": "2024-11-21 11:55:00",
"finished_at": null,
"user_id": 2,
"is_paused": false
},
{
"id": 101,
"started_at": "2024-11-11 12:00:00",
"finished_at": null,
"user_id": 1,
"is_paused": true
}
]