-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
59 changed files
with
6,776 additions
and
784 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ public static void SeedTestData(this Context context) | |
context.SeedMandates(); | ||
context.SeedDeliveries(); | ||
context.SeedAssets(); | ||
context.AuthorizeFirstUser(); | ||
context.AddOrganisationsToDefaultUsers(); | ||
|
||
transaction.Commit(); | ||
} | ||
|
@@ -187,15 +187,15 @@ public static void SeedAssets(this Context context) | |
context.SaveChanges(); | ||
} | ||
|
||
public static void AuthorizeFirstUser(this Context context) | ||
public static void AddOrganisationsToDefaultUsers(this Context context) | ||
{ | ||
var user = context.Users.OrderBy(u => u.Id).First(); | ||
var organisation = context.Organisations.OrderBy(o => o.Id).First(); | ||
var mandates = context.Mandates.OrderBy(m => m.Id).Skip(1); | ||
var admin = context.Users.Single(user => user.Email == "[email protected]"); | ||
var adminOrganisations = context.Organisations.OrderBy(o => o.Id).Skip(1); | ||
admin.Organisations.AddRange(adminOrganisations); | ||
|
||
user.IsAdmin = true; | ||
user.Organisations.Add(organisation); | ||
organisation.Mandates.AddRange(mandates); | ||
var user = context.Users.Single(user => user.Email == "[email protected]"); | ||
var userOrganistions = context.Organisations.OrderBy(o => o.Id).Take(2); | ||
user.Organisations.AddRange(userOrganistions); | ||
|
||
context.SaveChanges(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.