Hybris - Adding Service product to main product - sap-commerce-cloud

I would like to know what is the best approach to add service products to a main product.
Say for example, in Autocare we have Standard Oil Change (Main Product) and Synthetic Oil change (Main Product) and there are services products tied to it like tire pressure check, wheel balance, Air filter inspect, etc. Say Standard Oil change will have 6 services tied to it and Synthetic Oil Change will have 12 services to it.
When the user adds Standard Oil change to the cart, it should show all the services relates this this product in the cart.
So i will adding 12 Service Product to Hybris DB altogether and i can add these service products to any Main Products. Could anyone let me know what is the best approach and how we can make realtionship between Main Product and Service products. Another thing is the Service product will not be visible when the user searches for product, but it will be visible in the PDP once he selects that product.
Appreciate your help on this. Advance Thanks!!!
Thanks

If you want to link products with each other, based on a type of relationship, you should make use of the ProductReference datamodel. This allows you to link 2 products and specifying what their relationship is with the ProductReferenceType property.
By default, it's used a lot for cross selling, upselling, accessories,... It also has a default type available called CONSISTS_OF. This one fits your requirements perfectly.
For your example:
You would have your product Standard Oil Change, that will have 6 product references. One for each service. The type of this reference should be CONSISTS_OF

Related

Azure search solr index definition for supporting multiple markets

I am building a product catalog for an e-comm website. I am having a requirement to build a azure search/solr/elastic search based index. The problem is saving the market specific attributes. The website is supporting 109 markets and there is each market specific data like ratings, price, views, wish-listed, etc. that I need to save in the index eg: Product1 will have 109 ratings(rating is different in each market)/109 prices(price might be different in each market) corresponding to 109 markets. Also I will have to use this attributes to add a boosting function so that when people are searching for this, products with higher view/ratings surfaces up. How do I design the index definition to support this? Can I achieve this by 1 index doc per product or do I have to create 1 index doc per market? Some pointers will be very helpful. I have spent couple of days on this and could not reach to a conclusion that is optimized for this use case. Thank you!
My proposed index definition:
-id
-mktUSA
--mktId
--rating
--views
--price
...
-mktCanada
--mktId
--rating
--views
--price
...
-locales
--En
--Fr
--Zh
...
...other properties
The problem with this approach is configuring a magnitude scoring functions inside scoring profile, to boost products based on the market
Say eg: If user is from Canada, only the Canada based rating/views should be considered and not the other market ratings while Cognitive search is calculating the search relevance score.
Is there any possible work around this? Elastic search has a neat solution of Function score query that can be used to configure the scoring function dynamically
From what I understand, your problem is that you want to have a single index with products that support 109 different markets. Many different properties for your Product model can then be market-specific. Your concern is that the model gets to big, or if it's a scalable design. It is. You can have 1000+ properties without a problem.
I have built a similar search solution for e-commerce for multiple markets.
For price, I specify one price per market. I have about 80 or so markets, so that's 80 prices. There is no way around it. I would probably do the same for ratings and views too. One per market.
In our application we use separate dimensions for market, language and country. A market can be Scandinavia, BeNeLux or Asia-Pacific. You need to clearly define what a market is in your case, and agree with the business which markets you have and how you handle changes. Countries can map directly to markets, but it may also differ. Finally, language is usually shared across markets/countries and you usually only have to support 20-25 languages.
Suggested data model
Id
TitleEnGb
TitleDeDe
TitleFrFr
...
PriceGb
PriceUs
PriceNo
PriceDe
...
RatingsGb
RatingsUs
RatingsNo
RatingsDe
...
DescriptionEnGb
DescriptionDeDe
DescriptionFrFr
...
I try to illustrate that the Title and Description are language-specific. The price and ratings are market-specific.
For the 20-25 language-specific properties, you have to think about what analyzers to use. You want to use language-specific analyzers, and preferably the Microsoft analyzers since they have much better linguistics support with full lemmatization and so on.
When you develop your frontend application you have to keep track of which market, country and language you then refer to the specific properties. This is the easiest way to support boosting and so on.
Per-market index is not recommended
You could create one index per market. I have gone down this route before. I would not recommend this. This means you have to update 109 indexes every time you add, change or delete an item. And Azure Search supports 50 indexes per service at the most anyways.

Blockchain Application Architecture: UML & Use Cases

For my internship, I need to implement a blockchain based solution to manage a drug supply chain. The management of this supply chain implies to track-and-trace (geolocate) a drug on the chain, but also to monitor the storage temperature to see if the cold chain is respected. For that I created a mock-up of the POC my Dapps (https://balsamiq.cloud/sum5oq5/p8lsped)and also I wanted to prepare myself by doing a UML and a use cases. However, I didn't find a lot of information about blockchain's UML and use cases besides two literatures which were quite different, so I don't know if what I did was correct or not...
The users of my Dapps will be the following ones:
The stakeholders (Manufacturers, Distributors and Retailers) which will use the Dapps to place orders and also monitor them. They also can search in the historic a specific order. Finally, trough IOT sensors they update the conditions of the order (temperature & location).
The administrator which roles is to update the Dapps and its rules. But also to add or delete user while also defining the rights that they have on the blockchain (I intend to use a permisionned blockchain). Finally, they are also here to help in case of technical problem.
The Dapps that I'm thinking about works in the following:
A user, the customer, can place an order (a list of products) to a
certain seller and choose the final destination of the order.
The order is then put together before being shipped or stocked in the
depots of one of the stakeholders (distributor or retailer) with a
description of the stocking and/or shipping condition of the product
(for example the product must be stocked or transported in a room
with a temperature of less than 5°C). During the shipping and
storing, an IOT device will feed the drops with the temperature and
geolocation of the product by updating the data each 5-10mn.
Obviously they will be a function that allows all the users to see
the history of the order passed and search inside a specific order.
In case where the temperature doesn't respect the temperature
recommended, then the smart-contract send an alert. The same if the
collocation of the product is "weird" like being in some European
countries and not in an Asian country, an alert will be sent again by
the smart-contractual. Finally, in the case where the product is sent
to the asked location by the customer, then the money for the order
will be paid to the seller.
So based on what I explained, I came here in hope that someone tell me if the use cases and UML that I did were correct or not.
I thank in advance anybody who'll take the time to help me.

Is this Use Case correct?

Its my first time making a use case and this is for my coursework.
I had to follow the case study below.
Case Study 8: Warehouse Control System (WCS)
A warehouse distributes health food and related products. Customers order a particular
product and quantity from the warehouse. The Warehouse Control System WCS saves the
order and provides to the customer the order number. The WCS generates a pick list and
shopping label, which tells the order-picker person how many of each item to pick to fulfil
the order. The order-picker picks the items, places them in the box, and places the shipping
label on it. The order-picker then uses the WCS to specify whether the order is ready or
not. Then the manager sends the order number, address, and the payment data to the
shipping company. At the end of the day, the shipping company arrives to pick up all the
orders. The inventory of the product in stock is carried out by the staff, but in others, it is
outsourced to an external company. Each staff has a specific function which is either to
raise an order or check the re-order level of the products in stock.
The company wants to create a computer system that allows employees and external
companies to access the application system on desktop. Model, design and implement a
GUI client that can access the database using Visual Studio or any other software
development package. The database must be designed from the class model and the entity
data model using MS Access or Oracle database.
I'm not sure: should the Warehouse Control System (WCS) be an actor ? If not how to make the use case without it?
Here the use case I made:
The WCS is the system under consideration (the blue boundary).
Some observations:
Use verb-subject(-object) to name use cases
Order ready and the like are no use cases
Try to not start functional decomposition (like it seems you did with that Order ready
I recommend to read Bittner/Spence about use cases as usual.

Orders & Inventory DDD - Where should allocation/reservation be handled?

I am trying to refactor a legacy order handling and stock system with into a cleaner service oriented event-driven architecture. However, I am having some difficulty deciding what service should be responsible for the reservation/allocation of stock.
A brief overview of the current system
Sales orders are placed with us via third party system but we do not necessarily have all order lines in stock.
If an order item is in stock then we allocate/reserve the stock for that order straight away.
However, if we do not have enough stock then we procure the stock from our suppliers via a purchasing system.
When the item arrives from the supplier, the system will search through all open sales orders for the item and reserve/allocate the available stock to them, prioritising by sales order date. ***
I have already identified two services that I think need to be developed
Sales - Responsible for receiving the sales order and inserting into the database. Has domain entities such as Order, OrderLine etc.
Inventory - Responsible for keeping track of how much stock is available in our warehouse. Has domain entities such as StockItem.
However, as the allocation/reservation of stock concerns both inventory and sales I am not sure where the behaviour in point 2 above should be put.
I welcome any help or thoughts on this.
I think you have 2 BCs (bounded contexts): Inventory and Sales. For the integration between them I would probably go for domain events approach.
When a new item arrives at the warehouse, the Inventory BC increments the stock for the item, and publish an event.
Sales BC subscribes to the event, and it updates the opened sales that are waiting for the stock item.
So, behaviour of "point 2" are shared by both BC:
Sales BC search for opened orders waiting for that item. And then it asks Inventory BC to get the number of items it needs (this request is synchronous) and close the order.
Inventory BC receives the request and decrements the stock for the item.
However, as the allocation/reservation of stock concerns both inventory and sales I am not sure where the behaviour in point 2 above should be put.
I've been thinking about this problem (purely academically), and my current conclusion is that reservation management belongs with the inventory system. That keeps the stock source (the loading of items procured from your suppliers) and the stock sink (fulfillment of orders) together.
So the inventory system caches its own copy of the data required to fill the order (allowing it to work autonomously). It should be able to make progress as soon as it is informed that the suppliers have provided new inventory, even if the sales system happens to be down for maintenance.
You mentioned SOA and NServiceBus, so my initial thought was that you've attended Udi Dahan his ADSD training? I'll assume you have. With that, I'll try to answer your question.
So far I don't have a lot of information. But with what we have, I figured we need these properties to store all that you mentioned.
ProductId, one for each available product
InventoryTotal, attached to a ProductId. This number goes up and down
OrderId, to create an order
OrderDate, to make sure we can find the order that should receive incoming stock first.
If you have an OrderId, you can attach one or more ProductId to create an actual order. Different ways of storing this technically. Maybe in a relational database with Order and OrderLine tables, or possibly in a DocumentDb where everything is stored in a single document. That's totally irrelevant at this point.
Assuming we need 4 attributes, I'm not sure why we would create more than 1 service to split this up? This might change when we have more information, but at this moment I don't see the need.
If you want to discuss this, contact us at support#particular.net, mention my name and we can continue the conversation.
You are talking about loosely coupled domain apps, managing your sales orders, managing your inventory and managing your purchase orders.
Inventory must always be up to date, in order to not sell what you can't deliver. So PO en SO app should both talk to inventory via synchronous (inventory) services. To keep everything consistent, events on purchasing side, like receiving less than you expected for a PO, will have an impact on any SO already assigning quantity of that PO, as persisted in inventory. So the same PO pcs for example, in which the event of receiving less as expected, is registered, should synchronously update inventory, to update the quantity available for SOs to assign from, and publish an event, to be picked up, asynchronously, in the So app, so that the user can be notified and talk relevant action. Etc.

Does Hybris commerce have price override capability

Does Hybris commerce have price override or appeasements capability at Order level or Item level.
There are mulitple ways how that can be done in hybris, one example is using ASM (assisted service module) that offers special promotions that can be granted by a service agent.
There might also be ways to achieve this using the cs-cockpit (customer service cockpit), I haven't looked into that deeper though.
For ASM documentation look e.g. here: https://help.hybris.com/6.3.0/hcd/8ac06f10866910148d8c850e15b102d2.html
Hope this helps a bit.
It really depends on what exactly are you trying to achieve. If you like some sort of a discount or promotions, you can see the link provided by Sebastion. In the wiki you can also find other promotion and discount engines. Another solution would be to have multiple price rows per product. Hybris supports this. For example for a particular product, you can set a special price for a special customer or customerGroup. Also the same way you can set different prices for different quantities. For example an apple costs 1$ but if you buy 100, the price goes to 0.75$.
More information about the pricerows: here
Keep in mind that Hybris is highly customizable so you can also override some logic from the PriceFactory but i would recommend using first the out of the box price features and then try overriding the PriceFactory.

Resources