Skip to content

Releases: trebol-ecommerce/trebol-backend-monolith

v0.2.2

09 Jun 16:50
Compare
Choose a tag to compare
v0.2.2 Pre-release
Pre-release

Changed

  • Update GitHub issue templates, contribution guidelines and reformat *.md files
  • Removed properties in pom.xml that were only used once
  • Updated project dependencies
    • lombok 1.18.24 -> 1.18.26
    • h2 database 2.1.212 -> 2.1.214

Fixed

  • Missing validation for request bodies of PUT methods in /data/* controllers

v0.2.1

07 Jun 21:07
f689ebe
Compare
Choose a tag to compare
v0.2.1 Pre-release
Pre-release

Changed

  • Project-wide clean up (re-indentation & import optimization)
    • New indentation rules set in .editorconfig

Fixed

  • Raise an exception when no payment type is specified during checkout
  • Unintended errors during checkout
    • Description of each sell detail would not be included
    • New sales would not have an initial status or registered payment type
    • Billing address was required for non-enterprise customers

v0.2.0

27 May 00:22
f51e321
Compare
Choose a tag to compare
v0.2.0 Pre-release
Pre-release

Added

  • Support for partial updates using PATCH request in these endpoints
    • /data/products
    • /data/sales
    • /data/users
    • /data/images
    • /data/product_categories
    • /data/shippers
    • /data/product_lists

Changed

  • Update CrudService signature methods
    • update - now meant as a method to fully update a data registry or item
    • partialUpdate - new method; meant to update part(s) of a data registry or item (former behavior of the update method)
  • Update PatchService signature methods
    • patchExistingEntity method relies on a Map<String, Object> as first parameter, instead of a <P> object
      • The previous method signature has been deprecated in favor of this one
  • All @Entity classes implement a new DBEntity interface
    • This interface declares a getter & setter pair for an id field. Most entities already had one anyway.
    • This is made to easily integrate the partialUpdate method with database numeric primary keys, represented by the findById repositories
  • Update base CrudGenericService implementation
    • partialUpdate method is implemented, being fully-aware of the DBEntity interface to pass the id to an existing target entity
    • create and update methods now share extremely similar logic
      • Their only difference is that the update method syncs the entity id before being saved and flushed
    • prepareEntityWithUpdatesFromPojo renamed to flushPartialChanges
    • Remove method prepareNewEntityFromInputPojo
      • Instead of overriding this method, implementations may directly override its containing create method
    • Remove method persist
      • This two-line method started making things a bit confusing... (!?)
      • (note to self: never excuse a two-line method to duplicate code refactoring)
  • Scope and flows of data have changed
    • Entity classes' copy constructors are very often used, so now these never care for entity relationships
      • EXCEPT when it is explicitly stated otherwise! These exceptions were made (from-to):
        • Customer -> Person
        • Salesperson -> Person
        • Sell -> SellStatus
        • Sell -> PaymentType
        • Sell -> BillingType
        • User -> UserRole
    • ConverterServices now take care of one-to-one entity relationships at most
    • CrudServices now take care of all entity relationships not covered by other cases
    • Pojo classes with id fields have been stripped of them; only entities hold id fields now

Fixed

  • Calls to /checkout using an invalid sell will output a 400 error (bad input from user) instead of 500 (bad state of the server)
  • Add a check in two GenericCrudService methods, partialUpdate and update, both overloaded with a QueryDSL Predicate as a second method argument
    • Validate that said Predicate only ever matches one record
    • This behavior could change in the future, but for now it is a deliberate choice to avoid them affecting more than one registry at a time