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
Development
Core
Entity Definitions
The definitions in this module have id discriminators in the range 50-75. |
The BudgetEntityDefinition extends the AbstractEntityDefinition, the AbstractActivatableEntityDefinition, the AbstractExpensableEntityDefinition and the AbstractNameableEntityDefinition:

The additionally defined property here is department. Via the respective getter-setter pair, information for the budget of a department can be retrieved/stored.
The BusinessAbstractOrderEntityDefinition extends the AbstractOrderEntityDefinition, going further to the AbstractEntityDefinition and the AbstractUserableEntityDefinition and the AbstractUserableEntityDefinition:

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 |
The BusinessCartEntityDefinition extends the CartEntityDefinition and the BusinessAbstractOrderEntityDefinition, going further to the AbstractOrderEntityDefinition:

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

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 |
The BusinessOrganizationEntityDefinition extends the OrganizationEntityDefinition, going further to the AbstractEntityDefinition:

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.
The BusinessQuoteCommentEntityDefinition is the entity definition for quote comment entries. It extends the AbstractEntityDefinition :

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 |
The BusinessQuoteEntityDefinition is the entity definition for quotes (a B2B functionality). It extends the AbstractEntityDefinition :

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 |
The BusinessQuoteNegotiationEntityDefinition is the entity definition for quote negotiation entries. It extends the AbstractEntityDefinition :

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 |
The BusinessQuoteStatusDefinition is the enum definition to define the different quote statuses. It extends the AbstractEntityEnum, going to the MixInEnum:

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

The additionally defined property here is business. It stores a boolean value, indicating if the current site is a b2b business site or not.
The BusinessUserGroupEntityDefinition extends the UserGroupEntityDefinition, inheriting, further, the PrincipalEntityDefinition and the AbstractEntityDefinition:

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 |
The DepartmentEntityDefinition extends the AbstractEntityDefinition, the AbstractDescriptionableEntityDefinition and the AbstractNameableEntityDefinition:

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 |
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:

The organization
property stores the organization the catalog belongs to.
The PurchaseLimitEntityDefinition extends the AbstractEntityDefinition, the AbstractActivatableEntityDefinition, the AbstractExpensableEntityDefinition and the AbstractNameableEntityDefinition:

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 |
The PurchaseLimitTimespanTypeEntityDefinition extends the AbstractEntityEnum, going further to the MixInEnum:

The PurchaseLimitTimespanTypeEntityDefinition
holds an enumerated list of values. The type of purchase limit time span can be DAY
, WEEK
, MONTH
or YEAR
.
The PurchaseLimitTypeEntityDefinition extends the AbstractEntityEnum, going further to the MixInEnum:

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
.
The ReplenishmentOrderFrequencyTypeEntityDefinition extends the AbstractEntityEnum, going further to the MixInEnum:

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
The BudgetRepository extends the ActivatableRepository and the BaseEntityRepository. The BudgetRepository
is the corresponding Spring Data
JPA repository for the BudgetEntityDefinition
:

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

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

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

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

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

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

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

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

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

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

The conversion is customized.
The BusinessCustomerMapperFactoryConfigurer implements the MapperFactoryConfigurer, converting the BusinessCustomerEntityDefinition
to BusinessCustomerDetailsDtoDefinition
:

The conversion is done via the byDefault()
method.
The DepartmentMapperFactoryConfigurer implements the MapperFactoryConfigurer, converting the DepartmentEntityDefinition
to DepartmentDto
:

The conversion is done via the byDefault()
method.
The PurchaseLimitMapperFactoryConfigurer implements the MapperFactoryConfigurer, converting the PurchaseLimitEntityDefinition
to PurchaseLimitDto
:

The conversion is customized.
More about the mapping configurations you may read in the respective Orika guide.
Dto definitions
The BudgetDto is the corresponding Dto object for the BudgetEntityDefinition
.
The BusinessCustomerDetailsDtoDefinition extends the UserDetailsDtoDefinition. The UserDetailsDtoDefinition
, in its turn, relies on the defined within the Spring framework UserDetails:

The BusinessCustomerDetailsDtoDefinition
is the corresponding Dto object for the BusinessCustomerEntityDefinition
.
The BusinessUserGroupDtoDefinition extends the UserGroupDtoDefinition:

The DepartmentDto is the corresponding Dto object for the DepartmentEntityDefinition
The PurchaseLimitDto is the corresponding Dto object for the PurchaseLimitEntityDefinition
Facades
The functionalities, defined in the BudgetFacade, let you:
-
obtain the budget Dto,
-
update the budget Dto or
-
remove the budget Dto
The BusinessCartFacade extends the CartFacade:

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.
The functionalities, defined in the BusinessCatalogFacade, let you:
-
obtain all catalogs for the current organization,
*update the catalog,
-
delete the catalog.
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
The BusinessOrderFacade extends the OrderFacade:

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.
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
The extra methods, defined in the OrganizationFacade, let you:
-
retrieve the organization for the current user and
-
create a new organization
The functionalities, defined in the PurchaseLimitFacade, let you:
-
get the purchase limits,
-
update the given purchase limit and
-
delete the purchase limit
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