> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hellocobi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Student Favourite Model

> The student favourite data model represents the mappings between students and their favourite shops in the Cobi system.

<Note>
  **Important**: The student favourite model has dependencies on both the
  customer/student and shop models. The `student_id` field must reference an
  existing customer/student and the `shop_id` field must reference an existing
  shop. It's recommended to upload customer/student and shop data before
  uploading student favourite mappings.
</Note>

## Schema

```json theme={null}
{
  "type": "object",
  "required": ["student_id", "shop_id"],
  "properties": {
    "favourite_id": {
      "type": "string",
      "format": "uuid",
      "description": "Unique identifier for the favourite mapping"
    },
    "student_id": {
      "type": "string",
      "format": "uuid",
      "description": "ID of the student (must reference an existing customer/student)"
    },
    "shop_id": {
      "type": "string",
      "format": "uuid",
      "description": "ID of the shop (must reference an existing shop)"
    },
    "created": {
      "type": "string",
      "format": "date-time",
      "nullable": true,
      "description": "Timestamp when the record was created"
    },
    "updated": {
      "type": "string",
      "format": "date-time",
      "nullable": true,
      "description": "Timestamp when the record was last updated"
    },
    "is_deleted": {
      "type": "boolean",
      "nullable": true,
      "description": "Flag indicating if the record is marked as deleted"
    }
  }
}
```

## Field Descriptions

### Required Fields

| Field        | Type   | Format | Description                                                     |
| ------------ | ------ | ------ | --------------------------------------------------------------- |
| `student_id` | string | UUID   | ID of the student (must reference an existing customer/student) |
| `shop_id`    | string | UUID   | ID of the shop (must reference an existing shop)                |

### Optional Fields

| Field          | Type    | Format    | Description                                        |
| -------------- | ------- | --------- | -------------------------------------------------- |
| `favourite_id` | string  | UUID      | Unique identifier for the favourite mapping        |
| `created`      | string  | date-time | Timestamp when the record was created              |
| `updated`      | string  | date-time | Timestamp when the record was last updated         |
| `is_deleted`   | boolean | -         | Flag indicating if the record is marked as deleted |

## Example

```json theme={null}
{
  "favourite_id": "550e8400-e29b-41d4-a716-446655440000",
  "student_id": "550e8400-e29b-41d4-a716-446655440001",
  "shop_id": "550e8400-e29b-41d4-a716-446655440002",
  "created": "2023-01-15T14:30:00Z",
  "updated": "2023-06-22T09:15:30Z",
  "is_deleted": false
}
```

## Best Practices

1. **UUID Format**: Use valid UUID v4 format for all ID fields
2. **Data Dependencies**: Ensure student\_id references an existing customer/student and shop\_id references an existing shop
3. **Data Consistency**: Ensure consistent data across all student favourite mapping records
4. **Soft Deletion**: Use the is\_deleted flag instead of permanently deleting records

Need help? Contact our support team at [support@hellocobi.com](mailto:support@hellocobi.com)
