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

# Get All Costings

> Get all costings with filtering, sorting, and pagination.

**Pagination:** Database-level pagination for optimal performance.

**Standard Operations:**

- **Pagination:** `?page=1&limit=10`
- **Filtering:** `?status=Draft`
- **Sorting:** `?sort=-created_at` (newest first) or `?sort=+status`
- **Search:** `?search=CS-2024`

**Examples:**
```
GET /costings                           # All costings, page 1
GET /costings?status=Draft              # Only drafts
GET /costings?sort=-created_at          # Newest first
GET /costings?sort=+status              # Sort by status A-Z
GET /costings?page=2&limit=20           # Page 2, 20 per page
GET /costings?search=CS-2024            # Search for "CS-2024"
```

**Response Format:**
```json
{
  "data": [...],
  "pagination": {
    "page": 1,
    "limit": 10,
    "total": 45,
    "totalPages": 5,
    "hasNext": true,
    "hasPrev": false
  }
}
```



## OpenAPI

````yaml /api/openapi-cutmake.json get /api/v1/costings
openapi: 3.1.0
info:
  title: VM App API
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /api/v1/costings:
    get:
      tags:
        - Costing Management
      summary: Get All Costings
      description: |-
        Get all costings with filtering, sorting, and pagination.

        **Pagination:** Database-level pagination for optimal performance.

        **Standard Operations:**

        - **Pagination:** `?page=1&limit=10`
        - **Filtering:** `?status=Draft`
        - **Sorting:** `?sort=-created_at` (newest first) or `?sort=+status`
        - **Search:** `?search=CS-2024`

        **Examples:**
        ```
        GET /costings                           # All costings, page 1
        GET /costings?status=Draft              # Only drafts
        GET /costings?sort=-created_at          # Newest first
        GET /costings?sort=+status              # Sort by status A-Z
        GET /costings?page=2&limit=20           # Page 2, 20 per page
        GET /costings?search=CS-2024            # Search for "CS-2024"
        ```

        **Response Format:**
        ```json
        {
          "data": [...],
          "pagination": {
            "page": 1,
            "limit": 10,
            "total": 45,
            "totalPages": 5,
            "hasNext": true,
            "hasPrev": false
          }
        }
        ```
      operationId: get_all_costings_api_v1_costings_get
      parameters:
        - name: page
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            description: Page number (starts at 1)
            default: 1
            title: Page
          description: Page number (starts at 1)
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Items per page (max 100)
            default: 10
            title: Limit
          description: Items per page (max 100)
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: 'Filter by status: Draft, Under Review, Approved'
            title: Status
          description: 'Filter by status: Draft, Under Review, Approved'
        - name: sort
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Sort field with direction prefix. Use - for descending, + for
              ascending. Examples: -created_at, +status
            default: '-created_at'
            title: Sort
          description: >-
            Sort field with direction prefix. Use - for descending, + for
            ascending. Examples: -created_at, +status
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                minLength: 2
              - type: 'null'
            description: Search term (searches document ID)
            title: Search
          description: Search term (searches document ID)
        - name: X-Org-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Org-Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedCostingsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    PaginatedCostingsResponse:
      properties:
        data:
          items: {}
          type: array
          title: Data
        pagination:
          $ref: '#/components/schemas/core__pagination__PaginationInfo'
      type: object
      required:
        - data
        - pagination
      title: PaginatedCostingsResponse
      description: |-
        Paginated response for costings list endpoint.
        Follows API_STANDARDS.md pagination format.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    core__pagination__PaginationInfo:
      properties:
        page:
          type: integer
          title: Page
        limit:
          type: integer
          title: Limit
        total:
          type: integer
          title: Total
        totalPages:
          type: integer
          title: Totalpages
        hasNext:
          type: boolean
          title: Hasnext
        hasPrev:
          type: boolean
          title: Hasprev
      type: object
      required:
        - page
        - limit
        - total
        - totalPages
        - hasNext
        - hasPrev
      title: PaginationInfo
      description: |-
        Pagination metadata following API standards.

        Attributes:
            page: Current page number (1-indexed)
            limit: Items per page
            total: Total number of items matching query
            totalPages: Total number of pages
            hasNext: Whether there is a next page
            hasPrev: Whether there is a previous page
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /auth/login

````