**What**
- validate that variants are unique with respect to options on product update/create and variant update/create
- validate that the product has options upon creation
- ensure variants have the same number of option values as the product has options
- admin error handling
- update tests
---
FIXES FRMW-2707 CC-556
what:
When creating a variant, we can now create inventory as a part of the product and variants create endpoint.
This applies only to variants where `manage_inventory=true`. 2 cases present itself:
1. When inventory_items are present
- Link an inventory item with required_quantity to the variant
- the inventory item already needs to be present
2. When inventory_items are not present
- A default inventory item will be created
- links the created item to the variant with a default required_quantity
RESOLVES CORE-2220
what:
- adds variant inventory link management endpoints:
```
Link inventory item to variant
POST /products/:id/variants/:vid/inventory-items
Update variant's inventory item link
POST /products/:id/variants/:vid/inventory-items/:iid
Unlink variant's inventory item
DELETE /products/:id/variants/:vid/inventory-items/:iid
```
- a batch endpoint that does the above 3 across variants
```
POST /products/:id/variants/inventory-items
```