-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Warehouse identifier for orders and users #100
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is with great pleasure that I approve these additions.
@cdwieber it's missing a few features at the moment lol. |
*/ | ||
public static function getList($keyField = 'id', $valueField = 'name') | ||
{ | ||
$data = self::find()->orderBy([$valueField => SORT_ASC])->all(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How many warehouses are going to be in the database?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially it'll only be about 10 or so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When it will grow big, this solution won't work.
$this->createTable('{{%user_warehouse}}', [ | ||
'id' => $this->primaryKey(), | ||
'warehouse_id' => $this->integer()->notNull(), | ||
'user_id' => $this->integer()->notNull(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we define foreign keys for these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I'll get that added.
frontend/views/order/_form.php
Outdated
@@ -60,6 +60,15 @@ | |||
<?= $form->field($model->order, 'customer_id') | |||
->dropdownList($customers, ['prompt' => ' Please select']) ?> | |||
|
|||
|
|||
<?php | |||
// i think i only want this for admins right now... needs more thought |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: resolve.
Co-authored-by: Alexander Makarov <[email protected]>
# Conflicts: # frontend/controllers/OrderController.php # frontend/models/User.php
This addresses the issue #98
Users will either be associated with
customers
orwarehouses
. This way a warehouse user can see all customers that have orders with 'Warehouse 1' and customers can have multiple fulfillment centers. This also allows us to send requests upstream to the warehouses when modifications or cancellations are required.** Accidentally created a PR as open instead of draft.