# Model Analysis

Let’s analyze the *fabric* Model. It is composed of:

* 5 **properties**: *unique\_name*, *id\_technician*, *id\_employee*, *available*, *notes*.
* 3 **mutations**: *send\_to\_processing*, *send\_to\_confirmed*, *send\_to\_recalled*.
* 4 **states**: *open(default)*, *processing*, *confirmed*, *recalled*.

The required properties are ***id\_technician*** and ***unique\_name***.

The mutation **send\_to\_processing** contains only one transition change to shift the model from the **open** state to the **processing** state. This mutation can be executed only by a user who is a member of the **admin** group.

The mutation **send\_to\_confirmed** contains a collection of 5 changes:

1. **transition** type: changes the model state from processing to confirmed.
2. **dynamic** type: the id\_technician value will be updated with the one the user writes in the API request. The field **must** be valued in the request's body as it is marked as "required: 'true'".
3. **dynamic** type: the id\_employee value will be updated with the one the user writes in the API request. The field **may** be valued in the request as it is marked as "required: 'false'" (i.e. optional field).
4. **static** type: the value of the field available will be updated automatically by the system with the predetermined value true.
5. one **external mutation** invokes the send\_to\_available mutation defined in the garment Model. This implies that a model outside the fabric Model, the model garment, will also change due to the send\_to\_confirmed mutation.

\ <br>

> **Note**: The users authorized to call this mutation are the **admin** or **controller** group members.

\ <br>

The mutation **send\_to\_recalled** contains a collection of 3 changes:

1. **transition** type: changes the model state from confirmed to recalled.
2. **dynamic** type: the value of the notes will be updated with the one written by the user in the API request. The field must be valued in the request's body as it is marked as "required: 'true'".
3. **static** type: the value of the field *available* will be updated automatically by the system with the predetermined value *true*.
