Skip to content

Commit af914b7

Browse files
authored
Merge pull request #1 from synboxdev/Development
Project
2 parents 9cd6b4f + 651b956 commit af914b7

File tree

147 files changed

+7165
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+7165
-1
lines changed

CODE_OF_CONDUCT.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, caste, color, religion, or sexual
10+
identity and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the overall
26+
community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or advances of
31+
any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email address,
35+
without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement.
63+
All complaints will be reviewed and investigated promptly and fairly.
64+
65+
All community leaders are obligated to respect the privacy and security of the
66+
reporter of any incident.
67+
68+
## Enforcement Guidelines
69+
70+
Community leaders will follow these Community Impact Guidelines in determining
71+
the consequences for any action they deem in violation of this Code of Conduct:
72+
73+
### 1. Correction
74+
75+
**Community Impact**: Use of inappropriate language or other behavior deemed
76+
unprofessional or unwelcome in the community.
77+
78+
**Consequence**: A private, written warning from community leaders, providing
79+
clarity around the nature of the violation and an explanation of why the
80+
behavior was inappropriate. A public apology may be requested.
81+
82+
### 2. Warning
83+
84+
**Community Impact**: A violation through a single incident or series of
85+
actions.
86+
87+
**Consequence**: A warning with consequences for continued behavior. No
88+
interaction with the people involved, including unsolicited interaction with
89+
those enforcing the Code of Conduct, for a specified period of time. This
90+
includes avoiding interactions in community spaces as well as external channels
91+
like social media. Violating these terms may lead to a temporary or permanent
92+
ban.
93+
94+
### 3. Temporary Ban
95+
96+
**Community Impact**: A serious violation of community standards, including
97+
sustained inappropriate behavior.
98+
99+
**Consequence**: A temporary ban from any sort of interaction or public
100+
communication with the community for a specified period of time. No public or
101+
private interaction with the people involved, including unsolicited interaction
102+
with those enforcing the Code of Conduct, is allowed during this period.
103+
Violating these terms may lead to a permanent ban.
104+
105+
### 4. Permanent Ban
106+
107+
**Community Impact**: Demonstrating a pattern of violation of community
108+
standards, including sustained inappropriate behavior, harassment of an
109+
individual, or aggression toward or disparagement of classes of individuals.
110+
111+
**Consequence**: A permanent ban from any sort of public interaction within the
112+
community.
113+
114+
## Attribution
115+
116+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
117+
version 2.1, available at
118+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
119+
120+
Community Impact Guidelines were inspired by
121+
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
122+
123+
For answers to common questions about this code of conduct, see the FAQ at
124+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
125+
[https://www.contributor-covenant.org/translations][translations].
126+
127+
[homepage]: https://www.contributor-covenant.org
128+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
129+
[Mozilla CoC]: https://github.com/mozilla/diversity
130+
[FAQ]: https://www.contributor-covenant.org/faq
131+
[translations]: https://www.contributor-covenant.org/translations

CONTRIBUTING.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Contributing to 'Collection of coding exercises'
2+
3+
First and foremost, I appreciate you being interested enough in this project to even consider contributing to it as a whole. The following contents of the document lay out the basic rules and guidelines about contributing to the project. That being said, by no means these are laws set in stone - follow your best judgment, and feel free to propose changes to this document, or the project itself. Any and all positive contributions are always welcome, including features, issues, documentation, guides, and more.
4+
5+
---
6+
7+
## 📄 Table of contents
8+
9+
* [Code of Conduct](#code-of-conduct)
10+
* [GitHub Terms of Service](#github-terms-of-service)
11+
* [Guidelines of contribution](#guidelines-of-contribution)
12+
* [Code conventions](#code-conventions)
13+
* [Issues](#issues)
14+
* [How to contribute](#how-to-contribute)
15+
16+
---
17+
18+
## Code of Conduct
19+
This project and everyone participating in it are governed by the [Code of Conduct](CODE_OF_CONDUCT.md). By participating and contributing the the project and its contents, you are expected to uphold this code.
20+
21+
---
22+
23+
## Github Terms of Service
24+
If it wasn't already clear - you should always follow [GitHub's terms of service](https://docs.github.com/en/site-policy/github-terms/github-terms-of-service) not only when contributing to this project, but to any and all repositories on the platform - follow the rules
25+
26+
---
27+
28+
## Guidelines of contribution
29+
30+
## Code conventions
31+
In order for the project to remain well-built and structured you should align with stylistic of the code in the repo already. Good place to start would be following [Microsoft C# Coding Conventions](https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/coding-conventions).
32+
33+
---
34+
35+
## Issues
36+
I'd consider [GitHub Issues](https://docs.github.com/en/issues/tracking-your-work-with-issues/about-issues) as a standardized and widely accepted way of contributing to the project and its contents. It covers everything from feature requests, bugs, suggestions to questions. If you wish to read further, GitHub documentation on [Creating an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/creating-an-issue) has got you covered. As a general rule of thumb, here's a few bullet-points I'd like you to follow, when creating an issues, regardless of its type:
37+
* Title of the issues should be clear, concise and descriptive.
38+
* Utilize existing [labels](https://docs.github.com/en/issues/using-labels-and-milestones-to-track-work/managing-labels) for your issues to be more informative. If you believe an additional label should be added - create an issue with a default label 'enhancement', where you'd explain what that new label should be, as well as provide reasoning as to why it should be added to the project.
39+
* Provide an informative, comprehensive description of the bug, suggested feature or an enhancement that you believe should be changed/added or improved in the project.
40+
* Feel free to provide pictures, flowcharts or any other forms of visual representation of the suggestion or a problem. Make it easy for others to understand you, and get on the same page.
41+
42+
---
43+
44+
## How to contribute
45+
1. Clone the repository and make a new branch. [README.md Getting started](README.md) section might be a good starting point.
46+
2. Make any and all changes to your branch. Whatever that might be - a bugfix, a feature or a documentation change.
47+
3. Do NOT clump together multiple things into the same branch - a single branch should cover a single thing.
48+
4. Make sure all projects build successfully and pass all the unit tests.
49+
5. [Create a pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) with understandable, short and concise description of changes.

Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Base stage
2+
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
3+
WORKDIR /app
4+
EXPOSE 8080
5+
EXPOSE 8081
6+
7+
# Build stage
8+
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
9+
ARG BUILD_CONFIGURATION=Release
10+
WORKDIR /src
11+
COPY ["Hestia.Api/Hestia.Api.csproj", "Hestia.Api/"]
12+
RUN dotnet restore "Hestia.Api/Hestia.Api.csproj"
13+
COPY . .
14+
WORKDIR "/src/Hestia.Api"
15+
RUN dotnet build "Hestia.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build
16+
17+
# Publish stage
18+
FROM build AS publish
19+
ARG BUILD_CONFIGURATION=Release
20+
RUN dotnet publish "Hestia.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
21+
22+
# Final stage
23+
FROM base AS final
24+
WORKDIR /app
25+
COPY --from=publish /app/publish .
26+
EXPOSE 80
27+
EXPOSE 443
28+
ENTRYPOINT ["dotnet", "Hestia.Api.dll"]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace Hestia.Access.Entities.Authentication;
2+
3+
public class TokenLog(Guid id) : BaseEntity(id)
4+
{
5+
public required string IdentityUserId { get; set; } = null!;
6+
public required DateTime DateCreated { get; set; }
7+
public required DateTime TokenExpirationDate { get; set; }
8+
public required string Token { get; set; } = null!;
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using System.ComponentModel.DataAnnotations;
2+
3+
namespace Hestia.Access.Entities;
4+
5+
public abstract class BaseEntity(Guid id)
6+
{
7+
[Key]
8+
public Guid Id { get; private set; } = id;
9+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace Hestia.Access.Entities.Product;
2+
3+
public class Product(Guid id) : BaseEntity(id)
4+
{
5+
public required string ExternalId { get; set; } = null!;
6+
public required string UserId { get; set; } = null!;
7+
public required DateTime DateCreated { get; set; }
8+
public required string Name { get; set; } = null!;
9+
public required string Description { get; set; } = null!;
10+
public required decimal? Price { get; set; }
11+
12+
public DateTime DateEdited { get; set; }
13+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace Hestia.Access.Entities.User;
2+
3+
public class User(Guid id) : BaseEntity(id)
4+
{
5+
public required string IdentityUserId { get; set; } = null!;
6+
public required DateTime DateCreated { get; set; }
7+
public required string Name { get; set; }
8+
}

Hestia.Access/Hestia.Access.csproj

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<Nullable>enable</Nullable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="MediatR" Version="12.4.1" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<ProjectReference Include="..\Hestia.Domain\Hestia.Domain.csproj" />
15+
</ItemGroup>
16+
17+
</Project>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
using MediatR;
2+
3+
namespace Hestia.Access.Requests.Authentication.Commands.CreateTokenLog;
4+
5+
public sealed record CreateOrUpdateTokenLogCommand(string Token, string IdentityUserId, DateTime TokenExpirationDate) : IRequest<Unit>;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
using MediatR;
2+
3+
namespace Hestia.Access.Requests.Product.Commands.CreateProduct;
4+
5+
public sealed record CreateProductCommand(Entities.Product.Product Product) : IRequest<bool>;

0 commit comments

Comments
 (0)