-
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
62 changed files
with
1,585 additions
and
4 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 @@ | ||
COMPOSE_PROJECT_NAME=atm_labwork |
14 changes: 14 additions & 0 deletions
14
src/Lab5/ATM.Application.Abstractions/ATM.Application.Abstractions.csproj
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,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<RootNamespace>AutomatedTellerMachine.Abstractions</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\ATM.Application.Models\ATM.Application.Models.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
10 changes: 10 additions & 0 deletions
10
src/Lab5/ATM.Application.Abstractions/Auth/GenerateResult.cs
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,10 @@ | ||
namespace AutomatedTellerMachine.Abstractions.Auth; | ||
|
||
public abstract record GenerateResult | ||
{ | ||
private GenerateResult() { } | ||
|
||
public sealed record Success(string Token) : GenerateResult; | ||
|
||
public sealed record NotFound : GenerateResult; | ||
} |
7 changes: 7 additions & 0 deletions
7
src/Lab5/ATM.Application.Abstractions/Auth/IAuthenticationService.cs
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,7 @@ | ||
namespace AutomatedTellerMachine.Abstractions.Auth; | ||
|
||
public interface IAuthenticationService | ||
{ | ||
GenerateResult Generate(long id, string hashedPin); | ||
ValidationResult Validate(long id, string token); | ||
} |
12 changes: 12 additions & 0 deletions
12
src/Lab5/ATM.Application.Abstractions/Auth/ValidationResult.cs
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,12 @@ | ||
namespace AutomatedTellerMachine.Abstractions.Auth; | ||
|
||
public abstract record ValidationResult | ||
{ | ||
private ValidationResult() { } | ||
|
||
public sealed record Success : ValidationResult; | ||
|
||
public sealed record TimedOut : ValidationResult; | ||
|
||
public sealed record NotFound : ValidationResult; | ||
} |
12 changes: 12 additions & 0 deletions
12
src/Lab5/ATM.Application.Abstractions/Repositories/IAccountRepository.cs
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,12 @@ | ||
using AutomatedTellerMachine.Models; | ||
|
||
namespace AutomatedTellerMachine.Abstractions.Repositories; | ||
|
||
public interface IAccountRepository | ||
{ | ||
Account CreateAccount(string hashedPin); | ||
double GetBalanceByAccountId(long id); | ||
|
||
void Debit(long id, double amount); | ||
void Credit(long id, double amount); | ||
} |
9 changes: 9 additions & 0 deletions
9
src/Lab5/ATM.Application.Abstractions/Repositories/IOperationsRepository.cs
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,9 @@ | ||
using AutomatedTellerMachine.Models; | ||
|
||
namespace AutomatedTellerMachine.Abstractions.Repositories; | ||
|
||
public interface IOperationsRepository | ||
{ | ||
IEnumerable<Operation> GetOperationsByAccount(long id); | ||
void AddOperation(long id, double amount); | ||
} |
6 changes: 6 additions & 0 deletions
6
src/Lab5/ATM.Application.Abstractions/Repositories/IPinRepository.cs
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,6 @@ | ||
namespace AutomatedTellerMachine.Abstractions.Repositories; | ||
|
||
public interface IPinRepository | ||
{ | ||
string GetPinHashByAccountId(long id); | ||
} |
14 changes: 14 additions & 0 deletions
14
src/Lab5/ATM.Application.Contracts/ATM.Application.Contracts.csproj
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,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<RootNamespace>AutomatedTellerMachine.Contracts</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\ATM.Application.Models\ATM.Application.Models.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
16 changes: 16 additions & 0 deletions
16
src/Lab5/ATM.Application.Contracts/Accounts/IAccountService.cs
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,16 @@ | ||
using AutomatedTellerMachine.Models; | ||
|
||
namespace AutomatedTellerMachine.Contracts.Accounts; | ||
|
||
public interface IAccountService | ||
{ | ||
LoginResult Login(long id, string hashedPin); | ||
|
||
double GetBalance(long id, string token); | ||
|
||
OperationResult Credit(double amount, long id, string token); | ||
OperationResult Debit(double amount, long id, string token); | ||
|
||
IEnumerable<Operation> GetOperations(long id, string token); | ||
long Create(string hashedPin); | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Lab5/ATM.Application.Contracts/Accounts/LoginResult.cs
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,10 @@ | ||
namespace AutomatedTellerMachine.Contracts.Accounts; | ||
|
||
public abstract record LoginResult | ||
{ | ||
private LoginResult() { } | ||
|
||
public sealed record Success(string Token) : LoginResult; | ||
|
||
public sealed record NotFound : LoginResult; | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Lab5/ATM.Application.Contracts/Accounts/OperationResult.cs
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,10 @@ | ||
namespace AutomatedTellerMachine.Contracts.Accounts; | ||
|
||
public abstract record OperationResult | ||
{ | ||
private OperationResult() { } | ||
|
||
public sealed record Success : OperationResult; | ||
|
||
public sealed record Failure : OperationResult; | ||
} |
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,8 @@ | ||
using AutomatedTellerMachine.Contracts.Accounts; | ||
|
||
namespace AutomatedTellerMachine.Contracts.Admin; | ||
|
||
public interface IAdminService | ||
{ | ||
LoginResult AdminLogin(string hashPass); | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Lab5/ATM.Application.Models/ATM.Application.Models.csproj
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,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<RootNamespace>AutomatedTellerMachine.Models</RootNamespace> | ||
</PropertyGroup> | ||
|
||
</Project> |
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,3 @@ | ||
namespace AutomatedTellerMachine.Models; | ||
|
||
public record Account(long Id); |
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,3 @@ | ||
namespace AutomatedTellerMachine.Models; | ||
|
||
public record Operation(long Id, double Amount); |
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,19 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<RootNamespace>AutomatedTellerMachine.Application</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\ATM.Application.Abstractions\ATM.Application.Abstractions.csproj" /> | ||
<ProjectReference Include="..\ATM.Application.Contracts\ATM.Application.Contracts.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.