emoss08 / Trenova

An Open Source AI-driven asset based transportation management system
http://trenova.app
Other
24 stars 5 forks source link

🟡(change): audit service #277

Closed emoss08 closed 1 month ago

emoss08 commented 1 month ago

Summary by Sourcery

This pull request includes enhancements to the Commodity model, updates to the API router for cookie encryption, improvements to SQL migration scripts, and the addition of new tests for the Commodity service. Minor documentation formatting changes were also made.

sourcery-ai[bot] commented 1 month ago

Reviewer's Guide by Sourcery

This pull request primarily focuses on enhancing the 'Commodity' model by changing the 'Status' field type to 'property.Status' and adding corresponding tests. It also introduces 'encryptcookie' middleware in the API router, with necessary configuration changes. Additionally, it ensures that indexes in the migration script are created only if they do not already exist.

File-Level Changes

Files Changes
pkg/models/commodity.go
internal/api/services/commodity.service_test.go
Updated 'Commodity' model to use 'property.Status' type and added tests for 'CommodityService'.
internal/api/router/router.go
config/server_config.go
Added 'encryptcookie' middleware and corresponding 'SecretKey' configuration.
migrate/migrations/20240621160242_table_change_alerts.tx.up.sql Ensured indexes are created only if they do not already exist.

Tips - Trigger a new Sourcery review by commenting `@sourcery-ai review` on the pull request. - Continue your discussion with Sourcery by replying directly to review comments. - You can change your review settings at any time by accessing your [dashboard](https://app.sourcery.ai): - Enable or disable the Sourcery-generated pull request summary or reviewer's guide; - Change the review language; - You can always [contact us](mailto:support@sourcery.ai) if you have any questions or feedback.