CCI-MOC / flocx-market

2 stars 9 forks source link

Add Offer business object #76

Closed aliraza0337 closed 5 years ago

aliraza0337 commented 5 years ago

Hi @tzumainn , This is just initial work, I was wondering about the output of these operations etc. For now I am just looking at @fvukelic code and deciding the output of my code based on that.

tzumainn commented 5 years ago

Hi! This is a reasonable start. base.py should be more like https://github.com/CCI-MOC/esi-leap/blob/master/esi_leap/objects/base.py - a place for shared functionality of the base object - for example, a to_dict() method, or to accommodate the fact that all objects have created_at and updated_at fields (although that is not yet true).

There should also be a flocx_market/objects/offer.py, similar to https://github.com/CCI-MOC/esi-leap/blob/master/esi_leap/objects/offer.py. This is where we have the database functions - and note use of those database functions are changing to something a bit simpler, once https://github.com/CCI-MOC/flocx-market/pull/75 merges.

With flocx_market/objects/offer.py in place, the next step is to update code in the REST API layer, such as https://github.com/CCI-MOC/flocx-market/blob/master/flocx_market/api/offer.py#L22. That will no longer directly call a database function; instead it'll call your business object 'create' function.

My strongest advice is to see what esi-leap does and parallel that as much as you can.

codecov-io commented 5 years ago

Codecov Report

Merging #76 into master will increase coverage by 0.14%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #76      +/-   ##
==========================================
+ Coverage   97.21%   97.35%   +0.14%     
==========================================
  Files          33       35       +2     
  Lines         861      909      +48     
==========================================
+ Hits          837      885      +48     
  Misses         24       24
Impacted Files Coverage Δ
flocx_market/objects/base.py 100% <ø> (ø) :arrow_up:
...ocx_market/tests/unit/objects/test_object_offer.py 100% <100%> (ø)
flocx_market/api/offer.py 100% <100%> (ø) :arrow_up:
flocx_market/objects/__init__.py 100% <100%> (ø) :arrow_up:
flocx_market/objects/offer.py 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update dab132b...51dc378. Read the comment docs.

tzumainn commented 5 years ago

Looks good!