Magidoc

updateProjectOtherCosts
Mutation

Adds, updates, or removes one project other-cost entry and recalculates derived totals. UPDATE clears description or categoryId when omitted, but preserves omitted date, type, and recurrence values. Requires workspace-admin or project-owner access. ADD and UPDATE require name and amount; UPDATE and REMOVE require costId. Duplicate IDs and invalid categories are rejected; negative amounts are allowed as credits.

Arguments

#

projectId

ID !
Non-null

The project whose other costs are being changed

operation

Non-null

ADD, UPDATE or REMOVE

costId

The other-cost line id. Required for UPDATE and REMOVE; supplied by clients on ADD for optimistic rendering, generated when omitted

name

The cost line name. Required on ADD and on UPDATE

color

Hex color code for the cost line. Optional — falls back to the default project color when omitted

amount

The cost amount. Required on ADD and on UPDATE. Any number is accepted; negative amounts record credits that offset other costs on the project

type

FIXED (default) or RECURRING

date

The date the cost applies to

recurrence

Recurrence definition, used when type is RECURRING

description

Description for the cost line. On UPDATE this is not a partial field: omitting it clears any existing description

categoryId

Time category id; must belong to the project workspace. On UPDATE this is not a partial field: omitting it clears any existing category

Response

#

Returns Project .

Example

#