-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CleaningServiceDummy: Create Dummy Cleaning Result #433
Comments
Cleaning Service Dummy can be dumbed down a little bit more: Just don't access the Pool to get actual data and always convert the current generic business partner to its L/S/A representations. |
I simplified the logic for creating dummy cleaning results a bit. Now, legal entities and address representations are always created. The Pool needs to understand this logic and update/create business partners accordingly. |
How are the identifiers (and states) from the generic BP split between legalEntity and legalEntity.legalAddress? |
Good question... to be honest to keep it simple I think we can only do this in a limited manner for this cleaningServiceDummy. I would restrict for the dummy cleanning result that all identifiers go to the legal entity. With this, users would need adhere to that limitation only to share legal entitity identifiers otherwise the process rejects it with a cleaningservicedummy in place. |
So, I have a service that runs every x minutes with scheduling. Doubt: We need to validate whether this is a legal entity address or site, but how can we know to map from generic to the corresponding LSA type? We have the fields bpnA, bpnS, and bpnL, but these may not be filled out. @nicoprow @martinfkaeser @rainer-exxcellent i think you are the ones most in knowledge to answer this |
To elaborate the logic in the issue description: Independent of which BPNs or address type is given, we always create a legal entity with legal address and a logistic address from given generic business partner data. The BPNs and address type only influence what is being written in the BPN reference fields and whether also a site will be created. |
After clearing the logic part here is a diagram from mermaid of the logic implemented graph TD;
ScheduleProcess(Schedule Process: Scheduled Task) --> Step1(Step 1: Fetch and Reserve Cleaning Request)
Step1 -->|cleaningTasks| Step2(Step 2: Process Cleaning Tasks)
Step2 --> AddressRepresentation(Create LogisticAddress Representation)
AddressRepresentation --> CheckBpnA{Does it have BpnA?}
CheckBpnA -->|Yes| UseExistingBpnA(Use Existing BpnA)
CheckBpnA -->|No| GenerateBpnA(Generate New BpnA)
UseExistingBpnA --> LegalEntityCreation(Create Legal Entity Representation)
GenerateBpnA --> LegalEntityCreation(Create Legal Entity Representation)
LegalEntityCreation --> CheckAddressType{Is Address Type Legal or LegalAndSiteMain?}
CheckAddressType -->|Yes| UseBpnAForLegalAddress(Use BpnA for Legal Address)
CheckAddressType -->|No| GenerateBpnAForLegalAddress(Generate New BpnA for Legal Address)
UseBpnAForLegalAddress --> CheckBpnL{Does it have BpnL?}
GenerateBpnAForLegalAddress --> CheckBpnL{Does it have BpnL?}
CheckBpnL -->|Yes| UseExistingBpnL(Use Existing BpnL)
CheckBpnL -->|No| GenerateBpnL(Generate New Bpnl)
UseExistingBpnL--> CreateLegalEntity{Create Legal Entity }
GenerateBpnL--> CreateLegalEntity(Finished Legal Entity creation)
CreateLegalEntity --> SiteCreation{Should Create Site?}
SiteCreation -->|Yes| CheckSiteConditions{SiteMainAddress, LegalAndSiteMainAddress, or BpnS?}
SiteCreation -->|No| AddressCreation
CheckSiteConditions -->|Yes| UseBpnAForSiteAddress(Use BpnA for Site Address)
CheckSiteConditions -->|No| GenerateBpnAForSite(Generate New BpnA for Site)
CheckBpnS{Does it have BpnS?}
CheckBpnS -->|Yes| UseExistingBpnS(Use Existing BpnS)
CheckBpnS -->|No| GenerateBpnS(Generate New BpnS)
UseBpnAForSiteAddress --> CheckBpnS{Does it have BpnS?}
GenerateBpnAForSite --> CheckBpnS{Does it have BpnS?}
UseExistingBpnS--> CreateSite(Finished Site creation)
GenerateBpnS--> CreateSite(Finished Site creation)
CreateSite --> AddressCreation(Validate AddressPartner Creation)
AddressCreation --> CheckAddressConditions{Type is Additional Address?}
CheckAddressConditions -->|Yes| UseLogistic(Use Logistic address as AddressPartner)
CheckAddressConditions -->|No| Step3
UseLogistic --> Step3(Step 3: Send Result back to Orchestrator)
|
PR merged we can close the issue @nicoprow |
Lacking a service provider who can perform cleaning of business partner records we need a simple dummy logic mocking the generic cleaning process while still providing usable cleaning results for the next steps in the orchestration.
One of the biggest tasks in this issue is to create legal entity, site and address representations from the given generic business partner data. The service logic behaviour is dependent on the postal address type:
For creating a legal entity representation:
For creating a site representation:
For creating an address representation:
Legal Address, Site Main Address and Address Partner may share a newly BPN request id based on the address type of the generic business partner:
The field value for 'hasChanged' of the L/S/A partners is always true.
The BPN request identifier is a random UUID.
###Tasks
Dependencies:
#388
#392
The text was updated successfully, but these errors were encountered: