Summary

Story:

1)As a user I want to submit a pair_request to another developer in the platform.

  1. As an user I want to know the status of my pair_requests

This issue requires adding a pair_request table to keep track of pair_request sessions. We will need to keep track of the the pair_request status. Status can be: pending, rejected, accepted, or (expired?)

Proposals

Proposal 1: Add pair_request table

Proposed new columns:

create_table "pair_requests", force: :cascade do |t|
t.integer "author_id", null: false, foreign_key: true
t.integer "invitee_id", null: false, foreign_key: true
t.datetime "when", null: false
t.float "duration", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

Proposal 2: Add a column to indicate pair_request status and include an enum to keep track of the values, add invitee_id column

create_table "pair_requests", force: :cascade do |t|
    t.integer "author_id", null: false, foreign_key: true
    t.integer "invitee_id", null: false, foreign_key: true
    t.datetime "when", null: false
    t.float "duration", null: false
		t.integer "status", default: 0, null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end
class PairRequest do 

enum: status: {
	pending: 0,
	rejected: 1, 
	accepted: 2
	expired: 3
}

end 

Pros:

  1. Keeping track of “status” of the pair_session will allow better querying of previous and upcoming sessions

Proposal 3: Add a method that will set the status on rejected/expired when the “when” has has passed