Compare commits
28
Commits
3065d8e27a
...
1.17.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f6d0ccaa0 | ||
|
|
275befc258 | ||
|
|
1acbc4d213 | ||
|
|
193496bbf9 | ||
|
|
8c99668fac | ||
|
|
a015801423 | ||
|
|
ad44f46204 | ||
|
|
9d64b5e76d | ||
|
|
49d999c1e3 | ||
|
|
fd6b8cd965 | ||
|
|
9ed4777a18 | ||
|
|
ff34326a53 | ||
|
|
0cf44f68cc | ||
|
|
6db6228bc9 | ||
|
|
41ed5a4288 | ||
|
|
61118c6223 | ||
|
|
bbcba5e06c | ||
|
|
bd852b30c3 | ||
|
|
502cc326dd | ||
|
|
37e2116aaf | ||
|
|
4675d4c5fc | ||
|
|
60980292a2 | ||
|
|
f80bb2fff9 | ||
|
|
df1e31cc86 | ||
|
|
6767906b0d | ||
|
|
8cb1943ac8 | ||
|
|
a344af4498 | ||
|
|
c95efd1faf |
+71
@@ -0,0 +1,71 @@
|
|||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: litecharms-nuget-libraries
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
|
image: mcr.microsoft.com/dotnet/sdk:10.0
|
||||||
|
commands:
|
||||||
|
- dotnet restore
|
||||||
|
- dotnet build -c Release --no-restore
|
||||||
|
|
||||||
|
- name: pack-and-publish
|
||||||
|
image: mcr.microsoft.com/dotnet/sdk:10.0
|
||||||
|
environment:
|
||||||
|
NEXUS_KEY: { from_secret: nexus_api_key }
|
||||||
|
NEXUS_URL: https://nexus.khongisa.co.za/repository/nuget-hosted/
|
||||||
|
VERSION: 1.${DRONE_BUILD_NUMBER}.0
|
||||||
|
commands:
|
||||||
|
# Abstractions
|
||||||
|
- dotnet pack LiteCharms.Abstractions/LiteCharms.Abstractions.csproj -c Release -p:PackageVersion=$VERSION -o dist/
|
||||||
|
- dotnet nuget push dist/LiteCharms.Abstractions.$VERSION.nupkg --api-key $NEXUS_KEY --source $NEXUS_URL
|
||||||
|
|
||||||
|
# Models
|
||||||
|
- dotnet pack LiteCharms.Models/LiteCharms.Models.csproj -c Release -p:PackageVersion=$VERSION -o dist/
|
||||||
|
- dotnet nuget push dist/LiteCharms.Models.$VERSION.nupkg --api-key $NEXUS_KEY --source $NEXUS_URL
|
||||||
|
|
||||||
|
# Infrastructure
|
||||||
|
- dotnet pack LiteCharms.Infrastructure/LiteCharms.Infrastructure.csproj -c Release -p:PackageVersion=$VERSION -o dist/
|
||||||
|
- dotnet nuget push dist/LiteCharms.Infrastructure.$VERSION.nupkg --api-key $NEXUS_KEY --source $NEXUS_URL
|
||||||
|
|
||||||
|
# Features
|
||||||
|
- dotnet pack LiteCharms.Features/LiteCharms.Features.csproj -c Release -p:PackageVersion=$VERSION -o dist/
|
||||||
|
- dotnet nuget push dist/LiteCharms.Features.$VERSION.nupkg --api-key $NEXUS_KEY --source $NEXUS_URL
|
||||||
|
|
||||||
|
# Extensions
|
||||||
|
- dotnet pack LiteCharms.Extensions/LiteCharms.Extensions.csproj -c Release -p:PackageVersion=$VERSION -o dist/
|
||||||
|
- dotnet nuget push dist/LiteCharms.Extensions.$VERSION.nupkg --api-key $NEXUS_KEY --source $NEXUS_URL
|
||||||
|
|
||||||
|
# Entities
|
||||||
|
- dotnet pack LiteCharms.Entities/LiteCharms.Entities.csproj -c Release -p:PackageVersion=$VERSION -o dist/
|
||||||
|
- dotnet nuget push dist/LiteCharms.Entities.$VERSION.nupkg --api-key $NEXUS_KEY --source $NEXUS_URL
|
||||||
|
|
||||||
|
- name: gitea-tag-release
|
||||||
|
image: alpine/git
|
||||||
|
environment:
|
||||||
|
GITEA_TOKEN: { from_secret: git_token }
|
||||||
|
GITEA_USER: { from_secret: git_username }
|
||||||
|
GITEA_PASS: { from_secret: git_password }
|
||||||
|
VERSION: 1.${DRONE_BUILD_NUMBER}.0
|
||||||
|
commands:
|
||||||
|
- apk add --no-cache curl
|
||||||
|
- git remote set-url origin https://$${GITEA_USER}:$${GITEA_PASS}@gitea.khongisa.co.za/litecharms/components.git
|
||||||
|
- git tag $VERSION
|
||||||
|
- git push origin $VERSION
|
||||||
|
- |
|
||||||
|
curl -X POST "https://gitea.khongisa.co.za/api/v1/repos/litecharms/components/releases" \
|
||||||
|
-H "Authorization: token $${GITEA_TOKEN}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{
|
||||||
|
\"tag_name\": \"$VERSION\",
|
||||||
|
\"target_commitish\": \"${DRONE_COMMIT_SHA}\",
|
||||||
|
\"name\": \"Library Suite $VERSION\",
|
||||||
|
\"body\": \"### Published NuGet Packages\nAll packages versioned as **$VERSION**:\n* LiteCharms.Abstractions\n* LiteCharms.Models\n* LiteCharms.Infrastructure\n* LiteCharms.Features\n* LiteCharms.Extensions\n* LiteCharms.Entities\n\n[View in Nexus](https://nexus.khongisa.co.za/repository/nuget-group/)\",
|
||||||
|
\"draft\": false,
|
||||||
|
\"prerelease\": false
|
||||||
|
}"
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
- pull_request
|
||||||
+248
@@ -0,0 +1,248 @@
|
|||||||
|
# Remove the line below if you want to inherit .editorconfig settings from higher directories
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# C# files
|
||||||
|
[*.cs]
|
||||||
|
|
||||||
|
#### Core EditorConfig Options ####
|
||||||
|
|
||||||
|
# Indentation and spacing
|
||||||
|
indent_size = 4
|
||||||
|
indent_style = space
|
||||||
|
tab_width = 4
|
||||||
|
|
||||||
|
# New line preferences
|
||||||
|
end_of_line = crlf
|
||||||
|
insert_final_newline = false
|
||||||
|
|
||||||
|
#### .NET Code Actions ####
|
||||||
|
|
||||||
|
# Type members
|
||||||
|
dotnet_hide_advanced_members = false
|
||||||
|
dotnet_member_insertion_location = with_other_members_of_the_same_kind
|
||||||
|
dotnet_property_generation_behavior = prefer_throwing_properties
|
||||||
|
|
||||||
|
# Symbol search
|
||||||
|
dotnet_search_reference_assemblies = true
|
||||||
|
|
||||||
|
#### .NET Coding Conventions ####
|
||||||
|
|
||||||
|
# Organize usings
|
||||||
|
dotnet_separate_import_directive_groups = false
|
||||||
|
dotnet_sort_system_directives_first = false
|
||||||
|
file_header_template = unset
|
||||||
|
|
||||||
|
# this. and Me. preferences
|
||||||
|
dotnet_style_qualification_for_event = false
|
||||||
|
dotnet_style_qualification_for_field = false
|
||||||
|
dotnet_style_qualification_for_method = false
|
||||||
|
dotnet_style_qualification_for_property = false
|
||||||
|
|
||||||
|
# Language keywords vs BCL types preferences
|
||||||
|
dotnet_style_predefined_type_for_locals_parameters_members = true
|
||||||
|
dotnet_style_predefined_type_for_member_access = true
|
||||||
|
|
||||||
|
# Parentheses preferences
|
||||||
|
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
|
||||||
|
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
|
||||||
|
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
|
||||||
|
|
||||||
|
# Modifier preferences
|
||||||
|
dotnet_style_require_accessibility_modifiers = for_non_interface_members
|
||||||
|
|
||||||
|
# Expression-level preferences
|
||||||
|
dotnet_prefer_system_hash_code = true
|
||||||
|
dotnet_style_coalesce_expression = true
|
||||||
|
dotnet_style_collection_initializer = true
|
||||||
|
dotnet_style_explicit_tuple_names = true
|
||||||
|
dotnet_style_namespace_match_folder = true
|
||||||
|
dotnet_style_null_propagation = true
|
||||||
|
dotnet_style_object_initializer = true
|
||||||
|
dotnet_style_operator_placement_when_wrapping = beginning_of_line
|
||||||
|
dotnet_style_prefer_auto_properties = true
|
||||||
|
dotnet_style_prefer_collection_expression = when_types_loosely_match
|
||||||
|
dotnet_style_prefer_compound_assignment = true
|
||||||
|
dotnet_style_prefer_conditional_expression_over_assignment = true
|
||||||
|
dotnet_style_prefer_conditional_expression_over_return = true
|
||||||
|
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed
|
||||||
|
dotnet_style_prefer_inferred_anonymous_type_member_names = true
|
||||||
|
dotnet_style_prefer_inferred_tuple_names = true
|
||||||
|
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
|
||||||
|
dotnet_style_prefer_non_hidden_explicit_cast_in_source = true
|
||||||
|
dotnet_style_prefer_simplified_boolean_expressions = true
|
||||||
|
dotnet_style_prefer_simplified_interpolation = true
|
||||||
|
|
||||||
|
# Field preferences
|
||||||
|
dotnet_style_readonly_field = true
|
||||||
|
|
||||||
|
# Parameter preferences
|
||||||
|
dotnet_code_quality_unused_parameters = all
|
||||||
|
|
||||||
|
# Suppression preferences
|
||||||
|
dotnet_remove_unnecessary_suppression_exclusions = none
|
||||||
|
|
||||||
|
# New line preferences
|
||||||
|
dotnet_style_allow_multiple_blank_lines_experimental = true
|
||||||
|
dotnet_style_allow_statement_immediately_after_block_experimental = true
|
||||||
|
|
||||||
|
#### C# Coding Conventions ####
|
||||||
|
|
||||||
|
# var preferences
|
||||||
|
csharp_style_var_elsewhere = false
|
||||||
|
csharp_style_var_for_built_in_types = false
|
||||||
|
csharp_style_var_when_type_is_apparent = false
|
||||||
|
|
||||||
|
# Expression-bodied members
|
||||||
|
csharp_style_expression_bodied_accessors = true
|
||||||
|
csharp_style_expression_bodied_constructors = false
|
||||||
|
csharp_style_expression_bodied_indexers = true
|
||||||
|
csharp_style_expression_bodied_lambdas = true
|
||||||
|
csharp_style_expression_bodied_local_functions = true
|
||||||
|
csharp_style_expression_bodied_methods = false
|
||||||
|
csharp_style_expression_bodied_operators = false
|
||||||
|
csharp_style_expression_bodied_properties = true
|
||||||
|
|
||||||
|
# Pattern matching preferences
|
||||||
|
csharp_style_pattern_matching_over_as_with_null_check = true
|
||||||
|
csharp_style_pattern_matching_over_is_with_cast_check = true
|
||||||
|
csharp_style_prefer_extended_property_pattern = true
|
||||||
|
csharp_style_prefer_not_pattern = true
|
||||||
|
csharp_style_prefer_pattern_matching = true
|
||||||
|
csharp_style_prefer_switch_expression = true
|
||||||
|
|
||||||
|
# Null-checking preferences
|
||||||
|
csharp_style_conditional_delegate_call = true
|
||||||
|
|
||||||
|
# Modifier preferences
|
||||||
|
csharp_prefer_static_anonymous_function = true
|
||||||
|
csharp_prefer_static_local_function = true
|
||||||
|
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async
|
||||||
|
csharp_style_prefer_readonly_struct = true
|
||||||
|
csharp_style_prefer_readonly_struct_member = true
|
||||||
|
|
||||||
|
# Code-block preferences
|
||||||
|
csharp_prefer_braces = true
|
||||||
|
csharp_prefer_simple_using_statement = true
|
||||||
|
csharp_prefer_system_threading_lock = true
|
||||||
|
csharp_style_namespace_declarations = block_scoped
|
||||||
|
csharp_style_prefer_method_group_conversion = true
|
||||||
|
csharp_style_prefer_primary_constructors = true
|
||||||
|
csharp_style_prefer_simple_property_accessors = true
|
||||||
|
csharp_style_prefer_top_level_statements = true
|
||||||
|
|
||||||
|
# Expression-level preferences
|
||||||
|
csharp_prefer_simple_default_expression = true
|
||||||
|
csharp_style_deconstructed_variable_declaration = true
|
||||||
|
csharp_style_implicit_object_creation_when_type_is_apparent = true
|
||||||
|
csharp_style_inlined_variable_declaration = true
|
||||||
|
csharp_style_prefer_implicitly_typed_lambda_expression = true
|
||||||
|
csharp_style_prefer_index_operator = true
|
||||||
|
csharp_style_prefer_local_over_anonymous_function = true
|
||||||
|
csharp_style_prefer_null_check_over_type_check = true
|
||||||
|
csharp_style_prefer_range_operator = true
|
||||||
|
csharp_style_prefer_tuple_swap = true
|
||||||
|
csharp_style_prefer_unbound_generic_type_in_nameof = true
|
||||||
|
csharp_style_prefer_utf8_string_literals = true
|
||||||
|
csharp_style_throw_expression = true
|
||||||
|
csharp_style_unused_value_assignment_preference = discard_variable
|
||||||
|
csharp_style_unused_value_expression_statement_preference = discard_variable
|
||||||
|
|
||||||
|
# 'using' directive preferences
|
||||||
|
csharp_using_directive_placement = outside_namespace
|
||||||
|
|
||||||
|
# New line preferences
|
||||||
|
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
|
||||||
|
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true
|
||||||
|
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true
|
||||||
|
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
|
||||||
|
csharp_style_allow_embedded_statements_on_same_line_experimental = true
|
||||||
|
|
||||||
|
#### C# Formatting Rules ####
|
||||||
|
|
||||||
|
# New line preferences
|
||||||
|
csharp_new_line_before_catch = true
|
||||||
|
csharp_new_line_before_else = true
|
||||||
|
csharp_new_line_before_finally = true
|
||||||
|
csharp_new_line_before_members_in_anonymous_types = true
|
||||||
|
csharp_new_line_before_members_in_object_initializers = true
|
||||||
|
csharp_new_line_before_open_brace = all
|
||||||
|
csharp_new_line_between_query_expression_clauses = true
|
||||||
|
|
||||||
|
# Indentation preferences
|
||||||
|
csharp_indent_block_contents = true
|
||||||
|
csharp_indent_braces = false
|
||||||
|
csharp_indent_case_contents = true
|
||||||
|
csharp_indent_case_contents_when_block = true
|
||||||
|
csharp_indent_labels = one_less_than_current
|
||||||
|
csharp_indent_switch_labels = true
|
||||||
|
|
||||||
|
# Space preferences
|
||||||
|
csharp_space_after_cast = false
|
||||||
|
csharp_space_after_colon_in_inheritance_clause = true
|
||||||
|
csharp_space_after_comma = true
|
||||||
|
csharp_space_after_dot = false
|
||||||
|
csharp_space_after_keywords_in_control_flow_statements = true
|
||||||
|
csharp_space_after_semicolon_in_for_statement = true
|
||||||
|
csharp_space_around_binary_operators = before_and_after
|
||||||
|
csharp_space_around_declaration_statements = false
|
||||||
|
csharp_space_before_colon_in_inheritance_clause = true
|
||||||
|
csharp_space_before_comma = false
|
||||||
|
csharp_space_before_dot = false
|
||||||
|
csharp_space_before_open_square_brackets = false
|
||||||
|
csharp_space_before_semicolon_in_for_statement = false
|
||||||
|
csharp_space_between_empty_square_brackets = false
|
||||||
|
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||||
|
csharp_space_between_method_call_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_method_declaration_name_and_open_parenthesis = false
|
||||||
|
csharp_space_between_method_declaration_parameter_list_parentheses = false
|
||||||
|
csharp_space_between_parentheses = false
|
||||||
|
csharp_space_between_square_brackets = false
|
||||||
|
|
||||||
|
# Wrapping preferences
|
||||||
|
csharp_preserve_single_line_blocks = true
|
||||||
|
csharp_preserve_single_line_statements = true
|
||||||
|
|
||||||
|
#### Naming styles ####
|
||||||
|
|
||||||
|
# Naming rules
|
||||||
|
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
|
||||||
|
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
|
||||||
|
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
|
||||||
|
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
|
||||||
|
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
|
||||||
|
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
|
||||||
|
|
||||||
|
# Symbol specifications
|
||||||
|
|
||||||
|
dotnet_naming_symbols.interface.applicable_kinds = interface
|
||||||
|
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.interface.required_modifiers =
|
||||||
|
|
||||||
|
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
|
||||||
|
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.types.required_modifiers =
|
||||||
|
|
||||||
|
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
|
||||||
|
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
|
||||||
|
dotnet_naming_symbols.non_field_members.required_modifiers =
|
||||||
|
|
||||||
|
# Naming styles
|
||||||
|
|
||||||
|
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.begins_with_i.required_prefix = I
|
||||||
|
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
|
||||||
@@ -4,6 +4,8 @@ public static class Constants
|
|||||||
{
|
{
|
||||||
public const int QueueBounds = 100000;
|
public const int QueueBounds = 100000;
|
||||||
|
|
||||||
|
public const string ShopSchedulerName = "shop";
|
||||||
|
|
||||||
public const string EmailServiceBus = nameof(EmailServiceBus);
|
public const string EmailServiceBus = nameof(EmailServiceBus);
|
||||||
public const string GeneralServiceBus = nameof(GeneralServiceBus);
|
public const string GeneralServiceBus = nameof(GeneralServiceBus);
|
||||||
public const string SalesServiceBus = nameof(SalesServiceBus);
|
public const string SalesServiceBus = nameof(SalesServiceBus);
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ namespace LiteCharms.Extensions;
|
|||||||
|
|
||||||
public static class Postgres
|
public static class Postgres
|
||||||
{
|
{
|
||||||
public static IServiceCollection AddLeadGeneratorDatabase(this IServiceCollection services, IConfiguration configuration)
|
public static IServiceCollection AddShopDatabase(this IServiceCollection services, IConfiguration configuration)
|
||||||
{
|
{
|
||||||
services.AddPooledDbContextFactory<LeadGeneratorDbContext>(options =>
|
services.AddPooledDbContextFactory<ShopDbContext>(options =>
|
||||||
options.UseNpgsql(configuration.GetConnectionString("PostgresLeadGenerator")));
|
options.UseNpgsql(configuration.GetConnectionString("PostgresShop")));
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ public static class Quartz
|
|||||||
{
|
{
|
||||||
private const string databaseConfigName = "PostgresScheduler";
|
private const string databaseConfigName = "PostgresScheduler";
|
||||||
|
|
||||||
public static IServiceCollection AddQuartzSchedulerClient(this IServiceCollection services, string schedulerName, string schedulerId, IConfiguration configuration)
|
public static IServiceCollection AddQuartzSchedulerClient(this IServiceCollection services, string schedulerName, IConfiguration configuration)
|
||||||
{
|
{
|
||||||
var connectionString = configuration.GetConnectionString(databaseConfigName);
|
var connectionString = configuration.GetConnectionString(databaseConfigName);
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ public static class Quartz
|
|||||||
services.AddQuartz(config =>
|
services.AddQuartz(config =>
|
||||||
{
|
{
|
||||||
config.SchedulerName = schedulerName;
|
config.SchedulerName = schedulerName;
|
||||||
config.SchedulerId = schedulerId;
|
config.SchedulerId = "AUTO";
|
||||||
|
|
||||||
config.UseSimpleTypeLoader();
|
config.UseSimpleTypeLoader();
|
||||||
config.UseDefaultThreadPool(options => options.MaxConcurrency = 0);
|
config.UseDefaultThreadPool(options => options.MaxConcurrency = 0);
|
||||||
@@ -28,7 +28,7 @@ public static class Quartz
|
|||||||
|
|
||||||
storage.UseSystemTextJsonSerializer();
|
storage.UseSystemTextJsonSerializer();
|
||||||
storage.SetProperty("quartz.jobStore.clustered", "true");
|
storage.SetProperty("quartz.jobStore.clustered", "true");
|
||||||
storage.SetProperty("quartz.jobStore.tablePrefix", "quartz_");
|
storage.SetProperty("quartz.jobStore.tablePrefix", "qrtz_");
|
||||||
|
|
||||||
storage.UsePostgres(connectionString!);
|
storage.UsePostgres(connectionString!);
|
||||||
storage.UseClustering(cluster =>
|
storage.UseClustering(cluster =>
|
||||||
@@ -42,7 +42,7 @@ public static class Quartz
|
|||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IServiceCollection AddQuartzScheduler(this IServiceCollection services, string schedulerName, string schedulerId, IConfiguration configuration)
|
public static IServiceCollection AddQuartzScheduler(this IServiceCollection services, string schedulerName, IConfiguration configuration)
|
||||||
{
|
{
|
||||||
var connectionString = configuration.GetConnectionString(databaseConfigName);
|
var connectionString = configuration.GetConnectionString(databaseConfigName);
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ public static class Quartz
|
|||||||
services.AddQuartz(config =>
|
services.AddQuartz(config =>
|
||||||
{
|
{
|
||||||
config.SchedulerName = schedulerName;
|
config.SchedulerName = schedulerName;
|
||||||
config.SchedulerId = schedulerId;
|
config.SchedulerId = "AUTO";
|
||||||
config.InterruptJobsOnShutdown = true;
|
config.InterruptJobsOnShutdown = true;
|
||||||
config.InterruptJobsOnShutdownWithWait = true;
|
config.InterruptJobsOnShutdownWithWait = true;
|
||||||
config.MaxBatchSize = 5;
|
config.MaxBatchSize = 5;
|
||||||
@@ -66,7 +66,7 @@ public static class Quartz
|
|||||||
|
|
||||||
storage.UseSystemTextJsonSerializer();
|
storage.UseSystemTextJsonSerializer();
|
||||||
storage.SetProperty("quartz.jobStore.clustered", "true");
|
storage.SetProperty("quartz.jobStore.clustered", "true");
|
||||||
storage.SetProperty("quartz.jobStore.tablePrefix", "quartz_");
|
storage.SetProperty("quartz.jobStore.tablePrefix", "qrtz_");
|
||||||
|
|
||||||
storage.UsePostgres(connectionString!);
|
storage.UsePostgres(connectionString!);
|
||||||
storage.UseClustering(cluster =>
|
storage.UseClustering(cluster =>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Customers.Commands.Handlers;
|
namespace LiteCharms.Features.Customers.Commands.Handlers;
|
||||||
|
|
||||||
public class CreateCustomerCommandHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<CreateCustomerCommand, Result<Guid>>
|
public class CreateCustomerCommandHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<CreateCustomerCommand, Result<Guid>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Guid>> Handle(CreateCustomerCommand request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Guid>> Handle(CreateCustomerCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Customers.Commands.Handlers;
|
namespace LiteCharms.Features.Customers.Commands.Handlers;
|
||||||
|
|
||||||
public class UpdateCustomerCommandHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<UpdateCustomerCommand, Result>
|
public class UpdateCustomerCommandHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<UpdateCustomerCommand, Result>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result> Handle(UpdateCustomerCommand request, CancellationToken cancellationToken)
|
public async ValueTask<Result> Handle(UpdateCustomerCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Customers.Queries.Handlers;
|
namespace LiteCharms.Features.Customers.Queries.Handlers;
|
||||||
|
|
||||||
public class GetCustomerQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetCustomerQuery, Result<Customer>>
|
public class GetCustomerQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetCustomerQuery, Result<Customer>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Customer>> Handle(GetCustomerQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Customer>> Handle(GetCustomerQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Customers.Queries.Handlers;
|
namespace LiteCharms.Features.Customers.Queries.Handlers;
|
||||||
|
|
||||||
public class GetCustomersQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetCustomersQuery, Result<Customer[]>>
|
public class GetCustomersQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetCustomersQuery, Result<Customer[]>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Customer[]>> Handle(GetCustomersQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Customer[]>> Handle(GetCustomersQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using LiteCharms.Infrastructure.Database;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Leads.Commands.Handlers;
|
namespace LiteCharms.Features.Leads.Commands.Handlers;
|
||||||
|
|
||||||
public class CreateLeadCommandHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory, ISender mediator) : IRequestHandler<CreateLeadCommand, Result<Guid>>
|
public class CreateLeadCommandHandler(IDbContextFactory<ShopDbContext> contextFactory, ISender mediator) : IRequestHandler<CreateLeadCommand, Result<Guid>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Guid>> Handle(CreateLeadCommand request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Guid>> Handle(CreateLeadCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Leads.Commands.Handlers;
|
namespace LiteCharms.Features.Leads.Commands.Handlers;
|
||||||
|
|
||||||
public class UpdateLeadCommandHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<UpdateLeadCommand, Result>
|
public class UpdateLeadCommandHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<UpdateLeadCommand, Result>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result> Handle(UpdateLeadCommand request, CancellationToken cancellationToken)
|
public async ValueTask<Result> Handle(UpdateLeadCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Leads.Queries.Handlers;
|
namespace LiteCharms.Features.Leads.Queries.Handlers;
|
||||||
|
|
||||||
public class GetCustomerLeadsQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetCustomerLeadsQuery, Result<Lead[]>>
|
public class GetCustomerLeadsQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetCustomerLeadsQuery, Result<Lead[]>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Lead[]>> Handle(GetCustomerLeadsQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Lead[]>> Handle(GetCustomerLeadsQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Leads.Queries.Handlers;
|
namespace LiteCharms.Features.Leads.Queries.Handlers;
|
||||||
|
|
||||||
public class GetLeadsQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetLeadsQuery, Result<Lead[]>>
|
public class GetLeadsQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetLeadsQuery, Result<Lead[]>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Lead[]>> Handle(GetLeadsQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Lead[]>> Handle(GetLeadsQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Notifications.Commands.Handlers;
|
namespace LiteCharms.Features.Notifications.Commands.Handlers;
|
||||||
|
|
||||||
public class CreateNotificationCommandHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<CreateNotificationCommand, Result<Guid>>
|
public class CreateNotificationCommandHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<CreateNotificationCommand, Result<Guid>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Guid>> Handle(CreateNotificationCommand request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Guid>> Handle(CreateNotificationCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Notifications.Commands.Handlers;
|
namespace LiteCharms.Features.Notifications.Commands.Handlers;
|
||||||
|
|
||||||
public class UpdateNotificationCommandHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<UpdateNotificationCommand, Result>
|
public class UpdateNotificationCommandHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<UpdateNotificationCommand, Result>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result> Handle(UpdateNotificationCommand request, CancellationToken cancellationToken)
|
public async ValueTask<Result> Handle(UpdateNotificationCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Notifications.Queries.Handlers;
|
namespace LiteCharms.Features.Notifications.Queries.Handlers;
|
||||||
|
|
||||||
public class GetNotificationQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetNotificationQuery, Result<Notification>>
|
public class GetNotificationQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetNotificationQuery, Result<Notification>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Notification>> Handle(GetNotificationQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Notification>> Handle(GetNotificationQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Notifications.Queries.Handlers;
|
namespace LiteCharms.Features.Notifications.Queries.Handlers;
|
||||||
|
|
||||||
public class GetNotificationsQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetNotificationsQuery, Result<Notification[]>>
|
public class GetNotificationsQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetNotificationsQuery, Result<Notification[]>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Notification[]>> Handle(GetNotificationsQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Notification[]>> Handle(GetNotificationsQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Orders.Commands.Handlers;
|
namespace LiteCharms.Features.Orders.Commands.Handlers;
|
||||||
|
|
||||||
public class CreateOrderCommandHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<CreateOrderCommand, Result<Guid>>
|
public class CreateOrderCommandHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<CreateOrderCommand, Result<Guid>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Guid>> Handle(CreateOrderCommand request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Guid>> Handle(CreateOrderCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Orders.Commands.Handlers;
|
namespace LiteCharms.Features.Orders.Commands.Handlers;
|
||||||
|
|
||||||
public class UpdateOrderStatusCommandHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<UpdateOrderStatusCommand, Result>
|
public class UpdateOrderStatusCommandHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<UpdateOrderStatusCommand, Result>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result> Handle(UpdateOrderStatusCommand request, CancellationToken cancellationToken)
|
public async ValueTask<Result> Handle(UpdateOrderStatusCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Orders.Queries.Handlers;
|
namespace LiteCharms.Features.Orders.Queries.Handlers;
|
||||||
|
|
||||||
public class GetCustomerOrdersQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetCustomerOrdersQuery, Result<Order[]>>
|
public class GetCustomerOrdersQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetCustomerOrdersQuery, Result<Order[]>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Order[]>> Handle(GetCustomerOrdersQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Order[]>> Handle(GetCustomerOrdersQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Orders.Queries.Handlers;
|
namespace LiteCharms.Features.Orders.Queries.Handlers;
|
||||||
|
|
||||||
public class GetOrderRefundQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetOrderRefundQuery, Result<OrderRefund>>
|
public class GetOrderRefundQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetOrderRefundQuery, Result<OrderRefund>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<OrderRefund>> Handle(GetOrderRefundQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<OrderRefund>> Handle(GetOrderRefundQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Orders.Queries.Handlers;
|
namespace LiteCharms.Features.Orders.Queries.Handlers;
|
||||||
|
|
||||||
public class GetOrdersQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetOrdersQuery, Result<Order[]>>
|
public class GetOrdersQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetOrdersQuery, Result<Order[]>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Order[]>> Handle(GetOrdersQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Order[]>> Handle(GetOrdersQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Products.Queries.Handlers;
|
namespace LiteCharms.Features.Products.Queries.Handlers;
|
||||||
|
|
||||||
public class GetProductPriceQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetProductPriceQuery, Result<ProductPrice>>
|
public class GetProductPriceQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetProductPriceQuery, Result<ProductPrice>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<ProductPrice>> Handle(GetProductPriceQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<ProductPrice>> Handle(GetProductPriceQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Products.Queries.Handlers;
|
namespace LiteCharms.Features.Products.Queries.Handlers;
|
||||||
|
|
||||||
public class GetProductPricesQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetProductPricesQuery, Result<ProductPrice[]>>
|
public class GetProductPricesQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetProductPricesQuery, Result<ProductPrice[]>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<ProductPrice[]>> Handle(GetProductPricesQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<ProductPrice[]>> Handle(GetProductPricesQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Products.Queries.Handlers;
|
namespace LiteCharms.Features.Products.Queries.Handlers;
|
||||||
|
|
||||||
public class GetProductQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetProductQuery, Result<Product>>
|
public class GetProductQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetProductQuery, Result<Product>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Product>> Handle(GetProductQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Product>> Handle(GetProductQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Products.Queries.Handlers;
|
namespace LiteCharms.Features.Products.Queries.Handlers;
|
||||||
|
|
||||||
public class GetProductsQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetProductsQuery, Result<Product[]>>
|
public class GetProductsQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetProductsQuery, Result<Product[]>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Product[]>> Handle(GetProductsQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Product[]>> Handle(GetProductsQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Quotes.Commands.Handlers;
|
namespace LiteCharms.Features.Quotes.Commands.Handlers;
|
||||||
|
|
||||||
public class AssignQuoteToOrderCommandHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<AssignQuoteToOrderCommand, Result>
|
public class AssignQuoteToOrderCommandHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<AssignQuoteToOrderCommand, Result>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result> Handle(AssignQuoteToOrderCommand request, CancellationToken cancellationToken)
|
public async ValueTask<Result> Handle(AssignQuoteToOrderCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Quotes.Commands.Handlers;
|
namespace LiteCharms.Features.Quotes.Commands.Handlers;
|
||||||
|
|
||||||
public class AssignQuoteToShoppingCartCommandHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<AssignQuoteToShoppingCartCommand, Result>
|
public class AssignQuoteToShoppingCartCommandHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<AssignQuoteToShoppingCartCommand, Result>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result> Handle(AssignQuoteToShoppingCartCommand request, CancellationToken cancellationToken)
|
public async ValueTask<Result> Handle(AssignQuoteToShoppingCartCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Quotes.Commands.Handlers;
|
namespace LiteCharms.Features.Quotes.Commands.Handlers;
|
||||||
|
|
||||||
public class UpdateQuoteStatusCommandHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<UpdateQuoteStatusCommand, Result>
|
public class UpdateQuoteStatusCommandHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<UpdateQuoteStatusCommand, Result>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result> Handle(UpdateQuoteStatusCommand request, CancellationToken cancellationToken)
|
public async ValueTask<Result> Handle(UpdateQuoteStatusCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Quotes.Queries.Handlers;
|
namespace LiteCharms.Features.Quotes.Queries.Handlers;
|
||||||
|
|
||||||
public class GetCustomerQuotesQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetCustomerQuotesQuery, Result<Quote[]>>
|
public class GetCustomerQuotesQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetCustomerQuotesQuery, Result<Quote[]>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Quote[]>> Handle(GetCustomerQuotesQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Quote[]>> Handle(GetCustomerQuotesQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Quotes.Queries.Handlers;
|
namespace LiteCharms.Features.Quotes.Queries.Handlers;
|
||||||
|
|
||||||
public class GetQuoteQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetQuoteQuery, Result<Quote>>
|
public class GetQuoteQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetQuoteQuery, Result<Quote>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Quote>> Handle(GetQuoteQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Quote>> Handle(GetQuoteQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Quotes.Queries.Handlers;
|
namespace LiteCharms.Features.Quotes.Queries.Handlers;
|
||||||
|
|
||||||
public class GetQuotesHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetQuotesQuery, Result<Quote[]>>
|
public class GetQuotesHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetQuotesQuery, Result<Quote[]>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Quote[]>> Handle(GetQuotesQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Quote[]>> Handle(GetQuotesQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Refunds.Commands.Handlers;
|
namespace LiteCharms.Features.Refunds.Commands.Handlers;
|
||||||
|
|
||||||
public class RefundCustomerCommandHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<RefundCustomerCommand, Result<Guid>>
|
public class RefundCustomerCommandHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<RefundCustomerCommand, Result<Guid>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Guid>> Handle(RefundCustomerCommand request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Guid>> Handle(RefundCustomerCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Refunds.Commands.Handlers;
|
namespace LiteCharms.Features.Refunds.Commands.Handlers;
|
||||||
|
|
||||||
public class UpdateOrderRefundCommandHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<UpdateOrderRefundCommand, Result>
|
public class UpdateOrderRefundCommandHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<UpdateOrderRefundCommand, Result>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result> Handle(UpdateOrderRefundCommand request, CancellationToken cancellationToken)
|
public async ValueTask<Result> Handle(UpdateOrderRefundCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Refunds.Queries.Handlers;
|
namespace LiteCharms.Features.Refunds.Queries.Handlers;
|
||||||
|
|
||||||
public class GetCustomerRefundsQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetCustomerRefundsQuery, Result<OrderRefund[]>>
|
public class GetCustomerRefundsQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetCustomerRefundsQuery, Result<OrderRefund[]>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<OrderRefund[]>> Handle(GetCustomerRefundsQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<OrderRefund[]>> Handle(GetCustomerRefundsQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.Refunds.Queries.Handlers;
|
namespace LiteCharms.Features.Refunds.Queries.Handlers;
|
||||||
|
|
||||||
public class GetRefundQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetRefundQuery, Result<OrderRefund>>
|
public class GetRefundQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetRefundQuery, Result<OrderRefund>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<OrderRefund>> Handle(GetRefundQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<OrderRefund>> Handle(GetRefundQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace LiteCharms.Features.ShoppingCarts.Commands.Handlers;
|
namespace LiteCharms.Features.ShoppingCarts.Commands.Handlers;
|
||||||
|
|
||||||
public class AddItemToShoppingCartCommandHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<AddItemToShoppingCartCommand, Result>
|
public class AddItemToShoppingCartCommandHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<AddItemToShoppingCartCommand, Result>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result> Handle(AddItemToShoppingCartCommand request, CancellationToken cancellationToken)
|
public async ValueTask<Result> Handle(AddItemToShoppingCartCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace LiteCharms.Features.ShoppingCarts.Commands.Handlers;
|
namespace LiteCharms.Features.ShoppingCarts.Commands.Handlers;
|
||||||
|
|
||||||
public class CreateShoppingCartCommandHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<CreateShoppingCartCommand, Result<Guid>>
|
public class CreateShoppingCartCommandHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<CreateShoppingCartCommand, Result<Guid>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<Guid>> Handle(CreateShoppingCartCommand request, CancellationToken cancellationToken)
|
public async ValueTask<Result<Guid>> Handle(CreateShoppingCartCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace LiteCharms.Features.ShoppingCarts.Commands.Handlers;
|
namespace LiteCharms.Features.ShoppingCarts.Commands.Handlers;
|
||||||
|
|
||||||
public class EmptyShoppingCartCommandHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<EmptyShoppingCartCommand, Result>
|
public class EmptyShoppingCartCommandHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<EmptyShoppingCartCommand, Result>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result> Handle(EmptyShoppingCartCommand request, CancellationToken cancellationToken)
|
public async ValueTask<Result> Handle(EmptyShoppingCartCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace LiteCharms.Features.ShoppingCarts.Commands.Handlers;
|
namespace LiteCharms.Features.ShoppingCarts.Commands.Handlers;
|
||||||
|
|
||||||
public class RemoveShoppingCartItemCommandHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<RemoveShoppingCartItemCommand, Result>
|
public class RemoveShoppingCartItemCommandHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<RemoveShoppingCartItemCommand, Result>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result> Handle(RemoveShoppingCartItemCommand request, CancellationToken cancellationToken)
|
public async ValueTask<Result> Handle(RemoveShoppingCartItemCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace LiteCharms.Features.ShoppingCarts.Commands.Handlers;
|
namespace LiteCharms.Features.ShoppingCarts.Commands.Handlers;
|
||||||
|
|
||||||
public class UpdateShoppingCartItemCommandHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<UpdateShoppingCartItemCommand, Result>
|
public class UpdateShoppingCartItemCommandHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<UpdateShoppingCartItemCommand, Result>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result> Handle(UpdateShoppingCartItemCommand request, CancellationToken cancellationToken)
|
public async ValueTask<Result> Handle(UpdateShoppingCartItemCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.ShoppingCarts.Queries.Handlers;
|
namespace LiteCharms.Features.ShoppingCarts.Queries.Handlers;
|
||||||
|
|
||||||
public class GetCustomerShoppingCartsQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetCustomerShoppingCartsQuery, Result<ShoppingCart[]>>
|
public class GetCustomerShoppingCartsQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetCustomerShoppingCartsQuery, Result<ShoppingCart[]>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<ShoppingCart[]>> Handle(GetCustomerShoppingCartsQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<ShoppingCart[]>> Handle(GetCustomerShoppingCartsQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.ShoppingCarts.Queries.Handlers;
|
namespace LiteCharms.Features.ShoppingCarts.Queries.Handlers;
|
||||||
|
|
||||||
public class GetShoppingCartItemsQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetShoppingCartItemsQuery, Result<ShoppingCartItem[]>>
|
public class GetShoppingCartItemsQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetShoppingCartItemsQuery, Result<ShoppingCartItem[]>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<ShoppingCartItem[]>> Handle(GetShoppingCartItemsQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<ShoppingCartItem[]>> Handle(GetShoppingCartItemsQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using LiteCharms.Models;
|
|||||||
|
|
||||||
namespace LiteCharms.Features.ShoppingCarts.Queries.Handlers;
|
namespace LiteCharms.Features.ShoppingCarts.Queries.Handlers;
|
||||||
|
|
||||||
public class GetShoppingCartQueryHandler(IDbContextFactory<LeadGeneratorDbContext> contextFactory) : IRequestHandler<GetShoppingCartQuery, Result<ShoppingCart>>
|
public class GetShoppingCartQueryHandler(IDbContextFactory<ShopDbContext> contextFactory) : IRequestHandler<GetShoppingCartQuery, Result<ShoppingCart>>
|
||||||
{
|
{
|
||||||
public async ValueTask<Result<ShoppingCart>> Handle(GetShoppingCartQuery request, CancellationToken cancellationToken)
|
public async ValueTask<Result<ShoppingCart>> Handle(GetShoppingCartQuery request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
namespace LiteCharms.Infrastructure.Database;
|
|
||||||
|
|
||||||
public class LeadGeneratorDbContextFactory : IDesignTimeDbContextFactory<LeadGeneratorDbContext>
|
|
||||||
{
|
|
||||||
public LeadGeneratorDbContext CreateDbContext(string[] args)
|
|
||||||
{
|
|
||||||
var configuration = new ConfigurationBuilder()
|
|
||||||
.SetBasePath(Directory.GetCurrentDirectory())
|
|
||||||
.AddUserSecrets(typeof(LeadGeneratorDbContext).Assembly)
|
|
||||||
.AddJsonFile("appsettings.json")
|
|
||||||
.AddEnvironmentVariables()
|
|
||||||
.Build();
|
|
||||||
|
|
||||||
var optionsBuilder = new DbContextOptionsBuilder<LeadGeneratorDbContext>();
|
|
||||||
optionsBuilder.UseNpgsql(configuration.GetConnectionString("PostgresLeadGenerator"));
|
|
||||||
|
|
||||||
return new LeadGeneratorDbContext(optionsBuilder.Options);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+1
-1
@@ -11,7 +11,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
namespace LiteCharms.Infrastructure.Database.Migrations
|
namespace LiteCharms.Infrastructure.Database.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(LeadGeneratorDbContext))]
|
[DbContext(typeof(ShopDbContext))]
|
||||||
[Migration("20260502231708_Init")]
|
[Migration("20260502231708_Init")]
|
||||||
partial class Init
|
partial class Init
|
||||||
{
|
{
|
||||||
|
|||||||
Generated
+1
-1
@@ -11,7 +11,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
namespace LiteCharms.Infrastructure.Database.Migrations
|
namespace LiteCharms.Infrastructure.Database.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(LeadGeneratorDbContext))]
|
[DbContext(typeof(ShopDbContext))]
|
||||||
[Migration("20260503002123_DefinedEntityRelationships")]
|
[Migration("20260503002123_DefinedEntityRelationships")]
|
||||||
partial class DefinedEntityRelationships
|
partial class DefinedEntityRelationships
|
||||||
{
|
{
|
||||||
|
|||||||
Generated
+1
-1
@@ -11,7 +11,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
namespace LiteCharms.Infrastructure.Database.Migrations
|
namespace LiteCharms.Infrastructure.Database.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(LeadGeneratorDbContext))]
|
[DbContext(typeof(ShopDbContext))]
|
||||||
[Migration("20260503003624_RemovedLeadIdFromLead")]
|
[Migration("20260503003624_RemovedLeadIdFromLead")]
|
||||||
partial class RemovedLeadIdFromLead
|
partial class RemovedLeadIdFromLead
|
||||||
{
|
{
|
||||||
|
|||||||
Generated
+1
-1
@@ -11,7 +11,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
namespace LiteCharms.Infrastructure.Database.Migrations
|
namespace LiteCharms.Infrastructure.Database.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(LeadGeneratorDbContext))]
|
[DbContext(typeof(ShopDbContext))]
|
||||||
[Migration("20260503012708_AddedStatusToLead")]
|
[Migration("20260503012708_AddedStatusToLead")]
|
||||||
partial class AddedStatusToLead
|
partial class AddedStatusToLead
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
namespace LiteCharms.Infrastructure.Database.Migrations
|
namespace LiteCharms.Infrastructure.Database.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(LeadGeneratorDbContext))]
|
[DbContext(typeof(ShopDbContext))]
|
||||||
[Migration("20260503133855_CorrectedAttributionHashColumnOnLead")]
|
[Migration("20260503133855_CorrectedAttributionHashColumnOnLead")]
|
||||||
partial class CorrectedAttributionHashColumnOnLead
|
partial class CorrectedAttributionHashColumnOnLead
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
namespace LiteCharms.Infrastructure.Database.Migrations
|
namespace LiteCharms.Infrastructure.Database.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(LeadGeneratorDbContext))]
|
[DbContext(typeof(ShopDbContext))]
|
||||||
[Migration("20260505120450_GeneralisedLead")]
|
[Migration("20260505120450_GeneralisedLead")]
|
||||||
partial class GeneralisedLead
|
partial class GeneralisedLead
|
||||||
{
|
{
|
||||||
|
|||||||
Generated
+1
-1
@@ -11,7 +11,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
namespace LiteCharms.Infrastructure.Database.Migrations
|
namespace LiteCharms.Infrastructure.Database.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(LeadGeneratorDbContext))]
|
[DbContext(typeof(ShopDbContext))]
|
||||||
[Migration("20260505123745_AddedNotifications")]
|
[Migration("20260505123745_AddedNotifications")]
|
||||||
partial class AddedNotifications
|
partial class AddedNotifications
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
namespace LiteCharms.Infrastructure.Database.Migrations
|
namespace LiteCharms.Infrastructure.Database.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(LeadGeneratorDbContext))]
|
[DbContext(typeof(ShopDbContext))]
|
||||||
[Migration("20260505124135_AddedProcessedColumnToNotifications")]
|
[Migration("20260505124135_AddedProcessedColumnToNotifications")]
|
||||||
partial class AddedProcessedColumnToNotifications
|
partial class AddedProcessedColumnToNotifications
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
namespace LiteCharms.Infrastructure.Database.Migrations
|
namespace LiteCharms.Infrastructure.Database.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(LeadGeneratorDbContext))]
|
[DbContext(typeof(ShopDbContext))]
|
||||||
[Migration("20260505202859_AddedQuoteShoppingCartalteredOrderCustomer")]
|
[Migration("20260505202859_AddedQuoteShoppingCartalteredOrderCustomer")]
|
||||||
partial class AddedQuoteShoppingCartalteredOrderCustomer
|
partial class AddedQuoteShoppingCartalteredOrderCustomer
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
namespace LiteCharms.Infrastructure.Migrations
|
namespace LiteCharms.Infrastructure.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(LeadGeneratorDbContext))]
|
[DbContext(typeof(ShopDbContext))]
|
||||||
partial class LeadGeneratorDbContextModelSnapshot : ModelSnapshot
|
partial class LeadGeneratorDbContextModelSnapshot : ModelSnapshot
|
||||||
{
|
{
|
||||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace LiteCharms.Infrastructure.Database;
|
namespace LiteCharms.Infrastructure.Database;
|
||||||
|
|
||||||
public class LeadGeneratorDbContext(DbContextOptions<LeadGeneratorDbContext> options) : DbContext(options)
|
public class ShopDbContext(DbContextOptions<ShopDbContext> options) : DbContext(options)
|
||||||
{
|
{
|
||||||
public DbSet<Customer> Customers { get; set; }
|
public DbSet<Customer> Customers { get; set; }
|
||||||
|
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
namespace LiteCharms.Infrastructure.Database;
|
||||||
|
|
||||||
|
public class ShopDbContextFactory : IDesignTimeDbContextFactory<ShopDbContext>
|
||||||
|
{
|
||||||
|
public ShopDbContext CreateDbContext(string[] args)
|
||||||
|
{
|
||||||
|
var configuration = new ConfigurationBuilder()
|
||||||
|
.SetBasePath(Directory.GetCurrentDirectory())
|
||||||
|
.AddUserSecrets(typeof(ShopDbContext).Assembly)
|
||||||
|
.AddJsonFile("appsettings.json")
|
||||||
|
.AddEnvironmentVariables()
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
var optionsBuilder = new DbContextOptionsBuilder<ShopDbContext>();
|
||||||
|
optionsBuilder.UseNpgsql(configuration.GetConnectionString("PostgresShop"));
|
||||||
|
|
||||||
|
return new ShopDbContext(optionsBuilder.Options);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
public class PostgresHealthCheck(IConfiguration configuration) : IHealthCheck
|
public class PostgresHealthCheck(IConfiguration configuration) : IHealthCheck
|
||||||
{
|
{
|
||||||
private readonly string connectionString = configuration.GetConnectionString("PostgresLeadGenerator")!;
|
private readonly string connectionString = configuration.GetConnectionString("PostgresShop")!;
|
||||||
|
|
||||||
public async Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)
|
public async Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,14 @@
|
|||||||
<Solution>
|
<Solution>
|
||||||
|
<Folder Name="/Solution Items/">
|
||||||
|
<File Path=".drone.yml" />
|
||||||
|
<File Path=".editorconfig" />
|
||||||
|
<File Path=".gitattributes" />
|
||||||
|
<File Path=".gitignore" />
|
||||||
|
<File Path="icon.png" />
|
||||||
|
<File Path="LICENSE" />
|
||||||
|
<File Path="LiteCharms.snk" />
|
||||||
|
<File Path="README.md" />
|
||||||
|
</Folder>
|
||||||
<Project Path="LiteCharms.Abstractions/LiteCharms.Abstractions.csproj" Id="e080e621-5394-4260-a793-d54178401942" />
|
<Project Path="LiteCharms.Abstractions/LiteCharms.Abstractions.csproj" Id="e080e621-5394-4260-a793-d54178401942" />
|
||||||
<Project Path="LiteCharms.Entities/LiteCharms.Entities.csproj" />
|
<Project Path="LiteCharms.Entities/LiteCharms.Entities.csproj" />
|
||||||
<Project Path="LiteCharms.Extensions/LiteCharms.Extensions.csproj" />
|
<Project Path="LiteCharms.Extensions/LiteCharms.Extensions.csproj" />
|
||||||
|
|||||||
@@ -1 +1,23 @@
|
|||||||
# LiteCharmsShared
|
# LiteCharms.Components
|
||||||
|
|
||||||
|
A suite of shared libraries providing core logic, models, and infrastructure for the LiteCharms ecosystem.
|
||||||
|
|
||||||
|
## 📦 Published Packages
|
||||||
|
All packages are versioned and pushed to [Nexus](https://nexus.khongisa.co.za) automatically via CI/CD.
|
||||||
|
|
||||||
|
* **Abstractions:** Interfaces and base contracts.
|
||||||
|
* **Models:** Shared DTOs and Request/Response objects.
|
||||||
|
* **Entities:** Database schema definitions.
|
||||||
|
* **Infrastructure:** Persistence and external service clients.
|
||||||
|
* **Features:** Core business logic modules.
|
||||||
|
* **Extensions:** Shared helper methods and DI configurations.
|
||||||
|
|
||||||
|
## 🚀 CI/CD Workflow
|
||||||
|
1. Create a **Pull Request** to `master`.
|
||||||
|
2. Drone CI builds, tests, and packs the suite as `1.${DRONE_BUILD_NUMBER}.0`.
|
||||||
|
3. Packages are pushed to the Nexus `nuget-hosted` repository.
|
||||||
|
4. A formal **Gitea Release** is created with the versioned "Bill of Materials."
|
||||||
|
|
||||||
|
## 🛠 Usage
|
||||||
|
Add the Nexus NuGet source to your local environment and reference the version listed in the latest Gitea Release:
|
||||||
|
`dotnet add package LiteCharms.Models -v 1.XX.0`
|
||||||
Reference in New Issue
Block a user