feat(sbp_payments): added new chosen_plan fixtures with chosen_plan states and fixed chat tests

This commit is contained in:
misha
2026-07-08 14:28:08 +03:00
parent d21cc46558
commit e10610d93c
18 changed files with 707 additions and 2 deletions

View File

@@ -386,7 +386,7 @@ void main() {
test('getChosenPlan - получает выбранный план', () async {
const planId = 1;
final chosenPlanFixture = FixtureReader.readAsMap(
'chat/chosen_plan_response.json',
'chat/chosen_plan/chosen_plan_in_progress_response.json',
);
final expectedPlan = ChosenPlanModel.fromJson(chosenPlanFixture);

View File

@@ -238,7 +238,7 @@ void main() {
test('getChosenPlan - возвращает выбранный план', () async {
const planId = 1;
final chosenPlanFixture = FixtureReader.readAsMap(
'chat/chosen_plan_response.json',
'chat/chosen_plan/chosen_plan_in_progress_response.json',
);
final expectedPlan = ChosenPlanModel.fromJson(chosenPlanFixture);

View File

@@ -0,0 +1,47 @@
{
"id": 1,
"option_type": "1",
"start_date": "2024-01-01T00:00:00Z",
"last_state": "canceled_by_the_initiator",
"chat_id": "chat-1",
"consultant_id": 1,
"plan": {
"id": 1,
"slug": "test-plan",
"name": "Test Plan",
"image": "https://example.com/plan.jpg",
"duration": 30,
"state": "active",
"type": {
"fit": true,
"slim": false,
"behavior": false,
"wellness": false
},
"description_md": "Plan description",
"packets_count": 1,
"packet1_options": {
"items": ["Item 1", "Item 2"],
"price": 1500.0,
"short": "Option 1",
"description_md": "Description",
"has_personal_diet": false
},
"packet2_options": null,
"packet3_options": null,
"author": {
"author_slug": "author-1",
"author_name": "Author Name",
"author_profile_icon": "https://example.com/author.jpg",
"author_is_me": false
},
"total_likes": 10,
"total_views": 100,
"total_comments": 5,
"is_favorite": false,
"min_price_of_options": 1000.0,
"max_price_of_options": 2000.0,
"was_liked_by_me": false
}
}

View File

@@ -0,0 +1,47 @@
{
"id": 1,
"option_type": "1",
"start_date": "2024-01-01T00:00:00Z",
"last_state": "charge_was_collected",
"chat_id": "chat-1",
"consultant_id": 1,
"plan": {
"id": 1,
"slug": "test-plan",
"name": "Test Plan",
"image": "https://example.com/plan.jpg",
"duration": 30,
"state": "active",
"type": {
"fit": true,
"slim": false,
"behavior": false,
"wellness": false
},
"description_md": "Plan description",
"packets_count": 1,
"packet1_options": {
"items": ["Item 1", "Item 2"],
"price": 1500.0,
"short": "Option 1",
"description_md": "Description",
"has_personal_diet": false
},
"packet2_options": null,
"packet3_options": null,
"author": {
"author_slug": "author-1",
"author_name": "Author Name",
"author_profile_icon": "https://example.com/author.jpg",
"author_is_me": false
},
"total_likes": 10,
"total_views": 100,
"total_comments": 5,
"is_favorite": false,
"min_price_of_options": 1000.0,
"max_price_of_options": 2000.0,
"was_liked_by_me": false
}
}

View File

@@ -0,0 +1,47 @@
{
"id": 1,
"option_type": "1",
"start_date": "2024-01-01T00:00:00Z",
"last_state": "complained",
"chat_id": "chat-1",
"consultant_id": 1,
"plan": {
"id": 1,
"slug": "test-plan",
"name": "Test Plan",
"image": "https://example.com/plan.jpg",
"duration": 30,
"state": "active",
"type": {
"fit": true,
"slim": false,
"behavior": false,
"wellness": false
},
"description_md": "Plan description",
"packets_count": 1,
"packet1_options": {
"items": ["Item 1", "Item 2"],
"price": 1500.0,
"short": "Option 1",
"description_md": "Description",
"has_personal_diet": false
},
"packet2_options": null,
"packet3_options": null,
"author": {
"author_slug": "author-1",
"author_name": "Author Name",
"author_profile_icon": "https://example.com/author.jpg",
"author_is_me": false
},
"total_likes": 10,
"total_views": 100,
"total_comments": 5,
"is_favorite": false,
"min_price_of_options": 1000.0,
"max_price_of_options": 2000.0,
"was_liked_by_me": false
}
}

View File

@@ -0,0 +1,47 @@
{
"id": 1,
"option_type": "1",
"start_date": "2024-01-01T00:00:00Z",
"last_state": "confirmed_by_consultant",
"chat_id": "chat-1",
"consultant_id": 1,
"plan": {
"id": 1,
"slug": "test-plan",
"name": "Test Plan",
"image": "https://example.com/plan.jpg",
"duration": 30,
"state": "active",
"type": {
"fit": true,
"slim": false,
"behavior": false,
"wellness": false
},
"description_md": "Plan description",
"packets_count": 1,
"packet1_options": {
"items": ["Item 1", "Item 2"],
"price": 1500.0,
"short": "Option 1",
"description_md": "Description",
"has_personal_diet": false
},
"packet2_options": null,
"packet3_options": null,
"author": {
"author_slug": "author-1",
"author_name": "Author Name",
"author_profile_icon": "https://example.com/author.jpg",
"author_is_me": false
},
"total_likes": 10,
"total_views": 100,
"total_comments": 5,
"is_favorite": false,
"min_price_of_options": 1000.0,
"max_price_of_options": 2000.0,
"was_liked_by_me": false
}
}

View File

@@ -0,0 +1,47 @@
{
"id": 1,
"option_type": "1",
"start_date": "2024-01-01T00:00:00Z",
"last_state": "done",
"chat_id": "chat-1",
"consultant_id": 1,
"plan": {
"id": 1,
"slug": "test-plan",
"name": "Test Plan",
"image": "https://example.com/plan.jpg",
"duration": 30,
"state": "active",
"type": {
"fit": true,
"slim": false,
"behavior": false,
"wellness": false
},
"description_md": "Plan description",
"packets_count": 1,
"packet1_options": {
"items": ["Item 1", "Item 2"],
"price": 1500.0,
"short": "Option 1",
"description_md": "Description",
"has_personal_diet": false
},
"packet2_options": null,
"packet3_options": null,
"author": {
"author_slug": "author-1",
"author_name": "Author Name",
"author_profile_icon": "https://example.com/author.jpg",
"author_is_me": false
},
"total_likes": 10,
"total_views": 100,
"total_comments": 5,
"is_favorite": false,
"min_price_of_options": 1000.0,
"max_price_of_options": 2000.0,
"was_liked_by_me": false
}
}

View File

@@ -0,0 +1,47 @@
{
"id": 1,
"option_type": "1",
"start_date": "2024-01-01T00:00:00Z",
"last_state": "in_progress",
"chat_id": "chat-1",
"consultant_id": 1,
"plan": {
"id": 1,
"slug": "test-plan",
"name": "Test Plan",
"image": "https://example.com/plan.jpg",
"duration": 30,
"state": "active",
"type": {
"fit": true,
"slim": false,
"behavior": false,
"wellness": false
},
"description_md": "Plan description",
"packets_count": 1,
"packet1_options": {
"items": ["Item 1", "Item 2"],
"price": 1500.0,
"short": "Option 1",
"description_md": "Description",
"has_personal_diet": false
},
"packet2_options": null,
"packet3_options": null,
"author": {
"author_slug": "author-1",
"author_name": "Author Name",
"author_profile_icon": "https://example.com/author.jpg",
"author_is_me": false
},
"total_likes": 10,
"total_views": 100,
"total_comments": 5,
"is_favorite": false,
"min_price_of_options": 1000.0,
"max_price_of_options": 2000.0,
"was_liked_by_me": false
}
}

View File

@@ -0,0 +1,47 @@
{
"id": 1,
"option_type": "1",
"start_date": "2024-01-01T00:00:00Z",
"last_state": "initied",
"chat_id": "chat-1",
"consultant_id": 1,
"plan": {
"id": 1,
"slug": "test-plan",
"name": "Test Plan",
"image": "https://example.com/plan.jpg",
"duration": 30,
"state": "active",
"type": {
"fit": true,
"slim": false,
"behavior": false,
"wellness": false
},
"description_md": "Plan description",
"packets_count": 1,
"packet1_options": {
"items": ["Item 1", "Item 2"],
"price": 1500.0,
"short": "Option 1",
"description_md": "Description",
"has_personal_diet": false
},
"packet2_options": null,
"packet3_options": null,
"author": {
"author_slug": "author-1",
"author_name": "Author Name",
"author_profile_icon": "https://example.com/author.jpg",
"author_is_me": false
},
"total_likes": 10,
"total_views": 100,
"total_comments": 5,
"is_favorite": false,
"min_price_of_options": 1000.0,
"max_price_of_options": 2000.0,
"was_liked_by_me": false
}
}

View File

@@ -0,0 +1,47 @@
{
"id": 1,
"option_type": "1",
"start_date": "2024-01-01T00:00:00Z",
"last_state": "last_day_finished",
"chat_id": "chat-1",
"consultant_id": 1,
"plan": {
"id": 1,
"slug": "test-plan",
"name": "Test Plan",
"image": "https://example.com/plan.jpg",
"duration": 30,
"state": "active",
"type": {
"fit": true,
"slim": false,
"behavior": false,
"wellness": false
},
"description_md": "Plan description",
"packets_count": 1,
"packet1_options": {
"items": ["Item 1", "Item 2"],
"price": 1500.0,
"short": "Option 1",
"description_md": "Description",
"has_personal_diet": false
},
"packet2_options": null,
"packet3_options": null,
"author": {
"author_slug": "author-1",
"author_name": "Author Name",
"author_profile_icon": "https://example.com/author.jpg",
"author_is_me": false
},
"total_likes": 10,
"total_views": 100,
"total_comments": 5,
"is_favorite": false,
"min_price_of_options": 1000.0,
"max_price_of_options": 2000.0,
"was_liked_by_me": false
}
}

View File

@@ -0,0 +1,47 @@
{
"id": 1,
"option_type": "1",
"start_date": "2024-01-01T00:00:00Z",
"last_state": "last_day_started",
"chat_id": "chat-1",
"consultant_id": 1,
"plan": {
"id": 1,
"slug": "test-plan",
"name": "Test Plan",
"image": "https://example.com/plan.jpg",
"duration": 30,
"state": "active",
"type": {
"fit": true,
"slim": false,
"behavior": false,
"wellness": false
},
"description_md": "Plan description",
"packets_count": 1,
"packet1_options": {
"items": ["Item 1", "Item 2"],
"price": 1500.0,
"short": "Option 1",
"description_md": "Description",
"has_personal_diet": false
},
"packet2_options": null,
"packet3_options": null,
"author": {
"author_slug": "author-1",
"author_name": "Author Name",
"author_profile_icon": "https://example.com/author.jpg",
"author_is_me": false
},
"total_likes": 10,
"total_views": 100,
"total_comments": 5,
"is_favorite": false,
"min_price_of_options": 1000.0,
"max_price_of_options": 2000.0,
"was_liked_by_me": false
}
}

View File

@@ -0,0 +1,47 @@
{
"id": 1,
"option_type": "1",
"start_date": "2024-01-01T00:00:00Z",
"last_state": "paid",
"chat_id": "chat-1",
"consultant_id": 1,
"plan": {
"id": 1,
"slug": "test-plan",
"name": "Test Plan",
"image": "https://example.com/plan.jpg",
"duration": 30,
"state": "active",
"type": {
"fit": true,
"slim": false,
"behavior": false,
"wellness": false
},
"description_md": "Plan description",
"packets_count": 1,
"packet1_options": {
"items": ["Item 1", "Item 2"],
"price": 1500.0,
"short": "Option 1",
"description_md": "Description",
"has_personal_diet": false
},
"packet2_options": null,
"packet3_options": null,
"author": {
"author_slug": "author-1",
"author_name": "Author Name",
"author_profile_icon": "https://example.com/author.jpg",
"author_is_me": false
},
"total_likes": 10,
"total_views": 100,
"total_comments": 5,
"is_favorite": false,
"min_price_of_options": 1000.0,
"max_price_of_options": 2000.0,
"was_liked_by_me": false
}
}

View File

@@ -0,0 +1,47 @@
{
"id": 1,
"option_type": "1",
"start_date": "2024-01-01T00:00:00Z",
"last_state": "payment_failed",
"chat_id": "chat-1",
"consultant_id": 1,
"plan": {
"id": 1,
"slug": "test-plan",
"name": "Test Plan",
"image": "https://example.com/plan.jpg",
"duration": 30,
"state": "active",
"type": {
"fit": true,
"slim": false,
"behavior": false,
"wellness": false
},
"description_md": "Plan description",
"packets_count": 1,
"packet1_options": {
"items": ["Item 1", "Item 2"],
"price": 1500.0,
"short": "Option 1",
"description_md": "Description",
"has_personal_diet": false
},
"packet2_options": null,
"packet3_options": null,
"author": {
"author_slug": "author-1",
"author_name": "Author Name",
"author_profile_icon": "https://example.com/author.jpg",
"author_is_me": false
},
"total_likes": 10,
"total_views": 100,
"total_comments": 5,
"is_favorite": false,
"min_price_of_options": 1000.0,
"max_price_of_options": 2000.0,
"was_liked_by_me": false
}
}

View File

@@ -0,0 +1,47 @@
{
"id": 1,
"option_type": "1",
"start_date": "2024-01-01T00:00:00Z",
"last_state": "pending_payment",
"chat_id": "chat-1",
"consultant_id": 1,
"plan": {
"id": 1,
"slug": "test-plan",
"name": "Test Plan",
"image": "https://example.com/plan.jpg",
"duration": 30,
"state": "active",
"type": {
"fit": true,
"slim": false,
"behavior": false,
"wellness": false
},
"description_md": "Plan description",
"packets_count": 1,
"packet1_options": {
"items": ["Item 1", "Item 2"],
"price": 1500.0,
"short": "Option 1",
"description_md": "Description",
"has_personal_diet": false
},
"packet2_options": null,
"packet3_options": null,
"author": {
"author_slug": "author-1",
"author_name": "Author Name",
"author_profile_icon": "https://example.com/author.jpg",
"author_is_me": false
},
"total_likes": 10,
"total_views": 100,
"total_comments": 5,
"is_favorite": false,
"min_price_of_options": 1000.0,
"max_price_of_options": 2000.0,
"was_liked_by_me": false
}
}

View File

@@ -0,0 +1,47 @@
{
"id": 1,
"option_type": "1",
"start_date": "2024-01-01T00:00:00Z",
"last_state": "personal_diet_setted",
"chat_id": "chat-1",
"consultant_id": 1,
"plan": {
"id": 1,
"slug": "test-plan",
"name": "Test Plan",
"image": "https://example.com/plan.jpg",
"duration": 30,
"state": "active",
"type": {
"fit": true,
"slim": false,
"behavior": false,
"wellness": false
},
"description_md": "Plan description",
"packets_count": 1,
"packet1_options": {
"items": ["Item 1", "Item 2"],
"price": 1500.0,
"short": "Option 1",
"description_md": "Description",
"has_personal_diet": false
},
"packet2_options": null,
"packet3_options": null,
"author": {
"author_slug": "author-1",
"author_name": "Author Name",
"author_profile_icon": "https://example.com/author.jpg",
"author_is_me": false
},
"total_likes": 10,
"total_views": 100,
"total_comments": 5,
"is_favorite": false,
"min_price_of_options": 1000.0,
"max_price_of_options": 2000.0,
"was_liked_by_me": false
}
}

View File

@@ -0,0 +1,47 @@
{
"id": 1,
"option_type": "1",
"start_date": "2024-01-01T00:00:00Z",
"last_state": "start_date_has_been_set",
"chat_id": "chat-1",
"consultant_id": 1,
"plan": {
"id": 1,
"slug": "test-plan",
"name": "Test Plan",
"image": "https://example.com/plan.jpg",
"duration": 30,
"state": "active",
"type": {
"fit": true,
"slim": false,
"behavior": false,
"wellness": false
},
"description_md": "Plan description",
"packets_count": 1,
"packet1_options": {
"items": ["Item 1", "Item 2"],
"price": 1500.0,
"short": "Option 1",
"description_md": "Description",
"has_personal_diet": false
},
"packet2_options": null,
"packet3_options": null,
"author": {
"author_slug": "author-1",
"author_name": "Author Name",
"author_profile_icon": "https://example.com/author.jpg",
"author_is_me": false
},
"total_likes": 10,
"total_views": 100,
"total_comments": 5,
"is_favorite": false,
"min_price_of_options": 1000.0,
"max_price_of_options": 2000.0,
"was_liked_by_me": false
}
}

View File

@@ -0,0 +1,47 @@
{
"id": 1,
"option_type": "1",
"start_date": "2024-01-01T00:00:00Z",
"last_state": "started",
"chat_id": "chat-1",
"consultant_id": 1,
"plan": {
"id": 1,
"slug": "test-plan",
"name": "Test Plan",
"image": "https://example.com/plan.jpg",
"duration": 30,
"state": "active",
"type": {
"fit": true,
"slim": false,
"behavior": false,
"wellness": false
},
"description_md": "Plan description",
"packets_count": 1,
"packet1_options": {
"items": ["Item 1", "Item 2"],
"price": 1500.0,
"short": "Option 1",
"description_md": "Description",
"has_personal_diet": false
},
"packet2_options": null,
"packet3_options": null,
"author": {
"author_slug": "author-1",
"author_name": "Author Name",
"author_profile_icon": "https://example.com/author.jpg",
"author_is_me": false
},
"total_likes": 10,
"total_views": 100,
"total_comments": 5,
"is_favorite": false,
"min_price_of_options": 1000.0,
"max_price_of_options": 2000.0,
"was_liked_by_me": false
}
}