Compare commits
No commits in common. "features/receiveUi/main" and "main" have entirely different histories.
features/r
...
main
226
.editorconfig
226
.editorconfig
@ -1,226 +0,0 @@
|
|||||||
# 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 = 3
|
|
||||||
indent_style = tab
|
|
||||||
tab_width = 3
|
|
||||||
|
|
||||||
# New line preferences
|
|
||||||
end_of_line = crlf
|
|
||||||
insert_final_newline = false
|
|
||||||
|
|
||||||
#### .NET Coding Conventions ####
|
|
||||||
|
|
||||||
# Organize usings
|
|
||||||
dotnet_separate_import_directive_groups = false
|
|
||||||
dotnet_sort_system_directives_first = true
|
|
||||||
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_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_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_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 = false
|
|
||||||
dotnet_style_allow_statement_immediately_after_block_experimental = false
|
|
||||||
|
|
||||||
#### C# Coding Conventions ####
|
|
||||||
|
|
||||||
# var preferences
|
|
||||||
csharp_style_var_elsewhere = true
|
|
||||||
csharp_style_var_for_built_in_types = true
|
|
||||||
csharp_style_var_when_type_is_apparent = true
|
|
||||||
|
|
||||||
# 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 = false
|
|
||||||
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_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
|
|
||||||
|
|
||||||
# Code-block preferences
|
|
||||||
csharp_prefer_braces = when_multiline
|
|
||||||
csharp_prefer_simple_using_statement = true
|
|
||||||
csharp_style_namespace_declarations = file_scoped
|
|
||||||
csharp_style_prefer_method_group_conversion = 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_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_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_lines_between_consecutive_braces_experimental = false
|
|
||||||
csharp_style_allow_embedded_statements_on_same_line_experimental = false
|
|
||||||
|
|
||||||
#### 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 = false
|
|
||||||
|
|
||||||
#### 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
|
|
@ -1,77 +0,0 @@
|
|||||||
name: "🐞 Bug Report"
|
|
||||||
about: "Create a report about something that is not working"
|
|
||||||
title: "[BUG]: "
|
|
||||||
label: "bug"
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
More information on our issue management policies can be found [here](https://git.tompit.com/connected/info/src/branch/main/docs/issue_management.md).
|
|
||||||
|
|
||||||
Please keep in mind that the git issue tracker is not intended as a general support forum, but for reporting **non-security** bugs and feature requests.
|
|
||||||
|
|
||||||
For other types of questions, consider using [StackOverflow](https://stackoverflow.com).
|
|
||||||
- type: checkboxes
|
|
||||||
attributes:
|
|
||||||
label: Is there an existing issue for this?
|
|
||||||
description: Please search to see if an issue already exists for the bug you encountered ([Connected.Logistics/issues](https://git.tompit.com/connected/Connected.Logistics/issues?q=is%3Aissue)). More information on our issue management policies is available [here](https://git.tompit.com/connected/info/src/branch/main/docs/issue_management.md).
|
|
||||||
options:
|
|
||||||
- label: I have searched the existing issues
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Describe the bug
|
|
||||||
description: A clear and concise description of what the bug is.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Expected Behavior
|
|
||||||
description: A clear and concise description of what you expected to happen.
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Steps To Reproduce
|
|
||||||
description: |
|
|
||||||
We ❤ code! Point us to a minimalistic project which reproduces this issue (repro) hosted in a public GitHub repo.
|
|
||||||
|
|
||||||
We will close this issue if:
|
|
||||||
- The repro project you share with us is complex. We can't investigate custom projects, so don't point us to such, please.
|
|
||||||
- If we will not be able to repro the behavior you're reporting.
|
|
||||||
- If the repro project is attached as a `.zip` file.
|
|
||||||
- If the GitHub repro project is set to `Private`.
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Exceptions (if any)
|
|
||||||
description: Include the exception you get when facing this issue.
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: .NET Version
|
|
||||||
description: |
|
|
||||||
Run `dotnet --version`
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: input
|
|
||||||
attributes:
|
|
||||||
label: Code version
|
|
||||||
description: |
|
|
||||||
The nuget package version or commit number if building from source.
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Anything else?
|
|
||||||
description: |
|
|
||||||
- The IDE (VS / VS Code/ VS4Mac) you're running on, and its version:
|
|
||||||
- Include the output of `dotnet --info`:
|
|
||||||
|
|
||||||
Links? References? Anything that will give us more context about the issue you are encountering!
|
|
||||||
|
|
||||||
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
|
|
||||||
validations:
|
|
||||||
required: false
|
|
@ -1,36 +0,0 @@
|
|||||||
name: "💡 Feature request"
|
|
||||||
about: "Suggest an idea for this project"
|
|
||||||
title: "[ENHANCEMENT]: "
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
More information on our issue management policies can be found [here](https://git.tompit.com/connected/info/src/branch/main/docs/issue_management.md)
|
|
||||||
- type: checkboxes
|
|
||||||
attributes:
|
|
||||||
label: Is there an existing issue for this?
|
|
||||||
description: Please search to see if an issue already exists for the feature you are requesting. (([Connected.Logistics/issues](https://git.tompit.com/connected/connected.logistics/issues?q=is%3Aissue)).
|
|
||||||
options:
|
|
||||||
- label: I have searched the existing issues
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Is your feature request related to a problem? Please describe the problem.
|
|
||||||
description: A clear and concise description of what the problem is.
|
|
||||||
placeholder: I am trying to do [...] but [...]
|
|
||||||
validations:
|
|
||||||
required: false
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Describe the solution you'd like
|
|
||||||
description: |
|
|
||||||
A clear and concise description of what you want to happen. Include any alternative solutions you've considered.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
attributes:
|
|
||||||
label: Additional context
|
|
||||||
description: |
|
|
||||||
Add any other context or screenshots about the feature request here.
|
|
||||||
validations:
|
|
||||||
required: false
|
|
@ -1,46 +0,0 @@
|
|||||||
# {PR title}
|
|
||||||
|
|
||||||
Summary of the changes (Less than 80 chars)
|
|
||||||
|
|
||||||
## Description
|
|
||||||
|
|
||||||
{Detail}
|
|
||||||
|
|
||||||
Addresses #{issue number} (in this specific format)
|
|
||||||
|
|
||||||
## Customer Impact
|
|
||||||
|
|
||||||
{Justification}
|
|
||||||
|
|
||||||
## Regression?
|
|
||||||
|
|
||||||
- [ ] Yes
|
|
||||||
- [ ] No
|
|
||||||
|
|
||||||
[If yes, specify the version the behavior has regressed from]
|
|
||||||
|
|
||||||
## Risk
|
|
||||||
|
|
||||||
- [ ] High
|
|
||||||
- [ ] Medium
|
|
||||||
- [ ] Low
|
|
||||||
|
|
||||||
[Justify the selection above]
|
|
||||||
|
|
||||||
## Packaging changes reviewed?
|
|
||||||
|
|
||||||
- [ ] Yes
|
|
||||||
- [ ] No
|
|
||||||
- [ ] N/A
|
|
||||||
|
|
||||||
## Test coverage complete and passing?
|
|
||||||
|
|
||||||
- [ ] Yes
|
|
||||||
- [ ] No
|
|
||||||
- [ ] N/A
|
|
||||||
|
|
||||||
## Docs updated?
|
|
||||||
|
|
||||||
- [ ] Yes
|
|
||||||
- [ ] No
|
|
||||||
- [ ] N/A
|
|
@ -1,3 +0,0 @@
|
|||||||
**.md
|
|
||||||
**/issue_template/**
|
|
||||||
**/.gitea/**
|
|
16
.gitignore
vendored
16
.gitignore
vendored
@ -412,19 +412,3 @@ FodyWeavers.xsd
|
|||||||
# Built Visual Studio Code Extensions
|
# Built Visual Studio Code Extensions
|
||||||
*.vsix
|
*.vsix
|
||||||
|
|
||||||
#ignore all in root folder except the allowed values
|
|
||||||
/*
|
|
||||||
!.editorconfig
|
|
||||||
!.gitignore
|
|
||||||
!LICENSE
|
|
||||||
!README.mdf
|
|
||||||
!*.[Ss][Ll][Nn]
|
|
||||||
!/.gitea
|
|
||||||
!/build
|
|
||||||
!/docs
|
|
||||||
!/examples
|
|
||||||
!/src
|
|
||||||
!/tests
|
|
||||||
!/dependencies
|
|
||||||
!/tools
|
|
||||||
!/*.[Ss][Ll][Nn]
|
|
20
.gitmodules
vendored
20
.gitmodules
vendored
@ -1,20 +0,0 @@
|
|||||||
[submodule "dependencies/connected"]
|
|
||||||
path = dependencies/connected
|
|
||||||
url = https://git.tompit.com/connected/connected.git
|
|
||||||
branch = develop
|
|
||||||
[submodule "dependencies/connected.framework"]
|
|
||||||
path = dependencies/connected.framework
|
|
||||||
url = https://git.tompit.com/connected/connected.framework.git
|
|
||||||
branch = develop
|
|
||||||
[submodule "dependencies/connected.framework.servicemodel"]
|
|
||||||
path = dependencies/connected.framework.servicemodel
|
|
||||||
url = https://git.tompit.com/connected/connected.framework.servicemodel.git
|
|
||||||
branch = develop
|
|
||||||
[submodule "dependencies/connected.customers"]
|
|
||||||
path = dependencies/connected.customers
|
|
||||||
url = https://git.tompit.com/connected/connected.customers.git
|
|
||||||
branch = develop
|
|
||||||
[submodule "dependencies/connected.common"]
|
|
||||||
path = dependencies/connected.common
|
|
||||||
url = https://git.tompit.com/connected/connected.common.git
|
|
||||||
branch = develop
|
|
@ -1,149 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio Version 17
|
|
||||||
VisualStudioVersion = 17.4.32916.344
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Logistics.Types.Model", "src\Connected.Logistics.Types.Model\Connected.Logistics.Types.Model.csproj", "{A673CACA-8A88-4AE1-B6C4-E31CED477981}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Logistics.Documents.Model", "src\Connected.Logistics.Documents.Model\Connected.Logistics.Documents.Model.csproj", "{BCB56C1C-253F-4BB8-88A2-06653ED3E232}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Dependencies", "Dependencies", "{04C7CB0E-A6E1-4CCC-AF76-B199137278B7}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Logistics.Processes.Receive", "src\Connected.Logistics.Processes.Receive\Connected.Logistics.Processes.Receive.csproj", "{9EB45FF3-4910-4FEA-9553-97410C350AB9}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Common", ".\dependencies\Connected.Common\src\Connected.Common\Connected.Common.csproj", "{A4BF05CA-F790-4296-8647-18CEB1801637}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Common.Model", ".\dependencies\Connected.Common\src\Connected.Common.Model\Connected.Common.Model.csproj", "{652D8B33-1485-43DD-9BDA-EE8103C2E0C8}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected", ".\dependencies\Connected\src\Connected\Connected.csproj", "{6D40EEF9-9DB8-4755-B307-485523B1E3EF}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Logistics.Documents", "src\Connected.Logistics.Documents\Connected.Logistics.Documents.csproj", "{D808FC0D-355C-41D9-8560-DF99A963CA6A}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Contacts.Types.Model", ".\dependencies\Connected.Customers\src\Connected.Contacts.Types.Model\Connected.Contacts.Types.Model.csproj", "{67EF282C-7CDE-4D85-A628-001306629762}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.ServiceModel", ".\dependencies\Connected.Framework.ServiceModel\src\Connected.ServiceModel\Connected.ServiceModel.csproj", "{6332E9A7-9EE8-4979-94AF-D297E4BBEA26}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Logistics.Stock.Model", "src\Connected.Logistics.Stock.Model\Connected.Logistics.Stock.Model.csproj", "{415704FB-3DCA-41F9-A2D1-0FB72D346532}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Logistics.Stock", "src\Connected.Logistics.Stock\Connected.Logistics.Stock.csproj", "{8C4B2009-1DF6-4358-ABED-64E1F6076CCD}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Logistics.Types", "src\Connected.Logistics.Types\Connected.Logistics.Types.csproj", "{A7B4FE4C-9D04-41FC-B036-78FAB6B15899}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Data", ".\dependencies\Connected.Framework\src\Connected.Data\Connected.Data.csproj", "{39BE3D38-7D70-4EAF-B249-26E973CB3C58}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Entities", ".\dependencies\Connected.Framework\src\Connected.Entities\Connected.Entities.csproj", "{3CAD2F7F-2C32-44E0-A632-907D020FD511}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Hosting", ".\dependencies\Connected.Framework\src\Connected.Hosting\Connected.Hosting.csproj", "{ACEE4A52-F398-4149-92F2-0AF80E9B0923}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Middleware", ".\dependencies\Connected.Framework\src\Connected.Middleware\Connected.Middleware.csproj", "{349FCD5A-9E47-49BA-8DC2-59E76E99141B}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Runtime", ".\dependencies\Connected.Framework\src\Connected.Runtime\Connected.Runtime.csproj", "{43AA67F4-177C-43C9-B34F-A9B780A0278B}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Services", ".\dependencies\Connected.Framework\src\Connected.Services\Connected.Services.csproj", "{69A42F1E-A8FF-4F9A-8036-E53DA8BB7F0C}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Connected.Validation", ".\dependencies\Connected.Framework\src\Connected.Validation\Connected.Validation.csproj", "{1A4834EB-3E24-43F8-8205-E2F2A68D0B54}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{A673CACA-8A88-4AE1-B6C4-E31CED477981}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{A673CACA-8A88-4AE1-B6C4-E31CED477981}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{A673CACA-8A88-4AE1-B6C4-E31CED477981}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{A673CACA-8A88-4AE1-B6C4-E31CED477981}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{BCB56C1C-253F-4BB8-88A2-06653ED3E232}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{BCB56C1C-253F-4BB8-88A2-06653ED3E232}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{BCB56C1C-253F-4BB8-88A2-06653ED3E232}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{BCB56C1C-253F-4BB8-88A2-06653ED3E232}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{9EB45FF3-4910-4FEA-9553-97410C350AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{9EB45FF3-4910-4FEA-9553-97410C350AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{9EB45FF3-4910-4FEA-9553-97410C350AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{9EB45FF3-4910-4FEA-9553-97410C350AB9}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{A4BF05CA-F790-4296-8647-18CEB1801637}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{A4BF05CA-F790-4296-8647-18CEB1801637}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{A4BF05CA-F790-4296-8647-18CEB1801637}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{A4BF05CA-F790-4296-8647-18CEB1801637}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{652D8B33-1485-43DD-9BDA-EE8103C2E0C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{652D8B33-1485-43DD-9BDA-EE8103C2E0C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{652D8B33-1485-43DD-9BDA-EE8103C2E0C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{652D8B33-1485-43DD-9BDA-EE8103C2E0C8}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{6D40EEF9-9DB8-4755-B307-485523B1E3EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{6D40EEF9-9DB8-4755-B307-485523B1E3EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{6D40EEF9-9DB8-4755-B307-485523B1E3EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{6D40EEF9-9DB8-4755-B307-485523B1E3EF}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{D808FC0D-355C-41D9-8560-DF99A963CA6A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{D808FC0D-355C-41D9-8560-DF99A963CA6A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{D808FC0D-355C-41D9-8560-DF99A963CA6A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{D808FC0D-355C-41D9-8560-DF99A963CA6A}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{67EF282C-7CDE-4D85-A628-001306629762}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{67EF282C-7CDE-4D85-A628-001306629762}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{67EF282C-7CDE-4D85-A628-001306629762}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{67EF282C-7CDE-4D85-A628-001306629762}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{6332E9A7-9EE8-4979-94AF-D297E4BBEA26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{6332E9A7-9EE8-4979-94AF-D297E4BBEA26}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{6332E9A7-9EE8-4979-94AF-D297E4BBEA26}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{6332E9A7-9EE8-4979-94AF-D297E4BBEA26}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{415704FB-3DCA-41F9-A2D1-0FB72D346532}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{415704FB-3DCA-41F9-A2D1-0FB72D346532}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{415704FB-3DCA-41F9-A2D1-0FB72D346532}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{415704FB-3DCA-41F9-A2D1-0FB72D346532}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{8C4B2009-1DF6-4358-ABED-64E1F6076CCD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{8C4B2009-1DF6-4358-ABED-64E1F6076CCD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{8C4B2009-1DF6-4358-ABED-64E1F6076CCD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{8C4B2009-1DF6-4358-ABED-64E1F6076CCD}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{A7B4FE4C-9D04-41FC-B036-78FAB6B15899}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{A7B4FE4C-9D04-41FC-B036-78FAB6B15899}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{A7B4FE4C-9D04-41FC-B036-78FAB6B15899}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{A7B4FE4C-9D04-41FC-B036-78FAB6B15899}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{39BE3D38-7D70-4EAF-B249-26E973CB3C58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{39BE3D38-7D70-4EAF-B249-26E973CB3C58}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{39BE3D38-7D70-4EAF-B249-26E973CB3C58}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{39BE3D38-7D70-4EAF-B249-26E973CB3C58}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{3CAD2F7F-2C32-44E0-A632-907D020FD511}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{3CAD2F7F-2C32-44E0-A632-907D020FD511}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{3CAD2F7F-2C32-44E0-A632-907D020FD511}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{3CAD2F7F-2C32-44E0-A632-907D020FD511}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{ACEE4A52-F398-4149-92F2-0AF80E9B0923}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{ACEE4A52-F398-4149-92F2-0AF80E9B0923}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{ACEE4A52-F398-4149-92F2-0AF80E9B0923}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{ACEE4A52-F398-4149-92F2-0AF80E9B0923}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{349FCD5A-9E47-49BA-8DC2-59E76E99141B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{349FCD5A-9E47-49BA-8DC2-59E76E99141B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{349FCD5A-9E47-49BA-8DC2-59E76E99141B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{349FCD5A-9E47-49BA-8DC2-59E76E99141B}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{43AA67F4-177C-43C9-B34F-A9B780A0278B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{43AA67F4-177C-43C9-B34F-A9B780A0278B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{43AA67F4-177C-43C9-B34F-A9B780A0278B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{43AA67F4-177C-43C9-B34F-A9B780A0278B}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{69A42F1E-A8FF-4F9A-8036-E53DA8BB7F0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{69A42F1E-A8FF-4F9A-8036-E53DA8BB7F0C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{69A42F1E-A8FF-4F9A-8036-E53DA8BB7F0C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{69A42F1E-A8FF-4F9A-8036-E53DA8BB7F0C}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{1A4834EB-3E24-43F8-8205-E2F2A68D0B54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{1A4834EB-3E24-43F8-8205-E2F2A68D0B54}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{1A4834EB-3E24-43F8-8205-E2F2A68D0B54}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{1A4834EB-3E24-43F8-8205-E2F2A68D0B54}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(NestedProjects) = preSolution
|
|
||||||
{A4BF05CA-F790-4296-8647-18CEB1801637} = {04C7CB0E-A6E1-4CCC-AF76-B199137278B7}
|
|
||||||
{652D8B33-1485-43DD-9BDA-EE8103C2E0C8} = {04C7CB0E-A6E1-4CCC-AF76-B199137278B7}
|
|
||||||
{6D40EEF9-9DB8-4755-B307-485523B1E3EF} = {04C7CB0E-A6E1-4CCC-AF76-B199137278B7}
|
|
||||||
{67EF282C-7CDE-4D85-A628-001306629762} = {04C7CB0E-A6E1-4CCC-AF76-B199137278B7}
|
|
||||||
{6332E9A7-9EE8-4979-94AF-D297E4BBEA26} = {04C7CB0E-A6E1-4CCC-AF76-B199137278B7}
|
|
||||||
{39BE3D38-7D70-4EAF-B249-26E973CB3C58} = {04C7CB0E-A6E1-4CCC-AF76-B199137278B7}
|
|
||||||
{3CAD2F7F-2C32-44E0-A632-907D020FD511} = {04C7CB0E-A6E1-4CCC-AF76-B199137278B7}
|
|
||||||
{ACEE4A52-F398-4149-92F2-0AF80E9B0923} = {04C7CB0E-A6E1-4CCC-AF76-B199137278B7}
|
|
||||||
{349FCD5A-9E47-49BA-8DC2-59E76E99141B} = {04C7CB0E-A6E1-4CCC-AF76-B199137278B7}
|
|
||||||
{43AA67F4-177C-43C9-B34F-A9B780A0278B} = {04C7CB0E-A6E1-4CCC-AF76-B199137278B7}
|
|
||||||
{69A42F1E-A8FF-4F9A-8036-E53DA8BB7F0C} = {04C7CB0E-A6E1-4CCC-AF76-B199137278B7}
|
|
||||||
{1A4834EB-3E24-43F8-8205-E2F2A68D0B54} = {04C7CB0E-A6E1-4CCC-AF76-B199137278B7}
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
||||||
SolutionGuid = {FC558A1B-D7D9-4869-9589-1877A5E64720}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
661
LICENSE
661
LICENSE
@ -1,661 +0,0 @@
|
|||||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 19 November 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU Affero General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works, specifically designed to ensure
|
|
||||||
cooperation with the community in the case of network server software.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
our General Public Licenses are intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
Developers that use our General Public Licenses protect your rights
|
|
||||||
with two steps: (1) assert copyright on the software, and (2) offer
|
|
||||||
you this License which gives you legal permission to copy, distribute
|
|
||||||
and/or modify the software.
|
|
||||||
|
|
||||||
A secondary benefit of defending all users' freedom is that
|
|
||||||
improvements made in alternate versions of the program, if they
|
|
||||||
receive widespread use, become available for other developers to
|
|
||||||
incorporate. Many developers of free software are heartened and
|
|
||||||
encouraged by the resulting cooperation. However, in the case of
|
|
||||||
software used on network servers, this result may fail to come about.
|
|
||||||
The GNU General Public License permits making a modified version and
|
|
||||||
letting the public access it on a server without ever releasing its
|
|
||||||
source code to the public.
|
|
||||||
|
|
||||||
The GNU Affero General Public License is designed specifically to
|
|
||||||
ensure that, in such cases, the modified source code becomes available
|
|
||||||
to the community. It requires the operator of a network server to
|
|
||||||
provide the source code of the modified version running there to the
|
|
||||||
users of that server. Therefore, public use of a modified version, on
|
|
||||||
a publicly accessible server, gives the public access to the source
|
|
||||||
code of the modified version.
|
|
||||||
|
|
||||||
An older license, called the Affero General Public License and
|
|
||||||
published by Affero, was designed to accomplish similar goals. This is
|
|
||||||
a different license, not a version of the Affero GPL, but Affero has
|
|
||||||
released a new version of the Affero GPL which permits relicensing under
|
|
||||||
this license.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, if you modify the
|
|
||||||
Program, your modified version must prominently offer all users
|
|
||||||
interacting with it remotely through a computer network (if your version
|
|
||||||
supports such interaction) an opportunity to receive the Corresponding
|
|
||||||
Source of your version by providing access to the Corresponding Source
|
|
||||||
from a network server at no charge, through some standard or customary
|
|
||||||
means of facilitating copying of software. This Corresponding Source
|
|
||||||
shall include the Corresponding Source for any work covered by version 3
|
|
||||||
of the GNU General Public License that is incorporated pursuant to the
|
|
||||||
following paragraph.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the work with which it is combined will remain governed by version
|
|
||||||
3 of the GNU General Public License.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU Affero General Public License from time to time. Such new versions
|
|
||||||
will be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU Affero General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU Affero General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU Affero General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Affero General Public License as published
|
|
||||||
by the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Affero General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Affero General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If your software can interact with users remotely through a computer
|
|
||||||
network, you should also make sure that it provides a way for users to
|
|
||||||
get its source. For example, if your program is a web application, its
|
|
||||||
interface could display a "Source" link that leads users to an archive
|
|
||||||
of the code. There are many ways you could offer source, and different
|
|
||||||
solutions will be better for different programs; see section 13 for the
|
|
||||||
specific requirements.
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
|
||||||
<https://www.gnu.org/licenses/>.
|
|
28
README.md
28
README.md
@ -1,28 +1,2 @@
|
|||||||
Connected.Logistics
|
# connected.logistics
|
||||||
============
|
|
||||||
|
|
||||||
[](https://git.tompit.com/connected/Connected.Logistics/LICENSE)
|
|
||||||
|
|
||||||
${REPO_DESCRIPTION} [Learn more about Connected](https://git.tompit.com/connected/info).
|
|
||||||
|
|
||||||
## Get Started
|
|
||||||
|
|
||||||
Coming soon! Stay tuned.
|
|
||||||
|
|
||||||
## How to Engage, Contribute, and Give Feedback
|
|
||||||
|
|
||||||
* Check out the [contributing](CONTRIBUTING.md) page to see the best places to log issues and start discussions.
|
|
||||||
|
|
||||||
## Related projects
|
|
||||||
|
|
||||||
These are some other repos for related projects:
|
|
||||||
|
|
||||||
* [Documentation](https://git.tompit.com/connected/info/src/branch/main/docs) - documentation sources the Connected project
|
|
||||||
* [Developer guidelines](https://git.tompit.com/connected/info/src/branch/main/guidelines) - developer guidelines for code styles, formatting and pull request requirements
|
|
||||||
* [Connected.Framework.ServiceModel](https://git.tompit.com/Connected/connected.framework.servicemodel) - the Connected services client interfaces
|
|
||||||
* [Connected.Framework.ServiceModel.Client](https://git.tompit.com/Connected/connected.framework.servicemodel.client) - the Connected services client implementations
|
|
||||||
* [Connected.Components](https://git.tompit.com/connected/Connected.Components) - the Connected UI library
|
|
||||||
|
|
||||||
## Code of conduct
|
|
||||||
|
|
||||||
See [CODE-OF-CONDUCT](https://git.tompit.com/connected/info/src/branch/main/CODE-OF-CONDUCT.md)
|
|
@ -1,22 +0,0 @@
|
|||||||
@echo off
|
|
||||||
|
|
||||||
SET root=%cd%
|
|
||||||
|
|
||||||
echo "Syncing submodules"
|
|
||||||
git submodule sync
|
|
||||||
git submodule update --init --remote
|
|
||||||
echo "Submodules up to date"
|
|
||||||
|
|
||||||
FOR /F "delims=" %%a IN ('DIR "../dependencies" /A:d /B') DO (
|
|
||||||
echo Handling %%a
|
|
||||||
cd "../dependencies/%%a/build"
|
|
||||||
echo %cd%
|
|
||||||
IF EXIST init.bat (
|
|
||||||
echo "found init.bat"
|
|
||||||
call init
|
|
||||||
)
|
|
||||||
cd %root%
|
|
||||||
)
|
|
||||||
|
|
||||||
cd ../
|
|
||||||
dotnet build
|
|
0
dependencies/.gitkeep
vendored
0
dependencies/.gitkeep
vendored
1
dependencies/connected
vendored
1
dependencies/connected
vendored
@ -1 +0,0 @@
|
|||||||
Subproject commit dd40532a0ff03237407de9635c7211c5e1af5807
|
|
1
dependencies/connected.common
vendored
1
dependencies/connected.common
vendored
@ -1 +0,0 @@
|
|||||||
Subproject commit 174ef6636713482fd0d17b95fb7b0e9bf275da7c
|
|
1
dependencies/connected.customers
vendored
1
dependencies/connected.customers
vendored
@ -1 +0,0 @@
|
|||||||
Subproject commit 247f025b9025a020d20c411d3f0fb1efca9977b0
|
|
1
dependencies/connected.framework
vendored
1
dependencies/connected.framework
vendored
@ -1 +0,0 @@
|
|||||||
Subproject commit da3d363dd2edd09daaef332db5f2a22eadd3d5b9
|
|
@ -1 +0,0 @@
|
|||||||
Subproject commit b781dcd35e74d27e9d38fca71f0087c27b3643c6
|
|
@ -1,15 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<RootNamespace>Connected.Logistics.Documents</RootNamespace>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\..\Connected.Common\src\Connected.Common.Model\Connected.Common.Model.csproj" />
|
|
||||||
<ProjectReference Include="..\..\..\Connected.Customers\src\Connected.Contacts.Types.Model\Connected.Contacts.Types.Model.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
@ -1,5 +0,0 @@
|
|||||||
namespace Connected.Logistics.Documents;
|
|
||||||
public static class DocumentUrls
|
|
||||||
{
|
|
||||||
public const string Receives = "/logistics/documents/receives";
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
using Connected.Common.Documents;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
|
|
||||||
public interface IReceiveDocument : IDocument<int>
|
|
||||||
{
|
|
||||||
int? Supplier { get; init; }
|
|
||||||
DateTimeOffset? ReceiveDate { get; init; }
|
|
||||||
|
|
||||||
int ItemCount { get; init; }
|
|
||||||
int OpenItemCount { get; init; }
|
|
||||||
}
|
|
@ -1,84 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Annotations;
|
|
||||||
using Connected.Common.Documents;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
/// <summary>
|
|
||||||
/// Represents service for the <see cref="IReceiveDocument"/> document.
|
|
||||||
/// </summary>
|
|
||||||
[Service]
|
|
||||||
[ServiceUrl(DocumentUrls.Receives)]
|
|
||||||
public interface IReceiveDocumentService : IDocumentService<int, long>
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Inserts a new <see cref="IReceiveDocument"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the properties of the new document.</param>
|
|
||||||
/// <returns>The id of the newly inserted document.</returns>
|
|
||||||
Task<int> Insert(InsertReceiveDocumentArgs args);
|
|
||||||
/// <summary>
|
|
||||||
/// Updates <see cref="IReceiveDocument"/> document.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing changed properties of the document.</param>
|
|
||||||
Task Update(UpdateReceiveDocumentArgs args);
|
|
||||||
/// <summary>
|
|
||||||
/// Performs partial update on the <see cref="IReceiveDocument"/> for the properties specified
|
|
||||||
/// in arguments.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing properties that need to be updated.</param>
|
|
||||||
Task Patch(PatchArgs<int> args);
|
|
||||||
/// <summary>
|
|
||||||
/// Deletes <see cref="IReceiveDocument"/> from the storage.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the id of the document that is about to be deleted.</param>
|
|
||||||
Task Delete(PrimaryKeyArgs<int> args);
|
|
||||||
/// <summary>
|
|
||||||
/// Selects <see cref="IReceiveDocument"/> for the specified id.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the id.</param>
|
|
||||||
/// <returns><see cref="IReceiveDocument"/> if found, <c>null</c> otherwise.</returns>
|
|
||||||
Task<IReceiveDocument?> Select(PrimaryKeyArgs<int> args);
|
|
||||||
/// <summary>
|
|
||||||
/// Searches <see cref="IReceiveDocument">documents</see> for the specified criteria.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the query criteria.</param>
|
|
||||||
/// <returns>The list of <see cref="IReceiveDocument"/> documents that matches the search criteria.</returns>
|
|
||||||
Task<ImmutableList<IReceiveDocument>> Query(QueryArgs? args);
|
|
||||||
/// <summary>
|
|
||||||
/// Inserts a new <see cref="IReceiveItem"/> into the <see cref="IReceiveDocument"/> document.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the properties of the new item.</param>
|
|
||||||
/// <returns>The id of the newly inserted <see cref="IReceiveItem"/> item.</returns>
|
|
||||||
Task<long> InsertItem(InsertReceiveItemArgs args);
|
|
||||||
/// <summary>
|
|
||||||
/// Updates <see cref="IReceiveItem"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the properties to be updated.</param>
|
|
||||||
Task UpdateItem(UpdateReceiveItemArgs args);
|
|
||||||
/// <summary>
|
|
||||||
/// Permanently deleted the <see cref="IReceiveItem"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the id of the item to be deleted.</param>
|
|
||||||
Task DeleteItem(PrimaryKeyArgs<long> args);
|
|
||||||
/// <summary>
|
|
||||||
/// Queries the <see cref="IReceiveItem"/> items for the specified <see cref="IReceiveDocument"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the id of the document for which the items to be
|
|
||||||
/// queried.</param>
|
|
||||||
/// <returns>The list of items that belong to the specified document.</returns>
|
|
||||||
Task<ImmutableList<IReceiveItem>> QueryItems(PrimaryKeyArgs<int> args);
|
|
||||||
/// <summary>
|
|
||||||
/// Selects the <see cref="IReceiveItem"/> item for the specified id.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the id of the item.</param>
|
|
||||||
/// <returns>The <see cref="IReceiveItem"/> if found, <c>null</c> otherwise.</returns>
|
|
||||||
Task<IReceiveItem?> SelectItem(PrimaryKeyArgs<long> args);
|
|
||||||
/// <summary>
|
|
||||||
/// Select the <see cref="IReceiveItem"/> for the specified entity and entity id from the
|
|
||||||
/// specified document.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing criteria values.</param>
|
|
||||||
/// <returns>A first <see cref="IReceiveItem"/> that matches the criteria, <c>null</c> otherwise.</returns>
|
|
||||||
Task<IReceiveItem?> SelectItem(SelectReceiveItemArgs args);
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
using Connected.Data;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
|
|
||||||
public interface IReceiveItem : IEntityContainer<long>
|
|
||||||
{
|
|
||||||
int Document { get; init; }
|
|
||||||
float Quantity { get; init; }
|
|
||||||
float PostedQuantity { get; init; }
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
using Connected.Data;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
/// <summary>
|
|
||||||
/// Represents connected (many-to-many) entity between <see cref="IReceivePostingDocument"/>
|
|
||||||
/// and <see cref="IReceiveItem"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Master receive document contains one or more <see cref="IReceiveItem"/> items. Receive document
|
|
||||||
/// is then divided into one or more <see cref="IReceivePostingDocument"/> documents which contain
|
|
||||||
/// two lists of items:
|
|
||||||
/// <list type="bullet">
|
|
||||||
/// <item><see cref="IReceivePlannedItem"/></item>
|
|
||||||
/// <item><see cref="IReceivePostingItem"/></item>
|
|
||||||
/// </list>
|
|
||||||
/// This entity represents planned items which represents the plan of how what kind of item and how
|
|
||||||
/// much should be posted to each <see cref="IReceivePostingDocument"/>. This acts only as a guide to the user
|
|
||||||
/// not the actual items and quantities that arrived into warehouse.
|
|
||||||
/// </remarks>
|
|
||||||
public interface IReceivePlannedItem : IPrimaryKey<long>
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The id of the <see cref="IReceivePostingDocument"/> to which
|
|
||||||
/// this planned entity belongs.
|
|
||||||
/// </summary>
|
|
||||||
int Document { get; init; }
|
|
||||||
/// <summary>
|
|
||||||
/// The id of the <see cref="IReceiveItem"/> item to which
|
|
||||||
/// this planned entity belongs.
|
|
||||||
/// </summary>
|
|
||||||
int Item { get; init; }
|
|
||||||
/// <summary>
|
|
||||||
/// The planned entity which should be posted into this
|
|
||||||
/// item.
|
|
||||||
/// </summary>
|
|
||||||
float Quantity { get; init; }
|
|
||||||
/// <summary>
|
|
||||||
/// The actual posted quantity for this item.
|
|
||||||
/// </summary>
|
|
||||||
float PostedQuantity { get; init; }
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
using Connected.Common.Documents;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
|
|
||||||
public interface IReceivePostingDocument : IDocument<int>
|
|
||||||
{
|
|
||||||
int Document { get; init; }
|
|
||||||
int OpenItemCount { get; init; }
|
|
||||||
int ItemCount { get; init; }
|
|
||||||
}
|
|
@ -1,84 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Annotations;
|
|
||||||
using Connected.Common.Documents;
|
|
||||||
using Connected.Notifications;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Represents service for the <see cref="IReceivePostingDocument"/> document.
|
|
||||||
/// </summary>
|
|
||||||
[Service]
|
|
||||||
[ServiceUrl(DocumentUrls.Receives)]
|
|
||||||
public interface IReceivePostingDocumentService : IDocumentService<int, long>
|
|
||||||
{
|
|
||||||
event ServiceEventHandler<PrimaryKeyEventArgs<long>> PlannedItemUpdated;
|
|
||||||
/// <summary>
|
|
||||||
/// Inserts a new <see cref="IReceivePostingDocument"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the properties of the new document.</param>
|
|
||||||
/// <returns>The id of the newly inserted document.</returns>
|
|
||||||
Task<int> Insert(InsertReceivePostingDocumentArgs args);
|
|
||||||
/// <summary>
|
|
||||||
/// Updates <see cref="IReceivePostingDocument"/> document.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing changed properties of the document.</param>
|
|
||||||
Task Update(UpdateReceivePostingDocumentArgs args);
|
|
||||||
/// <summary>
|
|
||||||
/// Performs partial update on the <see cref="IReceivePostingDocument"/> for the properties specified
|
|
||||||
/// in arguments.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing properties that need to be updated.</param>
|
|
||||||
Task Patch(PatchArgs<int> args);
|
|
||||||
/// <summary>
|
|
||||||
/// Deletes <see cref="IReceivePostingDocument"/> from the storage.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the id of the document that is about to be deleted.</param>
|
|
||||||
Task Delete(PrimaryKeyArgs<int> args);
|
|
||||||
/// <summary>
|
|
||||||
/// Selects <see cref="IReceivePostingDocument"/> for the specified id.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the id.</param>
|
|
||||||
/// <returns><see cref="IReceivePostingDocument"/> is found, <c>null</c> otherwise.</returns>
|
|
||||||
Task<IReceivePostingDocument?> Select(PrimaryKeyArgs<int> args);
|
|
||||||
/// <summary>
|
|
||||||
/// Queries <see cref="IReceivePostingDocument"/> for the specified <see cref="IReceiveDocument"/> document.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the id of the parent receive document.</param>
|
|
||||||
/// <returns><see cref="IReceivePostingDocument"/> if found, <c>null</c> otherwise.</returns>
|
|
||||||
Task<ImmutableList<IReceivePostingDocument>> Query(PrimaryKeyArgs<int> args);
|
|
||||||
/// <summary>
|
|
||||||
/// Inserts a new <see cref="IReceivePostingItem"/> into the <see cref="IReceivePostingDocument"/> document.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the properties of the new item.</param>
|
|
||||||
/// <returns>The id of the newly inserted <see cref="IReceivePostingItem"/> item.</returns>
|
|
||||||
Task<long> InsertItem(InsertReceivePostingItemArgs args);
|
|
||||||
|
|
||||||
Task PatchPlanedItem(PatchArgs<long> args);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Queries the <see cref="IReceivePostingItem"/> items for the specified <see cref="IReceivePostingDocument"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the id of the document for which the items to be
|
|
||||||
/// queried.</param>
|
|
||||||
/// <returns>The list of items that belong to the specified document.</returns>
|
|
||||||
Task<ImmutableList<IReceivePostingItem>> QueryItems(PrimaryKeyArgs<int> args);
|
|
||||||
/// <summary>
|
|
||||||
/// Selects the <see cref="IReceivePostingItem"/> item for the specified id.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the id of the item.</param>
|
|
||||||
/// <returns>The <see cref="IReceivePostingItem"/> if found, <c>null</c> otherwise.</returns>
|
|
||||||
Task<IReceivePostingItem?> SelectItem(PrimaryKeyArgs<long> args);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Updates <see cref="IReceivePlannedItem"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the changed properties of the item.</param>
|
|
||||||
Task UpdatePlannedItem(UpdateReceivePlannedItemArgs args);
|
|
||||||
|
|
||||||
Task<IReceivePlannedItem?> SelectPlannedItem(PrimaryKeyArgs<long> args);
|
|
||||||
Task<IReceivePlannedItem?> SelectPlannedItem(SelectReceivePlannedItemArgs args);
|
|
||||||
Task<ImmutableList<IReceivePlannedItem>> QueryPlannedItems(PrimaryKeyArgs<int> args);
|
|
||||||
Task<ImmutableList<IReceivePlannedItem>> QueryPlannedItems(PrimaryKeyArgs<long> args);
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
using Connected.Data;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
public interface IReceivePostingItem : IPrimaryKey<long>
|
|
||||||
{
|
|
||||||
int Document { get; init; }
|
|
||||||
long Serial { get; init; }
|
|
||||||
float Quantity { get; init; }
|
|
||||||
int Location { get; init; }
|
|
||||||
}
|
|
@ -1,58 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Connected.Annotations;
|
|
||||||
using Connected.Common.Documents;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
/// <summary>
|
|
||||||
/// The arguments used when inserting a new <see cref="IReceiveItem"/> item
|
|
||||||
/// via <see cref="IReceiveDocumentService"/> service.
|
|
||||||
/// </summary>
|
|
||||||
public class InsertReceiveItemArgs : Dto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The id of the <see cref="IReceiveDocument"/> document.
|
|
||||||
/// Must exists in the storage.
|
|
||||||
/// </summary>
|
|
||||||
[Range(1, int.MaxValue)]
|
|
||||||
public int Document { get; set; }
|
|
||||||
|
|
||||||
[Required, MaxLength(128)]
|
|
||||||
public string EntityType { get; set; } = default!;
|
|
||||||
|
|
||||||
[Required, MaxLength(128)]
|
|
||||||
public string EntityId { get; set; } = default!;
|
|
||||||
|
|
||||||
[Range(0, float.MaxValue)]
|
|
||||||
public float Quantity { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class UpdateReceiveItemArgs : PrimaryKeyArgs<long>
|
|
||||||
{
|
|
||||||
[MinValue(0)]
|
|
||||||
public float PostedQuantity { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class InsertReceiveDocumentArgs : InsertDocumentArgs
|
|
||||||
{
|
|
||||||
public int? Warehouse { get; set; }
|
|
||||||
|
|
||||||
public int? Supplier { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class UpdateReceiveDocumentArgs : UpdateDocumentArgs<int>
|
|
||||||
{
|
|
||||||
public int? Warehouse { get; set; }
|
|
||||||
|
|
||||||
public int? Supplier { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class SelectReceiveItemArgs : Dto
|
|
||||||
{
|
|
||||||
[MinValue(1)]
|
|
||||||
public int Document { get; set; }
|
|
||||||
[Required, MaxLength(128)]
|
|
||||||
public string Entity { get; set; } = default!;
|
|
||||||
[Required, MaxLength(128)]
|
|
||||||
public string EntityId { get; set; } = default!;
|
|
||||||
}
|
|
@ -1,72 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Connected.Annotations;
|
|
||||||
using Connected.Common.Documents;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
public sealed class InsertReceivePostingDocumentArgs : InsertDocumentArgs
|
|
||||||
{
|
|
||||||
[MinValue(1)]
|
|
||||||
public int Document { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class UpdateReceivePostingDocumentArgs : UpdateDocumentArgs<int>
|
|
||||||
{
|
|
||||||
[MinValue(0)]
|
|
||||||
public int ItemCount { get; set; }
|
|
||||||
[MinValue(0)]
|
|
||||||
public int OpenItemCount { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The arguments used when inserting a new <see cref="IReceivePostingItem"/> item
|
|
||||||
/// via <see cref="IReceiveDocumentService"/> service.
|
|
||||||
/// </summary>
|
|
||||||
public class InsertReceivePostingItemArgs : Dto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The id of the <see cref="IReceivePostingDocument"/> document.
|
|
||||||
/// Must exists in the storage.
|
|
||||||
/// </summary>
|
|
||||||
[MinValue(1)]
|
|
||||||
public int Document { get; set; }
|
|
||||||
|
|
||||||
[MinValue(1)]
|
|
||||||
public int Location { get; set; }
|
|
||||||
|
|
||||||
[MinValue(0)]
|
|
||||||
public float Quantity { get; set; }
|
|
||||||
|
|
||||||
[MinValue(1)]
|
|
||||||
public long? Serial { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class InsertReceivePlannedItemArgs : Dto
|
|
||||||
{
|
|
||||||
[MinValue(1)]
|
|
||||||
public int Document { get; set; }
|
|
||||||
|
|
||||||
[MinValue(0)]
|
|
||||||
public float Quantity { get; set; }
|
|
||||||
|
|
||||||
public string Entity { get; set; }
|
|
||||||
public string EntityId { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class UpdateReceivePlannedItemArgs : PrimaryKeyArgs<long>
|
|
||||||
{
|
|
||||||
[MinValue(0)]
|
|
||||||
public float PostedQuantity { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class SelectReceivePlannedItemArgs : Dto
|
|
||||||
{
|
|
||||||
[MinValue(1)]
|
|
||||||
public int Document { get; set; }
|
|
||||||
[Required, MaxLength(128)]
|
|
||||||
public string Entity { get; set; } = default!;
|
|
||||||
|
|
||||||
[Required, MaxLength(128)]
|
|
||||||
public string EntityId { get; set; } = default!;
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
|||||||
using Connected.Annotations;
|
|
||||||
|
|
||||||
[assembly: MicroService(MicroServiceType.Service)]
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents;
|
|
||||||
internal sealed class Bootstrapper : Startup
|
|
||||||
{
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\..\Connected.Common\src\Connected.Common.Model\Connected.Common.Model.csproj" />
|
|
||||||
<ProjectReference Include="..\..\..\Connected.Common\src\Connected.Common\Connected.Common.csproj" />
|
|
||||||
<ProjectReference Include="..\..\..\Connected.Framework\src\Connected.Entities\Connected.Entities.csproj" />
|
|
||||||
<ProjectReference Include="..\Connected.Logistics.Documents.Model\Connected.Logistics.Documents.Model.csproj" />
|
|
||||||
<ProjectReference Include="..\Connected.Logistics.Types.Model\Connected.Logistics.Types.Model.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Update="SR.Designer.cs">
|
|
||||||
<DesignTime>True</DesignTime>
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DependentUpon>SR.resx</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Update="SR.resx">
|
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
|
||||||
<LastGenOutput>SR.Designer.cs</LastGenOutput>
|
|
||||||
</EmbeddedResource>
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
@ -1,24 +0,0 @@
|
|||||||
using Connected.Annotations;
|
|
||||||
using Connected.Common.Documents;
|
|
||||||
using Connected.Entities.Annotations;
|
|
||||||
using Connected.Logistics.Types;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
|
|
||||||
/// <inheritdoc cref="IReceiveDocument"/>
|
|
||||||
[Table(Schema = Domain.Code)]
|
|
||||||
internal sealed record ReceiveDocument : Document<int>, IReceiveDocument
|
|
||||||
{
|
|
||||||
public const string EntityKey = $"{Domain.Code}.{nameof(ReceiveDocument)}";
|
|
||||||
|
|
||||||
/// <inheritdoc cref="IReceiveDocument.Supplier"/>
|
|
||||||
[Ordinal(1), Nullable]
|
|
||||||
public int? Supplier { get; init; }
|
|
||||||
/// <inheritdoc cref="IReceiveDocument.ReceiveDate"/>
|
|
||||||
[Ordinal(2), Nullable]
|
|
||||||
public DateTimeOffset? ReceiveDate { get; init; }
|
|
||||||
/// <inheritdoc cref="IReceiveDocument.ItemCount"/>
|
|
||||||
public int ItemCount { get; init; }
|
|
||||||
/// <inheritdoc cref="IReceiveDocument.OpenItemCount"/>
|
|
||||||
public int OpenItemCount { get; init; }
|
|
||||||
}
|
|
@ -1,162 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Caching;
|
|
||||||
using Connected.Entities;
|
|
||||||
using Connected.Entities.Storage;
|
|
||||||
using Connected.Notifications.Events;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
using Connected.Services;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
internal sealed class ReceiveDocumentItemOps
|
|
||||||
{
|
|
||||||
public sealed class Insert : ServiceFunction<InsertReceiveItemArgs, long>
|
|
||||||
{
|
|
||||||
public Insert(IStorageProvider storage, IEventService events)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Events = events;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
|
|
||||||
protected override async Task<long> OnInvoke()
|
|
||||||
{
|
|
||||||
var result = await Storage.Open<ReceiveItem>().Update(Arguments.AsEntity<ReceiveItem>(State.New));
|
|
||||||
|
|
||||||
return result.Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Events.Enqueue(this, typeof(ReceiveDocumentService), nameof(IReceiveDocumentService.ItemInserted), new PrimaryKeyArgs<long> { Id = Result });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Delete : ServiceAction<PrimaryKeyArgs<long>>
|
|
||||||
{
|
|
||||||
public Delete(IStorageProvider storage, IEventService events, ICacheContext cache, IReceiveDocumentService documents)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Events = events;
|
|
||||||
Cache = cache;
|
|
||||||
Documents = documents;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
private ICacheContext Cache { get; }
|
|
||||||
private IReceiveDocumentService Documents { get; }
|
|
||||||
|
|
||||||
protected override async Task OnInvoke()
|
|
||||||
{
|
|
||||||
if (SetState(await Documents.SelectItem(Arguments)) is not IReceiveItem entity)
|
|
||||||
return;
|
|
||||||
|
|
||||||
await Storage.Open<ReceiveItem>().Update(Arguments.AsEntity<ReceiveItem>(State.Deleted));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Cache.Remove(ReceiveItem.EntityKey, Arguments.Id);
|
|
||||||
await Events.Enqueue(this, Documents, nameof(IReceiveDocumentService.ItemDeleted), Arguments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Query : ServiceFunction<PrimaryKeyArgs<int>, ImmutableList<IReceiveItem>>
|
|
||||||
{
|
|
||||||
public Query(IStorageProvider storage)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
|
|
||||||
protected override async Task<ImmutableList<IReceiveItem>> OnInvoke()
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<ReceiveItem>() where e.Document == Arguments.Id select e).AsEntities<IReceiveItem>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Select : NullableServiceFunction<PrimaryKeyArgs<long>, IReceiveItem?>
|
|
||||||
{
|
|
||||||
public Select(IStorageProvider storage, ICacheContext cache)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICacheContext Cache { get; }
|
|
||||||
|
|
||||||
protected override async Task<IReceiveItem?> OnInvoke()
|
|
||||||
{
|
|
||||||
return await Cache.Get(ReceiveItem.EntityKey, Arguments.Id, async (f) =>
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<ReceiveItem>() where e.Id == Arguments.Id select e).AsEntity();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class SelectByEntity : NullableServiceFunction<SelectReceiveItemArgs, IReceiveItem?>
|
|
||||||
{
|
|
||||||
public SelectByEntity(IStorageProvider storage, ICacheContext cache)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICacheContext Cache { get; }
|
|
||||||
|
|
||||||
protected override async Task<IReceiveItem?> OnInvoke()
|
|
||||||
{
|
|
||||||
return await Cache.Get(ReceiveItem.EntityKey,
|
|
||||||
f => f.Document == Arguments.Document
|
|
||||||
&& string.Equals(f.Entity, Arguments.Entity, StringComparison.OrdinalIgnoreCase)
|
|
||||||
&& string.Equals(f.EntityId, Arguments.EntityId, StringComparison.OrdinalIgnoreCase), async (f) =>
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<ReceiveItem>()
|
|
||||||
where e.Document == Arguments.Document
|
|
||||||
&& string.Equals(e.Entity, Arguments.Entity, StringComparison.OrdinalIgnoreCase)
|
|
||||||
&& string.Equals(e.EntityId, Arguments.EntityId, StringComparison.OrdinalIgnoreCase)
|
|
||||||
select e).AsEntity();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Update : ServiceAction<UpdateReceiveItemArgs>
|
|
||||||
{
|
|
||||||
public Update(IStorageProvider storage, ICacheContext cache, IEventService events, IReceiveDocumentService documents)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
Events = events;
|
|
||||||
Documents = documents;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICacheContext Cache { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
private IReceiveDocumentService Documents { get; }
|
|
||||||
|
|
||||||
protected override async Task OnInvoke()
|
|
||||||
{
|
|
||||||
if (await Documents.SelectItem(Arguments.Id) is not ReceiveItem entity)
|
|
||||||
return;
|
|
||||||
|
|
||||||
await Storage.Open<ReceiveItem>().Update(entity, Arguments, async () =>
|
|
||||||
{
|
|
||||||
await Cache.Remove(ReceiveItem.EntityKey, Arguments.Id);
|
|
||||||
|
|
||||||
return (await Documents.SelectItem(Arguments.Id)) as ReceiveItem;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Cache.Remove(ReceiveItem.EntityKey, Arguments.Id);
|
|
||||||
await Events.Enqueue(this, Documents, nameof(IReceiveDocumentService.ItemUpdated), Arguments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,144 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Caching;
|
|
||||||
using Connected.Entities;
|
|
||||||
using Connected.Entities.Storage;
|
|
||||||
using Connected.Notifications.Events;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
using Connected.Services;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
internal sealed class ReceiveDocumentOps
|
|
||||||
{
|
|
||||||
public sealed class Delete : ServiceAction<PrimaryKeyArgs<int>>
|
|
||||||
{
|
|
||||||
public Delete(IReceiveDocumentService documents, IStorageProvider storage, ICacheContext cache, IEventService events)
|
|
||||||
{
|
|
||||||
Documents = documents;
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
Events = events;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IReceiveDocumentService Documents { get; }
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICacheContext Cache { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
|
|
||||||
protected override async Task OnInvoke()
|
|
||||||
{
|
|
||||||
if (SetState(await Documents.Select(Arguments)) is not IReceiveDocument document)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Delete all items
|
|
||||||
*/
|
|
||||||
foreach (var item in await Documents.QueryItems(document.Id))
|
|
||||||
await Documents.DeleteItem(item.Id);
|
|
||||||
/*
|
|
||||||
* Delete document
|
|
||||||
*/
|
|
||||||
await Storage.Open<ReceiveDocument>().Update(Arguments.AsEntity<ReceiveDocument>(State.Deleted));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Cache.Remove(ReceiveDocument.EntityKey, Arguments.Id);
|
|
||||||
await Events.Enqueue(this, Documents, nameof(IReceiveDocumentService.Deleted), Arguments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Insert : ServiceFunction<InsertReceiveDocumentArgs, int>
|
|
||||||
{
|
|
||||||
public Insert(IStorageProvider storage, IEventService events, IReceiveDocumentService documents)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Events = events;
|
|
||||||
Documents = documents;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
private IReceiveDocumentService Documents { get; }
|
|
||||||
|
|
||||||
protected override async Task<int> OnInvoke()
|
|
||||||
{
|
|
||||||
return (await Storage.Open<ReceiveDocument>().Update(Arguments.AsEntity<ReceiveDocument>(State.New))).Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Events.Enqueue(this, Documents, nameof(IReceiveDocumentService.Inserted), new PrimaryKeyArgs<int> { Id = Result });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Query : ServiceFunction<QueryArgs, ImmutableList<IReceiveDocument>>
|
|
||||||
{
|
|
||||||
public Query(IStorageProvider storage)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IStorageProvider Storage { get; }
|
|
||||||
|
|
||||||
protected override async Task<ImmutableList<IReceiveDocument>> OnInvoke()
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<ReceiveDocument>() select e).WithArguments(Arguments).AsEntities<IReceiveDocument>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Select : NullableServiceFunction<PrimaryKeyArgs<int>, IReceiveDocument?>
|
|
||||||
{
|
|
||||||
public Select(IStorageProvider storage, ICacheContext cache)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICacheContext Cache { get; }
|
|
||||||
|
|
||||||
protected override async Task<IReceiveDocument?> OnInvoke()
|
|
||||||
{
|
|
||||||
return await Cache.Get<ReceiveDocument>(ReceiveDocument.EntityKey, Arguments.Id, async (f) =>
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<ReceiveDocument>() where e.Id == Arguments.Id select e).AsEntity();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Update : ServiceAction<UpdateReceiveDocumentArgs>
|
|
||||||
{
|
|
||||||
public Update(IStorageProvider storage, ICacheContext cache, IEventService events, IReceiveDocumentService documents)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
Events = events;
|
|
||||||
Documents = documents;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICacheContext Cache { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
private IReceiveDocumentService Documents { get; }
|
|
||||||
|
|
||||||
protected override async Task OnInvoke()
|
|
||||||
{
|
|
||||||
if (await Documents.Select(Arguments.Id) is not ReceiveDocument entity)
|
|
||||||
return;
|
|
||||||
|
|
||||||
await Storage.Open<ReceiveDocument>().Update(entity, Arguments, async () =>
|
|
||||||
{
|
|
||||||
await Cache.Remove(ReceiveDocument.EntityKey, Arguments.Id);
|
|
||||||
|
|
||||||
return (await Documents.Select(Arguments.Id)) as ReceiveDocument;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Cache.Remove(ReceiveDocument.EntityKey, Arguments.Id);
|
|
||||||
await Events.Enqueue(this, Documents, nameof(IReceiveDocumentService.Updated), Arguments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,82 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Common.Documents;
|
|
||||||
using Connected.Entities;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
using ItemOps = Connected.Logistics.Documents.Receive.ReceiveDocumentItemOps;
|
|
||||||
using Ops = Connected.Logistics.Documents.Receive.ReceiveDocumentOps;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
/// <inheritdoc cref="IReceiveDocumentService"/>
|
|
||||||
internal sealed class ReceiveDocumentService : DocumentService<int, long>, IReceiveDocumentService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Create a new <see cref="ReceiveDocument"/> instance
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The DI scope used by this instance.</param>
|
|
||||||
public ReceiveDocumentService(IContext context) : base(context)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="IReceiveDocumentService.Delete(PrimaryKeyArgs{int})"/>
|
|
||||||
public async Task Delete(PrimaryKeyArgs<int> args)
|
|
||||||
{
|
|
||||||
await Invoke(GetOperation<Ops.Delete>(), args);
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="IReceiveDocumentService.DeleteItem(PrimaryKeyArgs{long})"/>
|
|
||||||
public async Task DeleteItem(PrimaryKeyArgs<long> args)
|
|
||||||
{
|
|
||||||
await Invoke(GetOperation<ItemOps.Delete>(), args);
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="IReceiveDocumentService.Insert(InsertReceiveDocumentArgs)"/>
|
|
||||||
public async Task<int> Insert(InsertReceiveDocumentArgs args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.Insert>(), args);
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="IReceiveDocumentService.InsertItem(InsertReceiveItemArgs)"/>
|
|
||||||
public async Task<long> InsertItem(InsertReceiveItemArgs args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<ItemOps.Insert>(), args);
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="IReceiveDocumentService.Patch(PatchArgs{int})"/>
|
|
||||||
public async Task Patch(PatchArgs<int> args)
|
|
||||||
{
|
|
||||||
if (await Select(args.Id) is not ReceiveDocument entity)
|
|
||||||
return;
|
|
||||||
|
|
||||||
await Update(args.Patch<UpdateReceiveDocumentArgs, ReceiveDocument>(entity));
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="IReceiveDocumentService.Query(QueryArgs?)"/>
|
|
||||||
public async Task<ImmutableList<IReceiveDocument>> Query(QueryArgs? args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.Query>(), args ?? QueryArgs.Default);
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="IReceiveDocumentService.QueryItems(PrimaryKeyArgs{int})"/>
|
|
||||||
public async Task<ImmutableList<IReceiveItem>> QueryItems(PrimaryKeyArgs<int> args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<ItemOps.Query>(), args);
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="IReceiveDocumentService.Select(PrimaryKeyArgs{int})"/>
|
|
||||||
public async Task<IReceiveDocument?> Select(PrimaryKeyArgs<int> args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.Select>(), args);
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="IReceiveDocumentService.SelectItem(PrimaryKeyArgs{long})"/>
|
|
||||||
public async Task<IReceiveItem?> SelectItem(PrimaryKeyArgs<long> args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<ItemOps.Select>(), args);
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="IReceiveDocumentService.SelectItem(SelectReceiveItemArgs)"/>
|
|
||||||
public async Task<IReceiveItem?> SelectItem(SelectReceiveItemArgs args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<ItemOps.SelectByEntity>(), args);
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="IReceiveDocumentService.Update(UpdateReceiveDocumentArgs)"/>
|
|
||||||
public async Task Update(UpdateReceiveDocumentArgs args)
|
|
||||||
{
|
|
||||||
await Invoke(GetOperation<Ops.Update>(), args);
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="IReceiveDocumentService.UpdateItem(UpdateReceiveItemArgs)"/>
|
|
||||||
public async Task UpdateItem(UpdateReceiveItemArgs args)
|
|
||||||
{
|
|
||||||
await Invoke(GetOperation<ItemOps.Update>(), args);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
using Connected.Annotations;
|
|
||||||
using Connected.Common;
|
|
||||||
using Connected.Entities;
|
|
||||||
using Connected.Entities.Annotations;
|
|
||||||
using Connected.Logistics.Types;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
|
|
||||||
/// <inheritdoc cref="IReceiveItem"/>
|
|
||||||
[Table(Schema = CommonSchemas.DocumentSchema)]
|
|
||||||
internal sealed record ReceiveItem : EntityContainer<long>, IReceiveItem
|
|
||||||
{
|
|
||||||
public const string EntityKey = $"{Domain.Code}.{nameof(ReceiveItem)}";
|
|
||||||
/// <inheritdoc cref="IReceiveItem.Document"/>
|
|
||||||
[Ordinal(0), Index]
|
|
||||||
public int Document { get; init; }
|
|
||||||
/// <inheritdoc cref="IReceiveItem.Quantity"/>
|
|
||||||
[Ordinal(1)]
|
|
||||||
public float Quantity { get; init; }
|
|
||||||
/// <inheritdoc cref="IReceiveItem.PostedQuantity"/>
|
|
||||||
[Ordinal(4)]
|
|
||||||
public float PostedQuantity { get; init; }
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
using Connected.Annotations;
|
|
||||||
using Connected.Entities.Annotations;
|
|
||||||
using Connected.Entities.Consistency;
|
|
||||||
using Connected.Logistics.Types;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
/// <inheritdoc cref="IReceivePlannedItem"/>
|
|
||||||
[Table(Schema = Domain.Code)]
|
|
||||||
internal sealed record ReceivePlannedItem : ConsistentEntity<long>, IReceivePlannedItem
|
|
||||||
{
|
|
||||||
public const string EntityKey = $"{Domain.Code}.{nameof(ReceivePlannedItem)}";
|
|
||||||
|
|
||||||
/// <inheritdoc cref="IReceivePlannedItem.Document"/>
|
|
||||||
[Ordinal(0), Index]
|
|
||||||
public int Document { get; init; }
|
|
||||||
/// <inheritdoc cref="IReceivePlannedItem.Item"/>
|
|
||||||
[Ordinal(1), Index]
|
|
||||||
public int Item { get; init; }
|
|
||||||
/// <inheritdoc cref="IReceivePlannedItem.Quantity"/>
|
|
||||||
[Ordinal(2)]
|
|
||||||
public float Quantity { get; init; }
|
|
||||||
/// <inheritdoc cref="IReceivePlannedItem.PostedQuantity"/>
|
|
||||||
[Ordinal(3)]
|
|
||||||
public float PostedQuantity { get; init; }
|
|
||||||
}
|
|
@ -1,128 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Caching;
|
|
||||||
using Connected.Entities;
|
|
||||||
using Connected.Entities.Storage;
|
|
||||||
using Connected.Interop;
|
|
||||||
using Connected.Notifications.Events;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
using Connected.Services;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
internal sealed class ReceivePlannedItemsOps
|
|
||||||
{
|
|
||||||
public sealed class Query : ServiceFunction<PrimaryKeyArgs<int>, ImmutableList<IReceivePlannedItem>>
|
|
||||||
{
|
|
||||||
public Query(IStorageProvider storage)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
|
|
||||||
protected override async Task<ImmutableList<IReceivePlannedItem>> OnInvoke()
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<ReceivePlannedItem>() where e.Document == Arguments.Id select e).AsEntities<IReceivePlannedItem>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class QueryByItem : ServiceFunction<PrimaryKeyArgs<long>, ImmutableList<IReceivePlannedItem>>
|
|
||||||
{
|
|
||||||
public QueryByItem(IStorageProvider storage)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
|
|
||||||
protected override async Task<ImmutableList<IReceivePlannedItem>> OnInvoke()
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<ReceivePlannedItem>() where e.Item == Arguments.Id select e).AsEntities<IReceivePlannedItem>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Select : NullableServiceFunction<PrimaryKeyArgs<long>, IReceivePlannedItem>
|
|
||||||
{
|
|
||||||
public Select(IStorageProvider storage, ICacheContext cache)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICacheContext Cache { get; }
|
|
||||||
|
|
||||||
protected override async Task<IReceivePlannedItem?> OnInvoke()
|
|
||||||
{
|
|
||||||
return await Cache.Get(ReceivePlannedItem.EntityKey, Arguments.Id, async (f) =>
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<ReceivePlannedItem>() where e.Id == Arguments.Id select e).AsEntity();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class SelectByEntity : NullableServiceFunction<SelectReceivePlannedItemArgs, IReceivePlannedItem>
|
|
||||||
{
|
|
||||||
public SelectByEntity(IStorageProvider storage, ICacheContext cache, IReceiveDocumentService documents, IReceivePostingDocumentService postingDocuments)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
Documents = documents;
|
|
||||||
PostingDocuments = postingDocuments;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICacheContext Cache { get; }
|
|
||||||
private IReceiveDocumentService Documents { get; }
|
|
||||||
private IReceivePostingDocumentService PostingDocuments { get; }
|
|
||||||
|
|
||||||
protected override async Task<IReceivePlannedItem?> OnInvoke()
|
|
||||||
{
|
|
||||||
if (await PostingDocuments.Select(Arguments.Document) is not IReceivePostingDocument postingDocument)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
if (await Documents.SelectItem(Arguments.AsArguments<SelectReceiveItemArgs>(new { postingDocument.Document })) is not IReceiveItem item)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
return await Cache.Get<IReceivePlannedItem>(ReceivePlannedItem.EntityKey, f => f.Item == item.Id, async (f) =>
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<ReceivePlannedItem>() where e.Item == item.Id select e).AsEntity();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Update : ServiceAction<UpdateReceivePlannedItemArgs>
|
|
||||||
{
|
|
||||||
public Update(IStorageProvider storage, ICacheContext cache, IEventService events, IReceivePostingDocumentService documents)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
Events = events;
|
|
||||||
Documents = documents;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICacheContext Cache { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
private IReceivePostingDocumentService Documents { get; }
|
|
||||||
|
|
||||||
protected override async Task OnInvoke()
|
|
||||||
{
|
|
||||||
if (await Documents.SelectPlannedItem(Arguments.Id) is not ReceivePlannedItem entity)
|
|
||||||
return;
|
|
||||||
|
|
||||||
await Storage.Open<ReceivePlannedItem>().Update(entity, Arguments, async () =>
|
|
||||||
{
|
|
||||||
await Cache.Remove(ReceivePlannedItem.EntityKey, Arguments.Id);
|
|
||||||
|
|
||||||
return (await Documents.SelectPlannedItem(Arguments.Id)) as ReceivePlannedItem;
|
|
||||||
});
|
|
||||||
|
|
||||||
await Cache.Remove(ReceivePlannedItem.EntityKey, Arguments.Id);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Events.Enqueue(this, Documents, nameof(IReceivePostingDocumentService.PlannedItemUpdated), Arguments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
using Connected.Annotations;
|
|
||||||
using Connected.Common.Documents;
|
|
||||||
using Connected.Entities.Annotations;
|
|
||||||
using Connected.Logistics.Types;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
/// <inheritdoc cref="IReceivePostingDocument"/>
|
|
||||||
[Table(Schema = Domain.Code)]
|
|
||||||
internal sealed record ReceivePostingDocument : Document<int>, IReceivePostingDocument
|
|
||||||
{
|
|
||||||
public const string EntityKey = $"{Domain.Code}.{nameof(ReceivePostingDocument)}";
|
|
||||||
|
|
||||||
/// <inheritdoc cref="IReceivePostingDocument.Document"/>
|
|
||||||
[Ordinal(0)]
|
|
||||||
public int Document { get; init; }
|
|
||||||
/// <inheritdoc cref="IReceivePostingDocument.OpenItemCount"/>
|
|
||||||
[Ordinal(1)]
|
|
||||||
public int OpenItemCount { get; init; }
|
|
||||||
/// <inheritdoc cref="IReceivePostingDocument.ItemCount"/>
|
|
||||||
[Ordinal(2)]
|
|
||||||
public int ItemCount { get; init; }
|
|
||||||
}
|
|
@ -1,133 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Caching;
|
|
||||||
using Connected.Entities;
|
|
||||||
using Connected.Entities.Storage;
|
|
||||||
using Connected.Notifications.Events;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
using Connected.Services;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
internal sealed class ReceivePostingDocumentOps
|
|
||||||
{
|
|
||||||
public sealed class Delete : ServiceAction<PrimaryKeyArgs<int>>
|
|
||||||
{
|
|
||||||
public Delete(IStorageProvider storage, ICacheContext cache, IEventService events, IReceivePostingDocumentService documents)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
Events = events;
|
|
||||||
Documents = documents;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICacheContext Cache { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
private IReceivePostingDocumentService Documents { get; }
|
|
||||||
|
|
||||||
protected override async Task OnInvoke()
|
|
||||||
{
|
|
||||||
await Storage.Open<ReceivePostingDocument>().Update(Arguments.AsEntity<ReceivePostingDocument>(State.Deleted));
|
|
||||||
await Cache.Remove(ReceivePostingDocument.EntityKey, Arguments.Id);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Events.Enqueue(this, Documents, nameof(IReceivePostingDocumentService.Deleted), Arguments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Insert : ServiceFunction<InsertReceivePostingDocumentArgs, int>
|
|
||||||
{
|
|
||||||
public Insert(IStorageProvider storage, IEventService events, IReceivePostingDocumentService documents)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Events = events;
|
|
||||||
Documents = documents;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
private IReceivePostingDocumentService Documents { get; }
|
|
||||||
|
|
||||||
protected override async Task<int> OnInvoke()
|
|
||||||
{
|
|
||||||
return (await Storage.Open<ReceivePostingDocument>().Update(Arguments.AsEntity<ReceivePostingDocument>(State.New))).Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Events.Enqueue(this, Documents, nameof(IReceivePostingDocumentService.Inserted), new PrimaryKeyArgs<int> { Id = Result });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Query : ServiceFunction<PrimaryKeyArgs<int>, ImmutableList<IReceivePostingDocument>>
|
|
||||||
{
|
|
||||||
public Query(IStorageProvider storage)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
|
|
||||||
protected override async Task<ImmutableList<IReceivePostingDocument>> OnInvoke()
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<ReceivePostingDocument>() where e.Document == Arguments.Id select e).AsEntities<IReceivePostingDocument>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Select : NullableServiceFunction<PrimaryKeyArgs<int>, IReceivePostingDocument>
|
|
||||||
{
|
|
||||||
public Select(IStorageProvider storage, ICacheContext cache)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICacheContext Cache { get; }
|
|
||||||
|
|
||||||
protected override async Task<IReceivePostingDocument?> OnInvoke()
|
|
||||||
{
|
|
||||||
return await Cache.Get(ReceivePostingDocument.EntityKey, Arguments.Id, async (f) =>
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<ReceivePostingDocument>() where e.Id == Arguments.Id select e).AsEntity();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Update : ServiceAction<UpdateReceivePostingDocumentArgs>
|
|
||||||
{
|
|
||||||
public Update(IStorageProvider storage, ICacheContext cache, IEventService events, IReceivePostingDocumentService documents)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
Events = events;
|
|
||||||
Documents = documents;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICacheContext Cache { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
private IReceivePostingDocumentService Documents { get; }
|
|
||||||
|
|
||||||
protected override async Task OnInvoke()
|
|
||||||
{
|
|
||||||
if (await Documents.Select(Arguments.Id) is not ReceivePostingDocument entity)
|
|
||||||
return;
|
|
||||||
|
|
||||||
await Storage.Open<ReceivePostingDocument>().Update(entity, Arguments, async () =>
|
|
||||||
{
|
|
||||||
await Cache.Remove(ReceivePostingDocument.EntityKey, Arguments.Id);
|
|
||||||
|
|
||||||
return (await Documents.Select(Arguments.Id)) as ReceivePostingDocument;
|
|
||||||
});
|
|
||||||
|
|
||||||
await Cache.Remove(ReceivePostingDocument.EntityKey, Arguments.Id);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Events.Enqueue(this, Documents, nameof(IReceivePostingDocumentService.Updated), Arguments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,98 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Common.Documents;
|
|
||||||
using Connected.Entities;
|
|
||||||
using Connected.Notifications;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
using ItemOps = Connected.Logistics.Documents.Receive.ReceivePostingItemOps;
|
|
||||||
using Ops = Connected.Logistics.Documents.Receive.ReceivePostingDocumentOps;
|
|
||||||
using PlannedOps = Connected.Logistics.Documents.Receive.ReceivePlannedItemsOps;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
internal sealed class ReceivePostingDocumentService : DocumentService<int, long>, IReceivePostingDocumentService
|
|
||||||
{
|
|
||||||
public event ServiceEventHandler<PrimaryKeyEventArgs<long>> PlannedItemUpdated;
|
|
||||||
public ReceivePostingDocumentService(IContext context) : base(context)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task Delete(PrimaryKeyArgs<int> args)
|
|
||||||
{
|
|
||||||
await Invoke(GetOperation<Ops.Delete>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<int> Insert(InsertReceivePostingDocumentArgs args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.Insert>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<long> InsertItem(InsertReceivePostingItemArgs args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<ItemOps.Insert>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task Patch(PatchArgs<int> args)
|
|
||||||
{
|
|
||||||
if (await Select(args.Id) is not ReceivePostingDocument entity)
|
|
||||||
return;
|
|
||||||
|
|
||||||
await Update(entity.Merge(args, State.Default).AsArguments<UpdateReceivePostingDocumentArgs>());
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task PatchPlanedItem(PatchArgs<long> args)
|
|
||||||
{
|
|
||||||
if (await SelectPlannedItem(args.Id) is not ReceivePlannedItem entity)
|
|
||||||
return;
|
|
||||||
|
|
||||||
await UpdatePlannedItem(entity.Merge(args, State.Default).AsArguments<UpdateReceivePlannedItemArgs>());
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<ImmutableList<IReceivePostingDocument>> Query(PrimaryKeyArgs<int> args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.Query>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<ImmutableList<IReceivePostingItem>> QueryItems(PrimaryKeyArgs<int> args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<ItemOps.Query>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<ImmutableList<IReceivePlannedItem>> QueryPlannedItems(PrimaryKeyArgs<int> args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<PlannedOps.Query>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<ImmutableList<IReceivePlannedItem>> QueryPlannedItems(PrimaryKeyArgs<long> args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<PlannedOps.QueryByItem>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<IReceivePostingDocument?> Select(PrimaryKeyArgs<int> args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.Select>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<IReceivePostingItem?> SelectItem(PrimaryKeyArgs<long> args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<ItemOps.Select>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<IReceivePlannedItem?> SelectPlannedItem(PrimaryKeyArgs<long> args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<PlannedOps.Select>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<IReceivePlannedItem?> SelectPlannedItem(SelectReceivePlannedItemArgs args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<PlannedOps.SelectByEntity>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task Update(UpdateReceivePostingDocumentArgs args)
|
|
||||||
{
|
|
||||||
await Invoke(GetOperation<Ops.Update>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task UpdatePlannedItem(UpdateReceivePlannedItemArgs args)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
using Connected.Annotations;
|
|
||||||
using Connected.Entities.Annotations;
|
|
||||||
using Connected.Entities.Consistency;
|
|
||||||
using Connected.Logistics.Types;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
/// <inheritdoc cref="IReceivePostingItem"/>
|
|
||||||
[Table(Schema = Domain.Code)]
|
|
||||||
internal sealed record ReceivePostingItem : ConsistentEntity<long>, IReceivePostingItem
|
|
||||||
{
|
|
||||||
public const string EntityKey = $"{Domain.Code}.{nameof(ReceivePostingItem)}";
|
|
||||||
/// <inheritdoc cref="IReceivePostingItem.Document"/>
|
|
||||||
[Ordinal(0)]
|
|
||||||
public int Document { get; init; }
|
|
||||||
/// <inheritdoc cref="IReceivePostingItem.Serial"/>
|
|
||||||
[Ordinal(1)]
|
|
||||||
public long Serial { get; init; }
|
|
||||||
/// <inheritdoc cref="IReceivePostingItem.Quantity"/>
|
|
||||||
[Ordinal(2)]
|
|
||||||
public float Quantity { get; init; }
|
|
||||||
/// <inheritdoc cref="IReceivePostingItem.Location"/>
|
|
||||||
[Ordinal(3)]
|
|
||||||
public int Location { get; init; }
|
|
||||||
}
|
|
@ -1,70 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Caching;
|
|
||||||
using Connected.Entities;
|
|
||||||
using Connected.Entities.Storage;
|
|
||||||
using Connected.Notifications.Events;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
using Connected.Services;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
internal sealed class ReceivePostingItemOps
|
|
||||||
{
|
|
||||||
public sealed class Insert : ServiceFunction<InsertReceivePostingItemArgs, long>
|
|
||||||
{
|
|
||||||
public Insert(IStorageProvider storage, IEventService events, IReceivePostingDocumentService documents)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Events = events;
|
|
||||||
Documents = documents;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
private IReceivePostingDocumentService Documents { get; }
|
|
||||||
|
|
||||||
protected override async Task<long> OnInvoke()
|
|
||||||
{
|
|
||||||
return (await Storage.Open<ReceivePostingItem>().Update(Arguments.AsEntity<ReceivePostingItem>(State.New))).Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Events.Enqueue(this, Documents, nameof(IReceivePostingDocumentService.ItemInserted), new PrimaryKeyArgs<long> { Id = Result });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Query : ServiceFunction<PrimaryKeyArgs<int>, ImmutableList<IReceivePostingItem>>
|
|
||||||
{
|
|
||||||
public Query(IStorageProvider storage)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
|
|
||||||
protected override async Task<ImmutableList<IReceivePostingItem>> OnInvoke()
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<ReceivePostingItem>() where e.Document == Arguments.Id select e).AsEntities<IReceivePostingItem>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Select : NullableServiceFunction<PrimaryKeyArgs<long>, IReceivePostingItem>
|
|
||||||
{
|
|
||||||
public Select(IStorageProvider storage, ICacheContext cache)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICacheContext Cache { get; }
|
|
||||||
|
|
||||||
protected override async Task<IReceivePostingItem?> OnInvoke()
|
|
||||||
{
|
|
||||||
return await Cache.Get(ReceivePostingItem.EntityKey, Arguments.Id, async (f) =>
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<ReceivePostingItem>() where e.Id == Arguments.Id select e).AsEntity();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,64 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Connected.Annotations;
|
|
||||||
using Connected.Common.Documents;
|
|
||||||
using Connected.Contacts.Types;
|
|
||||||
using Connected.Data;
|
|
||||||
using Connected.Logistics.Types.Warehouses;
|
|
||||||
using Connected.Security.Identity;
|
|
||||||
using Connected.Validation;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Receive;
|
|
||||||
|
|
||||||
[Priority(0)]
|
|
||||||
internal sealed class InsertReceiveDocumentValidator : InsertDocumentValidator<InsertReceiveDocumentArgs>
|
|
||||||
{
|
|
||||||
public InsertReceiveDocumentValidator(IUserService users, IBusinessPartnerService businessPartners, IWarehouseService warehouses) : base(users)
|
|
||||||
{
|
|
||||||
BusinessPartners = businessPartners;
|
|
||||||
Warehouses = warehouses;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IBusinessPartnerService BusinessPartners { get; }
|
|
||||||
private IWarehouseService Warehouses { get; }
|
|
||||||
|
|
||||||
protected override async Task OnValidating()
|
|
||||||
{
|
|
||||||
await ValidateSupplier();
|
|
||||||
await ValidateWarehouse();
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task ValidateSupplier()
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* If supplier is not set there is no need for a validation.
|
|
||||||
*/
|
|
||||||
if (Arguments.Supplier is null)
|
|
||||||
return;
|
|
||||||
/*
|
|
||||||
* Check is business partner exists.
|
|
||||||
*/
|
|
||||||
if (await BusinessPartners.Select((int)Arguments.Supplier) is not IBusinessPartner supplier)
|
|
||||||
throw ValidationExceptions.NotFound(nameof(Arguments.Supplier), Arguments.Supplier);
|
|
||||||
/*
|
|
||||||
* Check if business partner has Supplier role which means it's actually a supplier.
|
|
||||||
*/
|
|
||||||
if (!supplier.Roles.HasFlag(CustomerRoles.Supplier))
|
|
||||||
throw new ValidationException($"{SR.ValPartnerNotSupplier} ({Arguments.Supplier})");
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task ValidateWarehouse()
|
|
||||||
{
|
|
||||||
if (Arguments.Warehouse is null)
|
|
||||||
return;
|
|
||||||
/*
|
|
||||||
* Check is warehouse exists.
|
|
||||||
*/
|
|
||||||
if (await Warehouses.Select(Arguments.Warehouse) is not IWarehouse warehouse)
|
|
||||||
throw ValidationExceptions.NotFound(nameof(Arguments.Warehouse), Arguments.Warehouse);
|
|
||||||
/*
|
|
||||||
* Only Enabled warehouses can be used.
|
|
||||||
*/
|
|
||||||
if (warehouse.Status == Status.Disabled)
|
|
||||||
throw ValidationExceptions.Disabled(nameof(Arguments.Warehouse));
|
|
||||||
}
|
|
||||||
}
|
|
72
src/Connected.Logistics.Documents/SR.Designer.cs
generated
72
src/Connected.Logistics.Documents/SR.Designer.cs
generated
@ -1,72 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by a tool.
|
|
||||||
// Runtime Version:4.0.30319.42000
|
|
||||||
//
|
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||||
// the code is regenerated.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents {
|
|
||||||
using System;
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
|
||||||
/// </summary>
|
|
||||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
|
||||||
// class via a tool like ResGen or Visual Studio.
|
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
|
||||||
// with the /str option, or rebuild your VS project.
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
internal class SR {
|
|
||||||
|
|
||||||
private static global::System.Resources.ResourceManager resourceMan;
|
|
||||||
|
|
||||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
|
||||||
|
|
||||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
|
||||||
internal SR() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the cached ResourceManager instance used by this class.
|
|
||||||
/// </summary>
|
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
|
||||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
|
||||||
get {
|
|
||||||
if (object.ReferenceEquals(resourceMan, null)) {
|
|
||||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Connected.Logistics.Documents.SR", typeof(SR).Assembly);
|
|
||||||
resourceMan = temp;
|
|
||||||
}
|
|
||||||
return resourceMan;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Overrides the current thread's CurrentUICulture property for all
|
|
||||||
/// resource lookups using this strongly typed resource class.
|
|
||||||
/// </summary>
|
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
|
||||||
internal static global::System.Globalization.CultureInfo Culture {
|
|
||||||
get {
|
|
||||||
return resourceCulture;
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
resourceCulture = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Business partner is not a supplier..
|
|
||||||
/// </summary>
|
|
||||||
internal static string ValPartnerNotSupplier {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("ValPartnerNotSupplier", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,123 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<root>
|
|
||||||
<!--
|
|
||||||
Microsoft ResX Schema
|
|
||||||
|
|
||||||
Version 2.0
|
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
|
||||||
that is mostly human readable. The generation and parsing of the
|
|
||||||
various data types are done through the TypeConverter classes
|
|
||||||
associated with the data types.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
|
||||||
<resheader name="version">2.0</resheader>
|
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
|
||||||
<comment>This is a comment</comment>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
|
||||||
name/value pairs.
|
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
|
||||||
text/value conversion through the TypeConverter architecture.
|
|
||||||
Classes that don't support this are serialized and stored with the
|
|
||||||
mimetype set.
|
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
|
||||||
read any of the formats listed below.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
|
||||||
value : The object must be serialized into a byte array
|
|
||||||
: using a System.ComponentModel.TypeConverter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
-->
|
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:choice maxOccurs="unbounded">
|
|
||||||
<xsd:element name="metadata">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="assembly">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="data">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="resheader">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:schema>
|
|
||||||
<resheader name="resmimetype">
|
|
||||||
<value>text/microsoft-resx</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="version">
|
|
||||||
<value>2.0</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="reader">
|
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="writer">
|
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<data name="ValPartnerNotSupplier" xml:space="preserve">
|
|
||||||
<value>Business partner is not a supplier.</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
|
@ -1,10 +0,0 @@
|
|||||||
using Connected.Annotations;
|
|
||||||
|
|
||||||
[assembly: MicroService(MicroServiceType.Process)]
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents;
|
|
||||||
|
|
||||||
internal sealed class Bootstrapper : Startup
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<RootNamespace>Connected.Logistics.Documents</RootNamespace>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\..\Connected.Common\src\Connected.Common\Connected.Common.csproj" />
|
|
||||||
<ProjectReference Include="..\..\..\Connected\src\Connected\Connected.csproj" />
|
|
||||||
<ProjectReference Include="..\..\..\Connected.Framework\src\Connected.Data\Connected.Data.csproj" />
|
|
||||||
<ProjectReference Include="..\..\..\Connected.Framework\src\Connected.Entities\Connected.Entities.csproj" />
|
|
||||||
<ProjectReference Include="..\..\..\Connected.Framework\src\Connected.Hosting\Connected.Hosting.csproj" />
|
|
||||||
<ProjectReference Include="..\..\..\Connected.Framework\src\Connected.Runtime\Connected.Runtime.csproj" />
|
|
||||||
<ProjectReference Include="..\..\..\Connected.Framework\src\Connected.Services\Connected.Services.csproj" />
|
|
||||||
<ProjectReference Include="..\Connected.Logistics.Documents.Model\Connected.Logistics.Documents.Model.csproj" />
|
|
||||||
<ProjectReference Include="..\Connected.Logistics.Stock.Model\Connected.Logistics.Stock.Model.csproj" />
|
|
||||||
<ProjectReference Include="..\Connected.Logistics.Types.Model\Connected.Logistics.Types.Model.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
@ -1,74 +0,0 @@
|
|||||||
using Connected.Logistics.Documents.Receive;
|
|
||||||
using Connected.Middleware.Annotations;
|
|
||||||
using Connected.Notifications;
|
|
||||||
using Connected.Notifications.Events;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Listeners;
|
|
||||||
[Middleware<IReceivePostingDocumentService>(nameof(IReceivePostingDocumentService.PlannedItemUpdated))]
|
|
||||||
internal sealed class PlannedItemListener : EventListener<PrimaryKeyEventArgs<long>>
|
|
||||||
{
|
|
||||||
public PlannedItemListener(ILogger<PlannedItemListener> logger, IReceivePostingDocumentService documents, IReceiveDocumentService receiveDocuments)
|
|
||||||
{
|
|
||||||
Logger = logger;
|
|
||||||
Documents = documents;
|
|
||||||
ReceiveDocuments = receiveDocuments;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ILogger<PlannedItemListener> Logger { get; }
|
|
||||||
private IReceivePostingDocumentService Documents { get; }
|
|
||||||
private IReceiveDocumentService ReceiveDocuments { get; }
|
|
||||||
|
|
||||||
protected override async Task OnInvoke()
|
|
||||||
{
|
|
||||||
if (await Documents.SelectPlannedItem(Arguments.Id) is not IReceivePlannedItem item)
|
|
||||||
{
|
|
||||||
Logger.LogWarning("The IReceivePlannedItem not found ({id}}.", Arguments.Id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (await ReceiveDocuments.SelectItem(item.Item) is not IReceiveItem receiveItem)
|
|
||||||
{
|
|
||||||
Logger.LogWarning("The IReceiveItem not found ({id}}.", item.Item);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (await Documents.Select(item.Document) is not IReceivePostingDocument document)
|
|
||||||
{
|
|
||||||
Logger.LogWarning("The IReceivePostingDocument not found ({id}}.", item.Document);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
await UpdateOpenItems(document);
|
|
||||||
await UpdatePostedQuantity(receiveItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task UpdateOpenItems(IReceivePostingDocument document)
|
|
||||||
{
|
|
||||||
var items = await Documents.QueryPlannedItems(new PrimaryKeyArgs<int> { Id = document.Id });
|
|
||||||
|
|
||||||
await Documents.Patch(new PatchArgs<int>
|
|
||||||
{
|
|
||||||
Id = document.Id,
|
|
||||||
Properties = new Dictionary<string, object>
|
|
||||||
{
|
|
||||||
{nameof(IReceivePostingDocument.OpenItemCount), items.Count(f => f.PostedQuantity < f.Quantity) }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task UpdatePostedQuantity(IReceiveItem item)
|
|
||||||
{
|
|
||||||
var items = await Documents.QueryPlannedItems(new PrimaryKeyArgs<long> { Id = item.Id });
|
|
||||||
|
|
||||||
await Documents.PatchPlanedItem(new PatchArgs<long>
|
|
||||||
{
|
|
||||||
Id = item.Id,
|
|
||||||
Properties = new Dictionary<string, object>
|
|
||||||
{
|
|
||||||
{nameof(IReceiveItem.PostedQuantity), items.Sum(f => f.PostedQuantity) }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,89 +0,0 @@
|
|||||||
using Connected.Logistics.Documents.Receive;
|
|
||||||
using Connected.Logistics.Stock;
|
|
||||||
using Connected.Logistics.Types.Serials;
|
|
||||||
using Connected.Middleware.Annotations;
|
|
||||||
using Connected.Notifications;
|
|
||||||
using Connected.Notifications.Events;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Listeners;
|
|
||||||
/// <summary>
|
|
||||||
/// Represents the event listener to the <see cref="IReceivePostingDocumentService"/> Updated event.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// This middleware reacts when the item is inserted and updates the <see cref="IStockItem"/>.
|
|
||||||
/// </remarks>
|
|
||||||
[Middleware<IReceivePostingDocumentService>(nameof(IReceivePostingDocumentService.ItemInserted))]
|
|
||||||
internal sealed class PostingItemListener : EventListener<PrimaryKeyEventArgs<long>>
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Creates a new instance of the <see cref="PostingItemListener"/>
|
|
||||||
/// </summary>
|
|
||||||
public PostingItemListener(ILogger<PostingItemListener> logger, IStockService stock, IReceivePostingDocumentService documents, ISerialService serials)
|
|
||||||
{
|
|
||||||
Logger = logger;
|
|
||||||
Stock = stock;
|
|
||||||
Documents = documents;
|
|
||||||
Serials = serials;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ILogger<PostingItemListener> Logger { get; }
|
|
||||||
private IStockService Stock { get; }
|
|
||||||
private IReceivePostingDocumentService Documents { get; }
|
|
||||||
private ISerialService Serials { get; }
|
|
||||||
|
|
||||||
protected override async Task OnInvoke()
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Stage 1 is to prepare all data neede to perform operation
|
|
||||||
*
|
|
||||||
* Load posting item
|
|
||||||
*/
|
|
||||||
if (await Documents.SelectItem(Arguments.Id) is not IReceivePostingItem item)
|
|
||||||
{
|
|
||||||
Logger.LogWarning("The IReceivePostingItem not found ({id}}.", Arguments.Id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Now load the serial number
|
|
||||||
*/
|
|
||||||
if (await Serials.Select(item.Serial) is not ISerial serial)
|
|
||||||
{
|
|
||||||
Logger.LogWarning("The ISerial not found ({id}}.", item.Serial);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* Now load the serial number
|
|
||||||
*/
|
|
||||||
if (await Documents.SelectPlannedItem(new SelectReceivePlannedItemArgs
|
|
||||||
{
|
|
||||||
Document = item.Document,
|
|
||||||
Entity = serial.Entity,
|
|
||||||
EntityId = serial.EntityId
|
|
||||||
}) is not ISerial plannedItem)
|
|
||||||
{
|
|
||||||
Logger.LogWarning("The IReceivePlannedItem not found ({entity}, {entityId}).", serial.Entity, serial.EntityId);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* The idea here is simple:
|
|
||||||
* update (increase) the stock for the specified item
|
|
||||||
* and posted quantity and update the statictics for
|
|
||||||
* the immediate parents.
|
|
||||||
*/
|
|
||||||
await Stock.Update(new UpdateStockArgs
|
|
||||||
{
|
|
||||||
Location = item.Location,
|
|
||||||
Quantity = item.Quantity,
|
|
||||||
Serial = item.Serial
|
|
||||||
});
|
|
||||||
/*
|
|
||||||
* Now update the planned item with posted quantity
|
|
||||||
*/
|
|
||||||
await Documents.UpdatePlannedItem(new UpdateReceivePlannedItemArgs
|
|
||||||
{
|
|
||||||
Id = plannedItem.Id,
|
|
||||||
PostedQuantity = item.Quantity
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
using Connected.Logistics.Documents.Receive;
|
|
||||||
using Connected.Middleware.Annotations;
|
|
||||||
using Connected.Notifications;
|
|
||||||
using Connected.Notifications.Events;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Listeners;
|
|
||||||
[Middleware<IReceiveDocumentService>(nameof(IReceiveDocumentService.ItemUpdated))]
|
|
||||||
internal sealed class ReceiveItemListener : EventListener<PrimaryKeyEventArgs<long>>
|
|
||||||
{
|
|
||||||
public ReceiveItemListener(ILogger<ReceiveItemListener> logger, IReceiveDocumentService documents)
|
|
||||||
{
|
|
||||||
Logger = logger;
|
|
||||||
Documents = documents;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ILogger<ReceiveItemListener> Logger { get; }
|
|
||||||
private IReceiveDocumentService Documents { get; }
|
|
||||||
|
|
||||||
protected override async Task OnInvoke()
|
|
||||||
{
|
|
||||||
if (await Documents.SelectItem(Arguments.Id) is not IReceiveItem item)
|
|
||||||
{
|
|
||||||
Logger.LogWarning("The IReceiveItem not found ({id}}.", Arguments.Id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var items = await Documents.QueryItems(item.Document);
|
|
||||||
|
|
||||||
await Documents.Patch(new PatchArgs<int>
|
|
||||||
{
|
|
||||||
Id = item.Document,
|
|
||||||
Properties = new Dictionary<string, object>
|
|
||||||
{
|
|
||||||
{nameof(IReceiveDocument.OpenItemCount), items.Count(f=>f.PostedQuantity<f.Quantity)}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
using Connected.Data.DataProtection;
|
|
||||||
using Connected.Data.EntityProtection;
|
|
||||||
using Connected.Logistics.Documents.Receive;
|
|
||||||
using Connected.Middleware;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Documents.Protection;
|
|
||||||
internal sealed class ReceiveProtector : MiddlewareComponent, IEntityProtector<IReceiveDocument>
|
|
||||||
{
|
|
||||||
public ReceiveProtector(IReceiveDocumentService documents)
|
|
||||||
{
|
|
||||||
Documents = documents;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IReceiveDocumentService Documents { get; }
|
|
||||||
|
|
||||||
public async Task Invoke(EntityProtectionArgs<IReceiveDocument> args)
|
|
||||||
{
|
|
||||||
if (await Documents.Select(new PrimaryKeyArgs<int> { Id = args.Entity.Id }) is not IReceiveDocument document)
|
|
||||||
return;
|
|
||||||
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
@ -1,9 +0,0 @@
|
|||||||
using Connected.Data;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Stock.Aggregations;
|
|
||||||
public interface IStockAggregation : IPrimaryKey<long>
|
|
||||||
{
|
|
||||||
long Stock { get; init; }
|
|
||||||
DateTimeOffset Date { get; init; }
|
|
||||||
float Quantity { get; init; }
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<RootNamespace>Connected.Logistics.Stock</RootNamespace>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\..\Connected\src\Connected\Connected.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
@ -1,33 +0,0 @@
|
|||||||
using Connected.Data;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Stock;
|
|
||||||
/// <summary>
|
|
||||||
/// The stock descriptor which describes what kind of entity it
|
|
||||||
/// represents. The entity could be Product, Semi product or any
|
|
||||||
/// other type of entity.
|
|
||||||
/// </summary>
|
|
||||||
public interface IStock : IPrimaryKey<long>
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The type of the entity.
|
|
||||||
/// </summary>
|
|
||||||
string Entity { get; init; }
|
|
||||||
/// <summary>
|
|
||||||
/// The primary key of the entity.
|
|
||||||
/// </summary>
|
|
||||||
string EntityId { get; init; }
|
|
||||||
/// <summary>
|
|
||||||
/// The total quantity currently available.
|
|
||||||
/// </summary>
|
|
||||||
float Quantity { get; init; }
|
|
||||||
/// <summary>
|
|
||||||
/// The minimum quantity that should be always available
|
|
||||||
/// in the stock.
|
|
||||||
/// </summary>
|
|
||||||
float? Min { get; init; }
|
|
||||||
/// <summary>
|
|
||||||
/// The maximum quantity that should be stored in
|
|
||||||
/// the stock.
|
|
||||||
/// </summary>
|
|
||||||
float? Max { get; init; }
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
using Connected.Data;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Stock;
|
|
||||||
/// <summary>
|
|
||||||
/// Represents a single stock item.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Goods are typically stored in the warehouse. Warehouse is
|
|
||||||
/// organized into locations or storage bins and each location contains
|
|
||||||
/// zero or more goods.
|
|
||||||
/// </remarks>
|
|
||||||
public interface IStockItem : IPrimaryKey<long>
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The <see cref="IStock"/> to which the item belong.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Stock contains information about the type of the entity whereas
|
|
||||||
/// the stock item contains information about actual storage.
|
|
||||||
/// </remarks>
|
|
||||||
long Stock { get; init; }
|
|
||||||
/// <summary>
|
|
||||||
/// The location where the goods are stored.
|
|
||||||
/// </summary>
|
|
||||||
int Location { get; init; }
|
|
||||||
/// <summary>
|
|
||||||
/// The serial number of the goods.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Each item has a serial number which uniquely identifies
|
|
||||||
/// the items even from the same type but from
|
|
||||||
/// different documents.
|
|
||||||
/// </remarks>
|
|
||||||
long Serial { get; init; }
|
|
||||||
/// <summary>
|
|
||||||
/// The quantity left in this location. Once the quantity reaches zero
|
|
||||||
/// the item gets deleted from the location.
|
|
||||||
/// </summary>
|
|
||||||
float Quantity { get; init; }
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Annotations;
|
|
||||||
using Connected.Notifications;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Stock;
|
|
||||||
/// <summary>
|
|
||||||
/// Represents the service which manipulates with stock items.
|
|
||||||
/// </summary>
|
|
||||||
[Service]
|
|
||||||
[ServiceUrl(StockUrls.Stock)]
|
|
||||||
public interface IStockService : IServiceNotifications<long>
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Updates the stock items at the specified location.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args"></param>
|
|
||||||
Task Update(UpdateStockArgs args);
|
|
||||||
|
|
||||||
Task<IStock?> Select(PrimaryKeyArgs<long> args);
|
|
||||||
Task<IStock?> Select(EntityArgs args);
|
|
||||||
/// <summary>
|
|
||||||
/// Queries all stock items for the specified stock.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the id of the stock</param>
|
|
||||||
/// <returns>The list of stock items that belong to the specified stock id.</returns>
|
|
||||||
Task<ImmutableList<IStockItem>> QueryItems(PrimaryKeyArgs<long> args);
|
|
||||||
/// <summary>
|
|
||||||
/// Queries stock items for the specified stock that are present in the specified
|
|
||||||
/// warehouse location.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the crieria used by query.</param>
|
|
||||||
/// <returns>The list of stock items that are present in the specified warehouse location and
|
|
||||||
/// belong to the specified stock id.</returns>
|
|
||||||
Task<ImmutableList<IStockItem>> QueryItems(QueryStockItemsArgs args);
|
|
||||||
|
|
||||||
Task<IStockItem?> SelectItem(PrimaryKeyArgs<long> args);
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
using Connected.Annotations;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Stock;
|
|
||||||
/// <summary>
|
|
||||||
/// Represents the arguments when updating the stock items.
|
|
||||||
/// </summary>
|
|
||||||
public sealed class UpdateStockArgs : Dto
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The serial number of the item.
|
|
||||||
/// </summary>
|
|
||||||
[MinValue(1)]
|
|
||||||
public long Serial { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// The warehouse location where the items are stored.
|
|
||||||
/// </summary>
|
|
||||||
|
|
||||||
[MinValue(1)]
|
|
||||||
public int Location { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// The changed quantity. Can be a positive or negative
|
|
||||||
/// value.
|
|
||||||
/// </summary>
|
|
||||||
public float Quantity { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class QueryStockItemsArgs : PrimaryKeyArgs<long>
|
|
||||||
{
|
|
||||||
[MinValue(1)]
|
|
||||||
public int Location { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// The optional serial number.
|
|
||||||
/// </summary>
|
|
||||||
public long? Serial { get; set; }
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
namespace Connected.Logistics.Stock;
|
|
||||||
public static class StockUrls
|
|
||||||
{
|
|
||||||
public const string Stock = "/logistics/stock";
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
using Connected.Annotations;
|
|
||||||
|
|
||||||
[assembly: MicroService(MicroServiceType.Service)]
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Stock;
|
|
||||||
internal sealed class Bootstrapper : Startup
|
|
||||||
{
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\..\Connected\src\Connected\Connected.csproj" />
|
|
||||||
<ProjectReference Include="..\..\..\Connected.Framework\src\Connected.Runtime\Connected.Runtime.csproj" />
|
|
||||||
<ProjectReference Include="..\..\..\Connected.Framework\src\Connected.Services\Connected.Services.csproj" />
|
|
||||||
<ProjectReference Include="..\Connected.Logistics.Stock.Model\Connected.Logistics.Stock.Model.csproj" />
|
|
||||||
<ProjectReference Include="..\Connected.Logistics.Types.Model\Connected.Logistics.Types.Model.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
@ -1,60 +0,0 @@
|
|||||||
using Connected.Collections.Queues;
|
|
||||||
using Connected.Logistics.Types.WarehouseLocations;
|
|
||||||
using Connected.Middleware;
|
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Stock.Services;
|
|
||||||
internal sealed class StockAggregator : MiddlewareComponent, IQueueClient<PrimaryKeyQueueArgs<long>>
|
|
||||||
{
|
|
||||||
public StockAggregator(ILogger<StockAggregator> logger, IWarehouseLocationService locations, IStockService stock)
|
|
||||||
{
|
|
||||||
Logger = logger;
|
|
||||||
Locations = locations;
|
|
||||||
Stock = stock;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ILogger<StockAggregator> Logger { get; }
|
|
||||||
private IWarehouseLocationService Locations { get; }
|
|
||||||
private IStockService Stock { get; }
|
|
||||||
|
|
||||||
public async Task Invoke(IQueueMessage message, PrimaryKeyQueueArgs<long> args)
|
|
||||||
{
|
|
||||||
if (await Stock.SelectItem(args.Id) is not IStockItem stock)
|
|
||||||
{
|
|
||||||
Logger.LogWarning("IStockItem not found {id}", args.Id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
await Calculate(stock, stock.Location);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task Calculate(IStockItem stock, int locationId)
|
|
||||||
{
|
|
||||||
if (await Locations.Select(locationId) is not IWarehouseLocation location)
|
|
||||||
{
|
|
||||||
Logger.LogWarning("IWarehouseLocation not found {id}", locationId);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (location.Parent is null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
var parent = (int)location.Parent;
|
|
||||||
|
|
||||||
var sum = (await Stock.QueryItems(new QueryStockItemsArgs
|
|
||||||
{
|
|
||||||
Id = stock.Id,
|
|
||||||
Location = parent,
|
|
||||||
Serial = stock.Serial
|
|
||||||
})).Sum(f => f.Quantity);
|
|
||||||
|
|
||||||
await Stock.Update(new UpdateStockArgs
|
|
||||||
{
|
|
||||||
Location = parent,
|
|
||||||
Quantity = sum,
|
|
||||||
Serial = stock.Serial
|
|
||||||
});
|
|
||||||
|
|
||||||
await Calculate(stock, parent);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
using Connected.Annotations;
|
|
||||||
using Connected.Entities.Annotations;
|
|
||||||
using Connected.Entities.Consistency;
|
|
||||||
using Connected.Logistics.Types;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Stock;
|
|
||||||
[Table(Schema = Domain.Code)]
|
|
||||||
internal sealed record Stock : ConsistentEntity<long>, IStock
|
|
||||||
{
|
|
||||||
[Ordinal(0), Length(128), Index(Name = $"ix_{Domain.Code}_{nameof(Entity)}_{nameof(EntityId)}", Unique = true)]
|
|
||||||
public string Entity { get; init; } = default!;
|
|
||||||
|
|
||||||
[Ordinal(1), Length(128), Index(Name = $"ix_{Domain.Code}_{nameof(Entity)}_{nameof(EntityId)}", Unique = true)]
|
|
||||||
public string EntityId { get; init; } = default!;
|
|
||||||
|
|
||||||
[Ordinal(2)]
|
|
||||||
public float Quantity { get; init; }
|
|
||||||
|
|
||||||
[Ordinal(3)]
|
|
||||||
public float? Min { get; init; }
|
|
||||||
|
|
||||||
[Ordinal(4)]
|
|
||||||
public float? Max { get; init; }
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
using Connected.Annotations;
|
|
||||||
using Connected.Entities.Annotations;
|
|
||||||
using Connected.Entities.Consistency;
|
|
||||||
using Connected.Logistics.Types;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Stock;
|
|
||||||
/// <inheritdoc cref="IStockItem"/>
|
|
||||||
[Table(Schema = Domain.Code)]
|
|
||||||
internal sealed record StockItem : ConsistentEntity<long>, IStockItem
|
|
||||||
{
|
|
||||||
public const string EntityKey = $"{Domain.Code}.{nameof(StockItem)}";
|
|
||||||
/// <inheritdoc cref="IStockItem.Stock"/>
|
|
||||||
[Ordinal(0)]
|
|
||||||
public long Stock { get; init; }
|
|
||||||
/// <inheritdoc cref="IStockItem.Location"/>
|
|
||||||
[Ordinal(1)]
|
|
||||||
public int Location { get; init; }
|
|
||||||
/// <inheritdoc cref="IStockItem.Serial"/>
|
|
||||||
[Ordinal(2)]
|
|
||||||
public long Serial { get; init; }
|
|
||||||
/// <inheritdoc cref="IStockItem.Quantity"/>
|
|
||||||
[Ordinal(3)]
|
|
||||||
public float Quantity { get; init; }
|
|
||||||
}
|
|
@ -1,187 +0,0 @@
|
|||||||
using Connected.Caching;
|
|
||||||
using Connected.Collections.Queues;
|
|
||||||
using Connected.Entities;
|
|
||||||
using Connected.Entities.Storage;
|
|
||||||
using Connected.Logistics.Stock.Services;
|
|
||||||
using Connected.Logistics.Types.Serials;
|
|
||||||
using Connected.Logistics.Types.WarehouseLocations;
|
|
||||||
using Connected.Notifications.Events;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
using Connected.Services;
|
|
||||||
using Connected.Threading;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Stock;
|
|
||||||
internal sealed class StockOps
|
|
||||||
{
|
|
||||||
public const string StockQueue = "Stock";
|
|
||||||
static StockOps()
|
|
||||||
{
|
|
||||||
Locker = new();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static AsyncLockerSlim Locker { get; }
|
|
||||||
/// <summary>
|
|
||||||
/// This method ensures that a stock (parent) record exists.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// The stock record is not created explicitly since this would introduce unnecessary complexity. It is
|
|
||||||
/// instead created on the fly when the first request is made. The tricky part is it must be thread safe
|
|
||||||
/// so we need an async locker since lock statement does not support async calls.
|
|
||||||
/// </remarks>
|
|
||||||
private static async Task<IStock> Ensure(IStorageProvider storage, IStockService stock, EntityArgs args)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* First check for existence so we don't need to perform a lock if the record is found.
|
|
||||||
*/
|
|
||||||
if (await stock.Select(args) is IStock existing)
|
|
||||||
return existing;
|
|
||||||
/*
|
|
||||||
* Doesn't exist.
|
|
||||||
* Perform an async lock to ensure no one else is trying to insert the item.
|
|
||||||
*/
|
|
||||||
return await Locker.LockAsync(async () =>
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Read again if two or more threads were competing for the insert. The thing is this
|
|
||||||
* is happening quite frequently even in semi loaded warehouse systems.
|
|
||||||
*/
|
|
||||||
if (await stock.Select(args) is IStock existing2)
|
|
||||||
return existing2;
|
|
||||||
/*
|
|
||||||
* Still nothing. We are safe to insert a new stock descriptor. Note that in scalable environments
|
|
||||||
* there is still a possibillity that two requests would made it here but from different processes.
|
|
||||||
* Thus we should have a unique constraint on the entity ensuring only one request will win, all the others
|
|
||||||
* lose. This also means the provider owning the entity must support unique constraints.
|
|
||||||
*/
|
|
||||||
var entity = await storage.Open<Stock>().Update(args.AsEntity<Stock>(State.New));
|
|
||||||
var result = await stock.Select(entity.Id);
|
|
||||||
/*
|
|
||||||
* This should not happen anyway but we'll do it for the sake of sompiler warning.
|
|
||||||
*/
|
|
||||||
if (result is null)
|
|
||||||
throw new NullReferenceException(nameof(IStock));
|
|
||||||
|
|
||||||
return result;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Update : ServiceFunction<UpdateStockArgs, long>
|
|
||||||
{
|
|
||||||
public Update(IStorageProvider storage, ICacheContext cache, IEventService events, IStockService stock,
|
|
||||||
ISerialService serials, IQueueService queue, IWarehouseLocationService locations)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
Events = events;
|
|
||||||
Stock = stock;
|
|
||||||
Serials = serials;
|
|
||||||
Queue = queue;
|
|
||||||
Locations = locations;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICacheContext Cache { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
private IStockService Stock { get; }
|
|
||||||
private ISerialService Serials { get; }
|
|
||||||
private IQueueService Queue { get; }
|
|
||||||
private IWarehouseLocationService Locations { get; }
|
|
||||||
private bool IsLeaf { get; set; }
|
|
||||||
|
|
||||||
protected override async Task<long> OnInvoke()
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* We need this info for queueing aggregations.
|
|
||||||
*/
|
|
||||||
IsLeaf = (await Locations.Select(Arguments.Location)).ItemCount == 0;
|
|
||||||
/*
|
|
||||||
* Validators should validate the existence. Serials don't get deleted.
|
|
||||||
*/
|
|
||||||
if (await Serials.Select(Arguments.Serial) is not ISerial serial)
|
|
||||||
return 0;
|
|
||||||
/*
|
|
||||||
* Ensure the stock record exists.
|
|
||||||
*/
|
|
||||||
var stock = await Ensure(Storage, Stock, serial.AsArguments<EntityArgs, long>());
|
|
||||||
/*
|
|
||||||
* Now we must check if the stock item exists for the specified serial and
|
|
||||||
* warehouse location. If so we'll only update the quantity.
|
|
||||||
*/
|
|
||||||
if (await FindExisting(stock) is not StockItem existing)
|
|
||||||
return await InsertItem(stock);
|
|
||||||
else
|
|
||||||
return await UpdateItem(existing);
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task<long> InsertItem(IStock stock)
|
|
||||||
{
|
|
||||||
return await Locker.LockAsync(async () =>
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Query again if someone overtook us.
|
|
||||||
*/
|
|
||||||
if (await FindExisting(stock) is not StockItem existing)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Still doesn't exist, it's safe to insert it since we are in the locked area.
|
|
||||||
*/
|
|
||||||
return (await Storage.Open<StockItem>().Update(Arguments.AsEntity<StockItem>(State.New))).Id;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Indeed, there was a record inserted in the meantime.
|
|
||||||
*/
|
|
||||||
return await UpdateItem(existing);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// Performs the update on the existing stock item.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="item">The stock item to be updated.</param>
|
|
||||||
private async Task<long> UpdateItem(StockItem item)
|
|
||||||
{
|
|
||||||
await Storage.Open<StockItem>().Update(item, Arguments, async () =>
|
|
||||||
{
|
|
||||||
await Cache.Remove(StockItem.EntityKey, item.Id);
|
|
||||||
|
|
||||||
return SetState((await Stock.SelectItem(item.Id)) as StockItem);
|
|
||||||
},
|
|
||||||
async (e) =>
|
|
||||||
{
|
|
||||||
var quantity = item.Quantity + Arguments.Quantity;
|
|
||||||
|
|
||||||
await Task.CompletedTask;
|
|
||||||
|
|
||||||
return e.Merge(Arguments, State.Default, new { Quantity = quantity });
|
|
||||||
});
|
|
||||||
|
|
||||||
return item.Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
private async Task<StockItem?> FindExisting(IStock stock)
|
|
||||||
{
|
|
||||||
var items = await Stock.QueryItems(new QueryStockItemsArgs
|
|
||||||
{
|
|
||||||
Id = stock.Id,
|
|
||||||
Location = Arguments.Location,
|
|
||||||
Serial = Arguments.Serial
|
|
||||||
});
|
|
||||||
|
|
||||||
if (items.IsEmpty || items[0] is not StockItem existing)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
return existing;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Cache.Remove(StockItem.EntityKey, Result);
|
|
||||||
await Events.Enqueue(this, Stock, nameof(IStockService.Updated), new PrimaryKeyArgs<long> { Id = Result });
|
|
||||||
|
|
||||||
if (IsLeaf)
|
|
||||||
await Queue.Enqueue<StockAggregator, PrimaryKeyQueueArgs<long>>(new PrimaryKeyQueueArgs<long> { Id = Result });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
using Connected.Services;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Stock;
|
|
||||||
internal sealed class StockService : EntityService<long>, IStockService
|
|
||||||
{
|
|
||||||
public StockService(IContext context) : base(context)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task<ImmutableList<IStockItem>> QueryItems(PrimaryKeyArgs<long> args)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task<ImmutableList<IStockItem>> QueryItems(QueryStockItemsArgs args)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task<IStock?> Select(PrimaryKeyArgs<long> args)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task<IStock?> Select(EntityArgs args)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task<IStockItem?> SelectItem(PrimaryKeyArgs<long> args)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task Update(UpdateStockArgs args)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<RootNamespace>Connected.Logistics.Types</RootNamespace>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\..\Connected\src\Connected\Connected.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
@ -1,6 +0,0 @@
|
|||||||
namespace Connected.Logistics.Types;
|
|
||||||
public static class Domain
|
|
||||||
{
|
|
||||||
public const string Name = "Logistics";
|
|
||||||
public const string Code = "lgs";
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
namespace Connected.Logistics.Types;
|
|
||||||
public static class LogisticsUrls
|
|
||||||
{
|
|
||||||
public const string Warehouses = "/logistics/types/warehouses";
|
|
||||||
public const string WarehouseLocations = "/logistics/types/warehouseLocations";
|
|
||||||
public const string Packing = "/logistics/types/packing";
|
|
||||||
public const string Serials = "/logistics/types/serials";
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
using Connected.Data;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.Packaging;
|
|
||||||
public interface IPacking : IPrimaryKey<int>
|
|
||||||
{
|
|
||||||
string Ean { get; init; }
|
|
||||||
string Entity { get; init; }
|
|
||||||
string EntityId { get; init; }
|
|
||||||
|
|
||||||
float? Quantity { get; init; }
|
|
||||||
float? NetWeight { get; init; }
|
|
||||||
float? GrossWeight { get; init; }
|
|
||||||
|
|
||||||
int? Width { get; init; }
|
|
||||||
int? Height { get; init; }
|
|
||||||
int? Depth { get; init; }
|
|
||||||
|
|
||||||
int? ItemCount { get; init; }
|
|
||||||
|
|
||||||
Status Status { get; init; }
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Annotations;
|
|
||||||
using Connected.Notifications;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.Packaging;
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
[ServiceUrl(LogisticsUrls.Packing)]
|
|
||||||
public interface IPackingService : IServiceNotifications<int>
|
|
||||||
{
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
|
|
||||||
Task<ImmutableList<IPacking>> Query(QueryArgs? args);
|
|
||||||
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
|
|
||||||
Task<ImmutableList<IPacking>> Query(PrimaryKeyListArgs<int> args);
|
|
||||||
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
|
|
||||||
Task<IPacking?> Select(PrimaryKeyArgs<int> args);
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
|
|
||||||
Task<IPacking?> Select(SelectPackingArgs args);
|
|
||||||
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Put)]
|
|
||||||
Task<int> Insert(InsertPackingArgs args);
|
|
||||||
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Patch)]
|
|
||||||
Task Update(UpdatePackingArgs args);
|
|
||||||
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Patch)]
|
|
||||||
Task Patch(PatchArgs<int> args);
|
|
||||||
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Delete | ServiceMethodVerbs.Post)]
|
|
||||||
Task Delete(PrimaryKeyArgs<int> args);
|
|
||||||
}
|
|
@ -1,54 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Connected.Data;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.Packaging;
|
|
||||||
public sealed class InsertPackingArgs : EntityArgs
|
|
||||||
{
|
|
||||||
[Required, MaxLength(32)]
|
|
||||||
public string Ean { get; set; } = default!;
|
|
||||||
|
|
||||||
public float? Quantity { get; set; }
|
|
||||||
|
|
||||||
public float? NetWeight { get; set; }
|
|
||||||
|
|
||||||
public float? GrossWeight { get; set; }
|
|
||||||
|
|
||||||
public int? Width { get; set; }
|
|
||||||
|
|
||||||
public int? Height { get; set; }
|
|
||||||
|
|
||||||
public int? Depth { get; set; }
|
|
||||||
|
|
||||||
public int? ItemCount { get; set; }
|
|
||||||
|
|
||||||
public Status Status { get; set; } = Status.Disabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class UpdatePackingArgs : PrimaryKeyArgs<int>
|
|
||||||
{
|
|
||||||
[Required, MaxLength(32)]
|
|
||||||
public string Ean { get; set; } = default!;
|
|
||||||
|
|
||||||
public float? Quantity { get; set; }
|
|
||||||
|
|
||||||
public float? NetWeight { get; set; }
|
|
||||||
|
|
||||||
public float? GrossWeight { get; set; }
|
|
||||||
|
|
||||||
public int? Width { get; set; }
|
|
||||||
|
|
||||||
public int? Height { get; set; }
|
|
||||||
|
|
||||||
public int? Depth { get; set; }
|
|
||||||
|
|
||||||
public int? ItemCount { get; set; }
|
|
||||||
|
|
||||||
public Status Status { get; set; } = Status.Disabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class SelectPackingArgs : Dto
|
|
||||||
{
|
|
||||||
[Required, MaxLength(32)]
|
|
||||||
public string Ean { get; set; } = default!;
|
|
||||||
}
|
|
@ -1,54 +0,0 @@
|
|||||||
using Connected.Data;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.Serials;
|
|
||||||
/// <summary>
|
|
||||||
/// Represents a serial number in the logistic environment.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// The primary usage of the Serial is in warehouse management
|
|
||||||
/// system, where every item in the stock is labeled with serial number.
|
|
||||||
/// Once the item is received and before it is put in the stock locations,
|
|
||||||
/// it receives a unique serial number. If the item is moved between stock
|
|
||||||
/// locations and even warehouses, its serial value remains the same. Serial
|
|
||||||
/// number plays a key role in traceability.
|
|
||||||
/// </remarks>
|
|
||||||
public interface ISerial : IPrimaryKey<long>
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The entity which owns the serial number. This could
|
|
||||||
/// be Product, Semi product, Raw or any other type of
|
|
||||||
/// entity which needs some kind of labeling.
|
|
||||||
/// </summary>
|
|
||||||
string Entity { get; init; }
|
|
||||||
/// <summary>
|
|
||||||
/// The primary key of the entity. This points to the exact record of
|
|
||||||
/// the Entity type.
|
|
||||||
/// </summary>
|
|
||||||
string EntityId { get; init; }
|
|
||||||
/// <summary>
|
|
||||||
/// The actual Serial number. System can use different middleware techniques
|
|
||||||
/// to obtain this value because it's very common to be have project specific
|
|
||||||
/// implementation to calculate this value.
|
|
||||||
/// </summary>
|
|
||||||
string Value { get; init; }
|
|
||||||
/// <summary>
|
|
||||||
/// The remaining quantity in the stock for this serial. This value can increase
|
|
||||||
/// or decrease depending on the warehouse implementation. Some systems do reuse
|
|
||||||
/// the same serial between different receives.
|
|
||||||
/// </summary>
|
|
||||||
float Quantity { get; init; }
|
|
||||||
/// <summary>
|
|
||||||
/// The date serial was created.
|
|
||||||
/// </summary>
|
|
||||||
DateTimeOffset Created { get; init; }
|
|
||||||
/// <summary>
|
|
||||||
/// If the item has limited shelf life, this value should hold the date when
|
|
||||||
/// the shelf life expires.
|
|
||||||
/// </summary>
|
|
||||||
DateTimeOffset? BestBefore { get; init; }
|
|
||||||
/// <summary>
|
|
||||||
/// The status of the serial number. If the status is <see cref="Status.Disabled"/> the
|
|
||||||
/// processes using the serial number should not allow the entity to be used in documents.
|
|
||||||
/// </summary>
|
|
||||||
Status Status { get; init; }
|
|
||||||
}
|
|
@ -1,71 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Annotations;
|
|
||||||
using Connected.Notifications;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.Serials;
|
|
||||||
/// <summary>
|
|
||||||
/// The service for manipulating with serials. A <see cref="ISerial"/> is a fundamental
|
|
||||||
/// entity used by labeling and traceability systems.
|
|
||||||
/// </summary>
|
|
||||||
[Service]
|
|
||||||
[ServiceUrl(LogisticsUrls.Serials)]
|
|
||||||
public interface ISerialService : IServiceNotifications<long>
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Queries all serial numbers.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The optional arguments specifiying the
|
|
||||||
/// behavior of the result set.</param>
|
|
||||||
/// <returns>A list of <see cref="ISerial"/> entities.</returns>
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
|
|
||||||
Task<ImmutableList<ISerial>> Query(QueryArgs? args);
|
|
||||||
/// <summary>
|
|
||||||
/// Performs a lookup on the serials for the specified set of ids.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the list of ids for
|
|
||||||
/// which the entities will be returned.</param>
|
|
||||||
/// <returns>A list of entities that matches the specified ids.</returns>
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
|
|
||||||
Task<ImmutableList<ISerial>> Query(PrimaryKeyListArgs<long> args);
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the first serial that matches the specified id.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the id of the entity.</param>
|
|
||||||
/// <returns>The <see cref="ISerial"/> if found, <c>null</c> otherwise.</returns>
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
|
|
||||||
Task<ISerial?> Select(PrimaryKeyArgs<long> args);
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the first serial with the specified value.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the value for which serial
|
|
||||||
/// entity will be returned.</param>
|
|
||||||
/// <returns>The <see cref="ISerial"/> if found, <c>null</c> otherwise.</returns>
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
|
|
||||||
Task<ISerial?> Select(SelectSerialArgs args);
|
|
||||||
/// <summary>
|
|
||||||
/// Inserts a new serial number.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the properties of the new serial.</param>
|
|
||||||
/// <returns>The id of the newly inserted serial.</returns>
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Put)]
|
|
||||||
Task<long> Insert(InsertSerialArgs args);
|
|
||||||
/// <summary>
|
|
||||||
/// Updates an existing serial.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing properties which will change the entity.</param>
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Patch)]
|
|
||||||
Task Update(UpdateSerialArgs args);
|
|
||||||
/// <summary>
|
|
||||||
/// Performs a partial update on the serial.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing properties which has to be updated.</param>
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Patch)]
|
|
||||||
Task Patch(PatchArgs<long> args);
|
|
||||||
/// <summary>
|
|
||||||
/// Peranently deletes the serial from the storage.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the id of the entity to be deleted.</param>
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Delete)]
|
|
||||||
Task Delete(PrimaryKeyArgs<long> args);
|
|
||||||
}
|
|
@ -1,59 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Connected.Annotations;
|
|
||||||
using Connected.Data;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.Serials;
|
|
||||||
/// <summary>
|
|
||||||
/// Arguments used when inserting a new serial number.
|
|
||||||
/// </summary>
|
|
||||||
public sealed class InsertSerialArgs : Dto
|
|
||||||
{
|
|
||||||
/// <inheritdoc cref="ISerial.Entity"/>
|
|
||||||
[Required, MaxLength(128)]
|
|
||||||
public string Entity { get; set; } = default!;
|
|
||||||
/// <inheritdoc cref="ISerial.EntityId"/>
|
|
||||||
[Required, MaxLength(128)]
|
|
||||||
public string EntityId { get; set; } = default!;
|
|
||||||
/// <inheritdoc cref="ISerial.Quantity"/>
|
|
||||||
[MinValue(0)]
|
|
||||||
public float Quantity { get; set; }
|
|
||||||
/// <inheritdoc cref="ISerial.Created"/>
|
|
||||||
/// <remarks>
|
|
||||||
/// If this property is null, the process will most likely
|
|
||||||
/// set the value of the current date (DateTime.UtcNow).
|
|
||||||
/// </remarks>
|
|
||||||
public DateTimeOffset? Created { get; set; }
|
|
||||||
/// <inheritdoc cref="ISerial.BestBefore"/>
|
|
||||||
public DateTimeOffset? BestBefore { get; set; }
|
|
||||||
/// <inheritdoc cref="ISerial.Status"/>
|
|
||||||
public Status Status { get; set; } = Status.Disabled;
|
|
||||||
/// <inheritdoc cref="ISerial.Value"/>
|
|
||||||
[Required, MaxLength(128)]
|
|
||||||
public string Value { get; set; } = default!;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// The arguments used when updating the existing serial entity.
|
|
||||||
/// </summary>
|
|
||||||
public sealed class UpdateSerialArgs : PrimaryKeyArgs<long>
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The new quantity. This is an absolute value, do not provide
|
|
||||||
/// delta values.
|
|
||||||
/// </summary>
|
|
||||||
[MinValue(0)]
|
|
||||||
public float Quantity { get; set; }
|
|
||||||
/// <inheritdoc cref="ISerial.BestBefore"/>
|
|
||||||
public DateTimeOffset? BestBefore { get; set; }
|
|
||||||
/// <inheritdoc cref="ISerial.Status"/>
|
|
||||||
public Status Status { get; set; } = Status.Disabled;
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// The arguments used for selecting serial by its value.
|
|
||||||
/// </summary>
|
|
||||||
public sealed class SelectSerialArgs : Dto
|
|
||||||
{
|
|
||||||
/// <inheritdoc cref="ISerial.Value"/>
|
|
||||||
[Required, MaxLength(128)]
|
|
||||||
public string Value { get; set; } = default!;
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
using Connected.Data;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.WarehouseLocations;
|
|
||||||
/// <summary>
|
|
||||||
/// Represents a physical or logical location inside a <see cref="IWarehouse"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Each <see cref="IWarehouse"/> contains zero or more <see cref="IWarehouseLocation">locations</see>.
|
|
||||||
/// Location can be a container, which means it contains child locations, or leaf, which doesn't contain
|
|
||||||
/// child locations. Items can be put only in leaf locations, whereas containers acts only as aggregators
|
|
||||||
/// which means they provide calculated values for items contained in the child locations.
|
|
||||||
/// </remarks>
|
|
||||||
public interface IWarehouseLocation : IPrimaryKey<int>
|
|
||||||
{
|
|
||||||
int? Parent { get; init; }
|
|
||||||
int Warehouse { get; init; }
|
|
||||||
string Name { get; init; }
|
|
||||||
string Code { get; init; }
|
|
||||||
Status Status { get; init; }
|
|
||||||
/// <summary>
|
|
||||||
/// The number of direct child items that belong to this
|
|
||||||
/// location. If this value is 0 it means the location
|
|
||||||
/// is leaf. If not, it's a container.
|
|
||||||
/// </summary>
|
|
||||||
int ItemCount { get; init; }
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Annotations;
|
|
||||||
using Connected.Notifications;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.WarehouseLocations;
|
|
||||||
[Service]
|
|
||||||
[ServiceUrl(LogisticsUrls.WarehouseLocations)]
|
|
||||||
public interface IWarehouseLocationService : IServiceNotifications<int>
|
|
||||||
{
|
|
||||||
Task<ImmutableList<IWarehouseLocation>> Query(QueryArgs? args);
|
|
||||||
/// <summary>
|
|
||||||
/// Queries warehouse locations for the specified <see cref="IWarehouse"/>.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="args">The arguments containing the id of the warehouse.</param>
|
|
||||||
/// <returns>The list of warehouse locations that belong to the specified warehouse.</returns>
|
|
||||||
Task<ImmutableList<IWarehouseLocation>> Query(QueryWarehouseLocationArgs args);
|
|
||||||
Task<ImmutableList<IWarehouseLocation>> Query(PrimaryKeyListArgs<int> args);
|
|
||||||
Task<ImmutableList<IWarehouseLocation>> QueryChildren(QueryWarehouseLocationChildrenArgs args);
|
|
||||||
|
|
||||||
Task<IWarehouseLocation?> Select(PrimaryKeyArgs<int> args);
|
|
||||||
Task<IWarehouseLocation?> Select(SelectWarehouseLocationArgs args);
|
|
||||||
|
|
||||||
Task<int> Insert(InsertWarehouseLocationArgs args);
|
|
||||||
Task Update(UpdateWarehouseLocationArgs args);
|
|
||||||
Task Patch(PatchArgs<int> args);
|
|
||||||
Task Delete(PrimaryKeyArgs<int> args);
|
|
||||||
}
|
|
@ -1,54 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Connected.Annotations;
|
|
||||||
using Connected.Data;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.WarehouseLocations;
|
|
||||||
public sealed class InsertWarehouseLocationArgs : Dto
|
|
||||||
{
|
|
||||||
public int? Parent { get; set; }
|
|
||||||
|
|
||||||
[MinValue(1)]
|
|
||||||
public int Warehouse { get; set; }
|
|
||||||
|
|
||||||
[Required, MaxLength(128)]
|
|
||||||
public string Name { get; set; } = default!;
|
|
||||||
|
|
||||||
[Required, MaxLength(32)]
|
|
||||||
public string Code { get; set; } = default!;
|
|
||||||
|
|
||||||
public Status Status { get; set; } = Status.Disabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class UpdateWarehouseLocationArgs : PrimaryKeyArgs<int>
|
|
||||||
{
|
|
||||||
public int? Parent { get; set; }
|
|
||||||
|
|
||||||
[Required, MaxLength(128)]
|
|
||||||
public string Name { get; set; } = default!;
|
|
||||||
|
|
||||||
[Required, MaxLength(32)]
|
|
||||||
public string Code { get; set; } = default!;
|
|
||||||
|
|
||||||
public Status Status { get; set; } = Status.Disabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class SelectWarehouseLocationArgs : Dto
|
|
||||||
{
|
|
||||||
[Required, MaxLength(32)]
|
|
||||||
public string Code { get; set; } = default!;
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class QueryWarehouseLocationArgs : QueryArgs
|
|
||||||
{
|
|
||||||
[MinValue(1)]
|
|
||||||
public int Warehouse { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class QueryWarehouseLocationChildrenArgs : QueryArgs
|
|
||||||
{
|
|
||||||
[MinValue(1)]
|
|
||||||
public int Warehouse { get; set; }
|
|
||||||
|
|
||||||
public int? Parent { get; set; }
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
using Connected.Data;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.Warehouses;
|
|
||||||
|
|
||||||
public interface IWarehouse : IPrimaryKey<int>
|
|
||||||
{
|
|
||||||
string Name { get; init; }
|
|
||||||
string Code { get; init; }
|
|
||||||
Status Status { get; init; }
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Annotations;
|
|
||||||
using Connected.Notifications;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.Warehouses;
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
[ServiceUrl(LogisticsUrls.Warehouses)]
|
|
||||||
public interface IWarehouseService : IServiceNotifications<int>
|
|
||||||
{
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
|
|
||||||
Task<ImmutableList<IWarehouse>> Query(QueryArgs? args);
|
|
||||||
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
|
|
||||||
Task<ImmutableList<IWarehouse>> Query(PrimaryKeyListArgs<int> args);
|
|
||||||
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)]
|
|
||||||
Task<IWarehouse?> Select(PrimaryKeyArgs<int> args);
|
|
||||||
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Put)]
|
|
||||||
Task<int> Insert(InsertWarehouseArgs args);
|
|
||||||
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Patch)]
|
|
||||||
Task Update(UpdateWarehouseArgs args);
|
|
||||||
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Patch)]
|
|
||||||
Task Patch(PatchArgs<int> args);
|
|
||||||
|
|
||||||
[ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Delete)]
|
|
||||||
Task Delete(PrimaryKeyArgs<int> args);
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Connected.Data;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.Warehouses;
|
|
||||||
public class InsertWarehouseArgs : Dto
|
|
||||||
{
|
|
||||||
[Required, MaxLength(128)]
|
|
||||||
public string Name { get; set; } = default!;
|
|
||||||
|
|
||||||
[Required, MaxLength(32)]
|
|
||||||
public string Code { get; set; } = default!;
|
|
||||||
|
|
||||||
public Status Status { get; set; } = Status.Disabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public class UpdateWarehouseArgs : PrimaryKeyArgs<int>
|
|
||||||
{
|
|
||||||
[Required, MaxLength(128)]
|
|
||||||
public string Name { get; set; } = default!;
|
|
||||||
|
|
||||||
[Required, MaxLength(32)]
|
|
||||||
public string Code { get; set; } = default!;
|
|
||||||
|
|
||||||
public Status Status { get; set; } = Status.Disabled;
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
using Connected.Annotations;
|
|
||||||
|
|
||||||
[assembly: MicroService(MicroServiceType.Service)]
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types;
|
|
||||||
internal sealed class Bootstrapper : Startup
|
|
||||||
{
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\..\..\Connected.Framework\src\Connected.Entities\Connected.Entities.csproj" />
|
|
||||||
<ProjectReference Include="..\..\..\Connected.Framework\src\Connected.Services\Connected.Services.csproj" />
|
|
||||||
<ProjectReference Include="..\Connected.Logistics.Types.Model\Connected.Logistics.Types.Model.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
@ -1,46 +0,0 @@
|
|||||||
using Connected.Annotations;
|
|
||||||
using Connected.Data;
|
|
||||||
using Connected.Entities.Annotations;
|
|
||||||
using Connected.Entities.Consistency;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.Packaging;
|
|
||||||
|
|
||||||
[Table(Schema = Domain.Code)]
|
|
||||||
internal sealed record Packing : ConsistentEntity<int>, IPacking
|
|
||||||
{
|
|
||||||
public const string EntityKey = $"{Domain.Code}.{nameof(Packing)}";
|
|
||||||
|
|
||||||
[Ordinal(0), Length(32)]
|
|
||||||
[Index(Unique = true)]
|
|
||||||
public string Ean { get; init; } = default!;
|
|
||||||
|
|
||||||
[Ordinal(1), Length(128)]
|
|
||||||
public string Entity { get; init; } = default!;
|
|
||||||
|
|
||||||
[Ordinal(2), Length(128)]
|
|
||||||
public string EntityId { get; init; } = default!;
|
|
||||||
|
|
||||||
[Ordinal(3)]
|
|
||||||
public float? Quantity { get; init; }
|
|
||||||
|
|
||||||
[Ordinal(4)]
|
|
||||||
public float? NetWeight { get; init; }
|
|
||||||
|
|
||||||
[Ordinal(5)]
|
|
||||||
public float? GrossWeight { get; init; }
|
|
||||||
|
|
||||||
[Ordinal(6)]
|
|
||||||
public int? Width { get; init; }
|
|
||||||
|
|
||||||
[Ordinal(7)]
|
|
||||||
public int? Height { get; init; }
|
|
||||||
|
|
||||||
[Ordinal(8)]
|
|
||||||
public int? Depth { get; init; }
|
|
||||||
|
|
||||||
[Ordinal(9)]
|
|
||||||
public int? ItemCount { get; init; }
|
|
||||||
|
|
||||||
[Ordinal(10)]
|
|
||||||
public Status Status { get; init; } = Status.Disabled;
|
|
||||||
}
|
|
@ -1,177 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Caching;
|
|
||||||
using Connected.Entities;
|
|
||||||
using Connected.Entities.Storage;
|
|
||||||
using Connected.Notifications.Events;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
using Connected.Services;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.Packaging;
|
|
||||||
internal sealed class PackingOps
|
|
||||||
{
|
|
||||||
public sealed class Delete : ServiceAction<PrimaryKeyArgs<int>>
|
|
||||||
{
|
|
||||||
public Delete(IStorageProvider storage, IPackingService packingService, IEventService events, ICachingService cache)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
PackingService = packingService;
|
|
||||||
Events = events;
|
|
||||||
Cache = cache;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private IPackingService PackingService { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
private ICachingService Cache { get; }
|
|
||||||
|
|
||||||
protected override async Task OnInvoke()
|
|
||||||
{
|
|
||||||
if (await PackingService.Select(Arguments.Id) is not IPacking packing)
|
|
||||||
return;
|
|
||||||
|
|
||||||
SetState(packing);
|
|
||||||
|
|
||||||
await Storage.Open<Packing>().Update(Arguments.AsEntity<Packing>(State.Deleted));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Cache.Remove(Packing.EntityKey, Arguments.Id);
|
|
||||||
await Events.Enqueue(this, Events, nameof(IPackingService.Deleted), Arguments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Insert : ServiceFunction<InsertPackingArgs, int>
|
|
||||||
{
|
|
||||||
public Insert(IStorageProvider storage, IEventService events)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Events = events;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
|
|
||||||
protected override async Task<int> OnInvoke()
|
|
||||||
{
|
|
||||||
return (await Storage.Open<Packing>().Update(Arguments.AsEntity<Packing>(State.New))).Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Events.Enqueue(this, Events, nameof(IPackingService.Inserted), Arguments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Query : ServiceFunction<QueryArgs, ImmutableList<IPacking>>
|
|
||||||
{
|
|
||||||
public Query(IStorageProvider storage)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
|
|
||||||
protected override async Task<ImmutableList<IPacking>?> OnInvoke()
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<Packing>()
|
|
||||||
select e).WithArguments(Arguments).AsEntities<IPacking>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Lookup : ServiceFunction<PrimaryKeyListArgs<int>, ImmutableList<IPacking>>
|
|
||||||
{
|
|
||||||
public Lookup(IStorageProvider storage)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
|
|
||||||
protected override async Task<ImmutableList<IPacking>> OnInvoke()
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<Packing>()
|
|
||||||
where Arguments.IdList.Any(f => f == e.Id)
|
|
||||||
select e).AsEntities<IPacking>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Select : NullableServiceFunction<PrimaryKeyArgs<int>, IPacking>
|
|
||||||
{
|
|
||||||
public Select(IStorageProvider storage, ICachingService cache)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICachingService Cache { get; }
|
|
||||||
|
|
||||||
protected override async Task<IPacking?> OnInvoke()
|
|
||||||
{
|
|
||||||
return await Cache.Get<IPacking>(Packing.EntityKey, Arguments.Id, async (f) =>
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<Packing>()
|
|
||||||
where e.Id == Arguments.Id
|
|
||||||
select e).AsEntity();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class SelectByEan : NullableServiceFunction<SelectPackingArgs, IPacking>
|
|
||||||
{
|
|
||||||
public SelectByEan(IStorageProvider storage, ICachingService cache)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICachingService Cache { get; }
|
|
||||||
|
|
||||||
protected override async Task<IPacking?> OnInvoke()
|
|
||||||
{
|
|
||||||
return await Cache.Get<IPacking>(Packing.EntityKey, f => string.Equals(f.Ean, Arguments.Ean, StringComparison.OrdinalIgnoreCase), async (f) =>
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<Packing>()
|
|
||||||
where string.Equals(e.Ean, Arguments.Ean, StringComparison.OrdinalIgnoreCase)
|
|
||||||
select e).AsEntity();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Update : ServiceAction<UpdatePackingArgs>
|
|
||||||
{
|
|
||||||
public Update(IStorageProvider storage, ICachingService cache, IPackingService packingService, IEventService events)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
PackingService = packingService;
|
|
||||||
Events = events;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICachingService Cache { get; }
|
|
||||||
private IPackingService PackingService { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
|
|
||||||
protected override async Task OnInvoke()
|
|
||||||
{
|
|
||||||
if (SetState(await PackingService.Select(Arguments.Id)) is not Packing entity)
|
|
||||||
return;
|
|
||||||
|
|
||||||
await Storage.Open<Packing>().Update(entity.Merge(Arguments, State.Default), Arguments, async () =>
|
|
||||||
{
|
|
||||||
await Cache.Remove(Packing.EntityKey, Arguments.Id);
|
|
||||||
|
|
||||||
return SetState(await PackingService.Select(Arguments.Id)) as Packing;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Cache.Remove(Packing.EntityKey, Arguments.Id);
|
|
||||||
await Events.Enqueue(this, PackingService, nameof(PackingService.Updated), Arguments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,56 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Entities;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
using Connected.Services;
|
|
||||||
using Ops = Connected.Logistics.Types.Packaging.PackingOps;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.Packaging;
|
|
||||||
internal sealed class PackingService : EntityService<int>, IPackingService
|
|
||||||
{
|
|
||||||
public PackingService(IContext context) : base(context)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task Delete(PrimaryKeyArgs<int> args)
|
|
||||||
{
|
|
||||||
await Invoke(GetOperation<Ops.Delete>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<int> Insert(InsertPackingArgs args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.Insert>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task Patch(PatchArgs<int> args)
|
|
||||||
{
|
|
||||||
if (await Select(args.Id) is not Packing entity)
|
|
||||||
return;
|
|
||||||
|
|
||||||
await Update(args.Patch<UpdatePackingArgs, Packing>(entity));
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<ImmutableList<IPacking>> Query(QueryArgs? args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.Query>(), args ?? QueryArgs.Default);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<ImmutableList<IPacking>> Query(PrimaryKeyListArgs<int> args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.Lookup>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<IPacking?> Select(PrimaryKeyArgs<int> args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.Select>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<IPacking?> Select(SelectPackingArgs args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.SelectByEan>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task Update(UpdatePackingArgs args)
|
|
||||||
{
|
|
||||||
await Invoke(GetOperation<Ops.Update>(), args);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
using Connected.Middleware;
|
|
||||||
using Connected.Validation;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.Packaging;
|
|
||||||
internal sealed class InsertPackingValidator : MiddlewareComponent, IValidator<InsertPackingArgs>
|
|
||||||
{
|
|
||||||
public InsertPackingValidator(IPackingService packingService)
|
|
||||||
{
|
|
||||||
PackingService = packingService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IPackingService PackingService { get; }
|
|
||||||
|
|
||||||
public async Task Validate(InsertPackingArgs args)
|
|
||||||
{
|
|
||||||
if (await PackingService.Select(new SelectPackingArgs
|
|
||||||
{
|
|
||||||
Ean = args.Ean
|
|
||||||
}) is not null)
|
|
||||||
{
|
|
||||||
throw ValidationExceptions.ValueExists(nameof(args.Ean), args.Ean);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
internal sealed class UpdatePackingValidator : MiddlewareComponent, IValidator<UpdatePackingArgs>
|
|
||||||
{
|
|
||||||
public UpdatePackingValidator(IPackingService packingService)
|
|
||||||
{
|
|
||||||
PackingService = packingService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IPackingService PackingService { get; }
|
|
||||||
|
|
||||||
public async Task Validate(UpdatePackingArgs args)
|
|
||||||
{
|
|
||||||
if (await PackingService.Select(new SelectPackingArgs
|
|
||||||
{
|
|
||||||
Ean = args.Ean
|
|
||||||
}) is Packing entity && entity.Id != args.Id)
|
|
||||||
{
|
|
||||||
throw ValidationExceptions.ValueExists(nameof(args.Ean), args.Ean);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Connected.Annotations;
|
|
||||||
using Connected.Data;
|
|
||||||
using Connected.Entities.Annotations;
|
|
||||||
using Connected.Entities.Consistency;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.Serials;
|
|
||||||
/// <inheritdoc cref="ISerial"/>
|
|
||||||
[Table(Schema = Domain.Code)]
|
|
||||||
internal sealed record Serial : ConsistentEntity<long>, ISerial
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// The entity identifier which can be used in caching keys for example.
|
|
||||||
/// </summary>
|
|
||||||
public const string EntityKey = $"{Domain.Code}.{nameof(Serial)}";
|
|
||||||
/// <inheritdoc cref="ISerial.Entity"/>
|
|
||||||
[Ordinal(0), MaxLength(128)]
|
|
||||||
public string Entity { get; init; } = default!;
|
|
||||||
/// <inheritdoc cref="ISerial.EntityId"/>
|
|
||||||
[Ordinal(1), MaxLength(128)]
|
|
||||||
public string EntityId { get; init; } = default!;
|
|
||||||
/// <inheritdoc cref="ISerial.Value"/>
|
|
||||||
[Ordinal(2), MaxLength(128), Index(Unique = true)]
|
|
||||||
public string Value { get; init; } = default!;
|
|
||||||
/// <inheritdoc cref="ISerial.Quantity"/>
|
|
||||||
[Ordinal(3)]
|
|
||||||
public float Quantity { get; init; }
|
|
||||||
/// <inheritdoc cref="ISerial.Created"/>
|
|
||||||
[Ordinal(4)]
|
|
||||||
public DateTimeOffset Created { get; init; }
|
|
||||||
/// <inheritdoc cref="ISerial.BestBefore"/>
|
|
||||||
[Ordinal(5)]
|
|
||||||
public DateTimeOffset? BestBefore { get; init; }
|
|
||||||
/// <inheritdoc cref="ISerial.Status"/>
|
|
||||||
[Ordinal(6)]
|
|
||||||
public Status Status { get; init; } = Status.Disabled;
|
|
||||||
}
|
|
@ -1,220 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Caching;
|
|
||||||
using Connected.Entities;
|
|
||||||
using Connected.Entities.Storage;
|
|
||||||
using Connected.Notifications.Events;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
using Connected.Services;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.Serials;
|
|
||||||
internal sealed class SerialOps
|
|
||||||
{
|
|
||||||
/// <inheritdoc cref="ISerialService.Delete(PrimaryKeyArgs{long})"/>
|
|
||||||
public sealed class Delete : ServiceAction<PrimaryKeyArgs<long>>
|
|
||||||
{
|
|
||||||
public Delete(IStorageProvider storage, ISerialService serials, IEventService events, ICachingService cache)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Serials = serials;
|
|
||||||
Events = events;
|
|
||||||
Cache = cache;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ISerialService Serials { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
private ICachingService Cache { get; }
|
|
||||||
|
|
||||||
protected override async Task OnInvoke()
|
|
||||||
{
|
|
||||||
if (await Serials.Select(Arguments.Id) is not ISerial serial)
|
|
||||||
return;
|
|
||||||
/*
|
|
||||||
* Setting state of the entity enable other middleware to use the entity even after it
|
|
||||||
* is deleted. For example, IEventListener will receive the state of this operation.
|
|
||||||
*/
|
|
||||||
SetState(serial);
|
|
||||||
/*
|
|
||||||
* Perform delete.
|
|
||||||
*/
|
|
||||||
await Storage.Open<Serial>().Update(Arguments.AsEntity<Serial>(State.Deleted));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Remove entity from the cache.
|
|
||||||
*/
|
|
||||||
await Cache.Remove(Serial.EntityKey, Arguments.Id);
|
|
||||||
/*
|
|
||||||
* Enqueue event so event listeners can respond to the transaction.
|
|
||||||
*/
|
|
||||||
await Events.Enqueue(this, Events, nameof(ISerialService.Deleted), Arguments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc cref=" ISerialService.Insert(InsertSerialArgs)"/>
|
|
||||||
public sealed class Insert : ServiceFunction<InsertSerialArgs, long>
|
|
||||||
{
|
|
||||||
public Insert(IStorageProvider storage, IEventService events)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Events = events;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
|
|
||||||
protected override async Task<long> OnInvoke()
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Perform insert and return the newly inserted id.
|
|
||||||
*/
|
|
||||||
return (await Storage.Open<Serial>().Update(Arguments.AsEntity<Serial>(State.New))).Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Events.Enqueue(this, Events, nameof(ISerialService.Inserted), Arguments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc cref="ISerialService.Query(QueryArgs?)"/>
|
|
||||||
public sealed class Query : ServiceFunction<QueryArgs, ImmutableList<ISerial>>
|
|
||||||
{
|
|
||||||
public Query(IStorageProvider storage)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
|
|
||||||
protected override async Task<ImmutableList<ISerial>> OnInvoke()
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* For non cached entities query always hits the storage.
|
|
||||||
*/
|
|
||||||
return await (from e in Storage.Open<Serial>()
|
|
||||||
select e).WithArguments(Arguments).AsEntities<ISerial>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="ISerialService.Query(PrimaryKeyListArgs{long})"/>
|
|
||||||
public sealed class Lookup : ServiceFunction<PrimaryKeyListArgs<long>, ImmutableList<ISerial>>
|
|
||||||
{
|
|
||||||
public Lookup(IStorageProvider storage)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
|
|
||||||
protected override async Task<ImmutableList<ISerial>> OnInvoke()
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<Serial>()
|
|
||||||
where Arguments.IdList.Any(f => f == e.Id)
|
|
||||||
select e).AsEntities<ISerial>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="ISerialService.Select(PrimaryKeyArgs{long})"/>
|
|
||||||
public sealed class Select : NullableServiceFunction<PrimaryKeyArgs<long>, ISerial>
|
|
||||||
{
|
|
||||||
public Select(IStorageProvider storage, ICachingService cache)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICachingService Cache { get; }
|
|
||||||
|
|
||||||
protected override async Task<ISerial?> OnInvoke()
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* First, try to receive entity from the cache. If it doesn't exist in the cache
|
|
||||||
* load it from storage. If storage returns non null value, store it in the cache
|
|
||||||
* for subsequent calls. The entity gets remove either because of inactivity or when
|
|
||||||
* updating or deleting it.
|
|
||||||
*/
|
|
||||||
return await Cache.Get<ISerial>(Serial.EntityKey, Arguments.Id, async (f) =>
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Doesn't exist in the cache. Let's do the storage action.
|
|
||||||
*/
|
|
||||||
return await (from e in Storage.Open<Serial>()
|
|
||||||
where e.Id == Arguments.Id
|
|
||||||
select e).AsEntity();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="ISerialService.Select(SelectSerialArgs)"/>
|
|
||||||
public sealed class SelectByValue : NullableServiceFunction<SelectSerialArgs, ISerial>
|
|
||||||
{
|
|
||||||
public SelectByValue(IStorageProvider storage, ICachingService cache)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICachingService Cache { get; }
|
|
||||||
|
|
||||||
protected override async Task<ISerial?> OnInvoke()
|
|
||||||
{
|
|
||||||
return await Cache.Get<ISerial>(Serial.EntityKey, f => string.Equals(f.Value, Arguments.Value, StringComparison.OrdinalIgnoreCase), async (f) =>
|
|
||||||
{
|
|
||||||
return await (from e in Storage.Open<Serial>()
|
|
||||||
where string.Equals(e.Value, Arguments.Value, StringComparison.OrdinalIgnoreCase)
|
|
||||||
select e).AsEntity();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="ISerialService.Update(UpdateSerialArgs)"/>
|
|
||||||
public sealed class Update : ServiceAction<UpdateSerialArgs>
|
|
||||||
{
|
|
||||||
public Update(IStorageProvider storage, ICachingService cache, ISerialService packingService, IEventService events)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
Serials = packingService;
|
|
||||||
Events = events;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private ICachingService Cache { get; }
|
|
||||||
private ISerialService Serials { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
|
|
||||||
protected override async Task OnInvoke()
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Set the state of the unchanged entity. This enable other middleware to
|
|
||||||
* calculate quantity delta, for example because they receive the state of
|
|
||||||
* this operation. Not all middleware supports this, the primary example of
|
|
||||||
* such state client is IEventListener.
|
|
||||||
*/
|
|
||||||
if (SetState(await Serials.Select(Arguments.Id)) is not Serial entity)
|
|
||||||
return;
|
|
||||||
/*
|
|
||||||
* Sinc ethis is concurrent entity we must perform retry if the concurrency fails.
|
|
||||||
*/
|
|
||||||
await Storage.Open<Serial>().Update(entity.Merge(Arguments, State.Default), Arguments, async () =>
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* The update failed because of concurrency. Remove the entity from the cache to ensure
|
|
||||||
* it gets loaded from the storage next time with fresh values and try again.
|
|
||||||
*/
|
|
||||||
await Cache.Remove(Serial.EntityKey, Arguments.Id);
|
|
||||||
/*
|
|
||||||
* Since the entity reloaded we must overwrite its state.
|
|
||||||
*/
|
|
||||||
return SetState(await Serials.Select(Arguments.Id)) as Serial;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Cache.Remove(Serial.EntityKey, Arguments.Id);
|
|
||||||
await Events.Enqueue(this, Serials, nameof(Serials.Updated), Arguments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,61 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Entities;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
using Connected.Services;
|
|
||||||
using Ops = Connected.Logistics.Types.Serials.SerialOps;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.Serials;
|
|
||||||
/// <inheritdoc cref="ISerialService"/>
|
|
||||||
internal sealed class SerialService : EntityService<long>, ISerialService
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Create a new <see cref="SerialService"/> service.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="context">The context which serves as a DI scope.</param>
|
|
||||||
public SerialService(IContext context) : base(context)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="ISerialService.Delete(PrimaryKeyArgs{long})"/>
|
|
||||||
public async Task Delete(PrimaryKeyArgs<long> args)
|
|
||||||
{
|
|
||||||
await Invoke(GetOperation<Ops.Delete>(), args);
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="ISerialService.Insert(InsertSerialArgs)"/>
|
|
||||||
public async Task<long> Insert(InsertSerialArgs args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.Insert>(), args);
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="ISerialService.Query(QueryArgs?)"/>
|
|
||||||
public async Task<ImmutableList<ISerial>> Query(QueryArgs? args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.Query>(), args ?? QueryArgs.Default);
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="ISerialService.Query(PrimaryKeyListArgs{long})"/>
|
|
||||||
public async Task<ImmutableList<ISerial>> Query(PrimaryKeyListArgs<long> args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.Lookup>(), args);
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="ISerialService.Select(PrimaryKeyArgs{long})"/>
|
|
||||||
public async Task<ISerial?> Select(PrimaryKeyArgs<long> args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.Select>(), args);
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="ISerialService.Select(SelectSerialArgs)"/>
|
|
||||||
public async Task<ISerial?> Select(SelectSerialArgs args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.SelectByValue>(), args);
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="ISerialService.Update(UpdateSerialArgs)"/>
|
|
||||||
public async Task Update(UpdateSerialArgs args)
|
|
||||||
{
|
|
||||||
await Invoke(GetOperation<Ops.Update>(), args);
|
|
||||||
}
|
|
||||||
/// <inheritdoc cref="ISerialService.Patch(PatchArgs{long})"/>
|
|
||||||
public async Task Patch(PatchArgs<long> args)
|
|
||||||
{
|
|
||||||
if (await Select(args.Id) is not Serial entity)
|
|
||||||
return;
|
|
||||||
|
|
||||||
await Update(args.Patch<UpdateSerialArgs, Serial>(entity));
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
using Connected.Middleware;
|
|
||||||
using Connected.Validation;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.Serials;
|
|
||||||
internal sealed class InsertSerialValidator : MiddlewareComponent, IValidator<InsertSerialArgs>
|
|
||||||
{
|
|
||||||
public InsertSerialValidator(ISerialService serials)
|
|
||||||
{
|
|
||||||
Serials = serials;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ISerialService Serials { get; }
|
|
||||||
|
|
||||||
public async Task Validate(InsertSerialArgs args)
|
|
||||||
{
|
|
||||||
if (await Serials.Select(new SelectSerialArgs
|
|
||||||
{
|
|
||||||
Value = args.Value
|
|
||||||
}) is not null)
|
|
||||||
{
|
|
||||||
throw ValidationExceptions.ValueExists(nameof(args.Value), args.Value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
|
||||||
using Connected.Annotations;
|
|
||||||
using Connected.Data;
|
|
||||||
using Connected.Entities.Annotations;
|
|
||||||
using Connected.Entities.Consistency;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.WarehouseLocations;
|
|
||||||
/// <inheritdoc cref="IWarehouseLocation"/>
|
|
||||||
internal sealed record WarehouseLocation : ConsistentEntity<int>, IWarehouseLocation
|
|
||||||
{
|
|
||||||
public const string EntityKey = $"{Domain.Code}.{nameof(WarehouseLocation)}";
|
|
||||||
|
|
||||||
/// <inheritdoc cref="IWarehouseLocation.Parent"/>
|
|
||||||
[Ordinal(0)]
|
|
||||||
public int? Parent { get; init; }
|
|
||||||
/// <inheritdoc cref="IWarehouseLocation.Warehouse"/>
|
|
||||||
[Ordinal(1)]
|
|
||||||
public int Warehouse { get; init; }
|
|
||||||
/// <inheritdoc cref="IWarehouseLocation.Name"/>
|
|
||||||
[Ordinal(2), MaxLength(128)]
|
|
||||||
public string Name { get; init; } = default!;
|
|
||||||
/// <inheritdoc cref="IWarehouseLocation.Code"/>
|
|
||||||
[Ordinal(3), MaxLength(32), Index(Unique = true)]
|
|
||||||
public string Code { get; init; } = default!;
|
|
||||||
/// <inheritdoc cref="IWarehouseLocation.Status"/>
|
|
||||||
[Ordinal(4)]
|
|
||||||
public Status Status { get; init; }
|
|
||||||
/// <inheritdoc cref="IWarehouseLocation.ItemCount"/>
|
|
||||||
[Ordinal(5)]
|
|
||||||
public int ItemCount { get; init; }
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
using Connected.Entities.Caching;
|
|
||||||
using Connected.Logistics.Types.Warehouses;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.WarehouseLocations;
|
|
||||||
internal interface IWarehouseLocationCache : IEntityCacheClient<WarehouseLocation, int> { }
|
|
||||||
/// <summary>
|
|
||||||
/// Cache for the <see cref="WarehouseLocation"/> entity.
|
|
||||||
/// </summary>
|
|
||||||
internal sealed class WarehouseLocationCache : EntityCacheClient<WarehouseLocation, int>, IWarehouseLocationCache
|
|
||||||
{
|
|
||||||
public WarehouseLocationCache(IEntityCacheContext context) : base(context, Warehouse.EntityKey)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,202 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Caching;
|
|
||||||
using Connected.Entities;
|
|
||||||
using Connected.Entities.Storage;
|
|
||||||
using Connected.Notifications.Events;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
using Connected.Services;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.WarehouseLocations;
|
|
||||||
internal sealed class WarehouseLocationOps
|
|
||||||
{
|
|
||||||
public sealed class Delete : ServiceAction<PrimaryKeyArgs<int>>
|
|
||||||
{
|
|
||||||
public Delete(IStorageProvider storage, IWarehouseLocationService locations, IEventService events, ICachingService cache)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Locations = locations;
|
|
||||||
Events = events;
|
|
||||||
Cache = cache;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private IWarehouseLocationService Locations { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
private ICachingService Cache { get; }
|
|
||||||
|
|
||||||
protected override async Task OnInvoke()
|
|
||||||
{
|
|
||||||
if (await Locations.Select(Arguments.Id) is not IWarehouseLocation entity)
|
|
||||||
return;
|
|
||||||
|
|
||||||
SetState(entity);
|
|
||||||
|
|
||||||
await Storage.Open<WarehouseLocation>().Update(Arguments.AsEntity<WarehouseLocation>(State.Deleted));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Cache.Remove(WarehouseLocation.EntityKey, Arguments.Id);
|
|
||||||
await Events.Enqueue(this, Events, nameof(IWarehouseLocationService.Deleted), Arguments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Insert : ServiceFunction<InsertWarehouseLocationArgs, int>
|
|
||||||
{
|
|
||||||
public Insert(IStorageProvider storage, IEventService events)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Events = events;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
|
|
||||||
protected override async Task<int> OnInvoke()
|
|
||||||
{
|
|
||||||
return (await Storage.Open<WarehouseLocation>().Update(Arguments.AsEntity<WarehouseLocation>(State.New))).Id;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Events.Enqueue(this, Events, nameof(IWarehouseLocationService.Inserted), Arguments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Query : ServiceFunction<QueryArgs, ImmutableList<IWarehouseLocation>>
|
|
||||||
{
|
|
||||||
public Query(IWarehouseLocationCache locations)
|
|
||||||
{
|
|
||||||
Locations = locations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IWarehouseLocationCache Locations { get; }
|
|
||||||
|
|
||||||
protected override async Task<ImmutableList<IWarehouseLocation>> OnInvoke()
|
|
||||||
{
|
|
||||||
return await (from e in Locations
|
|
||||||
select e).WithArguments(Arguments).AsEntities<IWarehouseLocation>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class QueryByWarehouse : ServiceFunction<QueryWarehouseLocationArgs, ImmutableList<IWarehouseLocation>>
|
|
||||||
{
|
|
||||||
public QueryByWarehouse(IWarehouseLocationCache locations)
|
|
||||||
{
|
|
||||||
Locations = locations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IWarehouseLocationCache Locations { get; }
|
|
||||||
|
|
||||||
protected override async Task<ImmutableList<IWarehouseLocation>> OnInvoke()
|
|
||||||
{
|
|
||||||
return await (from e in Locations
|
|
||||||
where e.Warehouse == Arguments.Warehouse
|
|
||||||
select e).WithArguments(Arguments).AsEntities<IWarehouseLocation>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class QueryChildren : ServiceFunction<QueryWarehouseLocationChildrenArgs, ImmutableList<IWarehouseLocation>>
|
|
||||||
{
|
|
||||||
public QueryChildren(IWarehouseLocationCache locations)
|
|
||||||
{
|
|
||||||
Locations = locations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IWarehouseLocationCache Locations { get; }
|
|
||||||
|
|
||||||
protected override async Task<ImmutableList<IWarehouseLocation>> OnInvoke()
|
|
||||||
{
|
|
||||||
return await (from e in Locations
|
|
||||||
where e.Warehouse == Arguments.Warehouse
|
|
||||||
&& (Arguments.Parent is null || e.Parent == Arguments.Parent)
|
|
||||||
select e).WithArguments(Arguments).AsEntities<IWarehouseLocation>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Lookup : ServiceFunction<PrimaryKeyListArgs<int>, ImmutableList<IWarehouseLocation>>
|
|
||||||
{
|
|
||||||
public Lookup(IWarehouseLocationCache locations)
|
|
||||||
{
|
|
||||||
Locations = locations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IWarehouseLocationCache Locations { get; }
|
|
||||||
|
|
||||||
protected override async Task<ImmutableList<IWarehouseLocation>> OnInvoke()
|
|
||||||
{
|
|
||||||
return await (from e in Locations
|
|
||||||
where Arguments.IdList.Any(f => f == e.Id)
|
|
||||||
select e).AsEntities<IWarehouseLocation>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Select : NullableServiceFunction<PrimaryKeyArgs<int>, IWarehouseLocation>
|
|
||||||
{
|
|
||||||
public Select(IWarehouseLocationCache locations)
|
|
||||||
{
|
|
||||||
Locations = locations;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IWarehouseLocationCache Locations { get; }
|
|
||||||
|
|
||||||
protected override async Task<IWarehouseLocation?> OnInvoke()
|
|
||||||
{
|
|
||||||
return await (from e in Locations
|
|
||||||
where e.Id == Arguments.Id
|
|
||||||
select e).AsEntity();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class SelectByCode : NullableServiceFunction<SelectWarehouseLocationArgs, IWarehouseLocation>
|
|
||||||
{
|
|
||||||
public SelectByCode(IWarehouseLocationCache locations)
|
|
||||||
{
|
|
||||||
Locations = locations;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IWarehouseLocationCache Locations { get; }
|
|
||||||
|
|
||||||
protected override async Task<IWarehouseLocation?> OnInvoke()
|
|
||||||
{
|
|
||||||
return await (from e in Locations
|
|
||||||
where string.Equals(e.Code, Arguments.Code, StringComparison.OrdinalIgnoreCase)
|
|
||||||
select e).AsEntity();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed class Update : ServiceAction<UpdateWarehouseLocationArgs>
|
|
||||||
{
|
|
||||||
public Update(IStorageProvider storage, IWarehouseLocationCache cache, IWarehouseLocationService locations, IEventService events)
|
|
||||||
{
|
|
||||||
Storage = storage;
|
|
||||||
Cache = cache;
|
|
||||||
Locations = locations;
|
|
||||||
Events = events;
|
|
||||||
}
|
|
||||||
|
|
||||||
private IStorageProvider Storage { get; }
|
|
||||||
private IWarehouseLocationCache Cache { get; }
|
|
||||||
private IWarehouseLocationService Locations { get; }
|
|
||||||
private IEventService Events { get; }
|
|
||||||
|
|
||||||
protected override async Task OnInvoke()
|
|
||||||
{
|
|
||||||
if (SetState(await Locations.Select(Arguments.Id)) is not WarehouseLocation entity)
|
|
||||||
return;
|
|
||||||
|
|
||||||
await Storage.Open<WarehouseLocation>().Update(entity.Merge(Arguments, State.Default), Arguments, async () =>
|
|
||||||
{
|
|
||||||
await Cache.Refresh(Arguments.Id);
|
|
||||||
|
|
||||||
return SetState(await Locations.Select(Arguments.Id)) as WarehouseLocation;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async Task OnCommitted()
|
|
||||||
{
|
|
||||||
await Cache.Refresh(Arguments.Id);
|
|
||||||
await Events.Enqueue(this, Locations, nameof(Locations.Updated), Arguments);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,29 +0,0 @@
|
|||||||
using Connected.Data.DataProtection;
|
|
||||||
using Connected.Data.EntityProtection;
|
|
||||||
using Connected.Entities;
|
|
||||||
using Connected.Middleware;
|
|
||||||
using Connected.Validation;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.WarehouseLocations;
|
|
||||||
internal class WarehouseLocationProtection : MiddlewareComponent, IEntityProtector<IWarehouseLocation>
|
|
||||||
{
|
|
||||||
public WarehouseLocationProtection(IWarehouseLocationCache cache)
|
|
||||||
{
|
|
||||||
Cache = cache;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IWarehouseLocationCache Cache { get; }
|
|
||||||
|
|
||||||
public async Task Invoke(EntityProtectionArgs<IWarehouseLocation> args)
|
|
||||||
{
|
|
||||||
if (args.State != State.Deleted)
|
|
||||||
return;
|
|
||||||
/*
|
|
||||||
* We are protecting the children because warehouse locations support nesting entities.
|
|
||||||
*/
|
|
||||||
if (args.Entity.ItemCount > 0)
|
|
||||||
throw ValidationExceptions.ReferenceExists(args.Entity.GetType(), args.Entity.Id);
|
|
||||||
|
|
||||||
await Task.CompletedTask;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,66 +0,0 @@
|
|||||||
using System.Collections.Immutable;
|
|
||||||
using Connected.Entities;
|
|
||||||
using Connected.ServiceModel;
|
|
||||||
using Connected.Services;
|
|
||||||
using Ops = Connected.Logistics.Types.WarehouseLocations.WarehouseLocationOps;
|
|
||||||
|
|
||||||
namespace Connected.Logistics.Types.WarehouseLocations;
|
|
||||||
internal sealed class WarehouseLocationService : EntityService<int>, IWarehouseLocationService
|
|
||||||
{
|
|
||||||
public WarehouseLocationService(IContext context) : base(context)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task Delete(PrimaryKeyArgs<int> args)
|
|
||||||
{
|
|
||||||
await Invoke(GetOperation<Ops.Delete>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task<int> Insert(InsertWarehouseLocationArgs args)
|
|
||||||
{
|
|
||||||
return Invoke(GetOperation<Ops.Insert>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task Patch(PatchArgs<int> args)
|
|
||||||
{
|
|
||||||
if (await Select(args.Id) is not WarehouseLocation entity)
|
|
||||||
return;
|
|
||||||
|
|
||||||
await Update(args.Patch<UpdateWarehouseLocationArgs, WarehouseLocation>(entity));
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<ImmutableList<IWarehouseLocation>> Query(QueryArgs? args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.Query>(), args ?? QueryArgs.Default);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<ImmutableList<IWarehouseLocation>> Query(QueryWarehouseLocationArgs args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.QueryByWarehouse>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<ImmutableList<IWarehouseLocation>> Query(PrimaryKeyListArgs<int> args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.Lookup>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<ImmutableList<IWarehouseLocation>> QueryChildren(QueryWarehouseLocationChildrenArgs args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.QueryChildren>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<IWarehouseLocation?> Select(PrimaryKeyArgs<int> args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.Select>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<IWarehouseLocation?> Select(SelectWarehouseLocationArgs args)
|
|
||||||
{
|
|
||||||
return await Invoke(GetOperation<Ops.SelectByCode>(), args);
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task Update(UpdateWarehouseLocationArgs args)
|
|
||||||
{
|
|
||||||
await Invoke(GetOperation<Ops.Update>(), args);
|
|
||||||
}
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user