Browse Source

Remove campaign test images and add new two images and change the name campaign seed

pull/223/head
Christian Arenas 7 years ago
parent
commit
a146fd3239
8 changed files with 9 additions and 7 deletions
  1. +3
    -1
      src/Services/Marketing/Marketing.API/Controllers/CampaignsController.cs
  2. +6
    -6
      src/Services/Marketing/Marketing.API/Infrastructure/MarketingContextSeed.cs
  3. BIN
      src/Services/Marketing/Marketing.API/Pics/1.png
  4. BIN
      src/Services/Marketing/Marketing.API/Pics/2.png
  5. BIN
      src/Services/Marketing/Marketing.API/Pics/3.png
  6. BIN
      src/Services/Marketing/Marketing.API/Pics/4.png
  7. BIN
      src/Services/Marketing/Marketing.API/Pics/5.png
  8. BIN
      src/Services/Marketing/Marketing.API/Pics/6.png

+ 3
- 1
src/Services/Marketing/Marketing.API/Controllers/CampaignsController.cs View File

@ -141,7 +141,9 @@
var userCampaignList = await _context.Rules
.OfType<UserLocationRule>()
.Include(c => c.Campaign)
.Where(c => c.LocationId == userLocation.LocationId)
.Where(c => c.Campaign.From >= DateTime.Now
&& c.Campaign.To <= DateTime.Now
&& c.LocationId == userLocation.LocationId)
.Select(c => c.Campaign)
.ToListAsync();


+ 6
- 6
src/Services/Marketing/Marketing.API/Infrastructure/MarketingContextSeed.cs View File

@ -33,7 +33,7 @@
{
new Campaign
{
Name = "Campaign Name 1",
Name = ".NET Bot Black Hoodie 50% OFF",
Description = "Campaign Description 1",
From = DateTime.Now,
To = DateTime.Now.AddDays(7),
@ -42,24 +42,24 @@
{
new UserLocationRule
{
Description = "UserLocationRule1",
Description = "Campaign is only for United States users.",
LocationId = 1
}
}
},
new Campaign
{
Name = "Campaign Name 2",
Name = "Roslyn Red T-Shirt 3x2",
Description = "Campaign Description 2",
From = DateTime.Now.AddDays(7),
From = DateTime.Now.AddDays(-7),
To = DateTime.Now.AddDays(14),
PictureUri = "http://externalcatalogbaseurltobereplaced/api/v1/campaigns/2/pic",
Rules = new List<Rule>
{
new UserLocationRule
{
Description = "UserLocationRule2",
LocationId = 6
Description = "Campaign is only for Seattle users.",
LocationId = 3
}
}
}


BIN
src/Services/Marketing/Marketing.API/Pics/1.png View File

Before After
Width: 256  |  Height: 180  |  Size: 631 B Width: 370  |  Height: 241  |  Size: 136 KiB

BIN
src/Services/Marketing/Marketing.API/Pics/2.png View File

Before After
Width: 256  |  Height: 180  |  Size: 1.6 KiB Width: 372  |  Height: 243  |  Size: 166 KiB

BIN
src/Services/Marketing/Marketing.API/Pics/3.png View File

Before After
Width: 256  |  Height: 180  |  Size: 2.0 KiB

BIN
src/Services/Marketing/Marketing.API/Pics/4.png View File

Before After
Width: 256  |  Height: 180  |  Size: 1.3 KiB

BIN
src/Services/Marketing/Marketing.API/Pics/5.png View File

Before After
Width: 256  |  Height: 180  |  Size: 1.6 KiB

BIN
src/Services/Marketing/Marketing.API/Pics/6.png View File

Before After
Width: 256  |  Height: 180  |  Size: 2.2 KiB

Loading…
Cancel
Save