Class: MOCO::CustomProperty

Inherits:
BaseEntity show all
Defined in:
lib/moco/entities/custom_property.rb

Overview

Represents a MOCO custom property/field definition (Eigene Felder)

Required attributes for create:

name   - String, field name (e.g., "Purchase Order Number")
kind   - String, field type:
         "String", "Textarea", "Link", "Boolean",
         "Select", "MultiSelect", "Date"
entity - String, entity type this field applies to:
         "Project", "Customer", "Deal", etc.

Optional attributes:

placeholder          - String, placeholder text for input
placeholder_alt      - String, placeholder in alternative language
print_on_invoice     - Boolean, show on invoices
print_on_offer       - Boolean, show on offers
print_on_timesheet   - Boolean, show on timesheets
notification_enabled - Boolean, send notification for Date fields
api_only             - Boolean, hide from UI (API access only)
defaults             - Array, options for Select/MultiSelect types

Read-only attributes:

id, name_alt, created_at, updated_at

Example:

# Create a dropdown field
moco.custom_properties.create(
  name: "Project Type",
  kind: "Select",
  entity: "Project",
  defaults: ["Website", "Mobile App", "API Integration"],
  print_on_invoice: true
)

Note:

`kind` and `entity` cannot be changed after creation.

Instance Attribute Summary

Attributes inherited from BaseEntity

#attributes, #client

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseEntity

#==, #association, #destroy, #eql?, #has_many, #hash, #id, #initialize, #inspect, #reload, #save, #to_h, #to_json, #update

Constructor Details

This class inherits a constructor from MOCO::BaseEntity

Class Method Details

.entity_pathObject



41
42
43
# File 'lib/moco/entities/custom_property.rb', line 41

def self.entity_path
  "account/custom_properties"
end

Instance Method Details

#to_sObject



45
46
47
# File 'lib/moco/entities/custom_property.rb', line 45

def to_s
  name.to_s
end