# Models

## The StateTransitionLog object

```json
{"openapi":"3.0.3","info":{"title":"OMS States Module API","version":"1.0.0"},"components":{"schemas":{"StateTransitionLog":{"type":"object","description":"Represents a state transition log entry with complete nested relationship data.\n\nThis schema includes full details of the old state, new state, and user who triggered\nthe transition. The attributes field contains additional metadata about the transition.\n","properties":{"id":{"type":"integer","description":"Unique identifier for the log entry","readOnly":true},"old_state":{"$ref":"#/components/schemas/StateListSerializer"},"new_state":{"$ref":"#/components/schemas/StateListSerializer"},"user":{"$ref":"#/components/schemas/UserListSerializer","nullable":true},"attributes":{"type":"object","description":"Additional metadata about the state transition.\n\nCommon fields:\n- `command.slug`: The command that triggered the transition (e.g., \"PKG_STATE_TRANSITION\")\n- `command.transition_id`: The ID of the state transition rule used\n- `remote_user_pk`: The ID of the user in a remote system\n- `remote_user_mail`: The email of the user in a remote system\n","nullable":true},"created_date":{"type":"string","format":"date-time","description":"When the transition occurred","readOnly":true},"object_id":{"type":"integer","description":"ID of the object that transitioned (Package, TransferOrder, etc.)","readOnly":true},"content_type":{"type":"integer","description":"Content type ID identifying the type of object that transitioned","readOnly":true}},"required":["id","old_state","new_state","created_date","object_id","content_type"]},"StateListSerializer":{"type":"object","description":"Represents a state with basic information","properties":{"id":{"type":"integer","description":"Unique identifier for the state"},"name":{"type":"string","description":"Human-readable name of the state"},"enum_value":{"type":"string","description":"Numeric enum value as string"},"enum_class":{"type":"string","description":"Name of the enum class"}},"required":["id","name","enum_value","enum_class"]},"UserListSerializer":{"type":"object","description":"Represents a user with basic information","properties":{"pk":{"type":"integer","description":"User's primary key"},"first_name":{"type":"string","description":"User's first name"},"last_name":{"type":"string","description":"User's last name"},"email":{"type":"string","format":"email","description":"User's email address"},"username":{"type":"string","description":"User's username"}},"required":["pk","username"]}}}}
```

## The StateTransitionLogSimple object

```json
{"openapi":"3.0.3","info":{"title":"OMS States Module API","version":"1.0.0"},"components":{"schemas":{"StateTransitionLogSimple":{"type":"object","description":"Simplified state transition log entry without nested relationship data.\nForeign key fields return only IDs for lightweight data retrieval.\n","properties":{"id":{"type":"integer","description":"Unique identifier for the log entry"},"created_date":{"type":"string","format":"date-time","description":"When the transition occurred"},"modified_date":{"type":"string","format":"date-time","description":"When the log entry was last modified"},"old_state":{"type":"integer","description":"ID of the old state"},"new_state":{"type":"integer","description":"ID of the new state"},"content_type":{"type":"integer","description":"Content type ID"},"object_id":{"type":"integer","description":"ID of the object that transitioned"},"user":{"type":"integer","nullable":true,"description":"ID of the user who triggered the transition"},"attributes":{"type":"object","nullable":true,"description":"Additional metadata about the transition"}}}}}}
```

## The StateListSerializer object

```json
{"openapi":"3.0.3","info":{"title":"OMS States Module API","version":"1.0.0"},"components":{"schemas":{"StateListSerializer":{"type":"object","description":"Represents a state with basic information","properties":{"id":{"type":"integer","description":"Unique identifier for the state"},"name":{"type":"string","description":"Human-readable name of the state"},"enum_value":{"type":"string","description":"Numeric enum value as string"},"enum_class":{"type":"string","description":"Name of the enum class"}},"required":["id","name","enum_value","enum_class"]}}}}
```

## The UserListSerializer object

```json
{"openapi":"3.0.3","info":{"title":"OMS States Module API","version":"1.0.0"},"components":{"schemas":{"UserListSerializer":{"type":"object","description":"Represents a user with basic information","properties":{"pk":{"type":"integer","description":"User's primary key"},"first_name":{"type":"string","description":"User's first name"},"last_name":{"type":"string","description":"User's last name"},"email":{"type":"string","format":"email","description":"User's email address"},"username":{"type":"string","description":"User's username"}},"required":["pk","username"]}}}}
```

## The Error object

```json
{"openapi":"3.0.3","info":{"title":"OMS States Module API","version":"1.0.0"},"components":{"schemas":{"Error":{"type":"object","properties":{"detail":{"type":"string","description":"Error message describing what went wrong"},"errors":{"type":"object","description":"Field-specific errors (for validation errors)","additionalProperties":{"type":"array","items":{"type":"string"}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.akinon.com/oms-openapis/state/models.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
