caution
This section refers to the old versions of the MonkJs SDK (version 3.X.X
and below). For the v4 docs, please refer to
this page.
Damage
yarn add @monkvision/corejs
import monk from '@monkvision/corejs'
const { createOne, deleteOne } = monk.entity.damage;
createOne
POST /inspections/${inspectionId}/damages
Add damage to an inspection.
await monk.entity.damage.createOne(inspectionId, data);
Try it on api.monk.ai documentation
name | type | default |
---|---|---|
inspectionId | string | |
data | CreateDamage | |
- data.damageType | DamageType | |
- data.partType | PartType |
{
"axiosResponse": {},
"entities": {
"damages": {
"3fa85f64-5717-4562-b3fc-2c963f66afa6": {
"damageType": "body_crack",
"partType": "ignore",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"parts": []
}
}
},
"result": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
deleteOne
DELETE /inspections/${inspectionId}/damages/${id}
Remove damage from an inspection.
await monk.entity.damage.deleteOne(id, inspectionId);
Try it on api.monk.ai documentation
name | type | default |
---|---|---|
inspectionId | string | |
id | string |
{
"axiosResponse": {},
"entities": {
"damages": {
"3fa85f64-5717-4562-b3fc-2c963f66afa6": {
"deleted": true,
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"parts": []
}
}
},
"result": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
Enums
DamageType
string
enum DamageType {
BODY_CRACK = 'body_crack',
BROKEN_GLASS = 'broken_glass',
BROKEN_LIGHT = 'broken_light',
DENT = 'dent',
DIRT = 'dirt',
HUBCAP_SCRATCH = 'hubcap_scratch',
MISSHAPE = 'misshape',
MISSING_HUBCAP = 'missing_hubcap',
MISSING_PIECE = 'missing_piece',
PAINT_PEELING = 'paint_peeling',
RUSTINESS = 'rustiness',
SCATTERED_SCRATCHES = 'scattered_scratches',
SCRATCH = 'scratch',
SMASH = 'smash',
LIGHT_REFLECTION = 'light_reflection',
SHADOW = 'shadow',
CAR_CURVE = 'car_curve',
}