> ## 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.

# Compare Cost Sheet Versions

> Compare two versions and report structured diffs (costs, BOM, processing).



## OpenAPI

````yaml /api/openapi-cutmake.json get /costings/{costing_id}/versions/{v1}/compare/{v2}
openapi: 3.1.0
info:
  title: VM App API
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /costings/{costing_id}/versions/{v1}/compare/{v2}:
    get:
      tags:
        - Costing Management
      summary: Compare Cost Sheet Versions
      description: >-
        Compare two versions and report structured diffs (costs, BOM,
        processing).
      operationId: >-
        compare_cost_sheet_versions_costings__costing_id__versions__v1__compare__v2__get
      parameters:
        - name: costing_id
          in: path
          required: true
          schema:
            type: string
            description: The costing document ID
            title: Costing Id
          description: The costing document ID
        - name: v1
          in: path
          required: true
          schema:
            type: integer
            minimum: 1
            description: First version number
            title: V1
          description: First version number
        - name: v2
          in: path
          required: true
          schema:
            type: integer
            minimum: 1
            description: Second version number
            title: V2
          description: Second version number
        - 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/CostSheetVersionDiffResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    CostSheetVersionDiffResponse:
      properties:
        costSheetId:
          type: string
          title: Costsheetid
        versionA:
          $ref: '#/components/schemas/CostSheetVersionMetadata'
        versionB:
          $ref: '#/components/schemas/CostSheetVersionMetadata'
        costChanges:
          items:
            $ref: '#/components/schemas/CostFieldChange'
          type: array
          title: Costchanges
        bomChanges:
          items:
            $ref: '#/components/schemas/BOMChange'
          type: array
          title: Bomchanges
        processingChanges:
          items:
            $ref: '#/components/schemas/ProcessingChange'
          type: array
          title: Processingchanges
      type: object
      required:
        - costSheetId
        - versionA
        - versionB
        - costChanges
        - bomChanges
        - processingChanges
      title: CostSheetVersionDiffResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CostSheetVersionMetadata:
      properties:
        versionNumber:
          anyOf:
            - type: integer
            - type: 'null'
          title: Versionnumber
        createdDate:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Createddate
        createdBy:
          anyOf:
            - type: string
            - type: 'null'
          title: Createdby
        changeDescription:
          anyOf:
            - type: string
            - type: 'null'
          title: Changedescription
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        isFinal:
          type: boolean
          title: Isfinal
          default: false
        finalizedAt:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Finalizedat
        finalizedById:
          anyOf:
            - type: string
            - type: 'null'
          title: Finalizedbyid
        stageKey:
          anyOf:
            - type: string
            - type: 'null'
          title: Stagekey
        stageLabel:
          anyOf:
            - type: string
            - type: 'null'
          title: Stagelabel
      type: object
      required:
        - versionNumber
        - createdDate
        - createdBy
        - changeDescription
        - status
      title: CostSheetVersionMetadata
      description: Version metadata used for listing and comparison
    CostFieldChange:
      properties:
        field:
          type: string
          title: Field
        label:
          type: string
          title: Label
        versionAValue:
          anyOf:
            - type: number
            - type: 'null'
          title: Versionavalue
        versionBValue:
          anyOf:
            - type: number
            - type: 'null'
          title: Versionbvalue
      type: object
      required:
        - field
        - label
        - versionAValue
        - versionBValue
      title: CostFieldChange
    BOMChange:
      properties:
        changeType:
          type: string
          title: Changetype
        key:
          type: string
          title: Key
        materialName:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialname
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        oldValue:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Oldvalue
        newValue:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Newvalue
        fieldChanges:
          anyOf:
            - items:
                $ref: '#/components/schemas/FieldValueChange'
              type: array
            - type: 'null'
          title: Fieldchanges
      type: object
      required:
        - changeType
        - key
        - materialName
        - oldValue
        - newValue
        - fieldChanges
      title: BOMChange
    ProcessingChange:
      properties:
        changeType:
          type: string
          title: Changetype
        key:
          type: string
          title: Key
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        oldValue:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Oldvalue
        newValue:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Newvalue
        fieldChanges:
          anyOf:
            - items:
                $ref: '#/components/schemas/FieldValueChange'
              type: array
            - type: 'null'
          title: Fieldchanges
      type: object
      required:
        - changeType
        - key
        - oldValue
        - newValue
        - fieldChanges
      title: ProcessingChange
    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
    FieldValueChange:
      properties:
        field:
          type: string
          title: Field
        versionAValue:
          anyOf:
            - {}
            - type: 'null'
          title: Versionavalue
        versionBValue:
          anyOf:
            - {}
            - type: 'null'
          title: Versionbvalue
      type: object
      required:
        - field
        - versionAValue
        - versionBValue
      title: FieldValueChange
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /auth/login

````