* @property int|null $status_1c Статус заказа в 1С
* @property int|null $marketplace_name Наименование маркетплейса 'ФлауВау' 'ЯндексМаркет'
* @property int|null $marketplace_id ID маркетплейса: 1 - Flowwow, 2 - YandexMarket
+ * @property string $error_text
+ * @property string|null $number_1c Название документа в 1с
+ * @property string|null $telegram_error ошибка телеграмма
*/
class MarketplaceOrders extends \yii\db\ActiveRecord
{
+ const STATUS_TELEGRAM_NOT_SENT = 0;
+ const STATUS_TELEGRAM_PREPARED_TO_SEND = 1;
+ const STATUS_TELEGRAM_SENT = 2;
+ const STATUS_TELEGRAM_ERROR = 8;
+
+ const STATUSES_1C_CREATED_IN_ERP = 1;
+ const STATUSES_1C_CREATED_IN_1C = 2;
+
+ const STATUSES_1C = [
+ self::STATUSES_1C_CREATED_IN_ERP => 'Создан в ЕРП',
+ self::STATUSES_1C_CREATED_IN_1C => 'Создан в 1C',
+ ];
+
/**
* {@inheritdoc}
*/
[['marketplace_order_id', 'marketplace_id', 'marketplace_name', 'status_id', 'substatus_id', 'creation_date', 'updated_at', 'total', 'delivery_total', 'buyer_total_before_discount', 'tax_system', 'payment_type', 'payment_method'], 'required'],
[['store_id', 'status_id', 'substatus_id', 'fake', 'cancel_requested', 'status_1c'], 'default', 'value' => null],
[[ 'fake'], 'default', 'value' => 0],
- [['store_id', 'status_id', 'substatus_id', 'fake', 'cancel_requested', 'status_1c', 'marketplace_id'], 'integer'],
+ [['store_id', 'status_id', 'substatus_id', 'fake', 'cancel_requested', 'status_1c', 'marketplace_id', 'status_telegram'], 'integer'],
[['creation_date', 'updated_at', 'returned_at'], 'safe'],
- [['return_data', 'raw_data', 'marketplace_name', 'error_text'], 'string'],
+ [['return_data', 'raw_data', 'marketplace_name', 'telegram_error'], 'string'],
[['total', 'delivery_total', 'buyer_total_before_discount'], 'number'],
[['marketplace_order_id'], 'string', 'max' => 64],
+ [['number_1c'], 'string', 'max' => 100],
[['warehouse_guid', 'guid'], 'string', 'max' => 36],
[['tax_system', 'payment_type', 'payment_method'], 'string', 'max' => 32],
[['marketplace_order_id'], 'unique'],
'status_1c' => 'Статус заказа в 1С',
'marketplace_name' => 'Наименование маркетплейса',
'marketplace_id' => 'ID маркетплейса: 1 - Flowwow, 2 - YandexMarket',
+ 'error_text' => 'Ошибка',
+ 'number_1c' => 'Номер документа в 1с',
+ 'status_telegram' => 'Статус отправки в телеграм',
+ 'telegram_error' => 'Ошибка телеграмма',
];
}