ardanlabs / service

Starter-kit for writing services in Go using Kubernetes.
https://www.ardanlabs.com
Apache License 2.0
3.4k stars 612 forks source link

Select layer to calculate decimal numbers #355

Closed mrbardia72 closed 2 months ago

mrbardia72 commented 2 months ago

Calculate decimal numbers

I want to write a function that performs an operation on decimal numbers Where should I put this function?(After calculating on decimal numbers, it stores it in the database) Layer foundation Layer business

ardan-bkennedy commented 2 months ago

Which packages need to use this function and what layer do they live in?

mrbardia72 commented 2 months ago

A simple package with a few functions for working with decimal numbers and sending values to the database layer

. If it is not complete, I will explain more

ardan-bkennedy commented 2 months ago

I would keep those functions with the packages that need them to start. If you need to copy/paste them into 3 or more packages, then let me know. I am assuming these are core business packages that need them?

mrbardia72 commented 2 months ago

Yes, I guess it should be in the business layer Because before being stored in Redis, decimal operations must be performed on the data

ardan-bkennedy commented 2 months ago

It might belong in the storage layer which means in could go in the sqldb package.

mrbardia72 commented 2 months ago

Thank you