Skip to content
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

Br 1 2 #42

Closed
wants to merge 24 commits into from
Closed

Br 1 2 #42

wants to merge 24 commits into from

Conversation

jross765
Copy link
Contributor

Hello Deniss,

got some new stuff for you.

As you can see, this is not as giant a pull-request like the last one, but not a small one either.
It just made sense to do all these changes on one go...

What have I changed? Short version: Commodities and prices.
Please refer to the README for more details.

Greetings,

James

 - Introduced GnucashCommodity(Impl) (first, very simple form, still
   work to be done for the quotes etc.)
 - According changes in GnucashFile(Impl)
 - First, very simple test case class for commodities
Overall:
 - Opened branch for V. 1.2.
 - ==> POM files: Reflect new version + some cosmetic changes
 - Improved interface for commodities
 - Adapted test cases and example program
Overall:
 - Little bit of code cleaning (exception classes)
 - Changed XSD file (some commodity elements were obsolete)
 - Introduced GCshPrice(Impl)
 - ==> Wrote according methods in GnucashFile(Impl) (analogs to tax tables / bill terms)
 - Wrote test cases for that
… of GnuCash's logic

  of identification of currencies/securities/commodities.
- With this class, simplified test cases for GnucashCommodityImpl
 - Change in CmdtyCurrID and CmdtyCurrNameSpace (formerly CurrencyNameSpace):
   introduced enum for exchange (semi-formal abbrev.), thus improving type
   safety.
 - GnuCashCommodity(Impl): Methods now use CmdtyCurrID
 - Adapted test cases accordingly
 - Test data: Changed "EUREX" to "EURONEXT" (the two should not be confused:
   the former is a derivatives exchange).
 - Added GnucashWritableCommodity(Impl) to generate new commodities
   (no test case yet)
 - Somme overall minor code cleaning
 - GnucashAccountImpl
 - GnucashCustomerImpl
 - GnucashVendorImpl
(had been forgotten)
 - The variants now are not all handled in CmdtyCurrID itself, but rather
   in its (grand)children: CommodityID, CurrencyID, CommodityID_Exchange,
   CommodityID_MIC (and possibly more in future releases).
 - CmdtyCurrID itself now is held very basic and does not perform any
   non-trivial checks.
 - Adapted interface/class GnucashCommodity(Impl) accordingly (there had
   been a declaration error anyway).
 - Adapted test cases / data accordingly
… being to

get rid of code that handles currency/commodity name-spaces and codes separately).

- Now uses CmdtyCurrID in GnucashAccount(Impl) (and only it).

  That led to a cascade of exceptions possibly being thrown all over the place.
  It looks intimidating, but essentially, all changes are harmless.

  (TODO: the same for GnucashTransaction(Impl))

- Re-iterated GCshPrice(Impl):

  o Now accounts for the fact that GnuCash prices are not always securities' quotes
    but can also be currencies' exchange rates.
  o Adapted test cases / test data accordingly.
…(cf. last check-in).

 - Now uses CmdtyCurrID in GnucashTransaction(Impl) (and only it).

   That led to a cascade of exceptions blabla (cf. last check-in),
   which essentially is harmless.
…(cf. previous check-ins).

 - Now uses CmdtyCurrID in Gnucash(Writable)Transaction(Impl) (and only it).
…(cf. previous check-ins).

   - Now uses CmdtyCurrID in Gnucash(Writable)Account(Impl) (and only it).

That should be it now.
for search methods
  Gnucash(Writable)File(Impl).getXYZByName()
Allowed for several results, made it more consistent/symmetric, and
adapted example programs accordingly.
 - All commodity/currency-ID types are renamed: CmdtyCurrID -> GCshCmdtCurrID etc.
 - All these types are now in new package org.gnucash.basetypes (other classes in this
   package likely to come in future releases).
 - Introduced new class GCshCmdtyID_SedIdType (this one is important for truly international
   portfolios, cf. README file)
thus improving overall type safety / robustness.
@sonarcloud
Copy link

sonarcloud bot commented Oct 26, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants