1
0
mirror of https://github.com/bitwarden/server synced 2025-12-17 16:53:23 +00:00

Use a header to track seeded data. This has benefits client side in simplicity and allows us to track entities added during a test, as long as they include the play id header.

This commit is contained in:
Matt Gibson
2025-11-10 18:17:41 -08:00
parent 0b22af53da
commit f2116734a2
20 changed files with 125 additions and 148 deletions

View File

@@ -1,5 +1,4 @@
using System.Text.Json;
using Bit.Infrastructure.EntityFramework.Models;
using Bit.SeederApi.Models.Response;
namespace Bit.SeederApi.Services;
@@ -14,14 +13,14 @@ public interface ISceneService
/// <returns>A tuple containing the result and optional seed ID for tracked entities</returns>
/// <exception cref="SceneNotFoundException">Thrown when the scene template is not found</exception>
/// <exception cref="SceneExecutionException">Thrown when there's an error executing the scene</exception>
SceneResponseModel ExecuteScene(string templateName, JsonElement? arguments);
Task<SceneResponseModel> ExecuteScene(string templateName, JsonElement? arguments);
/// <summary>
/// Destroys data created by a scene using the seeded data ID.
/// </summary>
/// <param name="seedId">The ID of the seeded data to destroy</param>
/// <param name="playId">The ID of the seeded data to destroy</param>
/// <returns>The result of the destroy operation</returns>
/// <exception cref="SceneExecutionException">Thrown when there's an error destroying the seeded data</exception>
Task<object?> DestroyScene(Guid seedId);
List<SeededData> GetAllSeededData();
Task<object?> DestroyScene(string playId);
List<string> GetAllPlayIds();
}