Schemas ======= The schemas used by sheepCRM need a full chapter. This fragment is to explain the ability to localise a core system schema. Each type of data in Sheep has a `resource_type` e.g. `person`, `member`, `payment`. Each `resource_type` has a schema which describes the fields and values that are supported. :enum: the values for this field must match an item from the list :loose_enum: the items in the list are suggested values, other values can be submitted Get the schema for a resource type ---------------------------------- .. code-block:: http $ http GET http https://api.sheepcrm.com/api/v1/{flock}/{resource type}/schema/ "Authorization: Bearer $API_KEY" Schema overloading ------------------ .. note:: You should not attempt to edit these settings unless you know what you are doing. The self-service settings have a section for editing the JSON settings. The schema field can be used to overload the core schema data. Note only enum/loose_enum updates are currently supported. (You can't for example create a new field or change an existing field name.) .. code-block:: json schema: { organisation: { fields: { primary_service_offered: { loose_enum: [ 'Dog Grooming', 'Cat Grooming', 'Dog Walking', 'Cat Walking', 'Cattery', 'Other' ] }, services_offered: { loose_enum: [ 'Dog Grooming', 'Cat Grooming', 'Dog Walking', 'Cat Walking', 'Cattery', ] }, industry: { loose_enum: [ 'Pets', 'Not pets', ] }, source: { loose_enum: [ 'Facebook', 'Instagram', ] } } }, booking: { layout_requirements: { loose_enum: [ 'Layout for dogs', 'Layout for cats' ] } } } The example above shows a configuration for a pet company. They are interested in tracking a primary service (a single field) and also a list field to capture all other services offered. They only need to capture whether the contact is within the pet industry or not. (The booking section is included to show how multiple schemas can be configured.)