-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 204 - Blocking pages from server side (#217)
* add server proof for Invest.razor * add link block for create also * fixup * fix error * act on review * act on review * add dan's comment * Add an IApplicationLogicService --------- Co-authored-by: dangershony <[email protected]>
- Loading branch information
1 parent
e0ceac3
commit 677868b
Showing
6 changed files
with
86 additions
and
30 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using Angor.Shared.Models; | ||
using Blockcore.Networks; | ||
|
||
namespace Angor.Shared.Services | ||
{ | ||
public class ApplicationLogicService : IApplicationLogicService | ||
{ | ||
private readonly INetworkConfiguration _networkConfiguration; | ||
|
||
public ApplicationLogicService(INetworkConfiguration networkConfiguration) | ||
{ | ||
_networkConfiguration = networkConfiguration; | ||
} | ||
|
||
public bool IsInvestmentWindowOpen(ProjectInfo? project) | ||
{ | ||
if (project == null) return false; | ||
|
||
// on testnet we always allow to invest for testing purposes. | ||
if (_networkConfiguration.GetNetwork().NetworkType == NetworkType.Testnet) return true; | ||
|
||
var now = DateTime.UtcNow; | ||
|
||
if (now <= project.StartDate) return true; | ||
|
||
return false; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Angor.Shared.Models; | ||
using Blockcore.Networks; | ||
|
||
namespace Angor.Shared.Services | ||
{ | ||
public interface IApplicationLogicService | ||
{ | ||
bool IsInvestmentWindowOpen(ProjectInfo? project); | ||
} | ||
} | ||
|