TokoBapak / mock-shipping-provider

Mock shipping provider
Apache License 2.0
0 stars 3 forks source link

Implement presentation handlers #1

Open aldy505 opened 1 year ago

aldy505 commented 1 year ago

This should be easy. For each handler, all you need to do is:

  1. Parse the request body (if any), to a schema that is already defined on the presentation/schema package.
  2. Convert the request schema into common business model
  3. Execute the business function
  4. Convert the returned business model into the response schema
  5. Send it

https://github.com/TokoBapak/mock-shipping-provider/blob/413bb3e6abb6362ced4b4bdc42173c1c82f6065d/presentation/estimate.go#L5-L7

https://github.com/TokoBapak/mock-shipping-provider/blob/413bb3e6abb6362ced4b4bdc42173c1c82f6065d/presentation/order.go#L5-L7

https://github.com/TokoBapak/mock-shipping-provider/blob/413bb3e6abb6362ced4b4bdc42173c1c82f6065d/presentation/status_history.go#L5-L7