How Product Groups Work
Source: product_groups_controller.rb:4-55
- Group name must be unique within a company (case-insensitive via ILIKE), limited to 30 characters
- A description is required for every group
- Deleting a product group unlinks all products from that group by setting their product_group_name to nil -- the products themselves are not deleted
- Group names with forward slashes are URL-encoded as %2F and decoded on lookup -- searching for groups with slashes requires this encoding
- Setting a group's category_id to blank/null explicitly sets the database value to NULL via a separate SQL path, removing the category association
- Groups are critical because they determine which tax rate is used for product cost calculations (category-specific vs company default)
Support scenarios
- "Why can't I create a product group with this name?" → A group with the same name (case-insensitive) already exists in your company
- "What happens to my products when I delete a product group?" → Products are unlinked (group set to null) but not deleted; reassign them to a new group
- "Why can't I find my product group with a slash in the name?" → Forward slashes in group names are URL-encoded; the system handles this automatically but API consumers may need to encode it
- "Why did my product group lose its category?" → The category_id was set to blank, which the system interprets as null