---
title: "WorkspaceRule · types"
url: https://developers.dagio.ai/reference/types-workspace-rule/
---

# WorkspaceRule · types

   
                              
                                                                        
                                      
                  
           
          
   

The following types define named objects and their relationships. Tables include inherited properties. Schema-derived types refer to their validated structures; a TypeScript declaration does not replace the compiler’s semantic checks.

## WorkspaceRule

Admitted complete Rule declaration using the shared scalar and typed expression grammar.

```typescript
export type WorkspaceRule = z.infer<typeof workspaceRuleSchema>;
```

## ModelRuleExpression

Expression syntax accepted by the complete Model Rule declaration.

```typescript
export type ModelRuleExpression = WorkspaceRule['expression'];
```

```typescript
type ModelRuleExpression = import("./WorkspaceModelFoundationDeclarations.js").ScalarModelRuleExpression | { kind: "exact-compare"; operator: "eq" | "ne" | "lt" | "lte" | "gt" | "gte"; left: import("./WorkspaceExactData.js").ManagedExactDataExpression; right: import("./WorkspaceExactData.js").ManagedExactDataExpression; } | { kind: "integer-compare"; schema: { kind: "integer"; minimum: string; maximum: string; unit: { kind: "dimensionless"; } | { kind: "unit"; key: string; } | { kind: "currency"; key: string; }; }; operator: "eq" | "ne" | "lt" | "lte" | "gt" | "gte"; left: { kind: "field"; field: { definitionPath: string; fieldKey: string; }; } | { kind: "literal"; value: string; }; right: { kind: "field"; field: { definitionPath: string; fieldKey: string; }; } | { kind: "literal"; value: string; }; } | { kind: "real-compare"; schema: { kind: "real"; representation: "binary64"; precisionBits: 53; minimum: number; maximum: number; tolerance: { absolute: number; relative: number; }; unit: { kind: "dimensionless"; } | { kind: "unit"; key: string; }; }; operator: "approximately-equal" | "not-approximately-equal"; left: { kind: "field"; field: { definitionPath: string; fieldKey: string; }; } | { kind: "literal"; value: number; }; right: { kind: "field"; field: { definitionPath: string; fieldKey: string; }; } | { kind: "literal"; value: number; }; };
```

[All references](https://developers.dagio.ai/reference/)

<!-- surface-examples:start -->

## Applied examples : Check before confirming

One rule requires a company; another rejects a zero or negative amount.

### Configuration

Fragment placed in `rules[]`. [Properties and accepted values](https://developers.dagio.ai/reference/workspace-model-foundation/).

```json
{
  "contract": "WorkspaceRule@1",
  "key": "company-required",
  "label": "Company provided",
  "expression": {
    "kind": "present",
    "field": {
      "definitionPath": "workspace/clients/surface/client",
      "fieldKey": "company"
    }
  }
}
```

### Variation and connection

Fragment placed in `rules[]`. [Properties and accepted values](https://developers.dagio.ai/reference/workspace-model-foundation/).

```json
{
  "contract": "WorkspaceRule@1",
  "key": "positive-amount",
  "label": "Positive amount",
  "expression": {
    "kind": "compare",
    "field": {
      "definitionPath": "workspace/quotes/surface/quote",
      "fieldKey": "amount"
    },
    "operator": "gt",
    "value": 0
  }
}
```

### UI layout example

The illustrative layout below places this configuration in the Clients/Quotes app. Insert each fragment at the stated location, with Field, Query and Action references matching the Model declarations.

1. Company *
2. Status *
3. Notes
4. Create client

<!-- surface-examples:end -->
