diff --git a/docs/cqrs/authorization/index.md b/docs/cqrs/authorization/index.md index a1fe4e96..fe8e3498 100644 --- a/docs/cqrs/authorization/index.md +++ b/docs/cqrs/authorization/index.md @@ -202,7 +202,8 @@ All [queries], [commands] and [operations] can (and should!) be behind authoriza } ``` -> **Tip:** You can implement your own authorization and use it with LeanCode CoreLibrary authorizers. To see how you can implement authorization using Ory Kratos and LeanCode CoreLibrary see [here](../../external_integrations/authorization_ory_kratos/index.md). +!!! tip + You can implement your own authorization and use it with LeanCode CoreLibrary authorizers. To see how you can implement authorization using Ory Kratos and LeanCode CoreLibrary see [here](../../external_integrations/authorization_ory_kratos/index.md). [query]: ../query/index.md [command]: ../command/index.md diff --git a/docs/cqrs/command/index.md b/docs/cqrs/command/index.md index e3a2dab5..bc4bbb2b 100644 --- a/docs/cqrs/command/index.md +++ b/docs/cqrs/command/index.md @@ -32,7 +32,8 @@ public class UpdateProjectName : ICommand, IProjectRelated } ``` -> **Tip:** More on authorization and permissions can be found [here](../authorization/index.md) and on error codes and validation [here](../validation/index.md). +!!! tip + More on authorization and permissions can be found [here](../authorization/index.md) and on error codes and validation [here](../validation/index.md). ## Naming conventions @@ -78,7 +79,8 @@ public class UpdateProjectNameCH : ICommandHandler } ``` -> **Tip:** More on ids can be found [here](../../domain/id/index.md) and on validation [here](../validation/index.md). +!!! tip + More on ids can be found [here](../../domain/id/index.md) and on validation [here](../validation/index.md). As you can see, the command handler is really simple - it just finds project with specified `ProjectId` and updates it's name. That does not mean this is the only responsibility of the handlers (it's just an example), but there are some guidelines related to them: diff --git a/docs/cqrs/index.md b/docs/cqrs/index.md index 0b61f227..fda411d2 100644 --- a/docs/cqrs/index.md +++ b/docs/cqrs/index.md @@ -13,7 +13,8 @@ The strict separation of [command] and [query] has sometimes led to awkwardness - **Validation on the write side:** With CQRS, the write side typically handles commands that change the state of the system. This is where validation of incoming data and business rules can be enforced. By centralizing validation logic on the write side, you ensure that all changes to the system go through a consistent validation process. - **Flexibility in storage and models:** CQRS allows to use different data storage mechanisms for the read and write sides. For example, you might use a relational database for the write side and a NoSQL database for the read side. This flexibility enables you to choose the right tool for each job. -> **Tip:** You can find more about how CQRS allows us generate API contracts for clients [ContractsGenerator documentation](https://github.com/leancodepl/contractsgenerator/blob/main/docs/index.md). +!!! tip + You can find more about how CQRS allows us generate API contracts for clients [ContractsGenerator documentation](https://github.com/leancodepl/contractsgenerator/blob/main/docs/index.md). [query]: ./query/index.md [command]: ./command/index.md diff --git a/docs/cqrs/pipeline/avoid_commiting_transactions_in_handlers.md b/docs/cqrs/pipeline/avoid_commiting_transactions_in_handlers.md index c7cbbd78..1d76427d 100644 --- a/docs/cqrs/pipeline/avoid_commiting_transactions_in_handlers.md +++ b/docs/cqrs/pipeline/avoid_commiting_transactions_in_handlers.md @@ -1,8 +1,10 @@ # Avoid committing transactions in handlers -> **Tip:** Before delving into this section, it's highly recommended to explore the [CQRS], [Domain] and [MassTransit] sections. +!!! tip + Before delving into this section, it's highly recommended to explore the [CQRS], [Domain] and [MassTransit] sections. -**⚠️ Directly commiting transactions in [command]/[operation] handlers poses a challenge, potentially causing inconsistencies between [events] and the associated entities.** +!!! warning + Directly commiting transactions in [command]/[operation] handlers poses a challenge, potentially causing inconsistencies between [events] and the associated entities. Let's consider following pipeline configuration: @@ -124,7 +126,8 @@ In our scenario, if the database fails after successfully saving changes to the Conversely, removing `SaveChangesAsync` from the [command] handler would result in both messages and project changes being committed in a single transaction. In the event of a database failure, neither project changes nor messages would be saved or sent, providing clients with information about the request failure without unintended side effects. This is why it's not recommended to not commit transactions directly in [command]/[operation] handlers. -> **Tip:** To read more about LeanCode Corelibrary MassTransit integtation visit [here](../../external_integrations/messaging_masstransit/index.md). +!!! tip + To read more about LeanCode Corelibrary MassTransit integtation visit [here](../../external_integrations/messaging_masstransit/index.md). [CQRS]: ../index.md [Domain]: ../../domain/index.md diff --git a/docs/cqrs/validation/index.md b/docs/cqrs/validation/index.md index 1614b45b..79512228 100644 --- a/docs/cqrs/validation/index.md +++ b/docs/cqrs/validation/index.md @@ -93,7 +93,8 @@ public class UpdateProjectNameCV : AbstractValidator } ``` -> **Tip:** More on ids can be found [here](../../domain/id/index.md). +!!! tip + More on ids can be found [here](../../domain/id/index.md). [commands]: ../command/index.md [command]: ../command/index.md diff --git a/docs/domain/aggregate/index.md b/docs/domain/aggregate/index.md index c41c55dc..d2da3950 100644 --- a/docs/domain/aggregate/index.md +++ b/docs/domain/aggregate/index.md @@ -139,6 +139,7 @@ public class Project : IAggregateRoot } ``` -> **Tip:** To see `Assignment` class implementation visit [here](../identifiable/index.md). +!!! tip + To see `Assignment` class implementation visit [here](../identifiable/index.md). Notice that these added methods can and will throw an exception if a project does not contain any assignment with provided Id. This is an excepted behavior - checks for respecting domain logic should be performed in respective command (or operations) validators. diff --git a/docs/domain/domain_event/index.md b/docs/domain/domain_event/index.md index 165d26e1..ebd92020 100644 --- a/docs/domain/domain_event/index.md +++ b/docs/domain/domain_event/index.md @@ -72,4 +72,5 @@ Ensure that `EmployeeAssignedToAssignment` implements the `IDomainEvent` interfa After being raised, the event can be handled by the matching `IConsumer` to perform wanted action. -> **Tip:** To read how to handle domain events, visit [here](../../external_integrations/messaging_masstransit/handling_events.md). +!!! tip + To read how to handle domain events, visit [here](../../external_integrations/messaging_masstransit/handling_events.md). diff --git a/docs/domain/time_provider/index.md b/docs/domain/time_provider/index.md index 1ec924e1..f7234192 100644 --- a/docs/domain/time_provider/index.md +++ b/docs/domain/time_provider/index.md @@ -38,4 +38,5 @@ public class Project : IAggregateRoot } ``` -> **Tip:** Employing a single instance of `LeanCode.TimeProvider.Time` throughout the domain enables convenient manipulation of time for testing purposes. Further information about this can be found [here](../../tests/faking_time/index.md). +!!! tip + Employing a single instance of `LeanCode.TimeProvider.Time` throughout the domain enables convenient manipulation of time for testing purposes. Further information about this can be found [here](../../tests/faking_time/index.md). diff --git a/docs/external_integrations/authorization_ory_kratos/index.md b/docs/external_integrations/authorization_ory_kratos/index.md index fdb2146f..5407529a 100644 --- a/docs/external_integrations/authorization_ory_kratos/index.md +++ b/docs/external_integrations/authorization_ory_kratos/index.md @@ -24,7 +24,8 @@ LeanCode CoreLibrary provides 3 main components to integrate with Kratos: Ory Kratos can be either hosted on [Ory Network](https://www.ory.sh/network/) or be self-hosted. -> **Tip:** To see quickstart about how you can run self-hosted Kratos instance visit [here](https://www.ory.sh/docs/kratos/quickstart). +!!! tip + To see quickstart about how you can run self-hosted Kratos instance visit [here](https://www.ory.sh/docs/kratos/quickstart). ## Configuration diff --git a/docs/external_integrations/logging_serilog/index.md b/docs/external_integrations/logging_serilog/index.md index ccd181b0..e322254b 100644 --- a/docs/external_integrations/logging_serilog/index.md +++ b/docs/external_integrations/logging_serilog/index.md @@ -37,7 +37,8 @@ public class Program } ``` -> **Tip:** If you rely on `appsettings.json` for your configuration or intend to use different configurations within your `Program.cs`, you can simply invoke `ConfigureDefaultLogging` on your `IHostBuilder`. +!!! tip + If you rely on `appsettings.json` for your configuration or intend to use different configurations within your `Program.cs`, you can simply invoke `ConfigureDefaultLogging` on your `IHostBuilder`. Once configured, leverage Serilog for logging purposes in your application: diff --git a/docs/external_integrations/messaging_masstransit/handling_events.md b/docs/external_integrations/messaging_masstransit/handling_events.md index 937fca73..1744e83d 100644 --- a/docs/external_integrations/messaging_masstransit/handling_events.md +++ b/docs/external_integrations/messaging_masstransit/handling_events.md @@ -47,4 +47,5 @@ public class SendEmailToEmployeeOnEmployeeAssignedToAssignment } ``` -> **Tip:** More about consumers can be found here: [MassTransit Consumers](https://masstransit.io/documentation/concepts/consumers). To read how you can send this email using LeanCode CoreLibrary SendGrid integration visit [here](../../external_integrations/emails_sendgrid/index.md). +!!! tip + More about consumers can be found here: [MassTransit Consumers](https://masstransit.io/documentation/concepts/consumers). To read how you can send this email using LeanCode CoreLibrary SendGrid integration visit [here](../../external_integrations/emails_sendgrid/index.md). diff --git a/docs/external_integrations/messaging_masstransit/index.md b/docs/external_integrations/messaging_masstransit/index.md index 4834de26..6b4ed20d 100644 --- a/docs/external_integrations/messaging_masstransit/index.md +++ b/docs/external_integrations/messaging_masstransit/index.md @@ -18,7 +18,8 @@ To integrate [MassTransit] with LeanCode CoreLibrary CQRS, you can utilize the [ 1. `CommitDatabaseTransactionMiddleware` (call [CommitTransaction]) 2. `EventsPublisherMiddleware` (call [PublishEvents]) -> **Tip:** To find you more how you can configure pipeline visit [here](../../cqrs/pipeline/index.md). +!!! tip + To find you more how you can configure pipeline visit [here](../../cqrs/pipeline/index.md). For setting up bus configuration, [AddMassTransitIntegration] must be used. This method registers all the essential services required for [MassTransit] to work seamlessly with the rest of CoreLibrary. It effectively invokes [AddMassTransit], allowing you to consult the [MassTransit documentation](https://masstransit.io/documentation/concepts) for further insights. diff --git a/docs/external_integrations/observability_open_telemetry/index.md b/docs/external_integrations/observability_open_telemetry/index.md index 24261dcb..0d0be0d7 100644 --- a/docs/external_integrations/observability_open_telemetry/index.md +++ b/docs/external_integrations/observability_open_telemetry/index.md @@ -107,4 +107,5 @@ To enable CQRS traces in your application, it's necessary to use the `CQRSTrace( } ``` -> **Tip:** To learn more about configuring the pipeline, visit [here](../../cqrs/pipeline/index.md). +!!! tip + To learn more about configuring the pipeline, visit [here](../../cqrs/pipeline/index.md). diff --git a/docs/external_integrations/push_notifications_fcm/index.md b/docs/external_integrations/push_notifications_fcm/index.md index 6f40be7b..8ee229e1 100644 --- a/docs/external_integrations/push_notifications_fcm/index.md +++ b/docs/external_integrations/push_notifications_fcm/index.md @@ -51,7 +51,8 @@ public override void ConfigureServices(IServiceCollection services) } ``` -> **Tip:** Further details about localization can be found [here](../../features/localization/index.md). +!!! tip + Further details about localization can be found [here](../../features/localization/index.md). Following the above configuration, it is necessary to incorporate a `DbSet` for the push notification token store. This can be accomplished through `CoreDbContext`, utilizing `Microsoft.EntityFrameworkCore`. diff --git a/docs/features/audit_logs/index.md b/docs/features/audit_logs/index.md index 6287c4fc..b258fca5 100644 --- a/docs/features/audit_logs/index.md +++ b/docs/features/audit_logs/index.md @@ -114,7 +114,8 @@ protected override void ConfigureApp(IApplicationBuilder app) `UseAuthentication` and `UseIdentityTraceAttributes` method calls are optional and used to enrich audit logs with `ActorId`. -⚠️ Bear in mind, that the order here makes difference. If you don't want to collect changes in the MT inbox/outbox tables, then you should configure `Audit()` middleware **after** the `PublishEvents()` middleware. +!!! warning + Bear in mind, that the order here makes difference. If you don't want to collect changes in the MT inbox/outbox tables, then you should configure `Audit()` middleware **after** the `PublishEvents()` middleware. ### 4. Consumers @@ -137,7 +138,8 @@ protected override void ConfigureConsumer( } ``` -⚠️ Bear in mind, that the order here makes difference. If you don't want to collect changes in the MT inbox/outbox tables, then you should configure `UseAuditLogs(context)` filter **after** the `UseDomainEventsPublishing(context)` filter. +!!! warning + Bear in mind, that the order here makes difference. If you don't want to collect changes in the MT inbox/outbox tables, then you should configure `UseAuditLogs(context)` filter **after** the `UseDomainEventsPublishing(context)` filter. ## Other options @@ -147,7 +149,8 @@ If you want to use some other store for your data feel free to implement `IAudit When configuring cloud resources in cloud you should remember about the right to be forgotten and costs of storing the data based on the access tiers. Below you can find a terraform snippet that configures automatic tier changes and deletion based on the last blob modification time. -⚠️ Bear in mind that the values provided below may not be valid for your use case. +!!! warning + Bear in mind that the values provided below may not be valid for your use case. ```terraform resource "azurerm_storage_management_policy" "decrease_access_tier" {