mirror of
https://github.com/bitwarden/server.git
synced 2025-05-28 23:04:50 -05:00
cycle takes parameters
This commit is contained in:
parent
8bcd4e0463
commit
be5f388fa1
@ -9,7 +9,7 @@ namespace Bit.Core.Models.StaticStore
|
||||
public short MaxUsers { get; set; }
|
||||
public decimal Price { get; set; }
|
||||
public TimeSpan? Trial { get; set; }
|
||||
public Func<TimeSpan> Cycle { get; set; }
|
||||
public Func<DateTime, TimeSpan> Cycle { get; set; }
|
||||
public bool Disabled { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ namespace Bit.Core.Services
|
||||
}
|
||||
else if(plan.Cycle != null)
|
||||
{
|
||||
organization.PlanRenewalDate = DateTime.UtcNow.Add(plan.Cycle());
|
||||
organization.PlanRenewalDate = DateTime.UtcNow.Add(plan.Cycle(DateTime.UtcNow));
|
||||
}
|
||||
|
||||
await _organizationRepository.CreateAsync(organization);
|
||||
|
@ -103,10 +103,7 @@ namespace Bit.Core.Utilities
|
||||
MaxUsers = 5,
|
||||
Price = 1,
|
||||
Trial = new TimeSpan(14, 0, 0, 0),
|
||||
Cycle = () => {
|
||||
var now = DateTime.Now;
|
||||
return now.AddYears(1) - now;
|
||||
}
|
||||
Cycle = now => now.AddYears(1) - now
|
||||
},
|
||||
new Plan
|
||||
{
|
||||
@ -114,10 +111,7 @@ namespace Bit.Core.Utilities
|
||||
MaxUsers = 5,
|
||||
Price = 10,
|
||||
Trial = new TimeSpan(14, 0, 0, 0),
|
||||
Cycle = () => {
|
||||
var now = DateTime.Now;
|
||||
return now.AddMonths(1) - now;
|
||||
}
|
||||
Cycle = now => now.AddMonths(1) - now
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user