This commit is contained in:
2026-08-22 20:09:28 +02:00
parent fa19852736
commit 8ed0919f67
5 changed files with 231 additions and 139 deletions
@@ -143,6 +143,18 @@ func (vr *ValueRepository) GetPropertyType(id int) (*models.PropertyType, error)
return &propertyType, nil
}
func (vr *ValueRepository) GetPropertyTypeIDByLabel(label string) (int, error) {
// Implement the logic to retrieve the propertyType ID from the database by label
query := `SELECT id FROM propertytypes WHERE label=$1`
row := vr.db.QueryRow(query, label)
var id int
err := row.Scan(&id)
if err != nil {
return 0, err
}
return id, nil
}
func (vr *ValueRepository) GetPropertyTypesByGroupId(groupId int) ([]*models.PropertyType, error) {
// Implement the logic to retrieve the propertyTypes by groupId from the database
query := `SELECT id, label, description, propertytypegroupid FROM propertytypes WHERE propertytypegroupid=$1`