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

Feature/api v3/merge #265

Merged
merged 15 commits into from
Oct 5, 2024
Merged

Feature/api v3/merge #265

merged 15 commits into from
Oct 5, 2024

Conversation

bglamadrid
Copy link
Collaborator

@bglamadrid bglamadrid commented Oct 1, 2024

Addressing the newest iteration of the base API document. The following changes were made:

  • Follow new specification for error messages
    • Introduce new model class AppError
    • Make the ExceptionsControllerAdvice use this new class on all its methods
  • Rename all references of the word Sell and Sales to Order and Orders respectively
    • REST API endpoints
      • /data/sales -> /data/orders
      • /data/sell_statuses -> /data/order_statuses
    • Hardcoded Spring Security authorities
      • sales:(create|read|update|delete) -> orders:(...)
      • sell_statuses:(create|read|update|delete) -> order_statuses:(...)
    • SQL schema tables, columns, constraints, indexes and initial values
      • Entity table mappings included as well
    • Custom properties
      • trebol.api.able-to-edit-sales-after-being-processed
        • to trebol.api.able-to-edit-orders-after-being-processed
    • Class names, by package
      • org.trebol.api.
        • models.
          • SellPojo -> OrderPojo
          • SellDetailPojo -> OrderDetailPojo
          • SellStatusPojo -> OrderStatusPojo
        • services. (for both interfaces and implementations)
          • SalesProcessService -> OrdersProcessService
      • org.trebol.jpa.
        • entities. (and their QueryDSL counterparts)
          • Sell -> Order
          • SellDetail -> OrderDetail
          • SellStatus -> OrderStatus
        • repositories.
          • SalesRepository -> OrdersRepository
          • SellDetailsRepository -> OrderDetailsRepository
          • SellStatusesRepository -> OrderStatusesRepository
        • sortspecs.
          • SalesSortSpec -> OrdersSortSpec
          • SellStatusesSortSpec -> OrderStatusesSortSpec
        • services. (for both interfaces and implementations)
          • crud.
            • SalesCrudService -> OrdersCrudService
            • SellStatusesCrudService -> OrderStatusesCrudService
          • patch.
            • SalesPatchService -> OrdersPatchService
            • SellStatusesPatchService -> OrderStatusesPatchService
          • conversion.
            • SalesConverterService -> OrdersConverterService
            • SellStatusesConverterService -> OrderStatusesConverterService
          • predicates.
            • SalesPredicateService -> OrdersPredicateService
            • SellStatusesPredicateService -> OrderStatusesPredicateService
    • And all other constant and variable names that reference them
  • remove CustomerPojo and SalespersonPojo classes
    • the OrderPojo class now relates to two instances of PersonPojo instead
  • Change status codes for most /data endpoints
    • All POST requests return 201, except for three specific paths
      • /data/orders/confirmation
      • /data/orders/rejection
      • /data/orders/completion
    • All PUT,PATCH,DELETE,OPTIONS requests return 204

There is one thing left however. The auth-related resources that were removed from the specification will be still very much needed, and so this backend implementation will still have them.
And so! They must be properly documented.

- introduce new model class `AppError`
- make `ExceptionsControllerAdvice` use this new class
as a core word for this project, this change affects a lot of files
a brief summary follows:

- REST API endpoints
  - `/data/sales` -> `/data/orders`
  - `/data/sell_statuses` -> `/data/order_statuses`
- security authorities
  - `sales:*` -> `orders:*`
  - `sell_statuses:*` -> `order_statuses:*`
- API models, JPA entities and QueryDSL counterparts
  - `Sell` -> `Order`
  - `SellDetail` -> `OrderDetail`
  - `SellStatus` -> `OrderStatus`
- services for CRUD, conversion, data patching and sorting
- JPA repositories
- property `trebol.api.able-to-edit-sales-after-being-processed`
  - `trebol.api.able-to-edit-orders-after-being-processed`
- SQL schema tables, columns, constraints, indexes and initial values
  - also entity table mappings
- constants and variables
the `OrderPojo` class must instead relate to two instances of `PersonPojo`
in turn, fix all code bits affected by this change, including unit tests
also update changelog
all POST requests return 201 (excepting `/data/orders/*`)
all PUT,PATCH,DELETE,OPTIONS requests return 204
`/public/checkout/result/{token}`
has the same purposes that
`/public/receipt/{token}`
does
Copy link

sonarqubecloud bot commented Oct 5, 2024

@bglamadrid bglamadrid merged commit 704cd38 into main Oct 5, 2024
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.

1 participant