Dirt/pm 33527/multi delete task types#7910
Conversation
| foreach (var deleteTaskType in deleteTaskTypes) | ||
| { | ||
| var deleteTask = new Dirt.Models.OrganizationDeleteTask | ||
| { | ||
| OrganizationId = organization.Id, | ||
| TaskType = deleteTaskType, | ||
| CreationDate = creationDate, | ||
| RevisionDate = creationDate, | ||
| }; | ||
| deleteTask.SetNewId(); | ||
| await dbContext.OrganizationDeleteTasks.AddAsync(deleteTask); | ||
| } |
|
|
||
| namespace Bit.Infrastructure.EntityFramework.Dirt.Models; | ||
|
|
||
| public class OrganizationDeleteTask : Core.Dirt.Entities.OrganizationDeleteTask |
| @OrganizationDeleteTaskId UNIQUEIDENTIFIER = NULL, | ||
| @OrganizationDeleteTaskType TINYINT = NULL, | ||
| @OrganizationDeleteTaskCreationDate DATETIME2(7) = NULL, | ||
| @OrganizationDeleteTasks [dbo].[OrganizationDeleteTaskArray] READONLY |
There was a problem hiding this comment.
❓ Should @OrganizationDeleteTasks argument default to NULL?
@OrganizationDeleteTaskId, @OrganizationDeleteTaskType, @OrganizationDeleteTaskCreationDate arguments and usage since they are replaced by @OrganizationDeleteTasks
| END | ||
| GO | ||
|
|
||
| CREATE OR ALTER PROCEDURE [dbo].[Organization_DeleteById] |
There was a problem hiding this comment.
| -- Legacy single-task path. Retained so callers still running the previous server | ||
| -- version keep working during a rolling deployment; safe to remove once fully rolled. | ||
| ELSE IF @OrganizationDeleteTaskId IS NOT NULL | ||
| BEGIN |
There was a problem hiding this comment.
@OrganizationDeleteTasks replaces @OrganizationDeleteTaskId
| -- Legacy single-task path. Retained so callers still running the previous server | ||
| -- version keep working during a rolling deployment; safe to remove once fully rolled. | ||
| ELSE IF @OrganizationDeleteTaskId IS NOT NULL | ||
| BEGIN |
There was a problem hiding this comment.
@OrganizationDeleteTasks replaces @OrganizationDeleteTaskId usage
| @OrganizationDeleteTaskId UNIQUEIDENTIFIER = NULL, | ||
| @OrganizationDeleteTaskType TINYINT = NULL, | ||
| @OrganizationDeleteTaskCreationDate DATETIME2(7) = NULL | ||
| @OrganizationDeleteTaskCreationDate DATETIME2(7) = NULL, | ||
| @OrganizationDeleteTasks [dbo].[OrganizationDeleteTaskArray] READONLY |
There was a problem hiding this comment.
❓ Should @OrganizationDeleteTasks default to NULL
|
|
||
| private async Task DeleteInternalAsync(Organization organization, OrganizationDeleteTaskType? taskType) | ||
| private async Task DeleteInternalAsync(Organization organization, | ||
| IEnumerable<OrganizationDeleteTaskType> taskTypes) |
There was a problem hiding this comment.
❓ Can/do we want to keep taskTypes optional?
🎟️ Tracking
📔 Objective
📸 Screenshots