Table of content



The PurchaseRule entity within the microservice architecture

Entity-Relationship-Model of <ProductService>

Entity Name: PurchaseRule

Data Schema: Shop

Master Service: ProductService


Dataflow of entity of PurchaseRule

Microservices

3.1 CountryService3.2 DiscountCampaignService3.3 ProductService3.4 ShopLicenseService

Entity Properties

Property NameDatatypeData EntityReference Entity
CreationDateLONGPurchaseRule
NotificationEmailSTRINGPurchaseRule
PrimaryKeyLONGPurchaseRule
ProductLONGPurchaseRuleProduct
ServerReplicationVersionLONGPurchaseRule
ShopOwnerLONGPurchaseRule
ThresholdINTPurchaseRule
WarehouseLONGPurchaseRuleWarehouse

Service Interfaces

Relative mapping URLRequest MethodMethod NameMicroserviceInvolved Entities
/purchaserule/product/{id}GETfindAllPurchaseRuleOfProduct(id)ProductServiceProduct PurchaseRule
/purchaseruleGETfindAllPurchaseRule()ProductServicePurchaseRule
/purchaserule/{id}GETfindPurchaseRuleById(id)ProductServicePurchaseRule
/purchaserule/{id}PUTupdatePurchaseRuleById(purchaserule)ProductServicePurchaseRule
/purchaserule/warehouse/{id}GETfindAllPurchaseRuleOfWarehouse(id)ProductServiceWarehouse PurchaseRule
/purchaserulePOSTinsertPurchaseRule(purchaserule)ProductServicePurchaseRule
/purchaserule/{id}DELETEdeletePurchaseRuleById(id)ProductServicePurchaseRule

Distributed transaction of <PurchaseRule>

Pseudo code snippet

final PurchaseRule purchaserule = (PurchaseRule) this.callMicroservice(ServiceNames.PRODUCT_SERVICE + "/purchaserule/" + id, PurchaseRule.class);
if (purchaserule != null) {
    final Product product1 = (Product) this.callMicroservice(ServiceNames.PRODUCT_SERVICE + "/product/" + purchaserule.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 Warehouse warehouse6 = (Warehouse) this.callMicroservice(ServiceNames.COUNTRY_SERVICE + "/warehouse/" + purchaserule.getWarehouse().getId(), Warehouse.class);
    if (warehouse6 != null) {
        final Country country7 = (Country) this.callMicroservice(ServiceNames.COUNTRY_SERVICE + "/country/" + warehouse6.getCountry().getId(), Country.class);
        if (country7 != null) {
        }
    }
}
return purchaserule;


Table of content