{
	"name": "table/external/woocommerce/order/order.json",
	"table_name": "order",
	"table_prefix": "ord",
	"record_type": ["sales"],
	"local_table": "order",
	"local_record_type": "sales",
	"default_field": "table/default_field.json",
	"field": [
		{
			"field_name": "json_data.fake_record_id",
			"field_type": "text",
			"local_field": "record_id",
			"info": "fake field to prevent local field 'ord.record_id' can't be converted to external field -warnings",
			"writeable": false
		},
		{
			"field_name": "json_data.fake_json_data",
			"field_type": "text",
			"local_field": "json_data",
			"info": "fake field to prevent local field 'ord.json_data' can't be converted to external field -warnings",
			"writeable": false
		},
		{
			"field_name": "id",
			"field_type": "integer",
			"local_field": "project_id"
		},
		{
			"field_name": "number",
			"field_type": "varchar",
			"local_field": "order_id",
			"info": "only placeholder, will be overriden in erp-sync",
			"writeable": false
		},
		{
			"field_name": "shipping",
			"field_type": "json",
			"local_field": "json_data.delivery_address"
		},
		{
			"field_name": "billing",
			"field_type": "json",
			"local_field": "json_data.invoicing_address"
		},
		{
			"field_name": "currency",
			"field_type": "varchar",
			"local_field": "currency_id"
		},
		{
			"field_name": "customer_id",
			"field_type": "varchar",
			"local_field": "company_id"
		},
		{
			"field_name": "status",
			"field_type": "varchar",
			"local_field": "order_state",
			"local_field2": "json_data.woocommerce.status"
		},
		{
			"field_name": "date_created",
			"field_type": "date",
			"local_field": "create_time"
		},
		{
			"field_name": "date_modified",
			"field_type": "date",
			"local_field": "modify_time"
		},
		{
			"info": "Grand total",
			"field_name": "total",
			"field_type": "double",
			"local_field": "price_without_vat"
		},
		{
			"info": "Sum of all taxes",
			"field_name": "total_tax",
			"field_type": "double",
			"local_field": "vat_price"
		},
		{
			"field_name": "payment_method",
			"field_type": "varchar",
			"local_field": "terms_of_payment_id"
		},
		{
			"field_name": "customer_note",
			"field_type": "text",
			"local_field": "note"
		}
	],
	"field_not_in_use": [
		{
			"field_name": "transaction_id",
			"field_type": "varchar",
			"local_field": "json_data.woocommerce.transaction_id"
		},
		{
			"field_name": "cart_hash",
			"field_type": "varchar",
			"local_field": "json_data.woocommerce.cart_hash"
		},
		{
			"field_name": "cart_tax",
			"field_type": "double",
			"local_field": "json_data.woocommerce.cart_tax"
		},
		{
			"field_name": "created_via",
			"field_type": "varchar",
			"local_field": "json_data.woocommerce.created_via"
		},
		{
			"field_name": "customer_ip_address",
			"field_type": "varchar",
			"local_field": "json_data.woocommerce.customer_ip_address"
		},
		{
			"field_name": "customer_user_agent",
			"field_type": "varchar",
			"local_field": "json_data.woocommerce.customer_user_agent"
		},
		{
			"field_name": "date_completed",
			"field_type": "date",
			"local_field": "json_data.woocommerce.date_completed"
		},
		{
			"field_name": "date_completed_gmt",
			"field_type": "date",
			"local_field": "json_data.woocommerce.date_completed_gmt"
		},
		{
			"field_name": "date_created_gmt",
			"field_type": "date",
			"local_field": "json_data.woocommerce.date_created_gmt"
		},
		{
			"field_name": "date_modified_gmt",
			"field_type": "date",
			"local_field": "json_data.woocommerce.date_modified_gmt"
		},
		{
			"field_name": "date_paid",
			"field_type": "date",
			"local_field": "json_data.woocommerce.date_paid"
		},
		{
			"field_name": "date_paid_gmt",
			"field_type": "date",
			"local_field": "json_data.woocommerce.date_paid_gmt"
		},
		{
			"field_name": "discount_tax",
			"field_type": "double",
			"local_field": "json_data.woocommerce.discount_tax"
		},
		{
			"field_name": "discount_total",
			"field_type": "double",
			"local_field": "json_data.woocommerce.discount_total"
		},
		{
			"field_name": "id",
			"field_type": "varchar",
			"local_field": "json_data.woocommerce.id"
		},
		{
			"field_name": "order_key",
			"field_type": "varchar",
			"local_field": "json_data.woocommerce.order_key"
		},
		{
			"field_name": "parent_id",
			"field_type": "varchar",
			"local_field": "json_data.woocommerce.parent_id"
		},
		{
			"field_name": "payment_method_title",
			"field_type": "varchar",
			"local_field": "json_data.woocommerce.payment_method_title"
		},
		{
			"field_name": "prices_include_tax",
			"field_type": "double",
			"local_field": "json_data.woocommerce.prices_include_tax"
		},
		{
			"field_name": "shipping_tax",
			"field_type": "double",
			"local_field": "json_data.woocommerce.shipping_tax"
		},
		{
			"field_name": "shipping_total",
			"field_type": "double",
			"local_field": "json_data.woocommerce.shipping_total"
		},
		{
			"field_name": "version",
			"field_type": "varchar",
			"local_field": "json_data.woocommerce.version"
		}
	],
	"field_not_in_use2": {
		"_links": {
			"collection": [
				{
					"href": "https://example.com/wp-json/wc/v2/orders"
				}
			],
			"self": [
				{
					"href": "https://example.com/wp-json/wc/v2/orders/727"
				}
			]
		},
		"coupon_lines": [],
		"fee_lines": [],
		"meta_data": [
			{
				"id": 13106,
				"key": "_download_permissions_granted",
				"value": "yes"
			}
		],
		"refunds": [],
		"shipping": {
			"address_1": "969 Market",
			"address_2": "",
			"city": "San Francisco",
			"company": "",
			"country": "US",
			"first_name": "John",
			"last_name": "Doe",
			"postcode": "94103",
			"state": "CA"
		},
		"shipping_lines": [
			{
				"id": 317,
				"method_id": "flat_rate",
				"method_title": "Flat Rate",
				"taxes": [],
				"total": "10.00",
				"total_tax": "0.00"
			}
		],
		"tax_lines": [
			{
				"compound": false,
				"id": 318,
				"label": "State Tax",
				"rate_code": "US-CA-STATE TAX",
				"rate_id": 75,
				"shipping_tax_total": "0.00",
				"tax_total": "1.35"
			}
		]
	},
	"example_data": [
		{
			"id": 186,
			"parent_id": 0,
			"number": "186",
			"order_key": "wc_order_5bab9cd9375d8",
			"created_via": "checkout",
			"version": "3.4.4",
			"status": "processing",
			"currency": "EUR",
			"date_created": "2018-09-26T08:51:05",
			"date_created_gmt": "2018-09-26T08:51:05",
			"date_modified": "2018-09-26T11:52:22",
			"date_modified_gmt": "2018-09-26T11:52:22",
			"discount_total": "0.00",
			"discount_tax": "0.00",
			"shipping_total": "10.00",
			"shipping_tax": "0.00",
			"cart_tax": "0.00",
			"total": "129.00",
			"total_tax": "0.00",
			"prices_include_tax": false,
			"customer_id": 3,
			"customer_ip_address": "85.76.49.174",
			"customer_user_agent": "mozilla/5.0 (macintosh; intel mac os x 10_14) applewebkit/605.1.15 (khtml, like gecko) version/12.0 safari/605.1.15",
			"customer_note": "",
			"billing": {
				"first_name": "Pasi",
				"last_name": "Mankinen",
				"company": "Manage",
				"address_1": "asd",
				"address_2": "",
				"city": "Jkl",
				"state": "",
				"postcode": "40320",
				"country": "FI",
				"email": "pasi.mankinen@manageapp.com",
				"phone": "0123456"
			},
			"shipping": {
				"first_name": "Pasi",
				"last_name": "Mankinen",
				"company": "Manage",
				"address_1": "asd",
				"address_2": "",
				"city": "Jkl",
				"state": "",
				"postcode": "40320",
				"country": "FI"
			},
			"payment_method": "paytrail",
			"payment_method_title": "Paytrail",
			"transaction_id": "ecdcb94b65",
			"date_paid": "2018-09-26T14:52:22",
			"date_paid_gmt": "2018-09-26T14:52:22",
			"date_completed": null,
			"date_completed_gmt": null,
			"cart_hash": "f32575ea44886badce58465a39371c0b",
			"meta_data": [],
			"line_items": [
				{
					"id": 7,
					"name": "Testituote",
					"product_id": 110,
					"variation_id": 0,
					"quantity": 1,
					"tax_class": "",
					"subtotal": "99.00",
					"subtotal_tax": "0.00",
					"total": "99.00",
					"total_tax": "0.00",
					"taxes": [],
					"meta_data": [],
					"sku": "",
					"price": 99
				},
				{
					"id": 8,
					"name": "Tarviketuote",
					"product_id": 118,
					"variation_id": 0,
					"quantity": 1,
					"tax_class": "",
					"subtotal": "10.00",
					"subtotal_tax": "0.00",
					"total": "10.00",
					"total_tax": "0.00",
					"taxes": [],
					"meta_data": [],
					"sku": "",
					"price": 10
				},
				{
					"id": 9,
					"name": "Toinen tarviketuote",
					"product_id": 119,
					"variation_id": 0,
					"quantity": 1,
					"tax_class": "",
					"subtotal": "10.00",
					"subtotal_tax": "0.00",
					"total": "10.00",
					"total_tax": "0.00",
					"taxes": [],
					"meta_data": [],
					"sku": "",
					"price": 10
				}
			],
			"tax_lines": [],
			"shipping_lines": [
				{
					"id": 10,
					"method_title": "Flat rate",
					"method_id": "flat_rate",
					"instance_id": "1",
					"total": "10.00",
					"total_tax": "0.00",
					"taxes": [],
					"meta_data": [
						{
							"id": 81,
							"key": "Items",
							"value": "Testituote &times; 1, Tarviketuote &times; 1, Toinen tarviketuote &times; 1"
						}
					]
				}
			],
			"fee_lines": [],
			"coupon_lines": [],
			"refunds": [],
			"_links": {
				"self": [
					{
						"href": "https://www.bedrock.vavaruste.oddysites.fi/wp-json/wc/v2/orders/186"
					}
				],
				"collection": [
					{
						"href": "https://www.bedrock.vavaruste.oddysites.fi/wp-json/wc/v2/orders"
					}
				],
				"customer": [
					{
						"href": "https://www.bedrock.vavaruste.oddysites.fi/wp-json/wc/v2/customers/3"
					}
				]
			}
		}
	]
}
