Columns
| Column | Description | API Field Name |
|---|---|---|
inventory_id | Part of composite primary key. Inventory unique identifier. | id |
inventory_is_deleted | Whether the global inventory record is deleted. | |
code | The unique inventory code for this global inventory item. | code |
kind | The kind/type of inventory item (e.g., STANDARD). | kind |
inventory_category_id | Foreign key to the inventory category table. | category_id |
clinic_id | Part of composite primary key. Foreign key to the clinic table. | |
global_preferences_name | The name of the inventory item from global inventory (Vetcove’s default). | name |
global_preferences_unit_of_measure | The unit of measure from global inventory (Vetcove’s default). | unit_of_measure |
organization_preference_id | The unique identifier for the organization/group inventory preference record. Always present at clinic level. | |
organization_preferences_is_enabled | Whether the inventory item is enabled at the organization/group level. Always present at clinic level (inner join to organization preferences). | organization_preferences.is_enabled |
organization_preferences_name | Organization-level override name for the inventory item. | organization_preferences.name |
organization_preferences_unit_of_measure | Organization-level override for unit of measure. | organization_preferences.unit_of_measure |
organization_preferences_grade | The grade classification set at the organization level. | organization_preferences.grade |
organization_preferences_code | Organization-specific code for the inventory item. | organization_preferences.code |
organization_preferences_is_deleted | Whether the organization/group inventory preference record is deleted. | |
clinic_preference_id | The unique identifier for the clinic inventory preference record. Null if no clinic preference exists. | |
clinic_preferences_status | The status of the inventory at the clinic level (e.g., IN_STOCK, OUT_OF_STOCK). | clinic_preferences.status |
clinic_preferences_is_enabled | Indicates whether the inventory item is enabled at the clinic level. | clinic_preferences.is_enabled |
clinic_preferences_name | Optional clinic-specific override name for the inventory item. | clinic_preferences.name |
clinic_preferences_min_quantity | Minimum quantity threshold set at the clinic level. | clinic_preferences.min_quantity |
clinic_preferences_reorder_point | Reorder point threshold set at the clinic level. | clinic_preferences.reorder_point |
clinic_preferences_should_track_lot_number | Indicates whether lot number tracking is enabled for this inventory at the clinic. | clinic_preferences.should_track_lot_number |
clinic_preferences_unit_price | The unit price for the inventory item at the clinic level. Snowflake displays dollars, API returns cents. | clinic_preferences.unit_price |
clinic_preferences_last_unit_price_update | The timestamp when the unit price was last updated. | clinic_preferences.last_unit_price_update |
clinic_preference_is_deleted | Indicates whether the clinic preference record is deleted. | |
effective_preferences_is_enabled | Complex AND logic: Organization preference must be enabled, AND clinic preference must exist AND not be deleted AND be enabled. Returns false if any condition fails. | effective_preferences.is_enabled |
effective_preferences_name | Resolved using hierarchy with nullif for empty strings: clinic → organization → global inventory name. | effective_preferences.name |
effective_preferences_unit_of_measure | Resolved using hierarchy: organization → global (clinic does not have unit_of_measure). | effective_preferences.unit_of_measure |
effective_preferences_grade | Resolved from organization preferences only (clinic and global don’t have grade). | effective_preferences.grade |
effective_preferences_min_quantity | Clinic preference value, null if no clinic preference exists (not set at organization/global level). | effective_preferences.min_quantity |
effective_preferences_reorder_point | Clinic preference value, null if no clinic preference exists (not set at organization/global level). | effective_preferences.reorder_point |
effective_preferences_should_track_lot_number | Clinic preference value, defaults to false if null or no clinic preference (not set at organization/global level). | effective_preferences.should_track_lot_number |
effective_preferences_unit_price | Clinic preference value, null if no clinic preference exists (only set at clinic level). Snowflake displays dollars, API returns cents. | effective_preferences.unit_price |
stock_quantity | The current stock quantity for this inventory item at this clinic. Calculated as the sum of bucket stock_quantity for all non-deleted buckets. | stock_quantity |
in_transit_quantity | The in-transit quantity for this inventory item at this clinic. Calculated from unreceived purchase order items, converted to global unit of measure. | in_transit_quantity |
on_hold_quantity | The on-hold quantity for this inventory item at this clinic. Calculated from editable invoices, summed per bucket then aggregated per inventory. | on_hold_quantity |
is_controlled | True if this inventory item is a controlled substance in this clinic’s context: federally controlled, or state-level controlled and the clinic’s primary address state is in the substance’s controlled_states list. False for non-US clinics or when no controlled substance is linked. | is_controlled |
last_updated | The timestamp when this inventory record was last updated. The most recent timestamp from all related tables. | |
vetcove_corporate_id | The unique identifier of the corporate group associated with this record. |
Relationships
- Clinic via
clinic_id
SQL Definition
View SQL
View SQL