Class ProductsAdapter
java.lang.Object
net.tangly.erp.products.ports.ProductsAdapter
- All Implemented Interfaces:
net.tangly.core.domain.Port<ProductsRealm>
,ProductsPort
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
Fields inherited from interface net.tangly.core.domain.Port
PATTERN
-
Constructor Summary
ConstructorsConstructorDescriptionProductsAdapter
(@NotNull ProductsRealm realm, @NotNull ProductsBusinessLogic logic, @NotNull Properties properties, @NotNull Path dataFolder, Path reportFolder) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearEntities
(@NotNull net.tangly.core.domain.DomainAudit audit) void
exportEfforts
(@NotNull List<Effort> efforts, @NotNull Path folder) void
exportEfforts
(@NotNull net.tangly.core.domain.DomainAudit audit, @NotNull Path path) Exports all efforts in a hierarchy of folders.void
exportEffortsDocument
(@NotNull net.tangly.core.domain.DomainAudit audit, @NotNull Assignment assignment, LocalDate from, LocalDate to, @NotNull String filename, @NotNull ChronoUnit unit) Exports all efforts of the assignment in the given period of time.void
exportEffortsDocumentsSplitPerMonth
(@NotNull net.tangly.core.domain.DomainAudit audit, @NotNull Assignment assignment, @NotNull YearMonth from, @NotNull YearMonth to, @NotNull ChronoUnit unit) Exports all efforts of the assignment in the given period of time.void
exportEntities
(@NotNull net.tangly.core.domain.DomainAudit audit) void
importEfforts
(@NotNull net.tangly.core.domain.DomainAudit audit, @NotNull Reader stream, @NotNull String source, boolean replace) Imports all efforts defined in the YAML file located at the given uri.void
importEntities
(@NotNull net.tangly.core.domain.DomainAudit audit) logic()
realm()
yamlLiteralBlockScalar
(@NotNull String text, int indent) yamlScalar
(@NotNull String key, @NotNull String value, int indent) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.tangly.core.domain.Port
importConfiguration
-
Field Details
-
PRODUCTS_TSV
- See Also:
-
WORK_CONTRACTS_TSV
- See Also:
-
ASSIGNMENTS_TSV
- See Also:
-
SCHEMA_FILE
- See Also:
-
YAML_EXT
- See Also:
-
-
Constructor Details
-
ProductsAdapter
public ProductsAdapter(@NotNull @NotNull ProductsRealm realm, @NotNull @NotNull ProductsBusinessLogic logic, @NotNull @NotNull Properties properties, @NotNull @NotNull Path dataFolder, Path reportFolder)
-
-
Method Details
-
realm
- Specified by:
realm
in interfacenet.tangly.core.domain.Port<ProductsRealm>
-
logic
- Specified by:
logic
in interfaceProductsPort
-
importEntities
public void importEntities(@NotNull @NotNull net.tangly.core.domain.DomainAudit audit) - Specified by:
importEntities
in interfacenet.tangly.core.domain.Port<ProductsRealm>
-
exportEntities
public void exportEntities(@NotNull @NotNull net.tangly.core.domain.DomainAudit audit) - Specified by:
exportEntities
in interfacenet.tangly.core.domain.Port<ProductsRealm>
-
clearEntities
public void clearEntities(@NotNull @NotNull net.tangly.core.domain.DomainAudit audit) - Specified by:
clearEntities
in interfacenet.tangly.core.domain.Port<ProductsRealm>
-
importEfforts
public void importEfforts(@NotNull @NotNull net.tangly.core.domain.DomainAudit audit, @NotNull @NotNull Reader stream, @NotNull @NotNull String source, boolean replace) throws org.eclipse.serializer.exceptions.IORuntimeException Description copied from interface:ProductsPort
Imports all efforts defined in the YAML file located at the given uri. An effort is identified by the combination of the assignment identifier and the date of the effort. The assignment identifies uniquely the collaborator working on the effort.- Specified by:
importEfforts
in interfaceProductsPort
- Parameters:
stream
- reader containing the efforts to importsource
- source of the efforts used to audit the import operationreplace
- if true, the imported ones replace the existing efforts, otherwise the imported efforts are only imported if not present- Throws:
org.eclipse.serializer.exceptions.IORuntimeException
-
exportEfforts
public void exportEfforts(@NotNull @NotNull net.tangly.core.domain.DomainAudit audit, @NotNull @NotNull Path path) Exports all efforts in a hierarchy of folders. The files are grouped in folders by years. The efforts are grouped by assignment, contract, collaborator, and year-month and written in a yaml file. The name of the file is the year and month of the efforts, the name of the collaborator, and the identifier of the contract.- Parameters:
path
- the uri of the root folder where the efforts are exported
-
exportEfforts
-
yamlScalar
-
yamlLiteralBlockScalar
-
exportEffortsDocument
public void exportEffortsDocument(@NotNull @NotNull net.tangly.core.domain.DomainAudit audit, @NotNull @NotNull Assignment assignment, LocalDate from, LocalDate to, @NotNull @NotNull String filename, @NotNull @NotNull ChronoUnit unit) Description copied from interface:ProductsPort
Exports all efforts of the assignment in the given period of time. The export shall be an asciidoc document. The document name should contain the contract identifier, the collaborator identifier, and the period of time. The prefix should be the year and month of the period end. The prefix is used to sort the documents.- Specified by:
exportEffortsDocument
in interfaceProductsPort
- Parameters:
assignment
- assignment which efforts are of interestfrom
- start of the considered time intervalto
- end of the considered time intervalfilename
- name of the file to createunit
- unit of the time interval (minutes, hours, and days)
-
exportEffortsDocumentsSplitPerMonth
public void exportEffortsDocumentsSplitPerMonth(@NotNull @NotNull net.tangly.core.domain.DomainAudit audit, @NotNull @NotNull Assignment assignment, @NotNull @NotNull YearMonth from, @NotNull @NotNull YearMonth to, @NotNull @NotNull ChronoUnit unit) Description copied from interface:ProductsPort
Exports all efforts of the assignment in the given period of time. The export shall create an asciidoc document per month. The document name should contain the contract identifier, the collaborator identifier, and the period of time. The prefix should be the year and month of the period end. The prefix is used to sort the documents.- Specified by:
exportEffortsDocumentsSplitPerMonth
in interfaceProductsPort
- Parameters:
assignment
- assignment which efforts are of interestfrom
- first month to considerto
- last month to considerunit
- unit of the time interval (minutes, hours, and days)
-