Skip to content

Conversation

@steveyken
Copy link
Member

Ticket Link:

NOTE: Specify ticket link

What does this PR do?

FEATURE: Specify feature name

BUG: Specify bug

NOTE: Give a description of what this PR does. If it fixes any bug, specify cause of an issue and approach/solution added to fix that issue.

Impacted Areas

NOTE: List any impacted areas (e.g. Dashboard > My Active Offers > scheduled )

Screenshots

NOTE: Attach screeenshots if PR contains any UI changes

Mockup Link

Note: Specify mockup link

Linked PR's:

NOTE: If these changes are related to some existing PR or fixes any issue from existing PR changes, specify PR links.

Linked Slack conversation:

NOTE: IF there is any conversation happened for current changes in any of the slack channel, mention the slack message link.

Any Open question(s) or challenge(s):

@steveyken steveyken requested a review from abulsayyad123 April 1, 2020 06:12
@steveyken
Copy link
Member Author

@abulsayyad123 I've made this a draft PR

if order_params[:stockit_id]
@order = Order.accessible_by(current_ability).where(stockit_id: order_params[:stockit_id]).first_or_initialize
@order.assign_attributes(order_params)
@order.assign_state(params[:status])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abulsayyad123 does this get run for Stockit requests or also for normal goodcity requests?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only for Stockit requests.

scope :shipments, -> { where(detail_type: "Shipment") }

def assign_state(status)
state = SHIPMENT_STATUS_MAP[status]
Copy link
Member Author

@steveyken steveyken Apr 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a default state

Suggested change
state = SHIPMENT_STATUS_MAP[status]
state = SHIPMENT_STATUS_MAP[status] || 'processing'

@order.assign_state(params[:status])
@order.stockit_activity = stockit_activity
@order.stockit_contact = stockit_contact
@order.stockit_organisation = stockit_organisation
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to change this code to accept stockit shipments as well as local orders... I wonder if we wait until after we have shutdown stockit then we don't need to do anything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants