Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for bulk updating AuthRequest database objects #4053

Merged

Commits on May 6, 2024

  1. Declare a new repository interface method

    To facilitate a new bulk device login request approval workflow in the
    admin console we need to update `IAuthRequestRepisitory` (owned by Auth
    team) to include an`UpdateManyAsync()` method. It should accept a list
    of `AuthRequest` table objects, and implementations will do a very
    simple 1:1 update of the passed in data.
    
    This commit adds an `UpdateManyAsync()` method to the
    `AuthRequestRepository` interface.
    addisonbeck committed May 6, 2024
    Configuration menu
    Copy the full SHA
    6b6ec51 View commit details
    Browse the repository at this point in the history
  2. Stub out method implementations to enable unit testing

    This commit stubs out implementations of
    `IAuthRequestRepository.UpdateManyAsync()` so the method signature can
    be called in unit tests. At this stage the methods are not implemented.
    addisonbeck committed May 6, 2024
    Configuration menu
    Copy the full SHA
    60667eb View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9f9509e View commit details
    Browse the repository at this point in the history
  4. Establish a user defined SQL type for Auth Requests

    To facilitate a bulk update operation for auth requests a new user
    defined type will need to be written that can be used as a table input
    to the stored procedure. This will follow a similar pattern to how the
    `OragnizationSponsorshipType` works and is used by the stored procedure
    `OrganizationSponsorship_UpdateMany`.
    addisonbeck committed May 6, 2024
    Configuration menu
    Copy the full SHA
    e8ff955 View commit details
    Browse the repository at this point in the history
  5. Establish a new stored procedure

    To facilitate the bulk updating of auth request table objects this
    commit adds a new stored procedure to  update a collection of entities
    on `AuthRequest` table by their primary key. It updates all properties,
    for convention, but the endpoint created later will only change the
    `Approved`, `ResponseDate`, `Key`, `MasterPasswordHash`, and
    `AuthenticationDate` properties.
    addisonbeck committed May 6, 2024
    Configuration menu
    Copy the full SHA
    0237032 View commit details
    Browse the repository at this point in the history
  6. Apply a SQL server migration script

    This commit simply applies a migration script containing the new user
    defined type and stored procedure comitted previously.
    addisonbeck committed May 6, 2024
    Configuration menu
    Copy the full SHA
    25c760d View commit details
    Browse the repository at this point in the history
  7. Enable converting an IEnumerable<AuthRequest> to a DataTable

    The current pattern in place for bulk update stored procedures is to
    pass a `DataTable` through Dapper as an input for the update stored
    procedure being run. In order to facilitate the new bulk update
    procedure for the`AuthRequest` type we need a function added that can
    convert an `IEnumerable<AuthRequest>` to a `DataTable`. This is commit
    follows the convention of having a static class with a conversion method
    in a `Helpers` folder: `AuthRequestHelpers.ToDataTable()`.
    addisonbeck committed May 6, 2024
    Configuration menu
    Copy the full SHA
    038f746 View commit details
    Browse the repository at this point in the history
  8. Implement Dapper/../AuthRequestRepository.UpdateMany()

    This commit implements `AuthRequestRepository.UpdateMany()` for the
    Dapper implementation of `AuthRequestRepository`. It connects the stored
    procedure, `DataTable` converter, and Dapper-focused unit test commits
    written previously into one exposed method that can be referenced by
    service callers.
    addisonbeck committed May 6, 2024
    Configuration menu
    Copy the full SHA
    69aad92 View commit details
    Browse the repository at this point in the history
  9. Implement EntityFramework/../AuthRequestRepository.UpdateMany()

    This commit implements the new
    `IAuthRequestRepository.UpdateManyAsync()`method in the Entity Framework
    skew of the repository layer. It checks to make sure the passed in list
    has auth requests, converts them all to an Entity Framework entity, and
    then uses `UpdateRange` to apply the whole thing over in the database
    context.
    addisonbeck committed May 6, 2024
    Configuration menu
    Copy the full SHA
    9d5b27e View commit details
    Browse the repository at this point in the history

Commits on May 13, 2024

  1. Configuration menu
    Copy the full SHA
    39c2643 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a8e53d8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cea0589 View commit details
    Browse the repository at this point in the history

Commits on May 20, 2024

  1. Configuration menu
    Copy the full SHA
    407d25a View commit details
    Browse the repository at this point in the history
  2. Fix the build

    addisonbeck committed May 20, 2024
    Configuration menu
    Copy the full SHA
    632e3fa View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    582409d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d816ce1 View commit details
    Browse the repository at this point in the history
  5. Remove extra comment

    addisonbeck committed May 20, 2024
    Configuration menu
    Copy the full SHA
    c6660d8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7f444b7 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    5034ace View commit details
    Browse the repository at this point in the history
  8. Unbreak it

    addisonbeck committed May 20, 2024
    Configuration menu
    Copy the full SHA
    6b9d2e3 View commit details
    Browse the repository at this point in the history