Skip to content

Commit

Permalink
Merge pull request #10 from gpproton/dev-v0.1
Browse files Browse the repository at this point in the history
Dev v0.1 merge with main
  • Loading branch information
gpproton authored Jun 5, 2023
2 parents 1bf33ab + 3add438 commit 7b07b5b
Show file tree
Hide file tree
Showing 226 changed files with 6,706 additions and 2,263 deletions.
24 changes: 24 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "7.0.2",
"commands": [
"dotnet-ef"
]
},
"run-script": {
"version": "0.5.0",
"commands": [
"r"
]
},
"microsoft.web.librarymanager.cli": {
"version": "2.1.175",
"commands": [
"libman"
]
}
}
}
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.idea
.fleet
.vscode
*.sqlite3*
StaticFiles
**/wwwroot/lib
bin
obj
secret.json
published
74 changes: 1 addition & 73 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,72 +1,5 @@
root=true

[*.{c++,cc,cpp,cppm,cxx,h,h++,hh,hpp,hxx,inl,ipp,ixx,tlh,tli}]

# Visual C++ Code Style settings

cpp_generate_documentation_comments = xml

# Visual C++ Formatting settings

cpp_indent_braces = false
cpp_indent_multi_line_relative_to = innermost_parenthesis
cpp_indent_within_parentheses = indent
cpp_indent_preserve_within_parentheses = true
cpp_indent_case_contents = true
cpp_indent_case_labels = false
cpp_indent_case_contents_when_block = false
cpp_indent_lambda_braces_when_parameter = true
cpp_indent_goto_labels = one_left
cpp_indent_preprocessor = leftmost_column
cpp_indent_access_specifiers = false
cpp_indent_namespace_contents = true
cpp_indent_preserve_comments = false
cpp_new_line_before_open_brace_namespace = ignore
cpp_new_line_before_open_brace_type = ignore
cpp_new_line_before_open_brace_function = ignore
cpp_new_line_before_open_brace_block = ignore
cpp_new_line_before_open_brace_lambda = ignore
cpp_new_line_scope_braces_on_separate_lines = false
cpp_new_line_close_brace_same_line_empty_type = false
cpp_new_line_close_brace_same_line_empty_function = false
cpp_new_line_before_catch = true
cpp_new_line_before_else = true
cpp_new_line_before_while_in_do_while = false
cpp_space_before_function_open_parenthesis = remove
cpp_space_within_parameter_list_parentheses = false
cpp_space_between_empty_parameter_list_parentheses = false
cpp_space_after_keywords_in_control_flow_statements = true
cpp_space_within_control_flow_statement_parentheses = false
cpp_space_before_lambda_open_parenthesis = false
cpp_space_within_cast_parentheses = false
cpp_space_after_cast_close_parenthesis = false
cpp_space_within_expression_parentheses = false
cpp_space_before_block_open_brace = true
cpp_space_between_empty_braces = false
cpp_space_before_initializer_list_open_brace = false
cpp_space_within_initializer_list_braces = true
cpp_space_preserve_in_initializer_list = true
cpp_space_before_open_square_bracket = false
cpp_space_within_square_brackets = false
cpp_space_before_empty_square_brackets = false
cpp_space_between_empty_square_brackets = false
cpp_space_group_square_brackets = true
cpp_space_within_lambda_brackets = false
cpp_space_between_empty_lambda_brackets = false
cpp_space_before_comma = false
cpp_space_after_comma = true
cpp_space_remove_around_member_operators = true
cpp_space_before_inheritance_colon = true
cpp_space_before_constructor_colon = true
cpp_space_remove_before_semicolon = true
cpp_space_after_semicolon = true
cpp_space_remove_around_unary_operator = true
cpp_space_around_binary_operator = insert
cpp_space_around_assignment_operator = insert
cpp_space_pointer_reference_alignment = left
cpp_space_around_ternary_operator = insert
cpp_wrap_preserve_blocks = one_liners

[*.{cs,vb,razor}]
#### Naming styles ####

Expand Down Expand Up @@ -105,11 +38,6 @@ dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
Expand Down Expand Up @@ -150,7 +78,7 @@ dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_event = false:silent
insert_final_newline = false

[*.{cs,razor}]
[*.{cs,vb,razor}]
csharp_indent_labels = one_less_than_current
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,9 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk
.idea
.config
.fleet
*.sqlite3*
StaticFiles
static-files
**/wwwroot/lib
secret.json
published
8 changes: 8 additions & 0 deletions .hintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": [
"development"
],
"hints": {
"meta-viewport": "off"
}
}
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine as base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:7.0 as build
WORKDIR /src
COPY . .
RUN dotnet restore src/Web/XClaim.Web.sln
RUN dotnet build -c Release src/Web/Server/XClaim.Web.Server.csproj

FROM build AS publish
RUN dotnet publish src/Web/Server/XClaim.Web.Server.csproj -c Release -o /app/published --self-contained

FROM base as runtime
WORKDIR /app
COPY --from=publish /app/published .
ENTRYPOINT [ "dotnet", "/app/XClaim.Web.Server.dll" ]
1 change: 1 addition & 0 deletions XClaim.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=appsettings/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=dufil/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=IBTC/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=MCPL/@EntryIndexedValue">True</s:Boolean>
Expand Down
Empty file added docker-compose.prod.yaml
Empty file.
56 changes: 56 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
version: '3.9'

volumes:
db:
service-files:

services:
service:
image: gpproton/x-claim:latest
restart: unless-stopped
depends_on:
- db
build:
context: .
dockerfile: Dockerfile
ports:
- "8000:80"
environment:
USER_SECRETS_ID: 836b9b8b-fd89-4aff-9286-809bda60998f
ROOT_URI: "http://localhost:8000"
# postgres | mysql | sqlite
DB_TYPE: postgres
DB_CONNECTION_STRING: "host=postgres_image;port=5432;database=x-claim;username=x-claim;password=x-claim"
ASPNETCORE_URLS: "https://+:443;http://+:80"
# ASPNETCORE_Kestrel__Certificates__Default__Password: dev
# ASPNETCORE_Kestrel__Certificates__Default__Path: /https/aspnetapp.pfx
volumes:
- service-files:/app/StaticFiles/
- ~/.aspnet/https:/https:ro
- ./secret.json:"/root/.microsoft/usersecrets/${USER_SECRETS_ID}/secret.json:ro"
deploy:
mode: replicated
resources:
limits:
memory: 256M
reservations:
memory: 64M

db:
image: postgres:15-alpine
restart: unless-stopped
volumes:
- db:/var/lib/postgresql/data
ports:
- "45432:5432"
environment:
POSTGRES_USER: x-claim
POSTGRES_PASSWORD: x-claim
POSTGRES_DB: x-claim
deploy:
mode: replicated
resources:
limits:
memory: 256M
reservations:
memory: 64M
15 changes: 15 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"sdk": {
"version": "7.0.*",
"rollForward": "latestPatch"
},
"scripts": {
"build": "dotnet build --configuration Debug",
"build:web": "dotnet build src/Web/Server/",
"build:app": "dotnet build src/Mobile/XClaim.Mobile.csproj",
"format": "dotnet format ./XClaim.sln",
"web": "dotnet watch --project src/Web/Server/",
"dev:blazor": "DOTNET_USE_POLLING_FILE_WATCHER=true dotnet watch --project src/Web/Client/",
"dev:web": "DOTNET_USE_POLLING_FILE_WATCHER=true dotnet r web"
}
}
3 changes: 0 additions & 3 deletions src/Common/Base/BaseEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@ namespace XClaim.Common.Base;

public abstract class BaseEntity : IBaseEntity {
[Key, Required] public Guid Id { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? ModifiedAt { get; set; }
public DateTime? DeletedAt { get; set; }
}
3 changes: 0 additions & 3 deletions src/Common/Base/IBaseEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@ namespace XClaim.Common.Base;

public interface IBaseEntity {
public Guid Id { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? ModifiedAt { get; set; }
public DateTime? DeletedAt { get; set; }
}
8 changes: 8 additions & 0 deletions src/Common/Base/ITimeEntity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace XClaim.Common.Base;

public class ITimedEntity : IBaseEntity {
public Guid Id { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime? ModifiedAt { get; set; }
public DateTime? DeletedAt { get; set; }
}
7 changes: 7 additions & 0 deletions src/Common/Base/TimedEntity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace XClaim.Common.Base;

public abstract class TimedEntity : ITimedEntity {
new public DateTime CreatedAt { get; set; }
new public DateTime? ModifiedAt { get; set; }
new public DateTime? DeletedAt { get; set; }
}
2 changes: 1 addition & 1 deletion src/Common/Dtos/AuthResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public class AuthResponse {
public string Message { get; set; } = string.Empty;
public string UserName { get; set; } = string.Empty;
public string Role { get; set; } = string.Empty;
public ProfileResponse? Data { get; set; }
public UserResponse? Data { get; set; }
}
2 changes: 2 additions & 0 deletions src/Common/Dtos/BankAccountResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ namespace XClaim.Common.Dtos;
public class BankAccountResponse : BaseResponse {
public string FullName { get; set; } = string.Empty;
public BankResponse? Bank { get; set; }
public Guid? BankId { get; set; }
public UserResponse? Owner { get; set; }
public Guid? OwnerId { get; set; }
public string Number { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
}
4 changes: 3 additions & 1 deletion src/Common/Dtos/ClaimResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ namespace XClaim.Common.Dtos;
public class ClaimResponse : BaseResponse {
public string Description { get; set; } = string.Empty;
public string Notes { get; set; } = string.Empty;
public decimal Amount { get; set; }
public decimal Amount { get; set; } = 100;
public ClaimPriority Priority { get; set; } = ClaimPriority.Normal;
public CategoryResponse? Category { get; set; }
public Guid? CategoryId { get; set; }
public CompanyResponse? Company { get; set; }
public Guid? CompanyId { get; set; }
public CurrencyResponse? Currency { get; set; }
public Guid? CurrencyId { get; set; }
public ClaimStatus Status { get; set; } = ClaimStatus.Pending;
public UserResponse? Owner { get; set; }
public UserResponse? ReviewedBy { get; set; }
Expand Down
19 changes: 19 additions & 0 deletions src/Common/Dtos/ClaimStateResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using XClaim.Common.Base;
using XClaim.Common.Enums;

namespace XClaim.Common.Dtos;

public class ClaimStateResponse : BaseResponse {
public string? Description { get; set; }
public string? Notes { get; set; }
public string? Currency { get; set; } = "$";
public decimal Amount { get; set; }
public string? Category { get; set; }
public ClaimStatus Status { get; set; }
public string? Owner { get; set; }
public Guid? OwnerId { get; set; }
public bool Approved { get; set; }
public bool Completed { get; set; }

public bool Payed { get; set; }
}
1 change: 1 addition & 0 deletions src/Common/Dtos/CurrencyResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public class CurrencyResponse : BaseResponse {
public string Name { get; set; } = string.Empty;

public string Symbol { get; set; } = string.Empty;
public string Code { get; set; } = string.Empty;
public decimal Rate { get; set; }
public string Description { get; set; } = string.Empty;
public bool Active { get; set; }
Expand Down
12 changes: 12 additions & 0 deletions src/Common/Dtos/NotificationResponse.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using XClaim.Common.Base;
using XClaim.Common.Enums;

namespace XClaim.Common.Dtos;

public class NotificationResponse : BaseResponse {
public UserResponse? Owner { get; set; }
public Guid? OwnerId { get; set; }
public bool Disabled { get; set; }
public ICollection<NotificationChannels> Channels { get; set; } = default!;
public ICollection<EventType> Types { get; set; } = default!;
}
21 changes: 9 additions & 12 deletions src/Common/Dtos/PaymentResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@ namespace XClaim.Common.Dtos;

public class PaymentResponse : BaseResponse {
public string Description { get; set; } = string.Empty;

public decimal Amount { get; set; }
public string Notes { get; set; } = string.Empty;
public UserResponse? Owner { get; set; }
public Guid? OwnerId { get; set; }
public DateTime? CompletedAt { get; set; }

public UserResponse? CompletedBy { get; set; }

public bool Completed {
get {
return CompletedAt != null;
}
}

public string Notes { get; set; } = string.Empty;
public CompanyResponse? Company { get; set; }
public Guid? CompanyId { get; set; }
public UserResponse? CreatedBy { get; set; }
public Guid? CreatedById { get; set; }
public DateTime? ConfirmedAt { get; set; }
public bool Confirmed => ConfirmedAt != null;
public int Count { get; set; }
public ICollection<ClaimResponse> Claims { get; set; } = default!;
public ICollection<FileResponse> Files { get; set; } = default!;
}
Loading

0 comments on commit 7b07b5b

Please sign in to comment.