Table of content



The OrderItem entity within the microservice architecture

Entity-Relationship-Model of <ProductService>

Entity Name: OrderItem

Data Schema: Shop

Master Service: ProductService


Dataflow of entity of OrderItem

Microservices

3.1 CountryService3.2 DiscountCampaignService3.3 ProductService3.4 ShopLicenseService

Entity Properties

Property NameDatatypeData EntityReference Entity
AmountDOUBLEOrderItem
CustomerOrderLONGOrderItemCustomerOrder
PrimaryKeyLONGOrderItem
ProductLONGOrderItemProduct
ServerReplicationVersionLONGOrderItem
ShopOwnerLONGOrderItem

Service Interfaces

Relative mapping URLRequest MethodMethod NameMicroserviceInvolved Entities
/orderitemGETfindAllOrderItem()ProductServiceOrderItem
/orderitem/{id}GETfindOrderItemById(id)ProductServiceOrderItem
/orderitem/product/{id}GETfindAllOrderItemOfProduct(id)ProductServiceProduct OrderItem
/customerdelivery/orderitem/{id}GETfindAllCustomerDeliveryOfOrderItem(id)ProductServiceOrderItem CustomerDelivery
/orderitemPOSTinsertOrderItem(orderitem)ProductServiceOrderItem
/orderitem/{id}DELETEdeleteOrderItemById(id)ProductServiceOrderItem
/orderitem/customerorder/{id}GETfindAllOrderItemOfCustomerOrder(id)ProductServiceCustomerOrder OrderItem
/orderitem/{id}PUTupdateOrderItemById(orderitem)ProductServiceOrderItem

Distributed transaction of <OrderItem>

Pseudo code snippet

final OrderItem orderitem = (OrderItem) this.callMicroservice(ServiceNames.PRODUCT_SERVICE + "/orderitem/" + id, OrderItem.class);
if (orderitem != null) {
    final Product product1 = (Product) this.callMicroservice(ServiceNames.PRODUCT_SERVICE + "/product/" + orderitem.getProduct().getId(), Product.class);
    if (product1 != null) {
        final SalesTax salestax2 = (SalesTax) this.callMicroservice(ServiceNames.PRODUCT_SERVICE + "/salestax/" + product1.getSalesTax().getId(), SalesTax.class);
        if (salestax2 != null) {
            final Country country3 = (Country) this.callMicroservice(ServiceNames.COUNTRY_SERVICE + "/country/" + salestax2.getCountry().getId(), Country.class);
            if (country3 != null) {
            }
        }
        final ProductCategory productcategory4 = (ProductCategory) this.callMicroservice(ServiceNames.PRODUCT_SERVICE + "/productcategory/" + product1.getProductCategory().getId(), ProductCategory.class);
        if (productcategory4 != null) {
        }
        final Country countryoforigin5 = (Country) this.callMicroservice(ServiceNames.COUNTRY_SERVICE + "/country/" + product1.getCountryOfOrigin().getId(), Country.class);
        if (countryoforigin5 != null) {
        }
    }
    final CustomerOrder customerorder6 = (CustomerOrder) this.callMicroservice(ServiceNames.COUNTRY_SERVICE + "/customerorder/" + orderitem.getCustomerOrder().getId(), CustomerOrder.class);
    if (customerorder6 != null) {
        final ShopCustomer shopcustomer7 = (ShopCustomer) this.callMicroservice(ServiceNames.COUNTRY_SERVICE + "/shopcustomer/" + customerorder6.getShopCustomer().getId(), ShopCustomer.class);
        if (shopcustomer7 != null) {
            final Country country8 = (Country) this.callMicroservice(ServiceNames.COUNTRY_SERVICE + "/country/" + shopcustomer7.getCountry().getId(), Country.class);
            if (country8 != null) {
            }
        }
    }
}
return orderitem;


Table of content