Skip to content

Commit a146fd3

Browse files
committed
Remove campaign test images and add new two images and change the name campaign seed
1 parent 278083a commit a146fd3

8 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/Services/Marketing/Marketing.API/Controllers/CampaignsController.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ public async Task<IActionResult> GetCampaignsByUserId(Guid userId)
141141
var userCampaignList = await _context.Rules
142142
.OfType<UserLocationRule>()
143143
.Include(c => c.Campaign)
144-
.Where(c => c.LocationId == userLocation.LocationId)
144+
.Where(c => c.Campaign.From >= DateTime.Now
145+
&& c.Campaign.To <= DateTime.Now
146+
&& c.LocationId == userLocation.LocationId)
145147
.Select(c => c.Campaign)
146148
.ToListAsync();
147149

src/Services/Marketing/Marketing.API/Infrastructure/MarketingContextSeed.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static List<Campaign> GetPreconfiguredMarketings()
3333
{
3434
new Campaign
3535
{
36-
Name = "Campaign Name 1",
36+
Name = ".NET Bot Black Hoodie 50% OFF",
3737
Description = "Campaign Description 1",
3838
From = DateTime.Now,
3939
To = DateTime.Now.AddDays(7),
@@ -42,24 +42,24 @@ static List<Campaign> GetPreconfiguredMarketings()
4242
{
4343
new UserLocationRule
4444
{
45-
Description = "UserLocationRule1",
45+
Description = "Campaign is only for United States users.",
4646
LocationId = 1
4747
}
4848
}
4949
},
5050
new Campaign
5151
{
52-
Name = "Campaign Name 2",
52+
Name = "Roslyn Red T-Shirt 3x2",
5353
Description = "Campaign Description 2",
54-
From = DateTime.Now.AddDays(7),
54+
From = DateTime.Now.AddDays(-7),
5555
To = DateTime.Now.AddDays(14),
5656
PictureUri = "http://externalcatalogbaseurltobereplaced/api/v1/campaigns/2/pic",
5757
Rules = new List<Rule>
5858
{
5959
new UserLocationRule
6060
{
61-
Description = "UserLocationRule2",
62-
LocationId = 6
61+
Description = "Campaign is only for Seattle users.",
62+
LocationId = 3
6363
}
6464
}
6565
}
136 KB
Loading
165 KB
Loading
-2 KB
Binary file not shown.
-1.26 KB
Binary file not shown.
-1.64 KB
Binary file not shown.
-2.25 KB
Binary file not shown.

0 commit comments

Comments
 (0)