# Schema: WorkPackagePatchModel
---
type: object
required:
  - lockVersion
properties:
  lockVersion:
    type: integer
    description: The version of the item as used for optimistic locking
  subject:
    type: string
    description: Work package subject
  description:
    allOf:
      - $ref: "./formattable.yml"
      - description: The work package description
  scheduleManually:
    type: boolean
    description: If false (default) schedule automatically.
  startDate:
    type: string
    format: date
    description: Scheduled beginning of a work package
  dueDate:
    type: string
    format: date
    description: Scheduled end of a work package
  date:
    type: string
    format: date
    description: Date on which a milestone is achieved
  estimatedTime:
    type: string
    format: duration
    description: Time a work package likely needs to be completed excluding its descendants
  ignoreNonWorkingDays:
    type: boolean
    description: |-
      **(NOT IMPLEMENTED)** When scheduling, whether or not to ignore the non working days being defined.
      A work package with the flag set to true will be allowed to be scheduled to a non working day.
    readOnly: true
  spentTime:
    type: string
    format: duration
    description: |-
      The time booked for this work package by users working on it

      # Conditions

      **Permission** view time entries
    readOnly: true
  percentageDone:
    type: integer
    description: Amount of total completion for a work package
    maximum: 100
  createdAt:
    type: string
    format: date-time
    description: Time of creation
    readOnly: true
  updatedAt:
    type: string
    format: date-time
    description: Time of the most recent change to the work package
    readOnly: true
  _links:
    type: object
    properties:
      assignee:
        allOf:
          - $ref: "./link.yml"
          - description: |-
              The person that is intended to work on the work package
              
              **Resource**: User
      budget:
        allOf:
          - $ref: "./link.yml"
          - description: |-
              The budget this work package is associated to
              
              **Resource**: Budget
              
              # Conditions
              
              **Permission** view cost objects
      category:
        allOf:
          - $ref: "./link.yml"
          - description: |-
              The category of the work package
              
              **Resource**: Category
      parent:
        allOf:
          - $ref: "./link.yml"
          - description: |-
              Parent work package
              
              **Resource**: WorkPackage
      priority:
        allOf:
          - $ref: "./link.yml"
          - description: |-
              The priority of the work package
              
              **Resource**: Priority
      project:
        allOf:
          - $ref: "./link.yml"
          - description: |-
              The project to which the work package belongs
              
              **Resource**: Project
      responsible:
        allOf:
          - $ref: "./link.yml"
          - description: |-
              The person that is responsible for the overall outcome
              
              **Resource**: User
      status:
        allOf:
          - $ref: "./link.yml"
          - description: |-
              The current status of the work package
              
              **Resource**: Status
      type:
        allOf:
          - $ref: "./link.yml"
          - description: |-
              The type of the work package
              
              **Resource**: Type
      version:
        allOf:
          - $ref: "./link.yml"
          - description: |-
              The version associated to the work package
              
              **Resource**: Version

examples:
  - subject: Upgrade hangar 25
    lockVersion: 0
    description:
      format: markdown
      raw: we need more place for new TIE Advanced
      html: "<p>we need more place for new TIE Advanced</p>"
    scheduleManually: false
    _links:
      responsible:
        href: "/api/v3/users/23"
        title: Palpatine
      assignee:
        href: "/api/v3/users/33"
        title: Darth Vader
      priority:
        href: "/api/v3/priorities/2"
        title: Normal
      project:
        href: "/api/v3/projects/1"
        title: Galactic Conquest
      status:
        href: "/api/v3/statuses/1"
        title: New
      type:
        href: "/api/v3/types/11"
        title: DeathStarUpgrades
      version:
        href: "/api/v3/versions/1"
        title: Version 1
      parent:
        href: "/api/v3/work_packages/1298"
        title: ct'hulhu f'tagn
