# Duoplane schema ERD

Table and field reference for the Fivetran Duoplane connector.

## Table & Field Reference

### shipment_tracking_attribute

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| tracking | String | PK |
| shipment_id | String | FK |
| tracking_url | String |  |

### shipment_item_serial_code

| Column | Type | Keys |
| --- | --- | --- |
| serial_code | String | PK |
| shipment_item_attribute_id | String | PK, FK |
| shipment_item_attribute_order_item_id | String | PK, FK |

### shipment_item_attribute

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| order_item_id | String | PK |
| shipment_id | String | FK |
| cost | Double |  |
| order_item_name | String |  |
| quantity | Int |  |

### shipment

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| created_at | Instant |  |
| purchase_order_id | String |  |
| purchase_order_public_reference | String |  |
| shipper_id | String |  |
| shipper_invoice_reference | String |  |
| shipper_name | String |  |
| shipper_scac_code | String |  |
| shipper_shipping_cost | Double |  |
| updated_at | Instant |  |
| vendor_handling_cost | Double |  |
| vendor_invoice_reference | String |  |
| vendor_shipping_cost | Double |  |
| vendor_tax_cost | Double |  |

### purchase_order_item_note

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| purchase_order_item_id | String | FK |
| body | String |  |
| title | String |  |

### purchase_order_item_comment

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| purchase_order_item_id | String | FK |
| body | String |  |
| commentator_company_name | String |  |
| recipient_company_name | String |  |

### purchase_order_item

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| purchase_order_id | String | FK |
| cost | Double |  |
| mpn | String |  |
| name | String |  |
| net_price | Double |  |
| order_id | String |  |
| other_barcode | String |  |
| price | Double |  |
| promise_date | LocalDate |  |
| quantity | Int |  |
| quantity_open | Int |  |
| retailer_product_id | String |  |
| retailer_sku | String |  |
| total_discount | Double |  |
| upc | String |  |
| vendor_sku | String |  |

### purchase_order_note

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| purchase_order_id | String | FK |
| body | String |  |
| title | String |  |

### purchase_order

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| created_at | Instant |  |
| customer_note | String |  |
| order_id | String |  |
| order_public_reference | String |  |
| ordered_at | Instant |  |
| promise_date | LocalDate |  |
| public_reference | String |  |
| retailer_account | String |  |
| retailer_id | String |  |
| retailer_name | String |  |
| sent_at | Instant |  |
| ship_method | String |  |
| shipping_address_address_1 | String |  |
| shipping_address_address_2 | String |  |
| shipping_address_city | String |  |
| shipping_address_company_name | String |  |
| shipping_address_country | String |  |
| shipping_address_email | String |  |
| shipping_address_first_name | String |  |
| shipping_address_last_name | String |  |
| shipping_address_phone | String |  |
| shipping_address_post_code | String |  |
| shipping_address_province | String |  |
| shipping_address_province_iso | String |  |
| status | String |  |
| store_name | String |  |
| total_shipping_revenue | Double |  |
| total_tax | Double |  |
| updated_at | Instant |  |
| vendor | String |  |
| vendor_account | String |  |
| vendor_id | String |  |
| vendor_reference | String |  |

### product_inventory

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| product_id | String | FK |
| actual_leadtime_days | Int |  |
| backordered_until | Unknown |  |
| cost | Double |  |
| manage_inventory | String |  |
| purchase_name | String |  |
| quantity_available | Int |  |
| vendor_id | String |  |
| vendor_name | String |  |
| vendor_sku | String |  |

### store_product

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| product_id | String | FK |
| inventory_quantity_buffer | String |  |
| store_id | String |  |
| store_name | String |  |
| store_product_type | String |  |
| store_reference_unique | String |  |
| vendor_store_reference | String |  |

### product

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| created_at | Instant |  |
| deactivated_at | Unknown |  |
| mpn | String |  |
| name | String |  |
| other_barcode | String |  |
| price | String |  |
| price_map | String |  |
| price_msrp | String |  |
| product_type | String |  |
| retailer_sku | String |  |
| upc | String |  |
| updated_at | Instant |  |

### order_vendor_comment

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| purchase_order_id | String | FK |
| body | String |  |
| commentable_id | String |  |
| commentable_type | String |  |
| commenter_email | String |  |
| commenter_full_name | String |  |
| created_at | Instant |  |
| recipient_company_id | String |  |
| recipient_company_name | String |  |
| updated_at | Instant |  |

### order_retailer_comment

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| purchase_order_item_id | String | FK |
| body | String |  |
| commentable_id | String |  |
| commentable_type | String |  |
| commenter_email | String |  |
| commenter_full_name | String |  |
| created_at | Instant |  |
| recipient_company_id | String |  |
| recipient_company_name | String |  |
| updated_at | Instant |  |

## Relationships

- shipment_tracking_attribute(shipment_id) → shipment(id)
- shipment_item_serial_code(shipment_item_attribute_id) → shipment_item_attribute(id)
- shipment_item_serial_code(shipment_item_attribute_order_item_id) → shipment_item_attribute(order_item_id)
- shipment_item_attribute(shipment_id) → shipment(id)
- purchase_order_item_note(purchase_order_item_id) → purchase_order_item(id)
- purchase_order_item_comment(purchase_order_item_id) → purchase_order_item(id)
- purchase_order_item(purchase_order_id) → purchase_order(id)
- purchase_order_note(purchase_order_id) → purchase_order(id)
- product_inventory(product_id) → product(id)
- store_product(product_id) → product(id)
- order_vendor_comment(purchase_order_id) → purchase_order(id)
- order_retailer_comment(purchase_order_item_id) → purchase_order_item(id)
