تخطَّ إلى المحتوى
CADCAMFUN
الوثائق

الوثائق

تكاليف الإنتاج

التقديرات وطلبات الحساب وتكاليف المواد وتكاليف التشغيل وسجلات استخدام الأدوات.

مترجم تلقائيًا من الإنجليزية. عرض الأصل بالإنجليزية

ساحة التجربة

أرسل هذه الطلبات إلى السايدكار الخاصة بك. تبقى القيم في هذا المتصفح.

غير متصل
كيف يعمل هذا

يستمع السايدكار إلى منفذ الاسترجاع الذي تم اختياره عند بدء التشغيل ويطبعه في منفذ الاسترجاع الخاص به ready خط؛ استخدم عنوان URL هذا و CADCAMFUN_TOKEN لقد بدأ مع. تذهب الطلبات مباشرة من هذه الصفحة إلى هذا العنوان.

يرسل السايدكار رؤوس CORS فقط إلى أصول Tauri وإلى http://localhost أو http://127.0.0.1 على أي منفذ. من المستندات المستضافة، يحظر المتصفح الاستجابة، لذا قم بتشغيل المستندات محليًا (bun run dev في packages/web) لاستخدام الملعب، أو نسخ الطلب كحليقة. للتجربة دون لمس البيانات الحقيقية، ابدأ تشغيل السايدكار باستخدام CADCAMFUN_DATA_DIR أشار إلى دليل مهمل - انظر إرشادات واجهة برمجة التطبيقات.

العمليات

21 نقاط نهاية في production-costs المجموعة التي تم إنشاؤها من السايدكار مستند OpenAPI. تأخذ العمليات المحمية Authorization: Bearer $CADCAMFUN_TOKEN; يرى المصادقة. السلوك والحدود موجودة دليل النظام الفرعي.

يحصل /api/production-costs/estimates production-costs.listEstimates
بريد /api/production-costs/estimates production-costs.createEstimate
يحصل /api/production-costs/estimates/{id} production-costs.getEstimate
يضع /api/production-costs/estimates/{id} production-costs.updateEstimate
يمسح /api/production-costs/estimates/{id} production-costs.deleteEstimate
بريد /api/production-costs/estimates/calculate production-costs.calculateEstimate
يحصل /api/production-costs/material-costs production-costs.listMaterialCosts
بريد /api/production-costs/material-costs production-costs.createMaterialCost
يحصل /api/production-costs/material-costs/{id} production-costs.getMaterialCost
يضع /api/production-costs/material-costs/{id} production-costs.updateMaterialCost
يمسح /api/production-costs/material-costs/{id} production-costs.deleteMaterialCost
يحصل /api/production-costs/operation-costs production-costs.listOperationCosts
بريد /api/production-costs/operation-costs production-costs.createOperationCost
يحصل /api/production-costs/operation-costs/{id} production-costs.getOperationCost
يضع /api/production-costs/operation-costs/{id} production-costs.updateOperationCost
يمسح /api/production-costs/operation-costs/{id} production-costs.deleteOperationCost
يحصل /api/production-costs/tool-wear production-costs.listToolWear
بريد /api/production-costs/tool-wear production-costs.createToolWear
يحصل /api/production-costs/tool-wear/{id} production-costs.getToolWear
يضع /api/production-costs/tool-wear/{id} production-costs.updateToolWear
يمسح /api/production-costs/tool-wear/{id} production-costs.deleteToolWear
عمليات تكاليف الإنتاج في 3د اسحب إلى المدار · قم بالتمرير للتكبير · اسحب بزر الماوس الأيمن للتحريك
كتلة واحدة لكل عملية (21)، مكدسة لكل قسم موارد في هذه الصفحة وملونة حسب الطريقة: GET الأخضر، POST البرتقالي، PUT الأزرق، PATCH البنفسجي، DELETE الأحمر. تم إنشاؤها من مستند OpenAPI في وقت الإنشاء.

/api/production-costs/estimates

يحصل /api/production-costs/estimates # production-costs.listEstimates

يتطلب Authorization: Bearer <token>.

حدود
اسمفييكتبمطلوب
toolpathId استفسار خيط | null خياري
projectId استفسار خيط | null خياري
organizationId استفسار "باطل" | خيط | null خياري
الردود
200 صفيف <كائن> application/json
Array<{
  id: string
  createdAt: string
  updatedAt: string
  materialCost: number | "Infinity" | "-Infinity" | "NaN"
  toolWearCost: number | "Infinity" | "-Infinity" | "NaN"
  machineTime: number | "Infinity" | "-Infinity" | "NaN"
  machineTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  operatorTime: number | "Infinity" | "-Infinity" | "NaN"
  operatorTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  setupCost: number | "Infinity" | "-Infinity" | "NaN"
  totalCost: number | "Infinity" | "-Infinity" | "NaN"
  currencyCode: string
  ownerId: string | null
  organizationId: string | null
  toolpathId: string
  details: unknown
  operationCostId: string | null
  costSettingsId?: string | null
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
  } | null
  toolpath: {
    id: string
    name: string
    projectId?: string | null
  }
  operationCost: {
    id: string
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
    currencyCode: string
    name: string
    machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
    operatorHourlyRate: number | "NaN"
    setupTime: number | "NaN"
  } | null
}>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
رد المثال تم الالتقاط · 200
احصل على /api/production-costs/estiates
[]
مثال SDK
production-costs.listEstimates
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsListEstimatesInput
const result = await client["production-costs"].listEstimates({})
curl
احصل على /api/production-costs/estiates
curl --request GET "${CADCAMFUN_URL}/api/production-costs/estimates" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
جربه
بريد /api/production-costs/estimates # production-costs.createEstimate

يتطلب Authorization: Bearer <token>.

نص الطلب · مطلوب · application/json
{
  toolpathId: string
  totalCost: number | "Infinity" | "-Infinity" | "NaN"
  materialCost?: number | "Infinity" | "-Infinity" | "NaN" | null
  toolWearCost?: number | "Infinity" | "-Infinity" | "NaN" | null
  machineTime?: number | "Infinity" | "-Infinity" | "NaN" | null
  machineTimeCost?: number | "Infinity" | "-Infinity" | "NaN" | null
  operatorTime?: number | "Infinity" | "-Infinity" | "NaN" | null
  operatorTimeCost?: number | "Infinity" | "-Infinity" | "NaN" | null
  setupCost?: number | "Infinity" | "-Infinity" | "NaN" | null
  currencyCode?: string | null
  details?: unknown | null
  operationCostId?: string | null
  costSettingsId?: string | null
  organizationId?: string | null
}
الردود
201 هدف application/json
{
  id: string
  createdAt: string
  updatedAt: string
  materialCost: number | "Infinity" | "-Infinity" | "NaN"
  toolWearCost: number | "Infinity" | "-Infinity" | "NaN"
  machineTime: number | "Infinity" | "-Infinity" | "NaN"
  machineTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  operatorTime: number | "Infinity" | "-Infinity" | "NaN"
  operatorTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  setupCost: number | "Infinity" | "-Infinity" | "NaN"
  totalCost: number | "Infinity" | "-Infinity" | "NaN"
  currencyCode: string
  ownerId: string | null
  organizationId: string | null
  toolpathId: string
  details: unknown
  operationCostId: string | null
  costSettingsId?: string | null
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
  } | null
  toolpath: {
    id: string
    name: string
    projectId?: string | null
  }
  operationCost: {
    id: string
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
    currencyCode: string
    name: string
    machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
    operatorHourlyRate: number | "NaN"
    setupTime: number | "NaN"
  } | null
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
مثال SDK
production-costs.createEstimate
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsCreateEstimateInput
const result = await client["production-costs"].createEstimate({
  toolpathId: "",
  totalCost: 0,
  materialCost: 0,
  toolWearCost: 0,
  machineTime: 0,
  machineTimeCost: 0,
  operatorTime: 0,
  operatorTimeCost: 0,
  setupCost: 0,
  currencyCode: "",
  details: null,
  operationCostId: "",
  costSettingsId: "",
  organizationId: ""
})
curl
POST /api/production-costs/estiates
curl --request POST "${CADCAMFUN_URL}/api/production-costs/estimates" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
جربه
يحصل /api/production-costs/estimates/{id} # production-costs.getEstimate

يتطلب Authorization: Bearer <token>.

حدود
اسمفييكتبمطلوب
بطاقة تعريف طريق خيط مطلوب
الردود
200 هدف application/json
{
  id: string
  createdAt: string
  updatedAt: string
  materialCost: number | "Infinity" | "-Infinity" | "NaN"
  toolWearCost: number | "Infinity" | "-Infinity" | "NaN"
  machineTime: number | "Infinity" | "-Infinity" | "NaN"
  machineTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  operatorTime: number | "Infinity" | "-Infinity" | "NaN"
  operatorTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  setupCost: number | "Infinity" | "-Infinity" | "NaN"
  totalCost: number | "Infinity" | "-Infinity" | "NaN"
  currencyCode: string
  ownerId: string | null
  organizationId: string | null
  toolpathId: string
  details: unknown
  operationCostId: string | null
  costSettingsId?: string | null
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
  } | null
  toolpath: {
    id: string
    name: string
    projectId?: string | null
  }
  operationCost: {
    id: string
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
    currencyCode: string
    name: string
    machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
    operatorHourlyRate: number | "NaN"
    setupTime: number | "NaN"
  } | null
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
مثال SDK
production-costs.getEstimate
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsGetEstimateInput
const result = await client["production-costs"].getEstimate({
  id: "<id>"
})
curl
الحصول على /api/production-costs/estiates/{id}
curl --request GET "${CADCAMFUN_URL}/api/production-costs/estimates/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
جربه
يضع /api/production-costs/estimates/{id} # production-costs.updateEstimate

يتطلب Authorization: Bearer <token>.

حدود
اسمفييكتبمطلوب
بطاقة تعريف طريق خيط مطلوب
نص الطلب · مطلوب · application/json
{
  currencyCode?: string | null
  details?: unknown | null
  notes?: string | null
}
الردود
200 هدف application/json
{
  id: string
  createdAt: string
  updatedAt: string
  materialCost: number | "Infinity" | "-Infinity" | "NaN"
  toolWearCost: number | "Infinity" | "-Infinity" | "NaN"
  machineTime: number | "Infinity" | "-Infinity" | "NaN"
  machineTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  operatorTime: number | "Infinity" | "-Infinity" | "NaN"
  operatorTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  setupCost: number | "Infinity" | "-Infinity" | "NaN"
  totalCost: number | "Infinity" | "-Infinity" | "NaN"
  currencyCode: string
  ownerId: string | null
  organizationId: string | null
  toolpathId: string
  details: unknown
  operationCostId: string | null
  costSettingsId?: string | null
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
  } | null
  toolpath: {
    id: string
    name: string
    projectId?: string | null
  }
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
مثال SDK
production-costs.updateEstimate
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsUpdateEstimateInput
const result = await client["production-costs"].updateEstimate({
  id: "<id>",
  currencyCode: "",
  details: null,
  notes: ""
})
curl
PUT /api/production-costs/estiates/{id}
curl --request PUT "${CADCAMFUN_URL}/api/production-costs/estimates/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
جربه
يمسح /api/production-costs/estimates/{id} # production-costs.deleteEstimate

يتطلب Authorization: Bearer <token>.

حدود
اسمفييكتبمطلوب
بطاقة تعريف طريق خيط مطلوب
الردود
200 هدف application/json
{
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
مثال SDK
production-costs.deleteEstimate
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsDeleteEstimateInput
const result = await client["production-costs"].deleteEstimate({
  id: "<id>"
})
curl
حذف /api/production-costs/estiates/{id}
curl --request DELETE "${CADCAMFUN_URL}/api/production-costs/estimates/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
جربه
بريد /api/production-costs/estimates/calculate # production-costs.calculateEstimate

يتطلب Authorization: Bearer <token>.

نص الطلب · مطلوب · application/json
{
  toolpathId: string
  costSettingsId?: string | null
  organizationId?: string | null
}
الردود
200 هدف application/json
{
  materialCost: number | "Infinity" | "-Infinity" | "NaN"
  toolWearCost: number | "Infinity" | "-Infinity" | "NaN"
  machineTime: number | "Infinity" | "-Infinity" | "NaN"
  machineTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  operatorTime: number | "Infinity" | "-Infinity" | "NaN"
  operatorTimeCost: number | "Infinity" | "-Infinity" | "NaN"
  setupCost: number | "Infinity" | "-Infinity" | "NaN"
  totalCost: number | "Infinity" | "-Infinity" | "NaN"
  currencyCode: string
  ownerId: string | null
  organizationId: string | null
  toolpathId: string
  details: {
    sourceSettingsId?: string | null
    inputs: {
      toolpathId: string
      toolId: string | null
      materialId: string | null
    }
    calculatedValues: {
      totalPathLengthMm: number | "Infinity" | "-Infinity" | "NaN"
      materialVolumeM3: number | "Infinity" | "-Infinity" | "NaN"
      feedRateMmMin: number | "Infinity" | "-Infinity" | "NaN"
      machineTimeMinutes: number | "Infinity" | "-Infinity" | "NaN"
      operatorTimeMinutes: number | "Infinity" | "-Infinity" | "NaN"
      totalSetupTimeMinutes: number | "Infinity" | "-Infinity" | "NaN"
    }
    costBreakdown: {
      material: number | "Infinity" | "-Infinity" | "NaN"
      toolWear: number | "Infinity" | "-Infinity" | "NaN"
      machineRun: number | "Infinity" | "-Infinity" | "NaN"
      operator: number | "Infinity" | "-Infinity" | "NaN"
      setup: number | "Infinity" | "-Infinity" | "NaN"
    }
  }
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
مثال SDK
production-costs.calculateEstimate
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsCalculateEstimateInput
const result = await client["production-costs"].calculateEstimate({
  toolpathId: "",
  costSettingsId: "",
  organizationId: ""
})
curl
POST /api/production-costs/estimates/calculate
curl --request POST "${CADCAMFUN_URL}/api/production-costs/estimates/calculate" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
جربه

/api/production-costs/material-costs

يحصل /api/production-costs/material-costs # production-costs.listMaterialCosts

يتطلب Authorization: Bearer <token>.

حدود
اسمفييكتبمطلوب
materialId استفسار خيط | null خياري
organizationId استفسار "باطل" | خيط | null خياري
الردود
200 صفيف <كائن> application/json
Array<{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  materialId: string
  costPerUnit: number | "Infinity" | "-Infinity" | "NaN"
  wasteFactor: number | "Infinity" | "-Infinity" | "NaN"
  minimumCharge: number | "Infinity" | "-Infinity" | "NaN"
  material: {
    id: string
    name: string
    description: string | null
    properties: unknown
    isPublic: boolean
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
  }
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
  } | null
}>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
رد المثال تم الالتقاط · 200
الحصول على /api/production-costs/material-costs
[]
مثال SDK
production-costs.listMaterialCosts
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsListMaterialCostsInput
const result = await client["production-costs"].listMaterialCosts({})
curl
الحصول على /api/production-costs/material-costs
curl --request GET "${CADCAMFUN_URL}/api/production-costs/material-costs" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
جربه
بريد /api/production-costs/material-costs # production-costs.createMaterialCost

يتطلب Authorization: Bearer <token>.

نص الطلب · مطلوب · application/json
{
  costPerUnit: number | "Infinity" | "-Infinity" | "NaN"
  wasteFactor?: number | "Infinity" | "-Infinity" | "NaN" | null
  minimumCharge?: number | "Infinity" | "-Infinity" | "NaN" | null
  currencyCode?: string | null
  materialId: string
  organizationId?: string | null
}
الردود
201 هدف application/json
{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  materialId: string
  costPerUnit: number | "Infinity" | "-Infinity" | "NaN"
  wasteFactor: number | "Infinity" | "-Infinity" | "NaN"
  minimumCharge: number | "Infinity" | "-Infinity" | "NaN"
  material: {
    id: string
    name: string
    description: string | null
    properties: unknown
    isPublic: boolean
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
  }
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
مثال SDK
production-costs.createMaterialCost
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsCreateMaterialCostInput
const result = await client["production-costs"].createMaterialCost({
  costPerUnit: 0,
  wasteFactor: 0,
  minimumCharge: 0,
  currencyCode: "",
  materialId: "",
  organizationId: ""
})
curl
POST /api/تكاليف الإنتاج/تكاليف المواد
curl --request POST "${CADCAMFUN_URL}/api/production-costs/material-costs" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
جربه
يحصل /api/production-costs/material-costs/{id} # production-costs.getMaterialCost

يتطلب Authorization: Bearer <token>.

حدود
اسمفييكتبمطلوب
بطاقة تعريف طريق خيط مطلوب
الردود
200 كائن | باطل application/json
{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  materialId: string
  costPerUnit: number | "Infinity" | "-Infinity" | "NaN"
  wasteFactor: number | "NaN"
  minimumCharge: number | "NaN"
  material: {
    id: string
    name: string
    description: string | null
    properties: unknown
    isPublic: boolean
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
  }
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
} | null
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
مثال SDK
production-costs.getMaterialCost
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsGetMaterialCostInput
const result = await client["production-costs"].getMaterialCost({
  id: "<id>"
})
curl
الحصول على /api/production-costs/material-costs/{id}
curl --request GET "${CADCAMFUN_URL}/api/production-costs/material-costs/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
جربه
يضع /api/production-costs/material-costs/{id} # production-costs.updateMaterialCost

يتطلب Authorization: Bearer <token>.

حدود
اسمفييكتبمطلوب
بطاقة تعريف طريق خيط مطلوب
نص الطلب · مطلوب · application/json
{
  costPerUnit?: number | "Infinity" | "-Infinity" | "NaN" | null
  wasteFactor?: number | "Infinity" | "-Infinity" | "NaN" | null
  minimumCharge?: number | "Infinity" | "-Infinity" | "NaN" | null
  currencyCode?: string | null
}
الردود
200 هدف application/json
{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  materialId: string
  costPerUnit: number | "Infinity" | "-Infinity" | "NaN"
  wasteFactor: number | "Infinity" | "-Infinity" | "NaN"
  minimumCharge: number | "Infinity" | "-Infinity" | "NaN"
  material: {
    id: string
    name: string
    description: string | null
    properties: unknown
    isPublic: boolean
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
  }
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
مثال SDK
production-costs.updateMaterialCost
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsUpdateMaterialCostInput
const result = await client["production-costs"].updateMaterialCost({
  id: "<id>",
  costPerUnit: 0,
  wasteFactor: 0,
  minimumCharge: 0,
  currencyCode: ""
})
curl
PUT /api/production-costs/material-costs/{id}
curl --request PUT "${CADCAMFUN_URL}/api/production-costs/material-costs/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
جربه
يمسح /api/production-costs/material-costs/{id} # production-costs.deleteMaterialCost

يتطلب Authorization: Bearer <token>.

حدود
اسمفييكتبمطلوب
بطاقة تعريف طريق خيط مطلوب
الردود
200 هدف application/json
{
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
مثال SDK
production-costs.deleteMaterialCost
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsDeleteMaterialCostInput
const result = await client["production-costs"].deleteMaterialCost({
  id: "<id>"
})
curl
حذف /api/production-costs/material-costs/{id}
curl --request DELETE "${CADCAMFUN_URL}/api/production-costs/material-costs/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
جربه

/api/production-costs/operation-costs

يحصل /api/production-costs/operation-costs # production-costs.listOperationCosts

يتطلب Authorization: Bearer <token>.

حدود
اسمفييكتبمطلوب
organizationId استفسار "باطل" | خيط | null خياري
الردود
200 صفيف <كائن> application/json
Array<{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  name: string
  machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
  operatorHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
  setupTime: number | "Infinity" | "-Infinity" | "NaN"
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
  } | null
}>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
رد المثال تم الالتقاط · 200
الحصول على /api/تكاليف الإنتاج/تكاليف التشغيل
[]
مثال SDK
production-costs.listOperationCosts
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsListOperationCostsInput
const result = await client["production-costs"].listOperationCosts({})
curl
الحصول على /api/تكاليف الإنتاج/تكاليف التشغيل
curl --request GET "${CADCAMFUN_URL}/api/production-costs/operation-costs" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
جربه
بريد /api/production-costs/operation-costs # production-costs.createOperationCost

يتطلب Authorization: Bearer <token>.

نص الطلب · مطلوب · application/json
{
  name: string
  machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
  operatorHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
  setupTime?: number | "Infinity" | "-Infinity" | "NaN" | null
  currencyCode?: string | null
  organizationId?: string | null
}
الردود
201 هدف application/json
{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  name: string
  machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
  operatorHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
  setupTime: number | "Infinity" | "-Infinity" | "NaN"
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
  } | null
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
مثال SDK
production-costs.createOperationCost
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsCreateOperationCostInput
const result = await client["production-costs"].createOperationCost({
  name: "",
  machineHourlyRate: 0,
  operatorHourlyRate: 0,
  setupTime: 0,
  currencyCode: "",
  organizationId: ""
})
curl
POST /api/تكاليف الإنتاج/تكاليف التشغيل
curl --request POST "${CADCAMFUN_URL}/api/production-costs/operation-costs" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
جربه
يحصل /api/production-costs/operation-costs/{id} # production-costs.getOperationCost

يتطلب Authorization: Bearer <token>.

حدود
اسمفييكتبمطلوب
بطاقة تعريف طريق خيط مطلوب
الردود
200 كائن | باطل application/json
{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  name: string
  machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
  operatorHourlyRate: number | "NaN"
  setupTime: number | "NaN"
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
} | null
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
مثال SDK
production-costs.getOperationCost
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsGetOperationCostInput
const result = await client["production-costs"].getOperationCost({
  id: "<id>"
})
curl
الحصول على /api/production-costs/operation-costs/{id}
curl --request GET "${CADCAMFUN_URL}/api/production-costs/operation-costs/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
جربه
يضع /api/production-costs/operation-costs/{id} # production-costs.updateOperationCost

يتطلب Authorization: Bearer <token>.

حدود
اسمفييكتبمطلوب
بطاقة تعريف طريق خيط مطلوب
نص الطلب · مطلوب · application/json
{
  name?: string | null
  machineHourlyRate?: number | "Infinity" | "-Infinity" | "NaN" | null
  operatorHourlyRate?: number | "Infinity" | "-Infinity" | "NaN" | null
  setupTime?: number | "Infinity" | "-Infinity" | "NaN" | null
  currencyCode?: string | null
}
الردود
200 هدف application/json
{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  name: string
  machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
  operatorHourlyRate: number | "Infinity" | "-Infinity" | "NaN"
  setupTime: number | "Infinity" | "-Infinity" | "NaN"
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
  } | null
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
مثال SDK
production-costs.updateOperationCost
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsUpdateOperationCostInput
const result = await client["production-costs"].updateOperationCost({
  id: "<id>",
  name: "",
  machineHourlyRate: 0,
  operatorHourlyRate: 0,
  setupTime: 0,
  currencyCode: ""
})
curl
PUT /api/production-costs/operation-costs/{id}
curl --request PUT "${CADCAMFUN_URL}/api/production-costs/operation-costs/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
جربه
يمسح /api/production-costs/operation-costs/{id} # production-costs.deleteOperationCost

يتطلب Authorization: Bearer <token>.

حدود
اسمفييكتبمطلوب
بطاقة تعريف طريق خيط مطلوب
الردود
200 هدف application/json
{
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
مثال SDK
production-costs.deleteOperationCost
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsDeleteOperationCostInput
const result = await client["production-costs"].deleteOperationCost({
  id: "<id>"
})
curl
حذف /api/production-costs/operation-costs/{id}
curl --request DELETE "${CADCAMFUN_URL}/api/production-costs/operation-costs/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
جربه

/api/production-costs/tool-wear

يحصل /api/production-costs/tool-wear # production-costs.listToolWear

يتطلب Authorization: Bearer <token>.

حدود
اسمفييكتبمطلوب
toolId استفسار خيط | null خياري
organizationId استفسار "باطل" | خيط | null خياري
الردود
200 صفيف <كائن> application/json
Array<{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  toolId: string
  wearRatePerMeter: number | "Infinity" | "-Infinity" | "NaN"
  replacementCost: number | "Infinity" | "-Infinity" | "NaN"
  replacementThreshold: number | "Infinity" | "-Infinity" | "NaN"
  tool: {
    id: string
    name: string
    type: string
    diameter: number | "Infinity" | "-Infinity" | "NaN"
    material: string
    numberOfFlutes: number | "Infinity" | "-Infinity" | "NaN" | null
    maxRPM: number | "Infinity" | "-Infinity" | "NaN" | null
    coolantType: string | null
    cuttingLength: number | "Infinity" | "-Infinity" | "NaN" | null
    totalLength: number | "Infinity" | "-Infinity" | "NaN" | null
    shankDiameter: number | "Infinity" | "-Infinity" | "NaN" | null
    cornerRadius?: number | "Infinity" | "-Infinity" | "NaN" | null
    tipAngle?: number | "Infinity" | "-Infinity" | "NaN" | null
    threadPitch?: number | "Infinity" | "-Infinity" | "NaN" | null
    holderDiameter?: number | "Infinity" | "-Infinity" | "NaN" | null
    holderLength?: number | "Infinity" | "-Infinity" | "NaN" | null
    stickout?: number | "Infinity" | "-Infinity" | "NaN" | null
    notes: string | null
    isPublic: boolean
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
  }
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
  } | null
}>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
رد المثال تم الالتقاط · 200
الحصول على /api/production-costs/tool-wear
[]
مثال SDK
production-costs.listToolWear
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsListToolWearInput
const result = await client["production-costs"].listToolWear({})
curl
الحصول على /api/production-costs/tool-wear
curl --request GET "${CADCAMFUN_URL}/api/production-costs/tool-wear" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
جربه
بريد /api/production-costs/tool-wear # production-costs.createToolWear

يتطلب Authorization: Bearer <token>.

نص الطلب · مطلوب · application/json
{
  wearRatePerMeter: number | "Infinity" | "-Infinity" | "NaN"
  replacementCost: number | "Infinity" | "-Infinity" | "NaN"
  replacementThreshold?: number | "Infinity" | "-Infinity" | "NaN" | null
  currencyCode?: string | null
  toolId: string
  organizationId?: string | null
}
الردود
201 هدف application/json
{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  toolId: string
  wearRatePerMeter: number | "Infinity" | "-Infinity" | "NaN"
  replacementCost: number | "Infinity" | "-Infinity" | "NaN"
  replacementThreshold: number | "Infinity" | "-Infinity" | "NaN"
  tool: {
    id: string
    name: string
    type: string
    diameter: number | "Infinity" | "-Infinity" | "NaN"
    material: string
    numberOfFlutes: number | "Infinity" | "-Infinity" | "NaN" | null
    maxRPM: number | "Infinity" | "-Infinity" | "NaN" | null
    coolantType: string | null
    cuttingLength: number | "Infinity" | "-Infinity" | "NaN" | null
    totalLength: number | "Infinity" | "-Infinity" | "NaN" | null
    shankDiameter: number | "Infinity" | "-Infinity" | "NaN" | null
    cornerRadius?: number | "Infinity" | "-Infinity" | "NaN" | null
    tipAngle?: number | "Infinity" | "-Infinity" | "NaN" | null
    threadPitch?: number | "Infinity" | "-Infinity" | "NaN" | null
    holderDiameter?: number | "Infinity" | "-Infinity" | "NaN" | null
    holderLength?: number | "Infinity" | "-Infinity" | "NaN" | null
    stickout?: number | "Infinity" | "-Infinity" | "NaN" | null
    notes: string | null
    isPublic: boolean
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
  }
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
مثال SDK
production-costs.createToolWear
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsCreateToolWearInput
const result = await client["production-costs"].createToolWear({
  wearRatePerMeter: 0,
  replacementCost: 0,
  replacementThreshold: 0,
  currencyCode: "",
  toolId: "",
  organizationId: ""
})
curl
POST /api/production-costs/tool-wear
curl --request POST "${CADCAMFUN_URL}/api/production-costs/tool-wear" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
جربه
يحصل /api/production-costs/tool-wear/{id} # production-costs.getToolWear

يتطلب Authorization: Bearer <token>.

حدود
اسمفييكتبمطلوب
بطاقة تعريف طريق خيط مطلوب
الردود
200 كائن | باطل application/json
{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  toolId: string
  wearRatePerMeter: number | "Infinity" | "-Infinity" | "NaN"
  replacementCost: number | "NaN"
  replacementThreshold: number | "NaN"
  tool: {
    id: string
    name: string
    type: string
    diameter: number | "NaN"
    material: string
    numberOfFlutes: number | "NaN" | null
    maxRPM: number | null
    coolantType: string | null
    cuttingLength: number | null
    totalLength: number | null
    shankDiameter: number | null
    cornerRadius?: number | null
    tipAngle?: number | null
    threadPitch?: number | null
    holderDiameter?: number | null
    holderLength?: number | null
    stickout?: number | null
    notes: string | null
    isPublic: boolean
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
  }
  owner: {
    id: string
    name: string | null
    email?: string | null
  } | null
  organization: {
    id: string
    name: string | null
} | null
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
مثال SDK
production-costs.getToolWear
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsGetToolWearInput
const result = await client["production-costs"].getToolWear({
  id: "<id>"
})
curl
احصل على /api/production-costs/tool-wear/{id}
curl --request GET "${CADCAMFUN_URL}/api/production-costs/tool-wear/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
جربه
يضع /api/production-costs/tool-wear/{id} # production-costs.updateToolWear

يتطلب Authorization: Bearer <token>.

حدود
اسمفييكتبمطلوب
بطاقة تعريف طريق خيط مطلوب
نص الطلب · مطلوب · application/json
{
  wearRatePerMeter?: number | "Infinity" | "-Infinity" | "NaN" | null
  replacementCost?: number | "Infinity" | "-Infinity" | "NaN" | null
  replacementThreshold?: number | "Infinity" | "-Infinity" | "NaN" | null
  currencyCode?: string | null
}
الردود
200 هدف application/json
{
  id: string
  createdAt: string
  updatedAt: string
  ownerId: string | null
  organizationId: string | null
  currencyCode: string
  toolId: string
  wearRatePerMeter: number | "Infinity" | "-Infinity" | "NaN"
  replacementCost: number | "Infinity" | "-Infinity" | "NaN"
  replacementThreshold: number | "Infinity" | "-Infinity" | "NaN"
  tool: {
    id: string
    name: string
    type: string
    diameter: number | "Infinity" | "-Infinity" | "NaN"
    material: string
    numberOfFlutes: number | "Infinity" | "-Infinity" | "NaN" | null
    maxRPM: number | "Infinity" | "-Infinity" | "NaN" | null
    coolantType: string | null
    cuttingLength: number | "Infinity" | "-Infinity" | "NaN" | null
    totalLength: number | "Infinity" | "-Infinity" | "NaN" | null
    shankDiameter: number | "Infinity" | "-Infinity" | "NaN" | null
    cornerRadius?: number | "Infinity" | "-Infinity" | "NaN" | null
    tipAngle?: number | "Infinity" | "-Infinity" | "NaN" | null
    threadPitch?: number | "Infinity" | "-Infinity" | "NaN" | null
    holderDiameter?: number | "Infinity" | "-Infinity" | "NaN" | null
    holderLength?: number | "Infinity" | "-Infinity" | "NaN" | null
    stickout?: number | "Infinity" | "-Infinity" | "NaN" | null
    notes: string | null
    isPublic: boolean
    createdAt: string
    updatedAt: string
    ownerId: string | null
    organizationId: string | null
  }
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
مثال SDK
production-costs.updateToolWear
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsUpdateToolWearInput
const result = await client["production-costs"].updateToolWear({
  id: "<id>",
  wearRatePerMeter: 0,
  replacementCost: 0,
  replacementThreshold: 0,
  currencyCode: ""
})
curl
PUT /api/production-costs/tool-wear/{id}
curl --request PUT "${CADCAMFUN_URL}/api/production-costs/tool-wear/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
جربه
يمسح /api/production-costs/tool-wear/{id} # production-costs.deleteToolWear

يتطلب Authorization: Bearer <token>.

حدود
اسمفييكتبمطلوب
بطاقة تعريف طريق خيط مطلوب
الردود
200 هدف application/json
{
  message: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
مثال SDK
production-costs.deleteToolWear
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// ProductionCostsDeleteToolWearInput
const result = await client["production-costs"].deleteToolWear({
  id: "<id>"
})
curl
حذف /api/production-costs/tool-wear/{id}
curl --request DELETE "${CADCAMFUN_URL}/api/production-costs/tool-wear/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
جربه

المخططات

يمكن الوصول إلى المخططات المسماة من معلمات هذه المجموعة وأجسامها واستجاباتها. أ ? يمثل حقلاً اختياريًا؛ | null يضع علامة على الحقل الذي قد يكون موجودًا بقيمة فارغة.

BadRequestEncoded
{
  _tag: "BadRequest"
  message: string
}
ConflictEncoded
{
  _tag: "Conflict"
  message: string
}
ForbiddenEncoded
{
  _tag: "Forbidden"
  message: string
}
InternalErrorEncoded
{
  _tag: "InternalError"
  message: string
}
NotFoundEncoded
{
  _tag: "NotFound"
  message: string
}
UnauthorizedEncoded
{
  _tag: "Unauthorized"
  message: string
}

استدعاء هذه المجموعة

معرفات العملية لها النموذج production-costs.<name>. وعد SDK الذي تم إنشاؤه (@cadcamfun/api/sdk) يعرض معظمهم client.<namespace>.<method>(input)، أين input هو كائن مسطح واحد من معلمات المسار وحقول النص؛ يُظهر مثال SDK لكل بطاقة الملحق الدقيق ونوع الإدخال. لا يتم إنشاء التحميلات متعددة الأجزاء والاستجابات الثنائية أو استجابات JavaScript وخطافات الويب الأولية؛ تظهر تلك البطاقات fetch بدلاً من ذلك.

أخطاء من Promise SDK
import { CadCam, ClientError } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

try {
  await client.projects.list()
} catch (error) {
  if (error instanceof ClientError) {
    // Transport | UnexpectedStatus | UnsupportedContentType | MalformedResponse | SseEventTooLarge
  } else {
    // a declared error body: switch on error._tag
  }
}

استكشاف الأخطاء وإصلاحها

أعراضالسبب المحتمليصلح
401 في كل طلبرمز مميز من إطلاق سابق، أو مفقود Bearer بادئةيرسل Authorization: Bearer <token> بالرمز المميز الذي بدأت به السايدكار.
400 قبل أن يحدث أي شيءالنص أو المعلمة لا يتطابقان مع المخططقارن الحمولة بمخطط الطلب الموجود على البطاقة.
403 أو 404 لسجل يمكنك رؤيته في مكان آخرحساب التمثيل يختلفأرسل الحق x-session-tokenأو استخدم ملف التعريف المحلي الذي يملك السجل.
409حالة متعارضة، مثل اسم مكرر أو رأس فرع قديمأعد قراءة المورد وأعد المحاولة باستخدام البيانات الحالية.
جربه يقول "تم حظره بواسطة CORS"يتم تقديم المستندات من أصل غير استرجاعيقم بتشغيل المستندات محليًا أو انسخ الطلب كـ curly.
رفض اتصالتم إعادة تشغيل السايدكار في منفذ جديدقراءة المنفذ من الجديد ready سطر.