# coding: utf-8

"""
    Nomad Envoy

    This is the API descriptor for the Nomad Envoy API, responsible for order creation and product lists.<br><br> Developed by <a href=\"https://samarkand.global\">Samarkand Global</a> in partnership with <a href=\"https://www.sf-express.com/cn/sc/\">SF Express</a><br><br> Install for node with <br>`npm install nomad_envoy_cli`<br><br> Install for python with <br>`pip install nomad-envoy-cli`<br>  # noqa: E501

    The version of the OpenAPI document: 1.40.0
    Contact: paul@samarkand.global
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import unittest
import datetime

import nomad_envoy_cli
from nomad_envoy_cli.models.order import Order  # noqa: E501
from nomad_envoy_cli.rest import ApiException

class TestOrder(unittest.TestCase):
    """Order unit test stubs"""

    def setUp(self):
        pass

    def tearDown(self):
        pass

    def make_instance(self, include_optional):
        """Test Order
            include_option is a boolean, when False only required
            params are included, when True both required and
            optional params are included """
        # model = nomad_envoy_cli.models.order.Order()  # noqa: E501
        if include_optional :
            return Order(
                order_id = '0', 
                client_order_ref = '0', 
                client_parent_order_ref = '0', 
                platform_transaction_id = '0', 
                platform_name = 'pdd', 
                is_sub_order = False, 
                is_distribution_order = False, 
                distributor_name = '0', 
                order_type = 'DEFAULT', 
                items = [
                    nomad_envoy_cli.models.order_product.OrderProduct(
                        product = nomad_envoy_cli.models.product.Product(
                            product_id = '123456', 
                            name = 'COLAB Dry Shampoo', 
                            name_en = 'COLAB Dry Shampoo', 
                            skus = [
                                nomad_envoy_cli.models.sku.Sku(
                                    sku_number = 'SMK123', 
                                    price = 10, 
                                    rrp = 8.0, 
                                    group_buying_price = 6.0, 
                                    images = nomad_envoy_cli.models.images.Images(
                                        ids = [
                                            '0'
                                            ], 
                                        urls = [
                                            '0'
                                            ], 
                                        uploads = [
                                            '0'
                                            ], ), 
                                    barcode = '55001234567', 
                                    color = 'green', 
                                    size = 'small', 
                                    quantity = 10, 
                                    is_onsale = False, 
                                    net_weight = 30.3, 
                                    gross_weight = 35.3, 
                                    shipping_cost = 4.2, 
                                    shipping_time = 7, 
                                    model = 'iPhone XR', 
                                    spec = '25mm', 
                                    customs_unit_code = '142, 007, 瓶, ...', 
                                    customs_unit_code_package = '142, 011, 140', 
                                    customs_unit_code_weight = '035', 
                                    cost = 200.0, )
                                ], 
                            currency = 'RMB', 
                            mass_unit = 'Kilogram', 
                            time_unit = 'days', 
                            barcode = '55001234567', 
                            description = 'Some nice dry shampoo for when you cant be bothered to shower', 
                            price = 7.0, 
                            rrp = 8.0, 
                            group_buying_price = 6.0, 
                            net_weight = 30.3, 
                            gross_weight = 35.3, 
                            images = nomad_envoy_cli.models.images.Images(), 
                            is_onsale = False, 
                            status = 'draft', 
                            category = ["All","Cloth","Top"], 
                            vendor = 'Apple', 
                            country = 'France', 
                            shelf_life = 21, 
                            created_at = '2019-03-19T08:57:41.133719+00:00', 
                            updated_at = '2019-03-19T08:57:41.133719+00:00', 
                            logistics_mode = 'red_auto', 
                            shipping_cost = 4.2, 
                            shipping_time = 7, 
                            hs_code = '7606929900', 
                            personal_postal_articles_tax = '01000000', 
                            ingredient = 'Silk', 
                            model = 'iPhone XR', 
                            spec = '25mm', 
                            warranty_period = 180, 
                            express_type = '0', 
                            discount = 0.0, 
                            tax_rate = 0.0, 
                            brand = 'Other', ), 
                        quantity = 4, 
                        price = 10.1, 
                        tax = 1.2, )
                    ], 
                customer = nomad_envoy_cli.models.address.Address(
                    first_name = 'John', 
                    last_name = '0', 
                    address1 = '0', 
                    address2 = '0', 
                    city = '0', 
                    state = '0', 
                    country = '0', 
                    zip = '0', 
                    tin = '0', 
                    phone = '0', 
                    country_code = '0', 
                    email = '0', 
                    chinese_id = '0', ), 
                customer_id_ref = '0', 
                seller = nomad_envoy_cli.models.address.Address(
                    first_name = 'John', 
                    last_name = '0', 
                    address1 = '0', 
                    address2 = '0', 
                    city = '0', 
                    state = '0', 
                    country = '0', 
                    zip = '0', 
                    tin = '0', 
                    phone = '0', 
                    country_code = '0', 
                    email = '0', 
                    chinese_id = '0', ), 
                payer = nomad_envoy_cli.models.address.Address(
                    first_name = 'John', 
                    last_name = '0', 
                    address1 = '0', 
                    address2 = '0', 
                    city = '0', 
                    state = '0', 
                    country = '0', 
                    zip = '0', 
                    tin = '0', 
                    phone = '0', 
                    country_code = '0', 
                    email = '0', 
                    chinese_id = '0', ), 
                status = '0', 
                tracking_reference = '0', 
                destination_code = '0', 
                node_code = '0', 
                express_company = '0', 
                express_type = '0', 
                currency = 'RMB', 
                customs_code = 'SH', 
                customs_filing_id = 'ABCDE29102918171', 
                created_at = '2019-07-12T13:13:52.004637+01:00', 
                updated_at = '2019-07-12T13:13:52.004637+01:00', 
                pay_method = 'EASIPAY', 
                pay_merchant_name = 'Paypal', 
                pay_amount = 611.08, 
                pay_id = '2014030120394812', 
                payment_pay_id = '191028195204000214', 
                paid_at = '2019-07-12T13:13:52.004637+01:00', 
                pay_customs_no = '190401103508000055101002', 
                products_total_tax = 53.28, 
                shipping_cost = 25.0, 
                non_cash_deduction_amount = 0.0, 
                insurance_fee = 2.5, 
                customer_note = 'This package is very important.', 
                delivery_slip_url = '0'
            )
        else :
            return Order(
                platform_name = 'pdd',
                currency = 'RMB',
        )

    def testOrder(self):
        """Test Order"""
        inst_req_only = self.make_instance(include_optional=False)
        inst_req_and_optional = self.make_instance(include_optional=True)


if __name__ == '__main__':
    unittest.main()
