ME-38:Added billing module domains - #41
sudhanshu-raj wants to merge 8 commits into
Conversation
|
hi @wikumChamith let me know if this is what expected from billing module domains , and i will test cases, configs and readme update |
|
@sudhanshu-raj have you noticed the build errors? |
|
@sudhanshu-raj can you check these build errors ? |
|
Hey @wikumChamith , though I fixed the exact error which happening due to event api which needed for billing module. But there is different issue which stopping the build and that is I think infinite recursive loop for the beans . The thing is its something wrong(which I assuming) with the how the beans are loading from the |
|
@sudhanshu-raj what if we keep the jars for compilation but keep them out of the test JVM? |
Will that not cause for the integration tests or calling the billing services methods, because those jar will be removed during the test classpath ? |
Ohh yes. Let's keep the exclusion on the default Surefire execution but give the billing tests their own execution with the full classpath |
|
ok, tested with one integration test for |
|
@sudhanshu-raj so I looked into this, and to fix it we need to make a few changes. I'll go through them one by one.
<bean id="sessionFactory" class="org.openmrs.api.db.hibernate.HibernateSessionFactoryBean">
<property name="configLocations">
<list>
<value>classpath:hibernate.cfg.xml</value>
<value>classpath:test-hibernate.cfg.xml</value>
</list>
</property>
<property name="mappingJarLocations" ref="mappingJarResources"/>
<property name="packagesToScan">
<list>
<value>org.openmrs</value>
</list>
</property>
</bean>
<hibernate-configuration>
<session-factory>
<!-- Billing -->
<mapping resource="Bill.hbm.xml"/>
<mapping resource="Cashier.hbm.xml"/>
<mapping resource="SequentialReceiptNumberGenerator.hbm.xml"/>
</session-factory>
</hibernate-configuration> |
It worked, thanks |
|
And I am curious how you came up with this ? |
Just went through it one error at a time. Had some help from Claude too. |
|
@sudhanshu-raj let's resolve these merge conflicts and make this ready for review. |
0a40d24 to
945390c
Compare
|
Ok so merged the conflicts and the new changes, then created test cases for |
|
@sudhanshu-raj have you tested this by trying to load the billing configs created by it using the initializer? The way to do it is to spin up a fresh OpenMRS O3 server and replace the billing configuration there with the exported one. |
Yes I tried loading all exported billing domain configs and matched it;s format too, it seems to worked after some small fixes. Yeah but i need to build without tests due to loop issue. |
|
Let's drop or disable the breaking tests for now if they're giving too much trouble. |
945390c to
11962cb
Compare
Ready for the review ! |
| if (instance.getServiceType() != null) { | ||
| Concept serviceType = instance.getServiceType(); | ||
| String serviceTypeName = null; | ||
| if (serviceType.getNames() != null && !serviceType.getNames().isEmpty()) { | ||
| serviceTypeName = serviceType.getNames().iterator().next().getName(); | ||
| } | ||
| line.put(HEADER_SERVICE_TYPE, serviceTypeName); | ||
| } |
There was a problem hiding this comment.
Rather than exporting service type as an arbitrary concept name, we can just export the UUID. In the BillableServicesLineProcessor, this field is resolved with Utils.fetchConcept, which supports UUIDs.
# Conflicts: # pom.xml # Conflicts: # pom.xml # Conflicts: # pom.xml # Conflicts: # pom.xml # Conflicts: # pom.xml
# Conflicts: # omod/src/main/resources/config.xml
2ef3e7a to
5fe53e4
Compare
Description of what I changed
Added billing module domains
Issue I worked on
see https://openmrs.atlassian.net/browse/ME-38
Checklist: I completed these to help reviewers :)
My IDE is configured to follow the code style of this project.
No? Unsure? -> configure your IDE, format the code and add the changes with
git add . && git commit --amendI have added tests to cover my changes. (If you refactored
existing code that was well tested you do not have to add tests)
No? -> write tests and add them to this commit
git add . && git commit --amendI ran
mvn clean packageright before creating this pull request andadded all formatting changes to my commit.
No? -> execute above command
All new and existing tests passed.
No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.
My pull request is based on the latest changes of the master branch.
No? Unsure? -> execute command
git pull --rebase upstream master