hedge icon indicating copy to clipboard operation
hedge copied to clipboard

commerce system

Open verti-go opened this issue 3 years ago • 0 comments


Payments

crypto

  • bitcoin
  • etherum
  • ...

cc

  • auth.net
  • ccbill
  • ect.

https://github.com/thrasher-corp/gocryptotrader

product - price

  • standard product - nothing special needed
    • availability_date -- when this product becomes available for sale.
    • expiration_date - when this product expires -- separate product for each month - fine.

  • golang - commerce module

(elastic and s3)

  • anytime product is changed version changes - previous version is flagged not active and new version becomes active version for (sku, site_id).

foo_subscription - for now this will work

  • price

  • discontinued

  • need to maintain verioning manually because does not currently exist for an ad - should add as feature -- see how ad changed over time - history.

  • will need ability to do between for ad search... unless we just remove availability and expiration for now.

  • could just make this an ad...

  • i think it is possible in elastic to get the highest version... without an active flag.

  • user can no longer own a product that has expired? - when digital

  • product will still be shown in order history.

  • /user/products --- get all products that have been purchased by user.

  • cassandra query - get all orders, than get all items matching order

if(has target product) { }

  • access control for pages

  • query something

  • gaurds in angular at a generic level for blocking access to specific pages based on whether user has product? -- or do we abstract into permissions -- roles and permissions based on product purchases.?


  • we might be better off combining orders and line_items... maybe orders - cassandra?
  • id
  • site
  • user_id (user)
  • final_total_cost
  • created_date

partition key (site, user_id) clustering key (created_date)

order_items

  • id
  • site
  • order_id (guid)
  • entity
  • entity_id
  • user_id
  • individual_cost
  • quantity
  • total_cost
  • weight
  • attributes map<string, string>

partition key (site, entity, entity_id, user_id) clustering key (weight)

payments

  • id
  • user_id
  • status
  • entity 'order'
  • entity_id - ssssssssss
  • type (cc, crypto, etc)
  • subtype (bitcoin, authorize.net, etc)
  • amount
  • attributes map<string, string>

Save Order

  • followed by paying for order.

POST /payment { type: 'cc' subtype: 'authorize.net, entity: '', entity_id: 'aaa-ccc-cccccc', amount: 123.00, attributes }

before save process payment

save payment to db.

do I want failed payment records in db - yes

order fullfilment models/flows

  • place user in group. -- group associated with role that has policy to access content in restricted bucket / folder.

verti-go avatar Jul 31 '21 22:07 verti-go