resonatecoop / api

The one Resonate API to rule them all

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How is membership determined in MySQL tables?

simonv3 opened this issue · comments

commented

Those numbers should be ported to the new user database, or the list of e-mails should be saved to encourage people to switch over to the new system once a year has passed.

We should also move over any old shares.

  • Add a legacyId and legacyTable column to share_transactions.
  • Create a column called legacy_transaction_id and
  • member_orders -> share_transactions. Use uid to map to a user.legacyId
    • shares > 0
    • uid = share_transactions.user.legacyId
    • shares = quantity
    • Use details to match to a user. Create a user if no user exist.
    • legacy_transaction_id = member_orders.txid
    • date = share_transactions.created_at
  • rsntr_gf_entry -> user_memberships
    • form_id = 35
    • Only do this for rsntr_gf_entry.payment_status = Paid
    • rsntr_gf_entry.created_by -> user_memberships.user.legacyId, create user if they don't exist?
    • copy rsntr_gf_entry.transaction_id into legacy_transaction_id
    • user_memberships.membership_class_id = 4 (Listener)
    • date_created = user_memberships.created_at
  • rsntr_gf_entry -> share_transactions
    • form_id = 45
    • Only do payment_status = Paid
    • payment_amount = quantity
    • legacy_transaction_id = rsntr_gf_entry.transaction_id.
    • created_by = share_transaction.user.legacyId
    • rsntr_gf_entry.created_by -> user_memberships.user.legacyId, create user if they don't exist?

Then we need to figure out what to do with the orders table, which currently doesn't get used.

commented

Will be closed in #159