Introduction

The module’s integration allows you to:

  • create a business structure within your site,

  • add business groups to your business structure and

  • delegate certain budgets to certain departments

Business

Development

Core

Entity Definitions

The definitions in this module have id discriminators in the range 50-75.

asciidoctor diagram BudgetEntityDefinition

The additionally defined property here is department. Via the respective getter-setter pair, information for the budget of a department can be retrieved/stored.

asciidoctor diagram BusinessAbstractOrderEntityDefinition

Via the respective getter-setter pairs, the following information can be retrieved/stored in the database:

Property Description

department

stores the department the abstract order is placed to

replenishmentDate

stores the replenishment date for the cart or for the order

frequencyType

stores the replenishment frequency type for the cart or for the order

frequency

stores the replenishment frequency for the cart or for the order

quote

stores the quote for the cart or for the order

BusinessCartEntityDefinition

The BusinessCartEntityDefinition extends the CartEntityDefinition and the BusinessAbstractOrderEntityDefinition, going further to the AbstractOrderEntityDefinition:

asciidoctor diagram BusinessCartEntityDefinition
BusinessCustomerEntityDefinition

The BusinessCustomerEntityDefinition inherits its features from the CustomerEntityDefinition, the UserEntityDefinition, the PrincipalEntityDefinition and the AbstractEntityDefinition:

asciidoctor diagram BusinessCustomerEntityDefinition

Via the respective getter-setter pairs, the following information can be retrieved/stored in the database:

Property Description

department

stores the department the customer belongs to

purchaseLimits

stores a set of purchase limits for the customer

approvers

stores a set of customer approvers for a particular customer

BusinessOrganizationEntityDefinition

The BusinessOrganizationEntityDefinition extends the OrganizationEntityDefinition, going further to the AbstractEntityDefinition:

asciidoctor diagram BusinessOrganizationEntityDefinition

The additionally defined property here is departments. Via the respective getter-setter pair, information for the departments of the particular organization can be retrieved/stored.

BusinessQuoteCommentEntityDefinition

The BusinessQuoteCommentEntityDefinition is the entity definition for quote comment entries. It extends the AbstractEntityDefinition :

asciidoctor diagram BusinessQuoteCommentEntityDefinition

Via the respective getter-setter pairs, the following information can be retrieved/stored in the database:

Property Description

comment

stores the comment for the quote comment entry

quote

stores the quote the comment belongs to

BusinessQuoteEntityDefinition

The BusinessQuoteEntityDefinition is the entity definition for quotes (a B2B functionality). It extends the AbstractEntityDefinition :

asciidoctor diagram BusinessQuoteEntityDefinition

Via the respective getter-setter pairs, the following information can be retrieved/stored in the database:

Property Description

status

stores the status of the quote

cart

stores the cart for the quote

quote negotiations

stores the negotiations for the quote

BusinessQuoteNegotiationEntityDefinition

The BusinessQuoteNegotiationEntityDefinition is the entity definition for quote negotiation entries. It extends the AbstractEntityDefinition :

asciidoctor diagram BusinessQuoteNegotiationEntityDefinition

Via the respective getter-setter pairs, the following information can be retrieved/stored in the database:

Property Description

cart total

stores the cart total proposed with the quote negotiation entry

comment

stores the comment for the quote negotiation entry

quote

stores the quote for the quote negotiation

BusinessQuoteStatusDefinition

The BusinessQuoteStatusDefinition is the enum definition to define the different quote statuses. It extends the AbstractEntityEnum, going to the MixInEnum:

asciidoctor diagram BusinessQuoteStatusDefinition
BusinessSiteEntityDefinition

The BusinessSiteEntityDefinition extends the SiteEntityDefinition. The SiteEntityDefinition, in its turn, inherits the AbstractEntityDefinition and the AbstractDescriptionableEntityDefinition:

asciidoctor diagram BusinessSiteEntityDefinition

The additionally defined property here is business. It stores a boolean value, indicating if the current site is a b2b business site or not.

BusinessUserGroupEntityDefinition

The BusinessUserGroupEntityDefinition extends the UserGroupEntityDefinition, inheriting, further, the PrincipalEntityDefinition and the AbstractEntityDefinition:

asciidoctor diagram BusinessUserGroupEntityDefinition

Via the respective getter-setter pairs, the following information can be retrieved/stored in the database:

Property Description

department

stores the department the employee belongs to

purchaseLimits

stores a set of purchase limits for the particular user group

asciidoctor diagram DepartmentEntityDefinition

Via the respective getter-setter pairs, the following information can be retrieved/stored in the database:

Property Description

organization

stores the organization for the department

administrator

stores the administrator profile for the department; the administrator is allowed to modify other employees' information

managers

stores the manager profile for the department; the manager is allowed to approve or reject the orders of their customers, to view aggregated reports and receive notifications when some of their customers exceed their budget

superdepartment

stores the super-departments for the given department

subdepartments

stores the sub-departments for the given department

budgets

stores a list of the budgets for the department

purchaseLimits

stores a list of purchase limits for the department

OrganizationCatalogEntityDefinition

The OrganizationCatalogEntityDefinition is a mix-in definition of the CatalogEntityDefinition to allow business users to create their own catalogs with products. The OrganizationCatalogEntityDefinition extends the CatalogEntityDefinition, going further to the AbstractEntityDefinition and the AbstractNameableEntityDefinition:

asciidoctor diagram OrganizationCatalogEntityDefinition

The organization property stores the organization the catalog belongs to.

asciidoctor diagram PurchaseLimitEntityDefinition

Via the respective getter-setter pairs, the following information can be retrieved/stored in the database:

Property Description

type

stores the purchase limit type - either order-based, or time-based.

timespan

stores the timespan type when the type of the purchase limit is time-span-based

department

stores the department for the purchase limit

userGroups

stores a set of user groups for the purchase limit

users

stores a set of employees for the purchase limit

PurchaseLimitTimespanTypeEntityDefinition

The PurchaseLimitTimespanTypeEntityDefinition extends the AbstractEntityEnum, going further to the MixInEnum:

asciidoctor diagram PurchaseLimitTimespanTypeEntityDefinition

The PurchaseLimitTimespanTypeEntityDefinition holds an enumerated list of values. The type of purchase limit time span can be DAY, WEEK, MONTH or YEAR.

PurchaseLimitTypeEntityDefinition

The PurchaseLimitTypeEntityDefinition extends the AbstractEntityEnum, going further to the MixInEnum:

asciidoctor diagram PurchaseLimitTypeEntityDefinition

The PurchaseLimitTypeEntityDefinition holds an enumerated list of values. The type of purchase limit could be either order-based - PER_ORDER or time-span-based - PER_TIMESPAN.

ReplenishmentOrderFrequencyTypeEntityDefinition

The ReplenishmentOrderFrequencyTypeEntityDefinition extends the AbstractEntityEnum, going further to the MixInEnum:

asciidoctor diagram ReplenishmentOrderFrequencyTypeEntityDefinition

The ReplenishmentOrderFrequencyTypeEntityDefinition holds an enumerated list of values. The type of the replenishment order frequency can be DAILY, WEEKLY, or MONTHLY.

Spring Data JPA Repositories

BudgetRepository

The BudgetRepository extends the ActivatableRepository and the BaseEntityRepository. The BudgetRepository is the corresponding Spring Data JPA repository for the BudgetEntityDefinition:

asciidoctor diagram BudgetRepository
BusinessAbstractOrderRepository

The BusinessAbstractOrderRepository extends the BaseEntityRepository and is the corresponding Spring Data JPA repository for the BusinessAbstractOrderEntityDefinition:

asciidoctor diagram
BusinessCustomerRepository

The BusinessCustomerRepository extends the BaseEntityRepository and is the corresponding Spring Data JPA repository for the BusinessCustomerEntityDefinition:

asciidoctor diagram BusinessCustomerRepository
BusinessQuoteCommentRepository

The BusinessQuoteCommentRepository extends BaseEntityRepository and is the corresponding Spring Data JPA repository for the BusinessQuoteCommentEntityDefinition:

asciidoctor diagram BusinessQuoteCommentRepository
BusinessQuoteNegotiationRepository

The BusinessQuoteNegotiationRepository extends BaseEntityRepository and is the corresponding Spring Data JPA repository for the BusinessQuoteNegotiationEntityDefinition:

asciidoctor diagram BusinessQuoteNegotiationRepository
BusinessQuoteRepository

The BusinessQuoteRepository extends the BaseEntityRepository and is the corresponding Spring Data JPA repository for the BusinessQuoteEntityDefinition:

asciidoctor diagram BusinessQuoteRepository
BusinessUserGroupRepository

The BusinessUserGroupRepository extends the BaseEntityRepository and is the corresponding Spring Data JPA repository for the BusinessUserGroupEntityDefinition.

asciidoctor diagram BusinessUserGroupRepository
DepartmentRepository

The DepartmentRepository extends the BaseEntityRepository and is the corresponding Spring Data JPA repository for the DepartmentEntityDefinition:

asciidoctor diagram DepartmentRepository
OrganizationCatalogRepository

The OrganizationCatalogRepository extends the BaseEntityRepository and is the corresponding Spring Data JPA repository for the OrganizationCatalogEntityDefinition:

asciidoctor diagram OrganizationCatalogRepository
PurchaseLimitRepository

The PurchaseLimitRepository extends the ActivatableRepository and the BaseEntityRepository. The `PurchaseLimitRepository is the corresponding Spring Data JPA repository for the PurchaseLimitEntityDefinition:

asciidoctor diagram PurchaseLimitRepository

Facade

MapperFactoryConfigurers

BudgetMapperFactoryConfigurer

The BudgetMapperFactoryConfigurer implements the MapperFactoryConfigurer, converting the BudgetEntityDefinition to BudgetDto:

asciidoctor diagram

The conversion is customized.

BusinessCustomerMapperFactoryConfigurer

The BusinessCustomerMapperFactoryConfigurer implements the MapperFactoryConfigurer, converting the BusinessCustomerEntityDefinition to BusinessCustomerDetailsDtoDefinition:

asciidoctor diagram BusinessCustomerMapperFactoryConfigurer

The conversion is done via the byDefault() method.

DepartmentMapperFactoryConfigurer

The DepartmentMapperFactoryConfigurer implements the MapperFactoryConfigurer, converting the DepartmentEntityDefinition to DepartmentDto:

asciidoctor diagram DepartmentMapperFactoryConfigurer

The conversion is done via the byDefault() method.

PurchaseLimitMapperFactoryConfigurer

The PurchaseLimitMapperFactoryConfigurer implements the MapperFactoryConfigurer, converting the PurchaseLimitEntityDefinition to PurchaseLimitDto:

asciidoctor diagram PurchaseLimitMapperFactoryConfigurer

The conversion is customized.

More about the mapping configurations you may read in the respective Orika guide.

Dto definitions

BudgetDto

The BudgetDto is the corresponding Dto object for the BudgetEntityDefinition.

BusinessCustomerDetailsDtoDefinition

The BusinessCustomerDetailsDtoDefinition extends the UserDetailsDtoDefinition. The UserDetailsDtoDefinition, in its turn, relies on the defined within the Spring framework UserDetails:

asciidoctor diagram BusinessCustomerDetailsDtoDefinition

The BusinessCustomerDetailsDtoDefinition is the corresponding Dto object for the BusinessCustomerEntityDefinition.

BusinessUserGroupDtoDefinition

The BusinessUserGroupDtoDefinition extends the UserGroupDtoDefinition:

asciidoctor diagram BusinessUserGroupDtoDefinition
DepartmentDto

The DepartmentDto is the corresponding Dto object for the DepartmentEntityDefinition

PurchaseLimitDto

The PurchaseLimitDto is the corresponding Dto object for the PurchaseLimitEntityDefinition

Facades

BudgetFacade

The functionalities, defined in the BudgetFacade, let you:

  • obtain the budget Dto,

  • update the budget Dto or

  • remove the budget Dto

BusinessCartFacade

The BusinessCartFacade extends the CartFacade:

asciidoctor diagram BusinessCartFacade

The defined here functionalities let you:

  • set the department for the business order/cart,

  • set the replenishment date for the business order/cart,

  • set the replenishment frequency type for the business order/cart,

  • set the replenishment frequency for the business order/cart,

  • set an empty cart as the current session cart.

BusinessCatalogFacade

The functionalities, defined in the BusinessCatalogFacade, let you:

  • obtain all catalogs for the current organization,

*update the catalog,

  • delete the catalog.

BusinessCustomerFacade

The functionalities, defined in the BusinessCustomerFacade, let you:

  • obtain all user`s details, based on different criteria used,

  • update the user’s profile,

  • create a new user’s profile

  • remove the user’s profile

BusinessOrderFacade

The BusinessOrderFacade extends the OrderFacade:

asciidoctor diagram BusinessOrderFacade
BusinessQuoteFacade

The functionalities, defined in the BusinessQuoteFacade, let you:

  • obtain the quote Dto for the given order code,

  • obtain all quotes Dto available for the current user,

  • update the quote specified with the given quote dto object. If the object’s id field equals null, a new quote with the given Dto is created

  • obtain all quote negotiations for the quote, corresponding to the passed code,

  • add the given quote comment for the specific quote,

  • obtain all quote comments for the quote, corresponding to the passed code.

DepartmentFacade

The functionalities, defined in the DepartmentFacade, let you:

  • get all departments for an organization,

  • update the specified department,

  • add a user to a department,

  • get a list of sub-departments for the specified department and

  • delete the specified department

OrganizationFacade

The extra methods, defined in the OrganizationFacade, let you:

  • retrieve the organization for the current user and

  • create a new organization

PurchaseLimitFacade

The functionalities, defined in the PurchaseLimitFacade, let you:

  • get the purchase limits,

  • update the given purchase limit and

  • delete the purchase limit

UserGroupFacade

The functionalities, defined in the UserGroupFacade, let you:

  • obtain all user groups for the current organization,

  • obtain a list of all "business-to-business" user groups for all suitable user roles,

  • retrieve the user group,

  • update the user group,

  • create a new user group,

  • copy the user group,

  • delete the user group

Integration

The integration with the Nemesis platform is pretty straight-forward - just add the module in your classpath:

<dependency>
    <groupId>io.nemesis.platform.module</groupId>
    <artifactId>nemesis-module-business</artifactId>
</dependency>