{"openapi":"3.1.0","info":{"title":"Setota Import Export API","version":"0.1.0","description":"REST API behind the ERP and Solar apps.\n\n**Authenticate:** `POST /api/v1/auth/login` with `{ email, password }` returns `{ token, expiresAt, user }`. Click **Authorize** and paste the token; every other call sends it as `Authorization: Bearer <token>`.\n\nLists accept `page`, `pageSize`, `q`, `sort` and their filters, and answer `{ data, meta: { page, pageSize, total, pages } }`. Decimals travel as strings. Errors are `{ error, message, details? }`."},"servers":[{"url":"https://api.setotaimportexport.com","description":"This server"}],"tags":[{"name":"Admin & access"},{"name":"Assets"},{"name":"CRM"},{"name":"Catalog & inventory"},{"name":"Dashboard"},{"name":"Expense claims"},{"name":"Expenses"},{"name":"Files & uploads"},{"name":"Finance"},{"name":"Fleet"},{"name":"HR & payroll"},{"name":"Ledger & statements"},{"name":"Notifications"},{"name":"Procurement"},{"name":"Solar distribution"},{"name":"Support"},{"name":"System"},{"name":"Tenders"},{"name":"Trade (imports, exports, shipments)"},{"name":"chat"},{"name":"process"},{"name":"reports"}],"paths":{"/health":{"get":{"tags":["System"],"operationId":"getHealth","summary":"GET /health","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}}},"security":[]}},"/api/v1/auth/login":{"post":{"tags":["Admin & access"],"operationId":"postAuthLogin","summary":"POST /auth/login","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"password":{"type":"string","minLength":1}},"required":["email","password"]}}}}}},"/api/v1/public/complaints":{"post":{"tags":["System"],"operationId":"postPublicComplaints","summary":"POST /public/complaints","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":8}},"required":["files"]}}}}}},"/api/v1/public/complaints/status":{"post":{"tags":["System"],"operationId":"postPublicComplaintsStatus","summary":"POST /public/complaints/status","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}},"/api/v1/files/{key}":{"get":{"tags":["Files & uploads"],"operationId":"getFilesByKey","summary":"GET /files/{key}","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"Storage key (may contain slashes)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}},"/api/v1/auth/logout":{"post":{"tags":["Admin & access"],"operationId":"postAuthLogout","summary":"POST /auth/logout","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/auth/me":{"get":{"tags":["Admin & access"],"operationId":"getAuthMe","summary":"GET /auth/me","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/auth/me/preferences":{"put":{"tags":["Admin & access"],"operationId":"putAuthMePreferences","summary":"PUT /auth/me/preferences","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"theme":{"type":"string","enum":["light","dark","system"]},"appearance":{"type":"object","properties":{"radius":{"type":"string","enum":["none","small","default","large"]},"scale":{"type":"string","enum":["compact","default","large"]},"font":{"type":"string","enum":["figtree","system"]}}},"notifications":{"type":"object","properties":{"sound":{"type":"boolean"},"volume":{"type":"number","minimum":0,"maximum":1}}}}}}}}}},"/api/v1/admin/system":{"get":{"tags":["reports"],"operationId":"getAdminSystem","summary":"GET /admin/system","description":"Requires the **Administration:View** permission.","x-permission":"Administration:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/system/jobs/{name}/run":{"post":{"tags":["reports"],"operationId":"postAdminSystemJobsByNameRun","summary":"POST /admin/system/jobs/{name}/run","description":"Requires the **Administration:Edit** permission.","x-permission":"Administration:Edit","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/security":{"get":{"tags":["reports"],"operationId":"getAdminSecurity","summary":"GET /admin/security","description":"Requires the **Administration:View** permission.","x-permission":"Administration:View","parameters":[{"name":"days","in":"query","required":false,"schema":{"default":7,"type":"integer","minimum":1,"maximum":90}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/security/sessions/{id}":{"delete":{"tags":["reports"],"operationId":"deleteAdminSecuritySessionsById","summary":"DELETE /admin/security/sessions/{id}","description":"Requires the **Administration:Edit** permission.","x-permission":"Administration:Edit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/security/locks/clear":{"post":{"tags":["reports"],"operationId":"postAdminSecurityLocksClear","summary":"POST /admin/security/locks/clear","description":"Requires the **Administration:Edit** permission.","x-permission":"Administration:Edit","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":320}},"required":["key"]}}}}}},"/api/v1/admin/users":{"get":{"tags":["Admin & access"],"operationId":"getAdminUsers","summary":"GET /admin/users","description":"Requires the **Administration:View** permission.","x-permission":"Administration:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: name, email, createdAt, lastLoginAt.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"status","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"kind","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"roleId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"branchId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"departmentId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"dealerId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Admin & access"],"operationId":"postAdminUsers","summary":"POST /admin/users","description":"Requires the **Administration:Create** permission.","x-permission":"Administration:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","minLength":1},"phone":{"type":"string","minLength":1},"kind":{"default":"Internal","type":"string","enum":["Internal","External"]},"roleId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dealerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organization":{"type":"string","minLength":1},"departmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"branchId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"password":{"type":"string","minLength":10}},"required":["email","name","roleId"]}}}}}},"/api/v1/admin/users/{key}":{"get":{"tags":["Admin & access"],"operationId":"getAdminUsersByKey","summary":"GET /admin/users/{key}","description":"Requires the **Administration:View** permission.","x-permission":"Administration:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Admin & access"],"operationId":"patchAdminUsersByKey","summary":"PATCH /admin/users/{key}","description":"Requires the **Administration:Edit** permission.","x-permission":"Administration:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"phone":{"type":"string","minLength":1},"kind":{"default":"Internal","type":"string","enum":["Internal","External"]},"roleId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dealerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"organization":{"type":"string","minLength":1},"departmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"branchId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["Active","Invited","Suspended","Deactivated"]},"mfaEnabled":{"type":"boolean"}}}}}}}},"/api/v1/admin/users/{key}/password":{"post":{"tags":["Admin & access"],"operationId":"postAdminUsersByKeyPassword","summary":"POST /admin/users/{key}/password","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","minLength":10}},"required":["password"]}}}}}},"/api/v1/admin/roles":{"get":{"tags":["Admin & access"],"operationId":"getAdminRoles","summary":"GET /admin/roles","description":"Requires the **Administration:View** permission.","x-permission":"Administration:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"kind","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"scope","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Admin & access"],"operationId":"postAdminRoles","summary":"POST /admin/roles","description":"Requires the **Administration:Create** permission.","x-permission":"Administration:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"default":"","type":"string"},"kind":{"default":"Internal","type":"string","enum":["Internal","External"]},"scope":{"default":"AllRecords","type":"string","enum":["AllRecords","OwnBranch","OwnRecords","DealerNetwork","AssignedProgram"]},"pendingDefinition":{"default":false,"type":"boolean"}},"required":["name"]}}}}}},"/api/v1/admin/roles/{key}":{"get":{"tags":["Admin & access"],"operationId":"getAdminRolesByKey","summary":"GET /admin/roles/{key}","description":"Requires the **Administration:View** permission.","x-permission":"Administration:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Admin & access"],"operationId":"patchAdminRolesByKey","summary":"PATCH /admin/roles/{key}","description":"Requires the **Administration:Edit** permission.","x-permission":"Administration:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"default":"","type":"string"},"kind":{"default":"Internal","type":"string","enum":["Internal","External"]},"scope":{"default":"AllRecords","type":"string","enum":["AllRecords","OwnBranch","OwnRecords","DealerNetwork","AssignedProgram"]},"pendingDefinition":{"default":false,"type":"boolean"}}}}}}},"delete":{"tags":["Admin & access"],"operationId":"deleteAdminRolesByKey","summary":"DELETE /admin/roles/{key}","description":"Requires the **Administration:DeleteCancel** permission.","x-permission":"Administration:DeleteCancel","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done (no content)"},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/admin/roles/{key}/permissions":{"put":{"tags":["Admin & access"],"operationId":"putAdminRolesByKeyPermissions","summary":"PUT /admin/roles/{key}/permissions","description":"Requires the **Administration:Edit** permission.","x-permission":"Administration:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"permissions":{"type":"array","items":{"type":"object","properties":{"module":{"type":"string","enum":["Dashboard","Imports","Exports","Shipments","CustomsDocs","Inventory","Products","Procurement","SolarDistribution","HouseholdRecords","InvoicesPayments","LoansFinancing","Crm","Partners","Tenders","Support","HrPayroll","Fleet","Assets","Reports","Settings","Administration"]},"action":{"type":"string","enum":["View","Create","Edit","Submit","Approve","DeleteCancel","Export","ViewAmounts"]}},"required":["module","action"]}}},"required":["permissions"]}}}}}},"/api/v1/admin/workflows":{"get":{"tags":["Admin & access"],"operationId":"getAdminWorkflows","summary":"GET /admin/workflows","description":"Requires the **Administration:View** permission.","x-permission":"Administration:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"module","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"active","in":"query","description":"Exact match (boolean); comma-separate values for \"any of\".","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Admin & access"],"operationId":"postAdminWorkflows","summary":"POST /admin/workflows","description":"Requires the **Administration:Create** permission.","x-permission":"Administration:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"module":{"type":"string","enum":["Dashboard","Imports","Exports","Shipments","CustomsDocs","Inventory","Products","Procurement","SolarDistribution","HouseholdRecords","InvoicesPayments","LoansFinancing","Crm","Partners","Tenders","Support","HrPayroll","Fleet","Assets","Reports","Settings","Administration"]},"requiredAttachments":{"default":[],"type":"array","items":{"type":"string","minLength":1}},"escalationHours":{"default":24,"type":"integer","minimum":1,"maximum":9007199254740991},"active":{"default":true,"type":"boolean"}},"required":["code","name","module"]}}}}}},"/api/v1/admin/workflows/{key}":{"get":{"tags":["Admin & access"],"operationId":"getAdminWorkflowsByKey","summary":"GET /admin/workflows/{key}","description":"Requires the **Administration:View** permission.","x-permission":"Administration:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Admin & access"],"operationId":"patchAdminWorkflowsByKey","summary":"PATCH /admin/workflows/{key}","description":"Requires the **Administration:Edit** permission.","x-permission":"Administration:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"module":{"type":"string","enum":["Dashboard","Imports","Exports","Shipments","CustomsDocs","Inventory","Products","Procurement","SolarDistribution","HouseholdRecords","InvoicesPayments","LoansFinancing","Crm","Partners","Tenders","Support","HrPayroll","Fleet","Assets","Reports","Settings","Administration"]},"requiredAttachments":{"default":[],"type":"array","items":{"type":"string","minLength":1}},"escalationHours":{"default":24,"type":"integer","minimum":1,"maximum":9007199254740991},"active":{"default":true,"type":"boolean"}}}}}}}},"/api/v1/admin/workflows/{key}/levels":{"put":{"tags":["Admin & access"],"operationId":"putAdminWorkflowsByKeyLevels","summary":"PUT /admin/workflows/{key}/levels","description":"Requires the **Administration:Edit** permission.","x-permission":"Administration:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"levels":{"minItems":1,"type":"array","items":{"type":"object","properties":{"roleId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"threshold":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]}},"required":["roleId"]}},"requiredAttachments":{"type":"array","items":{"type":"string","minLength":1}},"escalationHours":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["levels"]}}}}}},"/api/v1/admin/approvals":{"get":{"tags":["Admin & access"],"operationId":"getAdminApprovals","summary":"GET /admin/approvals","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Admin & access"],"operationId":"postAdminApprovals","summary":"POST /admin/approvals","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"workflowCode":{"type":"string","minLength":1},"entity":{"type":"string","enum":["ImportOrder","ExportOrder","CustomsDeclaration","Requisition","PurchaseOrderPayment","Quotation","Loan","OvertimeEntry","LaborAssignment","PayrollRun","SolarDealer","AssetDisposal","Tender","Expense","ExpenseClaim"]},"entityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]}},"required":["workflowCode","entity","entityId"]}}}}}},"/api/v1/admin/approvals/{id}/decide":{"post":{"tags":["Admin & access"],"operationId":"postAdminApprovalsByIdDecide","summary":"POST /admin/approvals/{id}/decide","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"approved":{"type":"boolean"},"comment":{"type":"string","minLength":1}},"required":["approved"]}}}}}},"/api/v1/admin/audit":{"get":{"tags":["Admin & access"],"operationId":"getAdminAudit","summary":"GET /admin/audit","description":"Requires the **Administration:View** permission.","x-permission":"Administration:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/chat/contacts":{"get":{"tags":["chat"],"operationId":"getChatContacts","summary":"GET /chat/contacts","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/chat/unread":{"get":{"tags":["chat"],"operationId":"getChatUnread","summary":"GET /chat/unread","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/chat/conversations":{"get":{"tags":["chat"],"operationId":"getChatConversations","summary":"GET /chat/conversations","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["chat"],"operationId":"postChatConversations","summary":"POST /chat/conversations","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["userId"]}}}}}},"/api/v1/chat/conversations/{id}/messages":{"get":{"tags":["chat"],"operationId":"getChatConversationsByIdMessages","summary":"GET /chat/conversations/{id}/messages","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"before","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"limit","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["chat"],"operationId":"postChatConversationsByIdMessages","summary":"POST /chat/conversations/{id}/messages","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":4000},"clientId":{"type":"string","minLength":8,"maxLength":64}},"required":["body"]}}}}}},"/api/v1/chat/conversations/{id}/read":{"post":{"tags":["chat"],"operationId":"postChatConversationsByIdRead","summary":"POST /chat/conversations/{id}/read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/organization":{"get":{"tags":["Admin & access"],"operationId":"getOrganization","summary":"GET /organization","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Admin & access"],"operationId":"putOrganization","summary":"PUT /organization","description":"Requires the **Settings:Edit** permission.","x-permission":"Settings:Edit","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"legalName":{"type":"string","minLength":1},"tin":{"type":"string","minLength":1},"vatNumber":{"type":"string","minLength":1},"eori":{"type":"string","minLength":1},"baseCurrency":{"type":"string","minLength":3,"maxLength":3},"defaultIncoterm":{"type":"string","enum":["EXW","FCA","FOB","CFR","CIF","DAP","DDP"]},"timezone":{"type":"string","minLength":1}}}}}}}},"/api/v1/settings":{"get":{"tags":["Admin & access"],"operationId":"getSettings","summary":"GET /settings","description":"Requires the **Settings:View** permission.","x-permission":"Settings:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/settings/{key}":{"get":{"tags":["Admin & access"],"operationId":"getSettingsByKey","summary":"GET /settings/{key}","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Admin & access"],"operationId":"putSettingsByKey","summary":"PUT /settings/{key}","description":"Requires the **Settings:Edit** permission.","x-permission":"Settings:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"$ref":"#/$defs/__schema0"}},"required":["value"],"$defs":{"__schema0":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/$defs/__schema0"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/$defs/__schema0"}}]}}}}}}}},"/api/v1/lookups/{type}":{"get":{"tags":["Admin & access"],"operationId":"getLookupsByType","summary":"GET /lookups/{type}","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Admin & access"],"operationId":"postLookupsByType","summary":"POST /lookups/{type}","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"type":"string","minLength":2,"maxLength":60},"sortOrder":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["value"]}}}}}},"/api/v1/branches":{"get":{"tags":["Admin & access"],"operationId":"getBranches","summary":"GET /branches","description":"Requires the **Settings:View** permission.","x-permission":"Settings:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"active","in":"query","description":"Exact match (boolean); comma-separate values for \"any of\".","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Admin & access"],"operationId":"postBranches","summary":"POST /branches","description":"Requires the **Settings:Create** permission.","x-permission":"Settings:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"active":{"type":"boolean"},"city":{"type":"string","minLength":1}},"required":["name"]}}}}}},"/api/v1/branches/{key}":{"get":{"tags":["Admin & access"],"operationId":"getBranchesByKey","summary":"GET /branches/{key}","description":"Requires the **Settings:View** permission.","x-permission":"Settings:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Admin & access"],"operationId":"patchBranchesByKey","summary":"PATCH /branches/{key}","description":"Requires the **Settings:Edit** permission.","x-permission":"Settings:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"active":{"type":"boolean"},"city":{"type":"string","minLength":1}}}}}}}},"/api/v1/departments":{"get":{"tags":["Admin & access"],"operationId":"getDepartments","summary":"GET /departments","description":"Requires the **Settings:View** permission.","x-permission":"Settings:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"active","in":"query","description":"Exact match (boolean); comma-separate values for \"any of\".","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Admin & access"],"operationId":"postDepartments","summary":"POST /departments","description":"Requires the **Settings:Create** permission.","x-permission":"Settings:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"active":{"type":"boolean"}},"required":["name"]}}}}}},"/api/v1/departments/{key}":{"get":{"tags":["Admin & access"],"operationId":"getDepartmentsByKey","summary":"GET /departments/{key}","description":"Requires the **Settings:View** permission.","x-permission":"Settings:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Admin & access"],"operationId":"patchDepartmentsByKey","summary":"PATCH /departments/{key}","description":"Requires the **Settings:Edit** permission.","x-permission":"Settings:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"active":{"type":"boolean"}}}}}}}},"/api/v1/exchange-rates":{"get":{"tags":["Admin & access"],"operationId":"getExchangeRates","summary":"GET /exchange-rates","description":"Requires the **Settings:View** permission.","x-permission":"Settings:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending.","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"base","in":"query","description":"Exact match (string); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"quote","in":"query","description":"Exact match (string); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Admin & access"],"operationId":"postExchangeRates","summary":"POST /exchange-rates","description":"Requires the **Settings:Create** permission.","x-permission":"Settings:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"base":{"type":"string","minLength":3,"maxLength":3},"quote":{"type":"string","minLength":3,"maxLength":3},"date":{},"rate":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"source":{"type":"string","minLength":1}},"required":["base","quote","date","rate"]}}}}}},"/api/v1/exchange-rates/{key}":{"get":{"tags":["Admin & access"],"operationId":"getExchangeRatesByKey","summary":"GET /exchange-rates/{key}","description":"Requires the **Settings:View** permission.","x-permission":"Settings:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Admin & access"],"operationId":"patchExchangeRatesByKey","summary":"PATCH /exchange-rates/{key}","description":"Requires the **Settings:Edit** permission.","x-permission":"Settings:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"base":{"type":"string","minLength":3,"maxLength":3},"quote":{"type":"string","minLength":3,"maxLength":3},"date":{},"rate":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"source":{"type":"string","minLength":1}}}}}}},"delete":{"tags":["Admin & access"],"operationId":"deleteExchangeRatesByKey","summary":"DELETE /exchange-rates/{key}","description":"Requires the **Settings:DeleteCancel** permission.","x-permission":"Settings:DeleteCancel","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done (no content)"},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/attachments":{"post":{"tags":["Admin & access"],"operationId":"postAttachments","summary":"POST /attachments","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"},"purpose":{"type":"string","enum":["Installation","Inspection","WarrantyClaim","TransferDispute","CustomsDocument","AssetDocument","MaintenanceInvoice","DisposalEvidence","TicketEvidence","SupplierDocument","SupplierInvoice","VerificationReport","TenderDocument","VehicleMaintenanceInvoice","ExpenseReceipt","StockEvidence","ProcessEvidence","Other"]},"owner":{"type":"object","properties":{"type":{"type":"string","enum":["solarUnitId","warrantyClaimId","transferId","verificationReportId","customsDocumentId","assetId","assetMaintenanceId","assetDisposalId","supportTicketId","supplierDocumentId","supplierInvoiceId","tenderId"]},"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["type","id"]}},"required":["fileName","storageKey","purpose","owner"]}}}}}},"/api/v1/attachments/{id}":{"get":{"tags":["Admin & access"],"operationId":"getAttachmentsById","summary":"GET /attachments/{id}","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Admin & access"],"operationId":"deleteAttachmentsById","summary":"DELETE /attachments/{id}","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/uploads":{"post":{"tags":["Files & uploads"],"operationId":"postUploads","summary":"POST /uploads","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"},"maxItems":8}},"required":["files"]}}}}}},"/api/v1/notifications":{"get":{"tags":["Notifications"],"operationId":"getNotifications","summary":"GET /notifications","parameters":[{"name":"unread","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/notifications/read-all":{"post":{"tags":["Notifications"],"operationId":"postNotificationsReadAll","summary":"POST /notifications/read-all","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/notifications/test":{"post":{"tags":["Notifications"],"operationId":"postNotificationsTest","summary":"POST /notifications/test","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/notifications/{id}/read":{"post":{"tags":["Notifications"],"operationId":"postNotificationsByIdRead","summary":"POST /notifications/{id}/read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/push/public-key":{"get":{"tags":["Notifications"],"operationId":"getPushPublicKey","summary":"GET /push/public-key","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/push/subscriptions":{"post":{"tags":["Notifications"],"operationId":"postPushSubscriptions","summary":"POST /push/subscriptions","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"string","format":"uri"},"keys":{"type":"object","properties":{"p256dh":{"type":"string","minLength":20},"auth":{"type":"string","minLength":8}},"required":["p256dh","auth"]}},"required":["endpoint","keys"]}}}}},"delete":{"tags":["Notifications"],"operationId":"deletePushSubscriptions","summary":"DELETE /push/subscriptions","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/dashboard/summary":{"get":{"tags":["Dashboard"],"operationId":"getDashboardSummary","summary":"GET /dashboard/summary","description":"Requires the **Dashboard:View** permission.","x-permission":"Dashboard:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/stock-counts":{"get":{"tags":["Catalog & inventory"],"operationId":"getStockCounts","summary":"GET /stock-counts","description":"Requires the **Inventory:View** permission.","x-permission":"Inventory:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Catalog & inventory"],"operationId":"postStockCounts","summary":"POST /stock-counts","description":"Requires the **Inventory:Create** permission.","x-permission":"Inventory:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"warehouseId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"blind":{"default":true,"type":"boolean"},"note":{"type":"string","minLength":1},"categoryIds":{"default":[],"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"productIds":{"default":[],"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["warehouseId"]}}}}}},"/api/v1/stock-counts/{key}":{"get":{"tags":["Catalog & inventory"],"operationId":"getStockCountsByKey","summary":"GET /stock-counts/{key}","description":"Requires the **Inventory:View** permission.","x-permission":"Inventory:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/stock-counts/{key}/start":{"post":{"tags":["Catalog & inventory"],"operationId":"postStockCountsByKeyStart","summary":"POST /stock-counts/{key}/start","description":"Requires the **Inventory:Create** permission.","x-permission":"Inventory:Create","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/stock-counts/{key}/lines":{"post":{"tags":["Catalog & inventory"],"operationId":"postStockCountsByKeyLines","summary":"POST /stock-counts/{key}/lines","description":"Requires the **Inventory:Create** permission.","x-permission":"Inventory:Create","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["productId"]}}}}}},"/api/v1/stock-counts/{key}/lines/{line}":{"patch":{"tags":["Catalog & inventory"],"operationId":"patchStockCountsByKeyLinesByLine","summary":"PATCH /stock-counts/{key}/lines/{line}","description":"Requires the **Inventory:Create** permission.","x-permission":"Inventory:Create","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"line","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"countedQty":{"anyOf":[{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},{"type":"null"}]},"excluded":{"type":"boolean"},"reason":{"type":"string","minLength":1}}}}}}}},"/api/v1/stock-counts/{key}/submit":{"post":{"tags":["Catalog & inventory"],"operationId":"postStockCountsByKeySubmit","summary":"POST /stock-counts/{key}/submit","description":"Requires the **Inventory:Create** permission.","x-permission":"Inventory:Create","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/stock-counts/{key}/reject":{"post":{"tags":["Catalog & inventory"],"operationId":"postStockCountsByKeyReject","summary":"POST /stock-counts/{key}/reject","description":"Requires the **Inventory:Approve** permission.","x-permission":"Inventory:Approve","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1}},"required":["reason"]}}}}}},"/api/v1/stock-counts/{key}/post":{"post":{"tags":["Catalog & inventory"],"operationId":"postStockCountsByKeyPost","summary":"POST /stock-counts/{key}/post","description":"Requires the **Inventory:Approve** permission.","x-permission":"Inventory:Approve","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/stock-counts/{key}/cancel":{"post":{"tags":["Catalog & inventory"],"operationId":"postStockCountsByKeyCancel","summary":"POST /stock-counts/{key}/cancel","description":"Requires the **Inventory:Approve** permission.","x-permission":"Inventory:Approve","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1}},"required":["reason"]}}}}}},"/api/v1/product-categories":{"get":{"tags":["Catalog & inventory"],"operationId":"getProductCategories","summary":"GET /product-categories","description":"Requires the **Products:View** permission.","x-permission":"Products:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"kind","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"active","in":"query","description":"Exact match (boolean); comma-separate values for \"any of\".","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Catalog & inventory"],"operationId":"postProductCategories","summary":"POST /product-categories","description":"Requires the **Products:Create** permission.","x-permission":"Products:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["TradeGoods","SolarProduct"]},"name":{"type":"string","minLength":2,"maxLength":80},"hsCode":{"type":"string","minLength":1},"active":{"default":true,"type":"boolean"}},"required":["kind","name"]}}}}}},"/api/v1/product-categories/{key}":{"get":{"tags":["Catalog & inventory"],"operationId":"getProductCategoriesByKey","summary":"GET /product-categories/{key}","description":"Requires the **Products:View** permission.","x-permission":"Products:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Catalog & inventory"],"operationId":"patchProductCategoriesByKey","summary":"PATCH /product-categories/{key}","description":"Requires the **Products:Edit** permission.","x-permission":"Products:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["TradeGoods","SolarProduct"]},"name":{"type":"string","minLength":2,"maxLength":80},"hsCode":{"type":"string","minLength":1},"active":{"default":true,"type":"boolean"}}}}}}}},"/api/v1/products":{"get":{"tags":["Catalog & inventory"],"operationId":"getProducts","summary":"GET /products","description":"Requires the **Products:View** permission.","x-permission":"Products:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: sku, name, listPrice, createdAt.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"kind","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"status","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"categoryId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"serialTracked","in":"query","description":"Exact match (boolean); comma-separate values for \"any of\".","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Catalog & inventory"],"operationId":"postProducts","summary":"POST /products","description":"Requires the **Products:Create** permission.","x-permission":"Products:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string","pattern":"^[A-Z0-9][A-Z0-9-]{2,19}$"},"name":{"type":"string","minLength":1},"kind":{"type":"string","enum":["TradeGoods","SolarProduct"]},"categoryId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"hsCode":{"type":"string","pattern":"^\\d{4}\\.\\d{2}(\\.\\d{2,4})?$"},"unit":{"type":"string","minLength":1},"listPrice":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"dutyRate":{"type":"number","minimum":0,"maximum":1},"serialTracked":{"default":false,"type":"boolean"},"status":{"default":"Active","type":"string","enum":["Active","Discontinued"]},"manufacturer":{"type":"string","minLength":1},"wattPeak":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"lightPoints":{"type":"integer","minimum":0,"maximum":9007199254740991},"warrantyYears":{"type":"integer","minimum":1,"maximum":30},"serialPrefix":{"type":"string","pattern":"^[A-Z0-9]{2,8}$"}},"required":["sku","name","kind","categoryId","hsCode","unit","listPrice","currency","dutyRate"]}}}}}},"/api/v1/products/{key}":{"get":{"tags":["Catalog & inventory"],"operationId":"getProductsByKey","summary":"GET /products/{key}","description":"Requires the **Products:View** permission.","x-permission":"Products:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Catalog & inventory"],"operationId":"patchProductsByKey","summary":"PATCH /products/{key}","description":"Requires the **Products:Edit** permission.","x-permission":"Products:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"categoryId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"hsCode":{"type":"string","pattern":"^\\d{4}\\.\\d{2}(\\.\\d{2,4})?$"},"unit":{"type":"string","minLength":1},"currency":{"type":"string","minLength":3,"maxLength":3},"dutyRate":{"type":"number","minimum":0,"maximum":1},"serialTracked":{"default":false,"type":"boolean"},"status":{"default":"Active","type":"string","enum":["Active","Discontinued"]},"manufacturer":{"type":"string","minLength":1},"wattPeak":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"lightPoints":{"type":"integer","minimum":0,"maximum":9007199254740991},"warrantyYears":{"type":"integer","minimum":1,"maximum":30},"serialPrefix":{"type":"string","pattern":"^[A-Z0-9]{2,8}$"}}}}}}}},"/api/v1/products/{key}/price":{"post":{"tags":["Catalog & inventory"],"operationId":"postProductsByKeyPrice","summary":"POST /products/{key}/price","description":"Requires the **Products:Edit** permission.","x-permission":"Products:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"listPrice":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"standardCost":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"reason":{"type":"string","minLength":3},"effectiveOn":{}},"required":["reason"]}}}}}},"/api/v1/products/{key}/price-history":{"get":{"tags":["Catalog & inventory"],"operationId":"getProductsByKeyPriceHistory","summary":"GET /products/{key}/price-history","description":"Requires the **Products:View** permission.","x-permission":"Products:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products/{key}/duplicate":{"post":{"tags":["Catalog & inventory"],"operationId":"postProductsByKeyDuplicate","summary":"POST /products/{key}/duplicate","description":"Requires the **Products:Create** permission.","x-permission":"Products:Create","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string","pattern":"^[A-Z0-9][A-Z0-9-]{2,19}$"},"name":{"type":"string","minLength":1},"serialPrefix":{"type":"string","pattern":"^[A-Z0-9]{2,8}$"}},"required":["sku","name"]}}}}}},"/api/v1/products/{key}/discontinue":{"post":{"tags":["Catalog & inventory"],"operationId":"postProductsByKeyDiscontinue","summary":"POST /products/{key}/discontinue","description":"Requires the **Products:Edit** permission.","x-permission":"Products:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3}},"required":["reason"]}}}}}},"/api/v1/products/{key}/reactivate":{"post":{"tags":["Catalog & inventory"],"operationId":"postProductsByKeyReactivate","summary":"POST /products/{key}/reactivate","description":"Requires the **Products:Edit** permission.","x-permission":"Products:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products/{key}/archive":{"post":{"tags":["Catalog & inventory"],"operationId":"postProductsByKeyArchive","summary":"POST /products/{key}/archive","description":"Requires the **Products:DeleteCancel** permission.","x-permission":"Products:DeleteCancel","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products/{key}/unarchive":{"post":{"tags":["Catalog & inventory"],"operationId":"postProductsByKeyUnarchive","summary":"POST /products/{key}/unarchive","description":"Requires the **Products:Edit** permission.","x-permission":"Products:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products/{key}/movements":{"get":{"tags":["Catalog & inventory"],"operationId":"getProductsByKeyMovements","summary":"GET /products/{key}/movements","description":"Requires the **Inventory:View** permission.","x-permission":"Inventory:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/products/{key}/profitability":{"get":{"tags":["Catalog & inventory"],"operationId":"getProductsByKeyProfitability","summary":"GET /products/{key}/profitability","description":"Requires the **Products:ViewAmounts** permission.","x-permission":"Products:ViewAmounts","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{}},{"name":"to","in":"query","required":false,"schema":{}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/warehouses":{"get":{"tags":["Catalog & inventory"],"operationId":"getWarehouses","summary":"GET /warehouses","description":"Requires the **Inventory:View** permission.","x-permission":"Inventory:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"active","in":"query","description":"Exact match (boolean); comma-separate values for \"any of\".","schema":{"type":"boolean"}},{"name":"bonded","in":"query","description":"Exact match (boolean); comma-separate values for \"any of\".","schema":{"type":"boolean"}},{"name":"branchId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Catalog & inventory"],"operationId":"postWarehouses","summary":"POST /warehouses","description":"Requires the **Inventory:Create** permission.","x-permission":"Inventory:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^[A-Z0-9-]{2,12}$"},"name":{"type":"string","minLength":1},"branchId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"city":{"type":"string","minLength":1},"bonded":{"default":false,"type":"boolean"},"active":{"default":true,"type":"boolean"}},"required":["code","name"]}}}}}},"/api/v1/warehouses/{key}":{"get":{"tags":["Catalog & inventory"],"operationId":"getWarehousesByKey","summary":"GET /warehouses/{key}","description":"Requires the **Inventory:View** permission.","x-permission":"Inventory:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Catalog & inventory"],"operationId":"patchWarehousesByKey","summary":"PATCH /warehouses/{key}","description":"Requires the **Inventory:Edit** permission.","x-permission":"Inventory:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"branchId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"city":{"type":"string","minLength":1},"bonded":{"default":false,"type":"boolean"},"active":{"default":true,"type":"boolean"}}}}}}}},"/api/v1/stock-levels":{"get":{"tags":["Catalog & inventory"],"operationId":"getStockLevels","summary":"GET /stock-levels","description":"Requires the **Inventory:View** permission.","x-permission":"Inventory:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/stock-movements":{"get":{"tags":["Catalog & inventory"],"operationId":"getStockMovements","summary":"GET /stock-movements","description":"Requires the **Inventory:View** permission.","x-permission":"Inventory:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Catalog & inventory"],"operationId":"postStockMovements","summary":"POST /stock-movements","description":"Requires the **Inventory:Create** permission.","x-permission":"Inventory:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"warehouseId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","enum":["Receipt","Issue","TransferIn","TransferOut","Adjustment","WriteOff","CustomerReturn","SupplierReturn","Reservation","Release"]},"quantity":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"unitCost":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"reference":{"type":"string","minLength":1},"note":{"type":"string","minLength":1},"reason":{"type":"string","minLength":1},"files":{"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}},"required":["productId","warehouseId","type","quantity"]}}}}}},"/api/v1/stock-transfers":{"post":{"tags":["Catalog & inventory"],"operationId":"postStockTransfers","summary":"POST /stock-transfers","description":"Requires the **Inventory:Create** permission.","x-permission":"Inventory:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"fromWarehouseId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"toWarehouseId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"quantity":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"reason":{"type":"string","minLength":1},"reference":{"type":"string","minLength":1}},"required":["productId","fromWarehouseId","toWarehouseId","quantity","reason"]}}}}}},"/api/v1/export-lots":{"post":{"tags":["process"],"operationId":"postExportLots","summary":"POST /export-lots","description":"Requires the **Exports:Edit** permission.","x-permission":"Exports:Edit","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"commodity":{"type":"string","minLength":1},"purchaseMethod":{"type":"string","enum":["VerticalFarming","ECX","ContractFarming"]},"warehouseLocation":{"type":"string","enum":["Gondar","AddisAbaba"]},"paymentTerm":{"type":"string","enum":["LC","CAD","TT"]},"quantity":{"type":"number","exclusiveMinimum":0},"unit":{"type":"string","maxLength":20},"note":{"type":"string","maxLength":2000}},"required":["commodity","purchaseMethod","warehouseLocation"],"additionalProperties":false}}}}}},"/api/v1/export-lots/{key}/link":{"post":{"tags":["process"],"operationId":"postExportLotsByKeyLink","summary":"POST /export-lots/{key}/link","description":"Requires the **Exports:Edit** permission.","x-permission":"Exports:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"orderCode":{"type":"string","minLength":1}},"required":["orderCode"]}}}}}},"/api/v1/export-lots/{key}/process":{"get":{"tags":["process"],"operationId":"getExportLotsByKeyProcess","summary":"GET /export-lots/{key}/process","description":"Requires the **Exports:View** permission.","x-permission":"Exports:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["process"],"operationId":"putExportLotsByKeyProcess","summary":"PUT /export-lots/{key}/process","description":"Requires the **Exports:Edit** permission.","x-permission":"Exports:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"paymentTerm":{"type":"string","enum":["LC","TT","Advance","CAD"]},"transport":{"type":"string","enum":["Vessel","DjiboutiTruck","Air"]},"incoterm":{"type":"string","enum":["FOB","CFR","FCA","CPT"]},"clearance":{"type":"string","enum":["Unimodal","Multimodal"]},"marginPercent":{"type":"number","minimum":0,"maximum":70}},"required":["paymentTerm","transport","incoterm","clearance"],"additionalProperties":false},{"type":"object","properties":{"commodity":{"type":"string","minLength":1},"purchaseMethod":{"type":"string","enum":["VerticalFarming","ECX","ContractFarming"]},"warehouseLocation":{"type":"string","enum":["Gondar","AddisAbaba"]},"paymentTerm":{"type":"string","enum":["LC","CAD","TT"]}},"required":["commodity","purchaseMethod","warehouseLocation"],"additionalProperties":false}]}}}}}},"/api/v1/export-lots/{key}/process/steps/{step}":{"patch":{"tags":["process"],"operationId":"patchExportLotsByKeyProcessStepsByStep","summary":"PATCH /export-lots/{key}/process/steps/{step}","description":"Requires the **Exports:Edit** permission.","x-permission":"Exports:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"step","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["Pending","InProgress","Done","Skipped","Blocked"]},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"assigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"dueOn":{"anyOf":[{},{"type":"null"}]},"data":{"type":"object","properties":{"reference":{"type":"string","maxLength":120},"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"riskChannel":{"type":"string","enum":["Green","Yellow","Red"]}}},"skipReason":{"type":"string","minLength":3},"reopenReason":{"type":"string","minLength":3}}}}}}}},"/api/v1/export-lots/{key}/process/steps/{step}/evidence":{"post":{"tags":["process"],"operationId":"postExportLotsByKeyProcessStepsByStepEvidence","summary":"POST /export-lots/{key}/process/steps/{step}/evidence","description":"Requires the **Exports:Edit** permission.","x-permission":"Exports:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"step","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"files":{"minItems":1,"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}},"required":["files"]}}}}}},"/api/v1/import-orders/{key}/process":{"get":{"tags":["process"],"operationId":"getImportOrdersByKeyProcess","summary":"GET /import-orders/{key}/process","description":"Requires the **Imports:View** permission.","x-permission":"Imports:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["process"],"operationId":"postImportOrdersByKeyProcess","summary":"POST /import-orders/{key}/process","description":"Requires the **Imports:Edit** permission.","x-permission":"Imports:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"paymentTerm":{"type":"string","enum":["LC","TT","Advance","CAD"]},"transport":{"type":"string","enum":["Vessel","DjiboutiTruck","Air"]},"incoterm":{"type":"string","enum":["FOB","CFR","FCA","CPT"]},"clearance":{"type":"string","enum":["Unimodal","Multimodal"]},"marginPercent":{"type":"number","minimum":0,"maximum":70}},"required":["paymentTerm","transport","incoterm","clearance"],"additionalProperties":false},{"type":"object","properties":{"commodity":{"type":"string","minLength":1},"purchaseMethod":{"type":"string","enum":["VerticalFarming","ECX","ContractFarming"]},"warehouseLocation":{"type":"string","enum":["Gondar","AddisAbaba"]},"paymentTerm":{"type":"string","enum":["LC","CAD","TT"]}},"required":["commodity","purchaseMethod","warehouseLocation"],"additionalProperties":false}]}}}}},"put":{"tags":["process"],"operationId":"putImportOrdersByKeyProcess","summary":"PUT /import-orders/{key}/process","description":"Requires the **Imports:Edit** permission.","x-permission":"Imports:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"paymentTerm":{"type":"string","enum":["LC","TT","Advance","CAD"]},"transport":{"type":"string","enum":["Vessel","DjiboutiTruck","Air"]},"incoterm":{"type":"string","enum":["FOB","CFR","FCA","CPT"]},"clearance":{"type":"string","enum":["Unimodal","Multimodal"]},"marginPercent":{"type":"number","minimum":0,"maximum":70}},"required":["paymentTerm","transport","incoterm","clearance"],"additionalProperties":false},{"type":"object","properties":{"commodity":{"type":"string","minLength":1},"purchaseMethod":{"type":"string","enum":["VerticalFarming","ECX","ContractFarming"]},"warehouseLocation":{"type":"string","enum":["Gondar","AddisAbaba"]},"paymentTerm":{"type":"string","enum":["LC","CAD","TT"]}},"required":["commodity","purchaseMethod","warehouseLocation"],"additionalProperties":false}]}}}}}},"/api/v1/import-orders/{key}/process/steps/{step}":{"patch":{"tags":["process"],"operationId":"patchImportOrdersByKeyProcessStepsByStep","summary":"PATCH /import-orders/{key}/process/steps/{step}","description":"Requires the **Imports:Edit** permission.","x-permission":"Imports:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"step","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["Pending","InProgress","Done","Skipped","Blocked"]},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"assigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"dueOn":{"anyOf":[{},{"type":"null"}]},"data":{"type":"object","properties":{"reference":{"type":"string","maxLength":120},"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"riskChannel":{"type":"string","enum":["Green","Yellow","Red"]}}},"skipReason":{"type":"string","minLength":3},"reopenReason":{"type":"string","minLength":3}}}}}}}},"/api/v1/import-orders/{key}/process/steps/{step}/evidence":{"post":{"tags":["process"],"operationId":"postImportOrdersByKeyProcessStepsByStepEvidence","summary":"POST /import-orders/{key}/process/steps/{step}/evidence","description":"Requires the **Imports:Edit** permission.","x-permission":"Imports:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"step","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"files":{"minItems":1,"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}},"required":["files"]}}}}}},"/api/v1/export-orders/{key}/process":{"get":{"tags":["process"],"operationId":"getExportOrdersByKeyProcess","summary":"GET /export-orders/{key}/process","description":"Requires the **Exports:View** permission.","x-permission":"Exports:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["process"],"operationId":"postExportOrdersByKeyProcess","summary":"POST /export-orders/{key}/process","description":"Requires the **Exports:Edit** permission.","x-permission":"Exports:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"paymentTerm":{"type":"string","enum":["LC","TT","Advance","CAD"]},"transport":{"type":"string","enum":["Vessel","DjiboutiTruck","Air"]},"incoterm":{"type":"string","enum":["FOB","CFR","FCA","CPT"]},"clearance":{"type":"string","enum":["Unimodal","Multimodal"]},"marginPercent":{"type":"number","minimum":0,"maximum":70}},"required":["paymentTerm","transport","incoterm","clearance"],"additionalProperties":false},{"type":"object","properties":{"commodity":{"type":"string","minLength":1},"purchaseMethod":{"type":"string","enum":["VerticalFarming","ECX","ContractFarming"]},"warehouseLocation":{"type":"string","enum":["Gondar","AddisAbaba"]},"paymentTerm":{"type":"string","enum":["LC","CAD","TT"]}},"required":["commodity","purchaseMethod","warehouseLocation"],"additionalProperties":false}]}}}}},"put":{"tags":["process"],"operationId":"putExportOrdersByKeyProcess","summary":"PUT /export-orders/{key}/process","description":"Requires the **Exports:Edit** permission.","x-permission":"Exports:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"paymentTerm":{"type":"string","enum":["LC","TT","Advance","CAD"]},"transport":{"type":"string","enum":["Vessel","DjiboutiTruck","Air"]},"incoterm":{"type":"string","enum":["FOB","CFR","FCA","CPT"]},"clearance":{"type":"string","enum":["Unimodal","Multimodal"]},"marginPercent":{"type":"number","minimum":0,"maximum":70}},"required":["paymentTerm","transport","incoterm","clearance"],"additionalProperties":false},{"type":"object","properties":{"commodity":{"type":"string","minLength":1},"purchaseMethod":{"type":"string","enum":["VerticalFarming","ECX","ContractFarming"]},"warehouseLocation":{"type":"string","enum":["Gondar","AddisAbaba"]},"paymentTerm":{"type":"string","enum":["LC","CAD","TT"]}},"required":["commodity","purchaseMethod","warehouseLocation"],"additionalProperties":false}]}}}}}},"/api/v1/export-orders/{key}/process/steps/{step}":{"patch":{"tags":["process"],"operationId":"patchExportOrdersByKeyProcessStepsByStep","summary":"PATCH /export-orders/{key}/process/steps/{step}","description":"Requires the **Exports:Edit** permission.","x-permission":"Exports:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"step","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["Pending","InProgress","Done","Skipped","Blocked"]},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"assigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"dueOn":{"anyOf":[{},{"type":"null"}]},"data":{"type":"object","properties":{"reference":{"type":"string","maxLength":120},"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"riskChannel":{"type":"string","enum":["Green","Yellow","Red"]}}},"skipReason":{"type":"string","minLength":3},"reopenReason":{"type":"string","minLength":3}}}}}}}},"/api/v1/export-orders/{key}/process/steps/{step}/evidence":{"post":{"tags":["process"],"operationId":"postExportOrdersByKeyProcessStepsByStepEvidence","summary":"POST /export-orders/{key}/process/steps/{step}/evidence","description":"Requires the **Exports:Edit** permission.","x-permission":"Exports:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"step","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"files":{"minItems":1,"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}},"required":["files"]}}}}}},"/api/v1/processes":{"get":{"tags":["process"],"operationId":"getProcesses","summary":"GET /processes","parameters":[{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["Import","Export"]}},{"name":"stage","in":"query","required":false,"schema":{"type":"string"}},{"name":"assignedToMe","in":"query","required":false,"schema":{"type":"string"}},{"name":"overdue","in":"query","required":false,"schema":{"type":"string"}},{"name":"blocked","in":"query","required":false,"schema":{"type":"string"}},{"name":"includeCompleted","in":"query","required":false,"schema":{"type":"string"}},{"name":"includeNotStarted","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/reports":{"get":{"tags":["reports"],"operationId":"getReports","summary":"GET /reports","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/reports/analytics":{"get":{"tags":["reports"],"operationId":"getReportsAnalytics","summary":"GET /reports/analytics","description":"Requires the **Dashboard:View** permission.","x-permission":"Dashboard:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/reports/{id}":{"get":{"tags":["reports"],"operationId":"getReportsById","summary":"GET /reports/{id}","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"asOf","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"warehouseId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"region","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":3650}},{"name":"export","in":"query","required":false,"schema":{"type":"string","enum":["csv","xlsx"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/stock-levels/{id}/reorder-point":{"put":{"tags":["reports"],"operationId":"putStockLevelsByIdReorderPoint","summary":"PUT /stock-levels/{id}/reorder-point","description":"Requires the **Inventory:Edit** permission.","x-permission":"Inventory:Edit","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reorderPoint":{"type":"number","minimum":0,"maximum":1000000000}},"required":["reorderPoint"]}}}}}},"/api/v1/partners":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getPartners","summary":"GET /partners","description":"Requires the **Partners:View** permission.","x-permission":"Partners:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: name, since, rating, createdAt.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"type","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"status","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"country","in":"query","description":"Exact match (string); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"category","in":"query","description":"Exact match (string); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Trade (imports, exports, shipments)"],"operationId":"postPartners","summary":"POST /partners","description":"Requires the **Partners:Create** permission.","x-permission":"Partners:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["Supplier","Customer"]},"country":{"type":"string","minLength":1},"city":{"type":"string","minLength":1},"port":{"type":"string","minLength":1},"contactName":{"type":"string","minLength":1},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","minLength":1},"category":{"type":"string","minLength":1},"paymentTerms":{"type":"string","minLength":1},"status":{"default":"PendingKyc","type":"string","enum":["Verified","PendingKyc","Expired","Suspended"]},"kycExpiresAt":{},"rating":{"default":0,"type":"number","minimum":0,"maximum":5},"since":{}},"required":["name","type","country","city","contactName","email","category","paymentTerms","since"]}}}}}},"/api/v1/partners/{key}":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getPartnersByKey","summary":"GET /partners/{key}","description":"Requires the **Partners:View** permission.","x-permission":"Partners:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Trade (imports, exports, shipments)"],"operationId":"patchPartnersByKey","summary":"PATCH /partners/{key}","description":"Requires the **Partners:Edit** permission.","x-permission":"Partners:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["Supplier","Customer"]},"country":{"type":"string","minLength":1},"city":{"type":"string","minLength":1},"port":{"type":"string","minLength":1},"contactName":{"type":"string","minLength":1},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","minLength":1},"category":{"type":"string","minLength":1},"paymentTerms":{"type":"string","minLength":1},"status":{"default":"PendingKyc","type":"string","enum":["Verified","PendingKyc","Expired","Suspended"]},"kycExpiresAt":{},"rating":{"default":0,"type":"number","minimum":0,"maximum":5},"since":{}}}}}}}},"/api/v1/import-orders":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getImportOrders","summary":"GET /import-orders","description":"Requires the **Imports:View** permission.","x-permission":"Imports:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: code, orderDate, eta, status, createdAt.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"status","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"supplierId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"incoterm","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"ownerId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"shipmentId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Trade (imports, exports, shipments)"],"operationId":"postImportOrders","summary":"POST /import-orders","description":"Requires the **Imports:Create** permission.","x-permission":"Imports:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"supplierId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"incoterm":{"type":"string","enum":["EXW","FCA","FOB","CFR","CIF","DAP","DDP"]},"currency":{"type":"string","minLength":3,"maxLength":3},"originPortId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"destinationPortId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"orderDate":{},"eta":{},"ownerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"lines":{"minItems":1,"type":"array","items":{"type":"object","properties":{"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"quantity":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"unitPrice":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"hsCode":{"type":"string","minLength":1},"unit":{"type":"string","minLength":1}},"required":["productId","quantity","unitPrice"]}}},"required":["supplierId","incoterm","currency","orderDate","lines"]}}}}}},"/api/v1/import-orders/{key}":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getImportOrdersByKey","summary":"GET /import-orders/{key}","description":"Requires the **Imports:View** permission.","x-permission":"Imports:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Trade (imports, exports, shipments)"],"operationId":"patchImportOrdersByKey","summary":"PATCH /import-orders/{key}","description":"Requires the **Imports:Edit** permission.","x-permission":"Imports:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"supplierId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"incoterm":{"type":"string","enum":["EXW","FCA","FOB","CFR","CIF","DAP","DDP"]},"currency":{"type":"string","minLength":3,"maxLength":3},"originPortId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"destinationPortId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"orderDate":{},"eta":{},"ownerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"shipmentId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}}}}}}}},"/api/v1/import-orders/{key}/status":{"post":{"tags":["Trade (imports, exports, shipments)"],"operationId":"postImportOrdersByKeyStatus","summary":"POST /import-orders/{key}/status","description":"Requires the **Imports:Edit** permission.","x-permission":"Imports:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["Draft","PendingApproval","Confirmed","InTransit","AtPort","CustomsHold","Cleared","Delivered","Cancelled"]},"shipmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"processOverride":{"type":"string","minLength":3}},"required":["status"]}}}}}},"/api/v1/import-orders/{key}/receive":{"post":{"tags":["Trade (imports, exports, shipments)"],"operationId":"postImportOrdersByKeyReceive","summary":"POST /import-orders/{key}/receive","description":"Requires the **Inventory:Create** permission.","x-permission":"Inventory:Create","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"warehouseId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"receivedOn":{},"lines":{"minItems":1,"type":"array","items":{"type":"object","properties":{"lineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"quantity":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]}},"required":["lineId","quantity"]}}},"required":["warehouseId","lines"]}}}}}},"/api/v1/import-orders/{key}/costing":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getImportOrdersByKeyCosting","summary":"GET /import-orders/{key}/costing","description":"Requires the **Products:ViewAmounts** permission.","x-permission":"Products:ViewAmounts","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/import-orders/{key}/costing/close":{"post":{"tags":["Trade (imports, exports, shipments)"],"operationId":"postImportOrdersByKeyCostingClose","summary":"POST /import-orders/{key}/costing/close","description":"Requires the **Imports:Edit** permission.","x-permission":"Imports:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"force":{"default":false,"type":"boolean"},"reason":{"type":"string","minLength":1}}}}}}}},"/api/v1/import-orders/{key}/costing/reopen":{"post":{"tags":["Trade (imports, exports, shipments)"],"operationId":"postImportOrdersByKeyCostingReopen","summary":"POST /import-orders/{key}/costing/reopen","description":"Requires the **Imports:Approve** permission.","x-permission":"Imports:Approve","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/import-orders/{key}/costing/apply-prices":{"post":{"tags":["Trade (imports, exports, shipments)"],"operationId":"postImportOrdersByKeyCostingApplyPrices","summary":"POST /import-orders/{key}/costing/apply-prices","description":"Requires the **Products:Edit** permission.","x-permission":"Products:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1},"lines":{"minItems":1,"type":"array","items":{"type":"object","properties":{"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"markupPercent":{"type":"number","exclusiveMinimum":-100,"exclusiveMaximum":10000}},"required":["productId","markupPercent"]}}},"required":["lines"]}}}}}},"/api/v1/export-orders":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getExportOrders","summary":"GET /export-orders","description":"Requires the **Exports:View** permission.","x-permission":"Exports:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: code, orderDate, etd, status, createdAt.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"status","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"customerId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"incoterm","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"ownerId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Trade (imports, exports, shipments)"],"operationId":"postExportOrders","summary":"POST /export-orders","description":"Requires the **Exports:Create** permission.","x-permission":"Exports:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"incoterm":{"type":"string","enum":["EXW","FCA","FOB","CFR","CIF","DAP","DDP"]},"currency":{"type":"string","minLength":3,"maxLength":3},"paymentTerms":{"type":"string","minLength":1},"originPortId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"destinationPortId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"destinationCountry":{"type":"string","minLength":1},"orderDate":{},"etd":{},"ownerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"lines":{"minItems":1,"type":"array","items":{"type":"object","properties":{"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"quantity":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"unitPrice":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"hsCode":{"type":"string","minLength":1},"unit":{"type":"string","minLength":1}},"required":["productId","quantity","unitPrice"]}}},"required":["customerId","incoterm","currency","paymentTerms","destinationCountry","orderDate","lines"]}}}}}},"/api/v1/export-orders/{key}":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getExportOrdersByKey","summary":"GET /export-orders/{key}","description":"Requires the **Exports:View** permission.","x-permission":"Exports:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Trade (imports, exports, shipments)"],"operationId":"patchExportOrdersByKey","summary":"PATCH /export-orders/{key}","description":"Requires the **Exports:Edit** permission.","x-permission":"Exports:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"incoterm":{"type":"string","enum":["EXW","FCA","FOB","CFR","CIF","DAP","DDP"]},"currency":{"type":"string","minLength":3,"maxLength":3},"paymentTerms":{"type":"string","minLength":1},"originPortId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"destinationPortId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"destinationCountry":{"type":"string","minLength":1},"orderDate":{},"etd":{},"ownerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"docsReady":{"type":"integer","minimum":0,"maximum":9007199254740991},"shipmentId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}}}}}}}},"/api/v1/export-orders/{key}/status":{"post":{"tags":["Trade (imports, exports, shipments)"],"operationId":"postExportOrdersByKeyStatus","summary":"POST /export-orders/{key}/status","description":"Requires the **Exports:Edit** permission.","x-permission":"Exports:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["Draft","AwaitingPayment","InProduction","Packing","ReadyToShip","Shipped","Delivered","Cancelled"]},"shipmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"processOverride":{"type":"string","minLength":3}},"required":["status"]}}}}}},"/api/v1/export-orders/{key}/costing":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getExportOrdersByKeyCosting","summary":"GET /export-orders/{key}/costing","description":"Requires the **Products:ViewAmounts** permission.","x-permission":"Products:ViewAmounts","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/shipments":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getShipments","summary":"GET /shipments","description":"Requires the **Shipments:View** permission.","x-permission":"Shipments:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: code, etd, eta, status, createdAt.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"status","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"direction","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"mode","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"partnerId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"carrierId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Trade (imports, exports, shipments)"],"operationId":"postShipments","summary":"POST /shipments","description":"Requires the **Shipments:Create** permission.","x-permission":"Shipments:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"direction":{"type":"string","enum":["Import","Export"]},"mode":{"type":"string","enum":["Ocean","Air","Road","Rail"]},"carrierId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"vessel":{"type":"string","minLength":1},"bookingReference":{"type":"string","minLength":1},"containerNumbers":{"default":[],"type":"array","items":{"type":"string","pattern":"^[A-Z]{4}\\d{7}$"}},"partnerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"originPortId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"destinationPortId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"etd":{},"eta":{},"packages":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"weightKg":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"value":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["direction","mode","partnerId"]}}}}}},"/api/v1/shipments/{key}":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getShipmentsByKey","summary":"GET /shipments/{key}","description":"Requires the **Shipments:View** permission.","x-permission":"Shipments:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Trade (imports, exports, shipments)"],"operationId":"patchShipmentsByKey","summary":"PATCH /shipments/{key}","description":"Requires the **Shipments:Edit** permission.","x-permission":"Shipments:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"direction":{"type":"string","enum":["Import","Export"]},"mode":{"type":"string","enum":["Ocean","Air","Road","Rail"]},"carrierId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"vessel":{"type":"string","minLength":1},"bookingReference":{"type":"string","minLength":1},"containerNumbers":{"default":[],"type":"array","items":{"type":"string","pattern":"^[A-Z]{4}\\d{7}$"}},"partnerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"originPortId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"destinationPortId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"etd":{},"eta":{},"packages":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"weightKg":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"value":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"exception":{"type":["string","null"]}}}}}}}},"/api/v1/shipments/{key}/status":{"post":{"tags":["Trade (imports, exports, shipments)"],"operationId":"postShipmentsByKeyStatus","summary":"POST /shipments/{key}/status","description":"Requires the **Shipments:Edit** permission.","x-permission":"Shipments:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["Booked","Departed","InTransit","Delayed","Arrived","InCustoms","OutForDelivery","Delivered"]},"exception":{"type":"string","minLength":1},"at":{}},"required":["status"]}}}}}},"/api/v1/shipments/{key}/milestones":{"post":{"tags":["Trade (imports, exports, shipments)"],"operationId":"postShipmentsByKeyMilestones","summary":"POST /shipments/{key}/milestones","description":"Requires the **Shipments:Edit** permission.","x-permission":"Shipments:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1},"location":{"type":"string","minLength":1},"plannedAt":{},"actualAt":{},"state":{"default":"Upcoming","type":"string","enum":["Done","Current","Upcoming","Issue"]}},"required":["label","location"]}}}}}},"/api/v1/shipments/{key}/milestones/{seq}":{"patch":{"tags":["Trade (imports, exports, shipments)"],"operationId":"patchShipmentsByKeyMilestonesBySeq","summary":"PATCH /shipments/{key}/milestones/{seq}","description":"Requires the **Shipments:Edit** permission.","x-permission":"Shipments:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"seq","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1},"location":{"type":"string","minLength":1},"plannedAt":{},"actualAt":{},"state":{"default":"Upcoming","type":"string","enum":["Done","Current","Upcoming","Issue"]}}}}}}}},"/api/v1/customs":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getCustoms","summary":"GET /customs","description":"Requires the **CustomsDocs:View** permission.","x-permission":"CustomsDocs:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: code, submittedAt, status, declaredValue, createdAt.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"status","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"direction","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"channel","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"brokerId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"shipmentId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Trade (imports, exports, shipments)"],"operationId":"postCustoms","summary":"POST /customs","description":"Requires the **CustomsDocs:Create** permission.","x-permission":"CustomsDocs:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mrn":{"type":"string","minLength":1},"direction":{"type":"string","enum":["Import","Export"]},"shipmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"brokerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"portId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"hsCode":{"type":"string","pattern":"^\\d{4}\\.\\d{2}(\\.\\d{2,4})?$"},"lineCount":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"declaredValue":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"duty":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"vat":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"documents":{"default":["Commercial invoice","Packing list","Bill of lading","Certificate of origin"],"type":"array","items":{"type":"string","minLength":1}}},"required":["direction","shipmentId","hsCode","declaredValue"]}}}}}},"/api/v1/customs/{key}":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getCustomsByKey","summary":"GET /customs/{key}","description":"Requires the **CustomsDocs:View** permission.","x-permission":"CustomsDocs:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Trade (imports, exports, shipments)"],"operationId":"patchCustomsByKey","summary":"PATCH /customs/{key}","description":"Requires the **CustomsDocs:Edit** permission.","x-permission":"CustomsDocs:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mrn":{"type":"string","minLength":1},"direction":{"type":"string","enum":["Import","Export"]},"shipmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"brokerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"portId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"hsCode":{"type":"string","pattern":"^\\d{4}\\.\\d{2}(\\.\\d{2,4})?$"},"lineCount":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991},"declaredValue":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"duty":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"vat":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"channel":{"type":"string","enum":["Green","Orange","Red"]}}}}}}}},"/api/v1/customs/{key}/status":{"post":{"tags":["Trade (imports, exports, shipments)"],"operationId":"postCustomsByKeyStatus","summary":"POST /customs/{key}/status","description":"Requires the **CustomsDocs:Submit** permission.","x-permission":"CustomsDocs:Submit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["Draft","Submitted","UnderReview","Inspection","Cleared","Rejected"]},"channel":{"type":"string","enum":["Green","Orange","Red"]},"mrn":{"type":"string","minLength":1}},"required":["status"]}}}}}},"/api/v1/customs/{key}/documents/{name}":{"put":{"tags":["Trade (imports, exports, shipments)"],"operationId":"putCustomsByKeyDocumentsByName","summary":"PUT /customs/{key}/documents/{name}","description":"Requires the **CustomsDocs:Edit** permission.","x-permission":"CustomsDocs:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["Verified","Pending","Missing","Rejected"]}},"required":["state"]}}}}}},"/api/v1/ports":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getPorts","summary":"GET /ports","description":"Requires the **Shipments:View** permission.","x-permission":"Shipments:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Trade (imports, exports, shipments)"],"operationId":"postPorts","summary":"POST /ports","description":"Requires the **Shipments:Create** permission.","x-permission":"Shipments:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^[A-Z]{5}$"},"name":{"type":"string","minLength":1},"country":{"type":"string","minLength":1},"mode":{"default":"Ocean","type":"string","enum":["Ocean","Air","Road","Rail"]}},"required":["code","name","country"]}}}}}},"/api/v1/ports/{key}":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getPortsByKey","summary":"GET /ports/{key}","description":"Requires the **Shipments:View** permission.","x-permission":"Shipments:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Trade (imports, exports, shipments)"],"operationId":"patchPortsByKey","summary":"PATCH /ports/{key}","description":"Requires the **Shipments:Edit** permission.","x-permission":"Shipments:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^[A-Z]{5}$"},"name":{"type":"string","minLength":1},"country":{"type":"string","minLength":1},"mode":{"default":"Ocean","type":"string","enum":["Ocean","Air","Road","Rail"]}}}}}}}},"/api/v1/carriers":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getCarriers","summary":"GET /carriers","description":"Requires the **Shipments:View** permission.","x-permission":"Shipments:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Trade (imports, exports, shipments)"],"operationId":"postCarriers","summary":"POST /carriers","description":"Requires the **Shipments:Create** permission.","x-permission":"Shipments:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"mode":{"type":"string","enum":["Ocean","Air","Road","Rail"]},"scac":{"type":"string","minLength":1},"active":{"default":true,"type":"boolean"}},"required":["name","mode"]}}}}}},"/api/v1/carriers/{key}":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getCarriersByKey","summary":"GET /carriers/{key}","description":"Requires the **Shipments:View** permission.","x-permission":"Shipments:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Trade (imports, exports, shipments)"],"operationId":"patchCarriersByKey","summary":"PATCH /carriers/{key}","description":"Requires the **Shipments:Edit** permission.","x-permission":"Shipments:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"mode":{"type":"string","enum":["Ocean","Air","Road","Rail"]},"scac":{"type":"string","minLength":1},"active":{"default":true,"type":"boolean"}}}}}}}},"/api/v1/brokers":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getBrokers","summary":"GET /brokers","description":"Requires the **Shipments:View** permission.","x-permission":"Shipments:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Trade (imports, exports, shipments)"],"operationId":"postBrokers","summary":"POST /brokers","description":"Requires the **Shipments:Create** permission.","x-permission":"Shipments:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"license":{"type":"string","minLength":1},"contact":{"type":"string","minLength":1},"phone":{"type":"string","minLength":1},"active":{"default":true,"type":"boolean"}},"required":["name"]}}}}}},"/api/v1/brokers/{key}":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getBrokersByKey","summary":"GET /brokers/{key}","description":"Requires the **Shipments:View** permission.","x-permission":"Shipments:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Trade (imports, exports, shipments)"],"operationId":"patchBrokersByKey","summary":"PATCH /brokers/{key}","description":"Requires the **Shipments:Edit** permission.","x-permission":"Shipments:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"license":{"type":"string","minLength":1},"contact":{"type":"string","minLength":1},"phone":{"type":"string","minLength":1},"active":{"default":true,"type":"boolean"}}}}}}}},"/api/v1/pricing-policy":{"get":{"tags":["Trade (imports, exports, shipments)"],"operationId":"getPricingPolicy","summary":"GET /pricing-policy","description":"Requires the **Products:ViewAmounts** permission.","x-permission":"Products:ViewAmounts","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Trade (imports, exports, shipments)"],"operationId":"putPricingPolicy","summary":"PUT /pricing-policy","description":"Requires the **Settings:Edit** permission.","x-permission":"Settings:Edit","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"defaultMarkupPercent":{"type":"number","exclusiveMinimum":-100,"exclusiveMaximum":10000},"byCategory":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number","exclusiveMinimum":-100,"exclusiveMaximum":10000}},"roundTo":{"default":1,"type":"number","minimum":0.01,"maximum":100000}},"required":["defaultMarkupPercent"]}}}}}},"/api/v1/invoices":{"get":{"tags":["Finance"],"operationId":"getInvoices","summary":"GET /invoices","description":"Requires the **InvoicesPayments:View** permission.","x-permission":"InvoicesPayments:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Finance"],"operationId":"postInvoices","summary":"POST /invoices","description":"Requires the **InvoicesPayments:Create** permission.","x-permission":"InvoicesPayments:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["Receivable","Payable"]},"partnerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"crmAccountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"importOrderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"exportOrderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"salesOrderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"issuedOn":{},"dueOn":{},"method":{"type":"string","enum":["LetterOfCredit","TelegraphicTransfer","OpenAccount","DocumentsAgainstPayment","BankTransfer","MobileMoney","Cash"]}},"required":["type","amount","currency","issuedOn","dueOn","method"]}}}}}},"/api/v1/invoices/{key}":{"get":{"tags":["Finance"],"operationId":"getInvoicesByKey","summary":"GET /invoices/{key}","description":"Requires the **InvoicesPayments:View** permission.","x-permission":"InvoicesPayments:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Finance"],"operationId":"patchInvoicesByKey","summary":"PATCH /invoices/{key}","description":"Requires the **InvoicesPayments:Edit** permission.","x-permission":"InvoicesPayments:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dueOn":{},"method":{"type":"string","enum":["LetterOfCredit","TelegraphicTransfer","OpenAccount","DocumentsAgainstPayment","BankTransfer","MobileMoney","Cash"]},"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]}}}}}}}},"/api/v1/invoices/{key}/status":{"post":{"tags":["Finance"],"operationId":"postInvoicesByKeyStatus","summary":"POST /invoices/{key}/status","description":"Requires the **InvoicesPayments:Edit** permission.","x-permission":"InvoicesPayments:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["Sent","Void"]}},"required":["status"]}}}}}},"/api/v1/invoices/{key}/payments":{"post":{"tags":["Finance"],"operationId":"postInvoicesByKeyPayments","summary":"POST /invoices/{key}/payments","description":"Requires the **InvoicesPayments:Create** permission.","x-permission":"InvoicesPayments:Create","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"paidOn":{},"method":{"type":"string","enum":["LetterOfCredit","TelegraphicTransfer","OpenAccount","DocumentsAgainstPayment","BankTransfer","MobileMoney","Cash"]},"reference":{"type":"string","minLength":1},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["amount","paidOn","method","reference"]}}}}}},"/api/v1/payments":{"get":{"tags":["Finance"],"operationId":"getPayments","summary":"GET /payments","description":"Requires the **InvoicesPayments:View** permission.","x-permission":"InvoicesPayments:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/lenders":{"get":{"tags":["Finance"],"operationId":"getLenders","summary":"GET /lenders","description":"Requires the **LoansFinancing:View** permission.","x-permission":"LoansFinancing:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"active","in":"query","description":"Exact match (boolean); comma-separate values for \"any of\".","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Finance"],"operationId":"postLenders","summary":"POST /lenders","description":"Requires the **LoansFinancing:Create** permission.","x-permission":"LoansFinancing:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"active":{"default":true,"type":"boolean"}},"required":["name"]}}}}}},"/api/v1/lenders/{key}":{"get":{"tags":["Finance"],"operationId":"getLendersByKey","summary":"GET /lenders/{key}","description":"Requires the **LoansFinancing:View** permission.","x-permission":"LoansFinancing:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Finance"],"operationId":"patchLendersByKey","summary":"PATCH /lenders/{key}","description":"Requires the **LoansFinancing:Edit** permission.","x-permission":"LoansFinancing:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"active":{"default":true,"type":"boolean"}}}}}}}},"/api/v1/loans":{"get":{"tags":["Finance"],"operationId":"getLoans","summary":"GET /loans","description":"Requires the **LoansFinancing:View** permission.","x-permission":"LoansFinancing:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: code, disbursedOn, principal, createdAt.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"status","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"category","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"lenderId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"currency","in":"query","description":"Exact match (string); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Finance"],"operationId":"postLoans","summary":"POST /loans","description":"Requires the **LoansFinancing:Create** permission.","x-permission":"LoansFinancing:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lenderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"category":{"type":"string","enum":["PreShipmentFinancing","GeneralBusinessLoan"]},"purpose":{"type":"string","minLength":1},"principal":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"annualRate":{"type":"number","minimum":0,"maximum":1},"method":{"type":"string","enum":["ReducingBalance","Flat"]},"frequency":{"type":"string","enum":["Monthly","Quarterly"]},"disbursedOn":{},"firstDueOn":{},"installmentCount":{"type":"integer","minimum":1,"maximum":360},"graceMonths":{"default":0,"type":"integer","minimum":0,"maximum":60},"fees":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"collateral":{"type":"string","minLength":1},"linkedReference":{"type":"string","minLength":1},"penaltyRate":{"default":0,"type":"number","minimum":0,"maximum":1},"penaltyBasis":{"default":"OverdueInstallment","type":"string","enum":["OverdueInstallment","OverduePrincipal","OutstandingBalance"]},"penaltyGraceDays":{"default":0,"type":"integer","minimum":0,"maximum":90}},"required":["lenderId","category","purpose","principal","currency","annualRate","method","frequency","disbursedOn","firstDueOn","installmentCount"]}}}}}},"/api/v1/loans/{key}":{"get":{"tags":["Finance"],"operationId":"getLoansByKey","summary":"GET /loans/{key}","description":"Requires the **LoansFinancing:View** permission.","x-permission":"LoansFinancing:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Finance"],"operationId":"patchLoansByKey","summary":"PATCH /loans/{key}","description":"Requires the **LoansFinancing:Edit** permission.","x-permission":"LoansFinancing:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"purpose":{"type":"string","minLength":1},"collateral":{"type":"string","minLength":1},"linkedReference":{"type":"string","minLength":1},"penaltyRate":{"type":"number","minimum":0,"maximum":1},"penaltyBasis":{"type":"string","enum":["OverdueInstallment","OverduePrincipal","OutstandingBalance"]},"penaltyGraceDays":{"type":"integer","minimum":0,"maximum":90}}}}}}}},"/api/v1/loans/{key}/schedule":{"post":{"tags":["Finance"],"operationId":"postLoansByKeySchedule","summary":"POST /loans/{key}/schedule","description":"Requires the **LoansFinancing:Edit** permission.","x-permission":"LoansFinancing:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/loans/{key}/confirm":{"post":{"tags":["Finance"],"operationId":"postLoansByKeyConfirm","summary":"POST /loans/{key}/confirm","description":"Requires the **LoansFinancing:Approve** permission.","x-permission":"LoansFinancing:Approve","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/loans/{key}/installments":{"get":{"tags":["Finance"],"operationId":"getLoansByKeyInstallments","summary":"GET /loans/{key}/installments","description":"Requires the **LoansFinancing:View** permission.","x-permission":"LoansFinancing:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/loan-installments/{id}/repayments":{"post":{"tags":["Finance"],"operationId":"postLoanInstallmentsByIdRepayments","summary":"POST /loan-installments/{id}/repayments","description":"Requires the **LoansFinancing:Create** permission.","x-permission":"LoansFinancing:Create","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"penalty":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"paidOn":{},"reference":{"type":"string","minLength":1}},"required":["amount","paidOn"]}}}}}},"/api/v1/expense-categories":{"get":{"tags":["Expenses"],"operationId":"getExpenseCategories","summary":"GET /expense-categories","description":"Requires the **InvoicesPayments:View** permission.","x-permission":"InvoicesPayments:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/expenses":{"get":{"tags":["Expenses"],"operationId":"getExpenses","summary":"GET /expenses","description":"Requires the **InvoicesPayments:View** permission.","x-permission":"InvoicesPayments:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Expenses"],"operationId":"postExpenses","summary":"POST /expenses","description":"Requires the **InvoicesPayments:Create** permission.","x-permission":"InvoicesPayments:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{},"categoryId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string","minLength":1},"vendorName":{"type":"string","minLength":1},"partnerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reference":{"type":"string","minLength":1},"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"vatAmount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"importOrderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"exportOrderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"shipmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"processStepId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"allocationMethod":{"type":"string","enum":["ByValue","ByQuantity","Direct"]},"files":{"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}},"postNow":{"default":false,"type":"boolean"},"paidNow":{"type":"object","properties":{"paidOn":{},"accountCode":{"type":"string","pattern":"^10\\d{2}$"},"reference":{"type":"string","minLength":1}},"required":["paidOn","accountCode"]}},"required":["date","categoryId","description","amount"]}}}}}},"/api/v1/expenses/{key}":{"get":{"tags":["Expenses"],"operationId":"getExpensesByKey","summary":"GET /expenses/{key}","description":"Requires the **InvoicesPayments:View** permission.","x-permission":"InvoicesPayments:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Expenses"],"operationId":"patchExpensesByKey","summary":"PATCH /expenses/{key}","description":"Requires the **InvoicesPayments:Edit** permission.","x-permission":"InvoicesPayments:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{},"categoryId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string","minLength":1},"vendorName":{"type":"string","minLength":1},"partnerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"reference":{"type":"string","minLength":1},"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"vatAmount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"importOrderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"exportOrderId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"shipmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"allocationMethod":{"type":"string","enum":["ByValue","ByQuantity","Direct"]},"files":{"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}}}}}}},"delete":{"tags":["Expenses"],"operationId":"deleteExpensesByKey","summary":"DELETE /expenses/{key}","description":"Requires the **InvoicesPayments:Edit** permission.","x-permission":"InvoicesPayments:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/expenses/{key}/post":{"post":{"tags":["Expenses"],"operationId":"postExpensesByKeyPost","summary":"POST /expenses/{key}/post","description":"Requires the **InvoicesPayments:Submit** permission.","x-permission":"InvoicesPayments:Submit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/expenses/{key}/pay":{"post":{"tags":["Expenses"],"operationId":"postExpensesByKeyPay","summary":"POST /expenses/{key}/pay","description":"Requires the **InvoicesPayments:Approve** permission.","x-permission":"InvoicesPayments:Approve","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"paidOn":{},"accountCode":{"type":"string","pattern":"^10\\d{2}$"},"reference":{"type":"string","minLength":1}},"required":["paidOn","accountCode"]}}}}}},"/api/v1/expenses/{key}/void":{"post":{"tags":["Expenses"],"operationId":"postExpensesByKeyVoid","summary":"POST /expenses/{key}/void","description":"Requires the **InvoicesPayments:Approve** permission.","x-permission":"InvoicesPayments:Approve","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":3}},"required":["reason"]}}}}}},"/api/v1/expense-claims":{"get":{"tags":["Expense claims"],"operationId":"getExpenseClaims","summary":"GET /expense-claims","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Expense claims"],"operationId":"postExpenseClaims","summary":"POST /expense-claims","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"purpose":{"type":"string","minLength":1},"lines":{"minItems":1,"type":"array","items":{"type":"object","properties":{"date":{},"categoryId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string","minLength":1},"vendorName":{"type":"string","minLength":1},"reference":{"type":"string","minLength":1},"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"vatAmount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"files":{"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}},"required":["date","categoryId","description","amount"]}}},"required":["purpose","lines"]}}}}}},"/api/v1/expense-claims/{key}":{"get":{"tags":["Expense claims"],"operationId":"getExpenseClaimsByKey","summary":"GET /expense-claims/{key}","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Expense claims"],"operationId":"patchExpenseClaimsByKey","summary":"PATCH /expense-claims/{key}","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"purpose":{"type":"string","minLength":1},"lines":{"minItems":1,"type":"array","items":{"type":"object","properties":{"date":{},"categoryId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string","minLength":1},"vendorName":{"type":"string","minLength":1},"reference":{"type":"string","minLength":1},"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"vatAmount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"files":{"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}},"required":["date","categoryId","description","amount"]}}}}}}}},"delete":{"tags":["Expense claims"],"operationId":"deleteExpenseClaimsByKey","summary":"DELETE /expense-claims/{key}","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/expense-claims/{key}/submit":{"post":{"tags":["Expense claims"],"operationId":"postExpenseClaimsByKeySubmit","summary":"POST /expense-claims/{key}/submit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/expense-claims/{key}/withdraw":{"post":{"tags":["Expense claims"],"operationId":"postExpenseClaimsByKeyWithdraw","summary":"POST /expense-claims/{key}/withdraw","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/expense-claims/{key}/reimburse":{"post":{"tags":["Expense claims"],"operationId":"postExpenseClaimsByKeyReimburse","summary":"POST /expense-claims/{key}/reimburse","description":"Requires the **InvoicesPayments:Approve** permission.","x-permission":"InvoicesPayments:Approve","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reimbursedOn":{},"accountCode":{"type":"string","pattern":"^10\\d{2}$"},"reference":{"type":"string","minLength":1}},"required":["reimbursedOn","accountCode"]}}}}}},"/api/v1/ledger/accounts":{"get":{"tags":["Ledger & statements"],"operationId":"getLedgerAccounts","summary":"GET /ledger/accounts","description":"Requires the **InvoicesPayments:View** permission.","x-permission":"InvoicesPayments:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ledger/accounts/{code}/lines":{"get":{"tags":["Ledger & statements"],"operationId":"getLedgerAccountsByCodeLines","summary":"GET /ledger/accounts/{code}/lines","description":"Requires the **InvoicesPayments:View** permission.","x-permission":"InvoicesPayments:View","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ledger/journal":{"get":{"tags":["Ledger & statements"],"operationId":"getLedgerJournal","summary":"GET /ledger/journal","description":"Requires the **InvoicesPayments:View** permission.","x-permission":"InvoicesPayments:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Ledger & statements"],"operationId":"postLedgerJournal","summary":"POST /ledger/journal","description":"Requires the **InvoicesPayments:View** permission.","x-permission":"InvoicesPayments:View","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{},"memo":{"type":"string","minLength":3},"source":{"default":"Manual","type":"string","enum":["Manual","Opening"]},"lines":{"minItems":2,"type":"array","items":{"type":"object","properties":{"accountCode":{"type":"string","minLength":1},"debit":{"default":0,"type":"number","minimum":0},"credit":{"default":0,"type":"number","minimum":0},"description":{"type":"string"},"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"partnerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["accountCode"]}}},"required":["date","memo","lines"]}}}}}},"/api/v1/ledger/journal/{code}":{"get":{"tags":["Ledger & statements"],"operationId":"getLedgerJournalByCode","summary":"GET /ledger/journal/{code}","description":"Requires the **InvoicesPayments:View** permission.","x-permission":"InvoicesPayments:View","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ledger/journal/{code}/reverse":{"post":{"tags":["Ledger & statements"],"operationId":"postLedgerJournalByCodeReverse","summary":"POST /ledger/journal/{code}/reverse","description":"Requires the **InvoicesPayments:View** permission.","x-permission":"InvoicesPayments:View","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ledger/trial-balance":{"get":{"tags":["Ledger & statements"],"operationId":"getLedgerTrialBalance","summary":"GET /ledger/trial-balance","description":"Requires the **InvoicesPayments:View** permission.","x-permission":"InvoicesPayments:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ledger/profit-and-loss":{"get":{"tags":["Ledger & statements"],"operationId":"getLedgerProfitAndLoss","summary":"GET /ledger/profit-and-loss","description":"Requires the **InvoicesPayments:View** permission.","x-permission":"InvoicesPayments:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/ledger/balance-sheet":{"get":{"tags":["Ledger & statements"],"operationId":"getLedgerBalanceSheet","summary":"GET /ledger/balance-sheet","description":"Requires the **InvoicesPayments:View** permission.","x-permission":"InvoicesPayments:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/solar/dealers":{"get":{"tags":["Solar distribution"],"operationId":"getSolarDealers","summary":"GET /solar/dealers","description":"Requires the **SolarDistribution:View** permission.","x-permission":"SolarDistribution:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: name, code, since, level, status, createdAt.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"level","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"status","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"region","in":"query","description":"Exact match (string); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"parentId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Solar distribution"],"operationId":"postSolarDealers","summary":"POST /solar/dealers","description":"Requires the **SolarDistribution:Create** permission.","x-permission":"SolarDistribution:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"level":{"type":"string","enum":["MasterDealer","RegionalDealer","SubDealer"]},"parentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"city":{"type":"string","minLength":1},"region":{"type":"string","minLength":1},"contactName":{"type":"string","minLength":1},"phone":{"type":"string","minLength":1},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"tin":{"type":"string","minLength":1},"licenseNo":{"type":"string","minLength":1},"since":{},"networkOversight":{"default":false,"type":"boolean"}},"required":["name","level","city","region","contactName","phone","since"]}}}}}},"/api/v1/solar/dealers/{key}":{"get":{"tags":["Solar distribution"],"operationId":"getSolarDealersByKey","summary":"GET /solar/dealers/{key}","description":"Requires the **SolarDistribution:View** permission.","x-permission":"SolarDistribution:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Solar distribution"],"operationId":"patchSolarDealersByKey","summary":"PATCH /solar/dealers/{key}","description":"Requires the **SolarDistribution:Edit** permission.","x-permission":"SolarDistribution:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"level":{"type":"string","enum":["MasterDealer","RegionalDealer","SubDealer"]},"parentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"city":{"type":"string","minLength":1},"region":{"type":"string","minLength":1},"contactName":{"type":"string","minLength":1},"phone":{"type":"string","minLength":1},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"tin":{"type":"string","minLength":1},"licenseNo":{"type":"string","minLength":1},"since":{},"networkOversight":{"default":false,"type":"boolean"}}}}}}}},"/api/v1/solar/dealers/{key}/approve":{"post":{"tags":["Solar distribution"],"operationId":"postSolarDealersByKeyApprove","summary":"POST /solar/dealers/{key}/approve","description":"Requires the **SolarDistribution:Approve** permission.","x-permission":"SolarDistribution:Approve","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/solar/dealers/{key}/suspend":{"post":{"tags":["Solar distribution"],"operationId":"postSolarDealersByKeySuspend","summary":"POST /solar/dealers/{key}/suspend","description":"Requires the **SolarDistribution:Approve** permission.","x-permission":"SolarDistribution:Approve","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1}},"required":["reason"]}}}}}},"/api/v1/solar/customers":{"get":{"tags":["Solar distribution"],"operationId":"getSolarCustomers","summary":"GET /solar/customers","description":"Requires the **HouseholdRecords:View** permission.","x-permission":"HouseholdRecords:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: name, code, registeredOn, region, createdAt.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"region","in":"query","description":"Exact match (string); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"woreda","in":"query","description":"Exact match (string); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"customerType","in":"query","description":"Exact match (string); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"dealerId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"gender","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Solar distribution"],"operationId":"postSolarCustomers","summary":"POST /solar/customers","description":"Requires the **HouseholdRecords:Create** permission.","x-permission":"HouseholdRecords:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"customerType":{"type":"string","minLength":1},"gender":{"type":"string","enum":["Female","Male"]},"occupation":{"type":"string","minLength":1},"phone":{"type":"string","minLength":1},"altPhone":{"type":"string","minLength":1},"nationalId":{"type":"string","minLength":1},"householdSize":{"type":"integer","minimum":1,"maximum":40},"region":{"type":"string","minLength":1},"zone":{"type":"string","minLength":1},"woreda":{"type":"string","minLength":1},"kebele":{"type":"string","minLength":1},"village":{"type":"string","minLength":1},"city":{"type":"string","minLength":1},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"dealerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"registeredOn":{}},"required":["name","customerType","phone","region","woreda","kebele","city","dealerId"]}}}}}},"/api/v1/solar/customers/{key}":{"get":{"tags":["Solar distribution"],"operationId":"getSolarCustomersByKey","summary":"GET /solar/customers/{key}","description":"Requires the **HouseholdRecords:View** permission.","x-permission":"HouseholdRecords:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Solar distribution"],"operationId":"patchSolarCustomersByKey","summary":"PATCH /solar/customers/{key}","description":"Requires the **HouseholdRecords:Edit** permission.","x-permission":"HouseholdRecords:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"customerType":{"type":"string","minLength":1},"gender":{"type":"string","enum":["Female","Male"]},"occupation":{"type":"string","minLength":1},"phone":{"type":"string","minLength":1},"altPhone":{"type":"string","minLength":1},"nationalId":{"type":"string","minLength":1},"householdSize":{"type":"integer","minimum":1,"maximum":40},"region":{"type":"string","minLength":1},"zone":{"type":"string","minLength":1},"woreda":{"type":"string","minLength":1},"kebele":{"type":"string","minLength":1},"village":{"type":"string","minLength":1},"city":{"type":"string","minLength":1},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180}}}}}}}},"/api/v1/solar/units":{"get":{"tags":["Solar distribution"],"operationId":"getSolarUnits","summary":"GET /solar/units","description":"Requires the **SolarDistribution:View** permission.","x-permission":"SolarDistribution:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/solar/units/receive":{"post":{"tags":["Solar distribution"],"operationId":"postSolarUnitsReceive","summary":"POST /solar/units/receive","description":"Requires the **SolarDistribution:Create** permission.","x-permission":"SolarDistribution:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"lot":{"type":"string","minLength":1},"receivedOn":{},"warehouseId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"shipmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dealerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serials":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","minLength":4}}},"required":["productId","lot","receivedOn","warehouseId","serials"]}}}}}},"/api/v1/solar/units/{serial}":{"get":{"tags":["Solar distribution"],"operationId":"getSolarUnitsBySerial","summary":"GET /solar/units/{serial}","description":"Requires the **SolarDistribution:View** permission.","x-permission":"SolarDistribution:View","parameters":[{"name":"serial","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/solar/units/{serial}/inspection":{"post":{"tags":["Solar distribution"],"operationId":"postSolarUnitsBySerialInspection","summary":"POST /solar/units/{serial}/inspection","description":"Requires the **SolarDistribution:Edit** permission.","x-permission":"SolarDistribution:Edit","parameters":[{"name":"serial","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"inspection":{"type":"string","enum":["Passed","Pending","Quarantined"]},"files":{"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}},"required":["inspection"]}}}}}},"/api/v1/solar/units/{serial}/install":{"post":{"tags":["Solar distribution"],"operationId":"postSolarUnitsBySerialInstall","summary":"POST /solar/units/{serial}/install","description":"Requires the **SolarDistribution:Edit** permission.","x-permission":"SolarDistribution:Edit","parameters":[{"name":"serial","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"installedOn":{}},"required":["installedOn"]}}}}}},"/api/v1/solar/sales":{"get":{"tags":["Solar distribution"],"operationId":"getSolarSales","summary":"GET /solar/sales","description":"Requires the **SolarDistribution:View** permission.","x-permission":"SolarDistribution:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Solar distribution"],"operationId":"postSolarSales","summary":"POST /solar/sales","description":"Requires the **SolarDistribution:Create** permission.","x-permission":"SolarDistribution:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dealerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"customerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"customer":{"type":"object","properties":{"name":{"type":"string","minLength":1},"customerType":{"type":"string","minLength":1},"gender":{"type":"string","enum":["Female","Male"]},"occupation":{"type":"string","minLength":1},"phone":{"type":"string","minLength":1},"altPhone":{"type":"string","minLength":1},"nationalId":{"type":"string","minLength":1},"householdSize":{"type":"integer","minimum":1,"maximum":40},"region":{"type":"string","minLength":1},"zone":{"type":"string","minLength":1},"woreda":{"type":"string","minLength":1},"kebele":{"type":"string","minLength":1},"village":{"type":"string","minLength":1},"city":{"type":"string","minLength":1},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"registeredOn":{}},"required":["name","customerType","phone","region","woreda","kebele","city"]},"serials":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}},"soldOn":{},"systemPrice":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"paymentType":{"type":"string","enum":["Cash","PAYG","Installment"]},"downPayment":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"downPaymentOn":{},"mobileMoneyRef":{"type":"string","minLength":1},"tenureMonths":{"type":"integer","minimum":1,"maximum":60},"installmentCount":{"type":"integer","minimum":1,"maximum":120},"installmentAmount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"grantAmount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"grantCurrency":{"type":"string","minLength":3,"maxLength":3},"installedOn":{}},"required":["dealerId","serials","soldOn","systemPrice","paymentType"]}}}}}},"/api/v1/solar/sales/{key}":{"get":{"tags":["Solar distribution"],"operationId":"getSolarSalesByKey","summary":"GET /solar/sales/{key}","description":"Requires the **SolarDistribution:View** permission.","x-permission":"SolarDistribution:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/solar/transfers":{"get":{"tags":["Solar distribution"],"operationId":"getSolarTransfers","summary":"GET /solar/transfers","description":"Requires the **SolarDistribution:View** permission.","x-permission":"SolarDistribution:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Solar distribution"],"operationId":"postSolarTransfers","summary":"POST /solar/transfers","description":"Requires the **SolarDistribution:Create** permission.","x-permission":"SolarDistribution:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fromDealerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"toDealerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serials":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string"}},"waybill":{"type":"string","minLength":1},"note":{"type":"string","minLength":1},"dispatchedOn":{}},"required":["fromDealerId","toDealerId","serials","waybill"]}}}}}},"/api/v1/solar/transfers/{key}":{"get":{"tags":["Solar distribution"],"operationId":"getSolarTransfersByKey","summary":"GET /solar/transfers/{key}","description":"Requires the **SolarDistribution:View** permission.","x-permission":"SolarDistribution:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/solar/transfers/{key}/receive":{"post":{"tags":["Solar distribution"],"operationId":"postSolarTransfersByKeyReceive","summary":"POST /solar/transfers/{key}/receive","description":"Requires the **SolarDistribution:Edit** permission.","x-permission":"SolarDistribution:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/solar/transfers/{key}/reject":{"post":{"tags":["Solar distribution"],"operationId":"postSolarTransfersByKeyReject","summary":"POST /solar/transfers/{key}/reject","description":"Requires the **SolarDistribution:Edit** permission.","x-permission":"SolarDistribution:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","minLength":1},"files":{"minItems":1,"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}},"required":["note","files"]}}}}}},"/api/v1/solar/transfers/{key}/dispute":{"post":{"tags":["Solar distribution"],"operationId":"postSolarTransfersByKeyDispute","summary":"POST /solar/transfers/{key}/dispute","description":"Requires the **SolarDistribution:Edit** permission.","x-permission":"SolarDistribution:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","minLength":1},"files":{"minItems":1,"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}},"required":["note","files"]}}}}}},"/api/v1/solar/transfers/{key}/cancel":{"post":{"tags":["Solar distribution"],"operationId":"postSolarTransfersByKeyCancel","summary":"POST /solar/transfers/{key}/cancel","description":"Requires the **SolarDistribution:DeleteCancel** permission.","x-permission":"SolarDistribution:DeleteCancel","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/solar/claims":{"get":{"tags":["Solar distribution"],"operationId":"getSolarClaims","summary":"GET /solar/claims","description":"Requires the **SolarDistribution:View** permission.","x-permission":"SolarDistribution:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Solar distribution"],"operationId":"postSolarClaims","summary":"POST /solar/claims","description":"Requires the **SolarDistribution:Create** permission.","x-permission":"SolarDistribution:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"serial":{"type":"string"},"description":{"type":"string","minLength":10},"files":{"minItems":1,"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}},"required":["serial","description","files"]}}}}}},"/api/v1/solar/claims/{key}/resolve":{"post":{"tags":["Solar distribution"],"operationId":"postSolarClaimsByKeyResolve","summary":"POST /solar/claims/{key}/resolve","description":"Requires the **SolarDistribution:Approve** permission.","x-permission":"SolarDistribution:Approve","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["Approved","Rejected","Replaced","Repaired"]},"resolution":{"type":"string","minLength":1}},"required":["status","resolution"]}}}}}},"/api/v1/solar/verification/rows":{"get":{"tags":["Solar distribution"],"operationId":"getSolarVerificationRows","summary":"GET /solar/verification/rows","description":"Requires the **HouseholdRecords:View** permission.","x-permission":"HouseholdRecords:View","parameters":[{"name":"period","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/solar/verification/submissions":{"get":{"tags":["Solar distribution"],"operationId":"getSolarVerificationSubmissions","summary":"GET /solar/verification/submissions","description":"Requires the **HouseholdRecords:View** permission.","x-permission":"HouseholdRecords:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Solar distribution"],"operationId":"postSolarVerificationSubmissions","summary":"POST /solar/verification/submissions","description":"Requires the **HouseholdRecords:Submit** permission.","x-permission":"HouseholdRecords:Submit","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"files":{"minItems":1,"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}},"required":["period","files"]}}}}}},"/api/v1/support/teams":{"get":{"tags":["Support"],"operationId":"getSupportTeams","summary":"GET /support/teams","description":"Requires the **Support:View** permission.","x-permission":"Support:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"active","in":"query","description":"Exact match (boolean); comma-separate values for \"any of\".","schema":{"type":"boolean"}},{"name":"isDealer","in":"query","description":"Exact match (boolean); comma-separate values for \"any of\".","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Support"],"operationId":"postSupportTeams","summary":"POST /support/teams","description":"Requires the **Support:Create** permission.","x-permission":"Support:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"isDealer":{"default":false,"type":"boolean"},"active":{"default":true,"type":"boolean"}},"required":["name"]}}}}}},"/api/v1/support/teams/{key}":{"get":{"tags":["Support"],"operationId":"getSupportTeamsByKey","summary":"GET /support/teams/{key}","description":"Requires the **Support:View** permission.","x-permission":"Support:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Support"],"operationId":"patchSupportTeamsByKey","summary":"PATCH /support/teams/{key}","description":"Requires the **Support:Edit** permission.","x-permission":"Support:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"isDealer":{"default":false,"type":"boolean"},"active":{"default":true,"type":"boolean"}}}}}}}},"/api/v1/support/sla":{"get":{"tags":["Support"],"operationId":"getSupportSla","summary":"GET /support/sla","description":"Requires the **Support:View** permission.","x-permission":"Support:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Support"],"operationId":"putSupportSla","summary":"PUT /support/sla","description":"Requires the **Settings:Edit** permission.","x-permission":"Settings:Edit","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"minItems":1,"type":"array","items":{"type":"object","properties":{"priority":{"type":"string","enum":["Low","Normal","High","Urgent"]},"hours":{"type":"integer","minimum":1,"maximum":1440}},"required":["priority","hours"]}}}}}}},"/api/v1/support/tickets":{"get":{"tags":["Support"],"operationId":"getSupportTickets","summary":"GET /support/tickets","description":"Requires the **Support:View** permission.","x-permission":"Support:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Support"],"operationId":"postSupportTickets","summary":"POST /support/tickets","description":"Requires the **Support:Create** permission.","x-permission":"Support:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerName":{"type":"string","minLength":1},"phone":{"type":"string","minLength":1},"channel":{"type":"string","minLength":1},"category":{"type":"string","minLength":1},"crmAccountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serial":{"type":"string"},"region":{"type":"string","minLength":1},"woreda":{"type":"string","minLength":1},"priority":{"default":"Normal","type":"string","enum":["Low","Normal","High","Urgent"]},"teamId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"dealerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"description":{"type":"string","minLength":10},"files":{"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}},"required":["customerName","phone","channel","category","region","woreda","description"]}}}}}},"/api/v1/support/tickets/history":{"get":{"tags":["Support"],"operationId":"getSupportTicketsHistory","summary":"GET /support/tickets/history","description":"Requires the **Support:View** permission.","x-permission":"Support:View","parameters":[{"name":"phone","in":"query","required":false,"schema":{"type":"string"}},{"name":"serial","in":"query","required":false,"schema":{"type":"string"}},{"name":"crmAccountId","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/support/tickets/{key}":{"get":{"tags":["Support"],"operationId":"getSupportTicketsByKey","summary":"GET /support/tickets/{key}","description":"Requires the **Support:View** permission.","x-permission":"Support:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Support"],"operationId":"patchSupportTicketsByKey","summary":"PATCH /support/tickets/{key}","description":"Requires the **Support:Edit** permission.","x-permission":"Support:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"priority":{"type":"string","enum":["Low","Normal","High","Urgent"]},"description":{"type":"string","minLength":10},"region":{"type":"string","minLength":1},"woreda":{"type":"string","minLength":1}}}}}}}},"/api/v1/support/tickets/{key}/assign":{"post":{"tags":["Support"],"operationId":"postSupportTicketsByKeyAssign","summary":"POST /support/tickets/{key}/assign","description":"Requires the **Support:Edit** permission.","x-permission":"Support:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"teamId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"assigneeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"assigneeName":{"type":"string","minLength":1},"dealerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"note":{"type":"string","minLength":1}},"required":["teamId"]}}}}}},"/api/v1/support/tickets/{key}/events":{"post":{"tags":["Support"],"operationId":"postSupportTicketsByKeyEvents","summary":"POST /support/tickets/{key}/events","description":"Requires the **Support:Edit** permission.","x-permission":"Support:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["Note","Visit","Customer"]},"text":{"type":"string","minLength":1}},"required":["kind","text"]}}}}}},"/api/v1/support/tickets/{key}/resolve":{"post":{"tags":["Support"],"operationId":"postSupportTicketsByKeyResolve","summary":"POST /support/tickets/{key}/resolve","description":"Requires the **Support:Edit** permission.","x-permission":"Support:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"string","minLength":5},"parts":{"default":[],"type":"array","items":{"type":"object","properties":{"part":{"type":"string","minLength":1},"quantity":{"type":"integer","minimum":1,"maximum":9007199254740991},"newSerial":{"type":"string","minLength":1}},"required":["part","quantity"]}}},"required":["summary"]}}}}}},"/api/v1/support/tickets/{key}/reopen":{"post":{"tags":["Support"],"operationId":"postSupportTicketsByKeyReopen","summary":"POST /support/tickets/{key}/reopen","description":"Requires the **Support:Edit** permission.","x-permission":"Support:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"default":{},"type":"object","properties":{"reason":{"type":"string","minLength":1}}}}}}}},"/api/v1/support/tickets/{key}/close":{"post":{"tags":["Support"],"operationId":"postSupportTicketsByKeyClose","summary":"POST /support/tickets/{key}/close","description":"Requires the **Support:Edit** permission.","x-permission":"Support:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/tenders":{"get":{"tags":["Tenders"],"operationId":"getTenders","summary":"GET /tenders","description":"Requires the **Tenders:View** permission.","x-permission":"Tenders:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Tenders"],"operationId":"postTenders","summary":"POST /tenders","description":"Requires the **Tenders:Create** permission.","x-permission":"Tenders:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reference":{"type":"string","minLength":1},"title":{"type":"string","minLength":1},"issuer":{"type":"string","minLength":1},"source":{"type":"string","enum":["PpaEgp","TwoMerkato","Newspaper","UndpEthiopia","WorldBankStep","EthiopianElectricUtility","Other"]},"sector":{"type":"string","minLength":1},"region":{"type":"string","minLength":1},"description":{"type":"string","minLength":10},"bidSecurity":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"documentFee":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"estimatedValue":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"publishedOn":{},"closesAt":{},"ownerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["reference","title","issuer","source","sector","region","description","publishedOn","closesAt"]}}}}}},"/api/v1/tenders/owners":{"get":{"tags":["Tenders"],"operationId":"getTendersOwners","summary":"GET /tenders/owners","description":"Requires the **Tenders:View** permission.","x-permission":"Tenders:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/tenders/{key}":{"get":{"tags":["Tenders"],"operationId":"getTendersByKey","summary":"GET /tenders/{key}","description":"Requires the **Tenders:View** permission.","x-permission":"Tenders:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Tenders"],"operationId":"patchTendersByKey","summary":"PATCH /tenders/{key}","description":"Requires the **Tenders:Edit** permission.","x-permission":"Tenders:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1},"issuer":{"type":"string","minLength":1},"sector":{"type":"string","minLength":1},"region":{"type":"string","minLength":1},"description":{"type":"string","minLength":10},"bidSecurity":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"documentFee":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"estimatedValue":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"publishedOn":{},"closesAt":{},"ownerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"checklist":{"maxItems":50,"type":"array","items":{"type":"boolean"}}}}}}}},"delete":{"tags":["Tenders"],"operationId":"deleteTendersByKey","summary":"DELETE /tenders/{key}","description":"Requires the **Tenders:DeleteCancel** permission.","x-permission":"Tenders:DeleteCancel","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done (no content)"},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/tenders/{key}/status":{"post":{"tags":["Tenders"],"operationId":"postTendersByKeyStatus","summary":"POST /tenders/{key}/status","description":"Requires the **Tenders:Edit** permission.","x-permission":"Tenders:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["New","Reviewing","Go","NoGo","PreparingBid","Submitted","Won","Lost"]}},"required":["status"]}}}}}},"/api/v1/tenders/{key}/decision":{"post":{"tags":["Tenders"],"operationId":"postTendersByKeyDecision","summary":"POST /tenders/{key}/decision","description":"Requires the **Tenders:Approve** permission.","x-permission":"Tenders:Approve","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"go":{"type":"boolean"},"reason":{"type":"string","minLength":5}},"required":["go","reason"]}}}}}},"/api/v1/vehicles":{"get":{"tags":["Fleet"],"operationId":"getVehicles","summary":"GET /vehicles","description":"Requires the **Fleet:View** permission.","x-permission":"Fleet:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Fleet"],"operationId":"postVehicles","summary":"POST /vehicles","description":"Requires the **Fleet:Create** permission.","x-permission":"Fleet:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plate":{"type":"string","minLength":3,"maxLength":20},"make":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"type":{"type":"string","enum":["Pickup","SUV","Sedan","Van","Truck","Motorcycle"]},"year":{"type":"integer","minimum":1980,"maximum":2027},"fuel":{"type":"string","enum":["Diesel","Petrol","Electric"]},"branchId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"custodianId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serviceIntervalKm":{"type":"integer","minimum":500,"maximum":100000},"lastServiceKm":{"type":"integer","minimum":0,"maximum":5000000},"lastServiceOn":{},"insuranceExpiry":{},"inspectionExpiry":{},"initialKm":{"type":"integer","minimum":0,"maximum":5000000},"assetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["plate","make","model","type","year","fuel","branchId","serviceIntervalKm","lastServiceKm","lastServiceOn","insuranceExpiry","inspectionExpiry","initialKm"]}}}}}},"/api/v1/vehicles/{key}":{"get":{"tags":["Fleet"],"operationId":"getVehiclesByKey","summary":"GET /vehicles/{key}","description":"Requires the **Fleet:View** permission.","x-permission":"Fleet:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Fleet"],"operationId":"patchVehiclesByKey","summary":"PATCH /vehicles/{key}","description":"Requires the **Fleet:Edit** permission.","x-permission":"Fleet:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plate":{"type":"string","minLength":3,"maxLength":20},"make":{"type":"string","minLength":1},"model":{"type":"string","minLength":1},"type":{"type":"string","enum":["Pickup","SUV","Sedan","Van","Truck","Motorcycle"]},"year":{"type":"integer","minimum":1980,"maximum":2027},"fuel":{"type":"string","enum":["Diesel","Petrol","Electric"]},"branchId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"custodianId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"serviceIntervalKm":{"type":"integer","minimum":500,"maximum":100000},"lastServiceKm":{"type":"integer","minimum":0,"maximum":5000000},"lastServiceOn":{},"insuranceExpiry":{},"inspectionExpiry":{},"initialKm":{"type":"integer","minimum":0,"maximum":5000000},"assetId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}}}}}}},"/api/v1/vehicles/{key}/service":{"post":{"tags":["Fleet"],"operationId":"postVehiclesByKeyService","summary":"POST /vehicles/{key}/service","description":"Requires the **Fleet:Edit** permission.","x-permission":"Fleet:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"km":{"type":"integer","minimum":0,"maximum":5000000},"on":{},"notes":{"type":"string","minLength":1}},"required":["km","on"]}}}}}},"/api/v1/vehicles/{key}/workshop":{"post":{"tags":["Fleet"],"operationId":"postVehiclesByKeyWorkshop","summary":"POST /vehicles/{key}/workshop","description":"Requires the **Fleet:Edit** permission.","x-permission":"Fleet:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"since":{}}}}}}}},"/api/v1/trips":{"get":{"tags":["Fleet"],"operationId":"getTrips","summary":"GET /trips","description":"Requires the **Fleet:View** permission.","x-permission":"Fleet:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Fleet"],"operationId":"postTrips","summary":"POST /trips","description":"Requires the **Fleet:Create** permission.","x-permission":"Fleet:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"vehicleId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"driverId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"purpose":{"type":"string","minLength":1},"destination":{"type":"string","minLength":1},"departAt":{},"departKm":{"type":"integer","minimum":0,"maximum":5000000},"expectedReturnAt":{},"notes":{"type":"string","minLength":1}},"required":["vehicleId","driverId","purpose","destination","departKm","expectedReturnAt"]}}}}}},"/api/v1/trips/{key}/return":{"post":{"tags":["Fleet"],"operationId":"postTripsByKeyReturn","summary":"POST /trips/{key}/return","description":"Requires the **Fleet:Edit** permission.","x-permission":"Fleet:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"returnKm":{"type":"integer","minimum":0,"maximum":5000000},"returnedAt":{},"notes":{"type":"string","minLength":1}},"required":["returnKm"]}}}}}},"/api/v1/fuel-logs":{"get":{"tags":["Fleet"],"operationId":"getFuelLogs","summary":"GET /fuel-logs","description":"Requires the **Fleet:View** permission.","x-permission":"Fleet:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Fleet"],"operationId":"postFuelLogs","summary":"POST /fuel-logs","description":"Requires the **Fleet:Create** permission.","x-permission":"Fleet:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"vehicleId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"driverId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{},"odometerKm":{"type":"integer","minimum":0,"maximum":5000000},"quantity":{"type":"number","exclusiveMinimum":0,"maximum":2000},"unitPrice":{"type":"number","exclusiveMinimum":0,"maximum":100000},"total":{"type":"number","minimum":0,"maximum":1000000000},"station":{"type":"string","minLength":1},"fullTank":{"default":true,"type":"boolean"},"note":{"type":"string","minLength":1}},"required":["vehicleId","date","odometerKm","quantity"]}}}}}},"/api/v1/fuel-logs/{key}":{"delete":{"tags":["Fleet"],"operationId":"deleteFuelLogsByKey","summary":"DELETE /fuel-logs/{key}","description":"Requires the **Fleet:DeleteCancel** permission.","x-permission":"Fleet:DeleteCancel","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/vehicle-maintenance":{"get":{"tags":["Fleet"],"operationId":"getVehicleMaintenance","summary":"GET /vehicle-maintenance","description":"Requires the **Fleet:View** permission.","x-permission":"Fleet:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Fleet"],"operationId":"postVehicleMaintenance","summary":"POST /vehicle-maintenance","description":"Requires the **Fleet:Create** permission.","x-permission":"Fleet:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"vehicleId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"type":{"type":"string","minLength":1},"scheduledOn":{},"odometerKm":{"type":"integer","minimum":0,"maximum":5000000},"vendor":{"type":"string","minLength":1},"cost":{"default":0,"type":"number","minimum":0,"maximum":1000000000},"description":{"type":"string","minLength":1},"files":{"maxItems":8,"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}},"required":["vehicleId","type","scheduledOn","description"]}}}}}},"/api/v1/vehicle-maintenance/{key}/start":{"post":{"tags":["Fleet"],"operationId":"postVehicleMaintenanceByKeyStart","summary":"POST /vehicle-maintenance/{key}/start","description":"Requires the **Fleet:Edit** permission.","x-permission":"Fleet:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/vehicle-maintenance/{key}/complete":{"post":{"tags":["Fleet"],"operationId":"postVehicleMaintenanceByKeyComplete","summary":"POST /vehicle-maintenance/{key}/complete","description":"Requires the **Fleet:Edit** permission.","x-permission":"Fleet:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"completedOn":{},"odometerKm":{"type":"integer","minimum":0,"maximum":5000000},"cost":{"type":"number","minimum":0,"maximum":1000000000},"vendor":{"type":"string","minLength":1},"notes":{"type":"string","minLength":1},"files":{"maxItems":8,"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}},"required":["completedOn","odometerKm","cost"]}}}}}},"/api/v1/vehicle-maintenance/{key}/cancel":{"post":{"tags":["Fleet"],"operationId":"postVehicleMaintenanceByKeyCancel","summary":"POST /vehicle-maintenance/{key}/cancel","description":"Requires the **Fleet:Edit** permission.","x-permission":"Fleet:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":1}},"required":["reason"]}}}}}},"/api/v1/vehicle-assignments":{"get":{"tags":["Fleet"],"operationId":"getVehicleAssignments","summary":"GET /vehicle-assignments","description":"Requires the **Fleet:View** permission.","x-permission":"Fleet:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Fleet"],"operationId":"postVehicleAssignments","summary":"POST /vehicle-assignments","description":"Requires the **Fleet:Create** permission.","x-permission":"Fleet:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"vehicleId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"startDate":{},"startKm":{"type":"integer","minimum":0,"maximum":5000000},"purpose":{"type":"string","minLength":1},"note":{"type":"string","minLength":1}},"required":["vehicleId","employeeId","startDate","purpose"]}}}}}},"/api/v1/vehicle-assignments/{key}/end":{"post":{"tags":["Fleet"],"operationId":"postVehicleAssignmentsByKeyEnd","summary":"POST /vehicle-assignments/{key}/end","description":"Requires the **Fleet:Edit** permission.","x-permission":"Fleet:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"endDate":{},"endKm":{"type":"integer","minimum":0,"maximum":5000000},"note":{"type":"string","minLength":1}},"required":["endDate"]}}}}}},"/api/v1/asset-categories":{"get":{"tags":["Assets"],"operationId":"getAssetCategories","summary":"GET /asset-categories","description":"Requires the **Assets:View** permission.","x-permission":"Assets:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"active","in":"query","description":"Exact match (boolean); comma-separate values for \"any of\".","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Assets"],"operationId":"postAssetCategories","summary":"POST /asset-categories","description":"Requires the **Assets:Create** permission.","x-permission":"Assets:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"usefulLifeYears":{"default":5,"type":"integer","minimum":1,"maximum":50},"active":{"default":true,"type":"boolean"}},"required":["name"]}}}}}},"/api/v1/asset-categories/{key}":{"get":{"tags":["Assets"],"operationId":"getAssetCategoriesByKey","summary":"GET /asset-categories/{key}","description":"Requires the **Assets:View** permission.","x-permission":"Assets:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Assets"],"operationId":"patchAssetCategoriesByKey","summary":"PATCH /asset-categories/{key}","description":"Requires the **Assets:Edit** permission.","x-permission":"Assets:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":80},"usefulLifeYears":{"default":5,"type":"integer","minimum":1,"maximum":50},"active":{"default":true,"type":"boolean"}}}}}}}},"/api/v1/assets":{"get":{"tags":["Assets"],"operationId":"getAssets","summary":"GET /assets","description":"Requires the **Assets:View** permission.","x-permission":"Assets:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Assets"],"operationId":"postAssets","summary":"POST /assets","description":"Requires the **Assets:Create** permission.","x-permission":"Assets:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"categoryId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"serial":{"type":"string","minLength":3},"branchId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"location":{"type":"string","minLength":1},"custodianId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"purchaseDate":{},"cost":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"currency":{"type":"string","minLength":3,"maxLength":3},"usefulLifeYears":{"type":"integer","minimum":1,"maximum":50},"salvageRate":{"default":0.1,"type":"number","minimum":0,"maximum":0.99},"supplierName":{"type":"string","minLength":1},"supplierId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"warrantyEnd":{},"serviceIntervalDays":{"type":"integer","minimum":7,"maximum":3650},"files":{"minItems":1,"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}},"required":["name","categoryId","serial","branchId","location","purchaseDate","cost","supplierName","files"]}}}}}},"/api/v1/assets/{key}":{"get":{"tags":["Assets"],"operationId":"getAssetsByKey","summary":"GET /assets/{key}","description":"Requires the **Assets:View** permission.","x-permission":"Assets:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Assets"],"operationId":"patchAssetsByKey","summary":"PATCH /assets/{key}","description":"Requires the **Assets:Edit** permission.","x-permission":"Assets:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"serial":{"type":"string","minLength":3},"supplierName":{"type":"string","minLength":1},"supplierId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"warrantyEnd":{},"serviceIntervalDays":{"type":"integer","minimum":7,"maximum":3650}}}}}}}},"/api/v1/assets/{key}/depreciation":{"get":{"tags":["Assets"],"operationId":"getAssetsByKeyDepreciation","summary":"GET /assets/{key}/depreciation","description":"Requires the **Assets:View** permission.","x-permission":"Assets:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/assets/{key}/assign":{"post":{"tags":["Assets"],"operationId":"postAssetsByKeyAssign","summary":"POST /assets/{key}/assign","description":"Requires the **Assets:Edit** permission.","x-permission":"Assets:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"branchId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"custodianId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"location":{"type":"string","minLength":1},"note":{"type":"string","minLength":1}},"required":["branchId","location"]}}}}}},"/api/v1/assets/{key}/maintenance":{"post":{"tags":["Assets"],"operationId":"postAssetsByKeyMaintenance","summary":"POST /assets/{key}/maintenance","description":"Requires the **Assets:Edit** permission.","x-permission":"Assets:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{},"type":{"type":"string","minLength":1},"vendor":{"type":"string","minLength":1},"cost":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"notes":{"type":"string","minLength":5},"files":{"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}},"required":["date","type","vendor","cost","notes"]}}}}}},"/api/v1/assets/{key}/status":{"post":{"tags":["Assets"],"operationId":"postAssetsByKeyStatus","summary":"POST /assets/{key}/status","description":"Requires the **Assets:Edit** permission.","x-permission":"Assets:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["InUse","UnderMaintenance"]},"note":{"type":"string","minLength":1}},"required":["status"]}}}}}},"/api/v1/assets/{key}/dispose":{"post":{"tags":["Assets"],"operationId":"postAssetsByKeyDispose","summary":"POST /assets/{key}/dispose","description":"Requires the **Assets:Approve** permission.","x-permission":"Assets:Approve","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","enum":["End of useful life","Damaged beyond repair","Sold","Lost or stolen","Donated"]},"proceeds":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"date":{},"files":{"minItems":1,"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}},"required":["reason","proceeds","files"]}}}}}},"/api/v1/hr/employees":{"get":{"tags":["HR & payroll"],"operationId":"getHrEmployees","summary":"GET /hr/employees","description":"Requires the **HrPayroll:View** permission.","x-permission":"HrPayroll:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: code, name, startDate, status, createdAt.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"status","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"type","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"departmentId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"branchId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"supervisorId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["HR & payroll"],"operationId":"postHrEmployees","summary":"POST /hr/employees","description":"Requires the **HrPayroll:Create** permission.","x-permission":"HrPayroll:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"departmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"branchId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"position":{"type":"string","minLength":1},"type":{"type":"string","enum":["Permanent","Contract","SalesCommission","DailyLaborer"]},"startDate":{},"supervisorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"salary":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"phone":{"type":"string","pattern":"^(\\+251|0)9\\d{8}$"},"tin":{"type":"string","pattern":"^\\d{10}$"},"status":{"default":"Active","type":"string","enum":["Active","OnLeave","Terminated"]}},"required":["name","departmentId","branchId","position","type","startDate","salary","phone"]}}}}}},"/api/v1/hr/employees/{key}":{"get":{"tags":["HR & payroll"],"operationId":"getHrEmployeesByKey","summary":"GET /hr/employees/{key}","description":"Requires the **HrPayroll:View** permission.","x-permission":"HrPayroll:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["HR & payroll"],"operationId":"patchHrEmployeesByKey","summary":"PATCH /hr/employees/{key}","description":"Requires the **HrPayroll:Edit** permission.","x-permission":"HrPayroll:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"departmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"branchId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"position":{"type":"string","minLength":1},"type":{"type":"string","enum":["Permanent","Contract","SalesCommission","DailyLaborer"]},"startDate":{},"supervisorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"salary":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"phone":{"type":"string","pattern":"^(\\+251|0)9\\d{8}$"},"tin":{"type":"string","pattern":"^\\d{10}$"},"status":{"default":"Active","type":"string","enum":["Active","OnLeave","Terminated"]},"endDate":{}}}}}}}},"/api/v1/hr/employees/{key}/summary":{"get":{"tags":["HR & payroll"],"operationId":"getHrEmployeesByKeySummary","summary":"GET /hr/employees/{key}/summary","description":"Requires the **HrPayroll:View** permission.","x-permission":"HrPayroll:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/hr/employees/{key}/payroll-history":{"get":{"tags":["HR & payroll"],"operationId":"getHrEmployeesByKeyPayrollHistory","summary":"GET /hr/employees/{key}/payroll-history","description":"Requires the **HrPayroll:View** permission.","x-permission":"HrPayroll:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/hr/leave-balances":{"get":{"tags":["HR & payroll"],"operationId":"getHrLeaveBalances","summary":"GET /hr/leave-balances","description":"Requires the **HrPayroll:View** permission.","x-permission":"HrPayroll:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["HR & payroll"],"operationId":"putHrLeaveBalances","summary":"PUT /hr/leave-balances","description":"Requires the **HrPayroll:Edit** permission.","x-permission":"HrPayroll:Edit","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"year":{"type":"integer","minimum":2000,"maximum":2100},"entitled":{"type":"integer","minimum":0,"maximum":60},"taken":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"sickTaken":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["employeeId","year","entitled"]}}}}}},"/api/v1/hr/attendance":{"get":{"tags":["HR & payroll"],"operationId":"getHrAttendance","summary":"GET /hr/attendance","description":"Requires the **HrPayroll:View** permission.","x-permission":"HrPayroll:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["HR & payroll"],"operationId":"putHrAttendance","summary":"PUT /hr/attendance","description":"Requires the **HrPayroll:Edit** permission.","x-permission":"HrPayroll:Edit","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"records":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{},"status":{"type":"string","enum":["Present","Late","Absent","OnLeave"]},"checkIn":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"checkOut":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["employeeId","date"]}}},"required":["records"]}}}}}},"/api/v1/hr/overtime":{"get":{"tags":["HR & payroll"],"operationId":"getHrOvertime","summary":"GET /hr/overtime","description":"Requires the **HrPayroll:View** permission.","x-permission":"HrPayroll:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: date, hours, status, code.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"status","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"category","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"employeeId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"payrollRunId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["HR & payroll"],"operationId":"postHrOvertime","summary":"POST /hr/overtime","description":"Requires the **HrPayroll:Create** permission.","x-permission":"HrPayroll:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"employeeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"date":{},"hours":{"type":"number","minimum":0.5,"maximum":12,"multipleOf":0.5},"reason":{"type":"string","minLength":5}},"required":["employeeId","date","hours","reason"]}}}}}},"/api/v1/hr/overtime/{key}":{"get":{"tags":["HR & payroll"],"operationId":"getHrOvertimeByKey","summary":"GET /hr/overtime/{key}","description":"Requires the **HrPayroll:View** permission.","x-permission":"HrPayroll:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["HR & payroll"],"operationId":"patchHrOvertimeByKey","summary":"PATCH /hr/overtime/{key}","description":"Requires the **HrPayroll:Edit** permission.","x-permission":"HrPayroll:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"hours":{"type":"number","minimum":0.5,"maximum":12,"multipleOf":0.5},"reason":{"type":"string","minLength":5}}}}}}},"delete":{"tags":["HR & payroll"],"operationId":"deleteHrOvertimeByKey","summary":"DELETE /hr/overtime/{key}","description":"Requires the **HrPayroll:DeleteCancel** permission.","x-permission":"HrPayroll:DeleteCancel","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done (no content)"},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/hr/overtime/{key}/decide":{"post":{"tags":["HR & payroll"],"operationId":"postHrOvertimeByKeyDecide","summary":"POST /hr/overtime/{key}/decide","description":"Requires the **HrPayroll:Edit** permission.","x-permission":"HrPayroll:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"approved":{"type":"boolean"}},"required":["approved"]}}}}}},"/api/v1/hr/public-holidays":{"get":{"tags":["HR & payroll"],"operationId":"getHrPublicHolidays","summary":"GET /hr/public-holidays","description":"Requires the **HrPayroll:View** permission.","x-permission":"HrPayroll:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/hr/public-holidays/{date}":{"put":{"tags":["HR & payroll"],"operationId":"putHrPublicHolidaysByDate","summary":"PUT /hr/public-holidays/{date}","description":"Requires the **HrPayroll:Edit** permission.","x-permission":"HrPayroll:Edit","parameters":[{"name":"date","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1}},"required":["name"]}}}}},"delete":{"tags":["HR & payroll"],"operationId":"deleteHrPublicHolidaysByDate","summary":"DELETE /hr/public-holidays/{date}","description":"Requires the **HrPayroll:DeleteCancel** permission.","x-permission":"HrPayroll:DeleteCancel","parameters":[{"name":"date","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/hr/labor-contractors":{"get":{"tags":["HR & payroll"],"operationId":"getHrLaborContractors","summary":"GET /hr/labor-contractors","description":"Requires the **HrPayroll:View** permission.","x-permission":"HrPayroll:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"active","in":"query","description":"Exact match (boolean); comma-separate values for \"any of\".","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["HR & payroll"],"operationId":"postHrLaborContractors","summary":"POST /hr/labor-contractors","description":"Requires the **HrPayroll:Create** permission.","x-permission":"HrPayroll:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2},"phone":{"type":"string","minLength":1},"tin":{"type":"string","minLength":1},"active":{"type":"boolean"}},"required":["name"]}}}}}},"/api/v1/hr/labor-contractors/{key}":{"get":{"tags":["HR & payroll"],"operationId":"getHrLaborContractorsByKey","summary":"GET /hr/labor-contractors/{key}","description":"Requires the **HrPayroll:View** permission.","x-permission":"HrPayroll:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["HR & payroll"],"operationId":"patchHrLaborContractorsByKey","summary":"PATCH /hr/labor-contractors/{key}","description":"Requires the **HrPayroll:Edit** permission.","x-permission":"HrPayroll:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":2},"phone":{"type":"string","minLength":1},"tin":{"type":"string","minLength":1},"active":{"type":"boolean"}}}}}}}},"/api/v1/hr/labor":{"get":{"tags":["HR & payroll"],"operationId":"getHrLabor","summary":"GET /hr/labor","description":"Requires the **HrPayroll:View** permission.","x-permission":"HrPayroll:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: date, code, status.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"status","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"job","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"workforce","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"branchId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"contractorId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"supervisorId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"shipmentId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["HR & payroll"],"operationId":"postHrLabor","summary":"POST /hr/labor","description":"Requires the **HrPayroll:Create** permission.","x-permission":"HrPayroll:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{},"job":{"type":"string","enum":["ContainerUnloading","ContainerLoading","WarehouseHandling"]},"branchId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"shipmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"container":{"type":"string","pattern":"^[A-Z]{4}\\d{7}$"},"workforce":{"type":"string","enum":["Contractor","DailyLaborers"]},"contractorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"workerIds":{"default":[],"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"workerCount":{"type":"integer","minimum":1,"maximum":200},"rateBasis":{"type":"string","enum":["PerContainer","DailyWage"]},"rate":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"quantity":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"supervisorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"notes":{"type":"string","minLength":1}},"required":["date","job","branchId","workforce","rate","quantity","supervisorId"]}}}}}},"/api/v1/hr/labor/{key}":{"get":{"tags":["HR & payroll"],"operationId":"getHrLaborByKey","summary":"GET /hr/labor/{key}","description":"Requires the **HrPayroll:View** permission.","x-permission":"HrPayroll:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["HR & payroll"],"operationId":"patchHrLaborByKey","summary":"PATCH /hr/labor/{key}","description":"Requires the **HrPayroll:Edit** permission.","x-permission":"HrPayroll:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{},"notes":{"type":"string","minLength":1},"rate":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"quantity":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"container":{"type":"string","pattern":"^[A-Z]{4}\\d{7}$"}}}}}}}},"/api/v1/hr/labor/{key}/status":{"post":{"tags":["HR & payroll"],"operationId":"postHrLaborByKeyStatus","summary":"POST /hr/labor/{key}/status","description":"Requires the **HrPayroll:Edit** permission.","x-permission":"HrPayroll:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["Scheduled","InProgress","AwaitingConfirmation","PendingApproval","Approved","Paid"]}},"required":["status"]}}}}}},"/api/v1/hr/payroll-runs":{"get":{"tags":["HR & payroll"],"operationId":"getHrPayrollRuns","summary":"GET /hr/payroll-runs","description":"Requires the **HrPayroll:View** permission.","x-permission":"HrPayroll:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["HR & payroll"],"operationId":"postHrPayrollRuns","summary":"POST /hr/payroll-runs","description":"Requires the **HrPayroll:Create** permission.","x-permission":"HrPayroll:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"}},"required":["period"]}}}}}},"/api/v1/hr/payroll-runs/{period}":{"get":{"tags":["HR & payroll"],"operationId":"getHrPayrollRunsByPeriod","summary":"GET /hr/payroll-runs/{period}","description":"Requires the **HrPayroll:View** permission.","x-permission":"HrPayroll:View","parameters":[{"name":"period","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/hr/payroll-runs/{period}/lines/{employeeCode}":{"put":{"tags":["HR & payroll"],"operationId":"putHrPayrollRunsByPeriodLinesByEmployeeCode","summary":"PUT /hr/payroll-runs/{period}/lines/{employeeCode}","description":"Requires the **HrPayroll:Edit** permission.","x-permission":"HrPayroll:Edit","parameters":[{"name":"period","in":"path","required":true,"schema":{"type":"string"}},{"name":"employeeCode","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"daysWorked":{"type":"integer","minimum":0,"maximum":31},"absentDays":{"type":"integer","minimum":0,"maximum":31},"incentives":{"type":"number","minimum":0},"allowances":{"type":"number","minimum":0},"otherDeductions":{"type":"number","minimum":0},"deductionNote":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]}}}}}}}},"/api/v1/hr/payroll-runs/{period}/review":{"post":{"tags":["HR & payroll"],"operationId":"postHrPayrollRunsByPeriodReview","summary":"POST /hr/payroll-runs/{period}/review","description":"Requires the **HrPayroll:Edit** permission.","x-permission":"HrPayroll:Edit","parameters":[{"name":"period","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"paidOn":{}},"required":["paidOn"]}}}}}},"/api/v1/hr/payroll-runs/{period}/approve":{"post":{"tags":["HR & payroll"],"operationId":"postHrPayrollRunsByPeriodApprove","summary":"POST /hr/payroll-runs/{period}/approve","description":"Requires the **HrPayroll:Approve** permission.","x-permission":"HrPayroll:Approve","parameters":[{"name":"period","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"paidOn":{}},"required":["paidOn"]}}}}}},"/api/v1/hr/payroll-runs/{period}/pay":{"post":{"tags":["HR & payroll"],"operationId":"postHrPayrollRunsByPeriodPay","summary":"POST /hr/payroll-runs/{period}/pay","description":"Requires the **HrPayroll:Approve** permission.","x-permission":"HrPayroll:Approve","parameters":[{"name":"period","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"paidOn":{}},"required":["paidOn"]}}}}}},"/api/v1/procurement/suppliers":{"get":{"tags":["Procurement"],"operationId":"getProcurementSuppliers","summary":"GET /procurement/suppliers","description":"Requires the **Procurement:View** permission.","x-permission":"Procurement:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: code, name, registeredOn, createdAt.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"status","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"origin","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"category","in":"query","description":"Exact match (string); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"country","in":"query","description":"Exact match (string); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Procurement"],"operationId":"postProcurementSuppliers","summary":"POST /procurement/suppliers","description":"Requires the **Procurement:Create** permission.","x-permission":"Procurement:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"origin":{"type":"string","enum":["Local","Foreign"]},"country":{"type":"string","minLength":1},"city":{"type":"string","minLength":1},"category":{"type":"string","minLength":1},"contactName":{"type":"string","minLength":1},"phone":{"type":"string","minLength":1},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"taxId":{"type":"string","minLength":1},"registeredOn":{},"priorSpend":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"documents":{"default":[{"name":"Trade license"},{"name":"TIN certificate"},{"name":"VAT registration"},{"name":"Bank details"}],"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"expiresOn":{}},"required":["name"]}}},"required":["name","origin","country","city","category","contactName","phone","registeredOn"]}}}}}},"/api/v1/procurement/suppliers/{key}":{"get":{"tags":["Procurement"],"operationId":"getProcurementSuppliersByKey","summary":"GET /procurement/suppliers/{key}","description":"Requires the **Procurement:View** permission.","x-permission":"Procurement:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Procurement"],"operationId":"patchProcurementSuppliersByKey","summary":"PATCH /procurement/suppliers/{key}","description":"Requires the **Procurement:Edit** permission.","x-permission":"Procurement:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"origin":{"type":"string","enum":["Local","Foreign"]},"country":{"type":"string","minLength":1},"city":{"type":"string","minLength":1},"category":{"type":"string","minLength":1},"contactName":{"type":"string","minLength":1},"phone":{"type":"string","minLength":1},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"taxId":{"type":"string","minLength":1},"registeredOn":{},"priorSpend":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"status":{"type":"string","enum":["Qualified","PendingDocuments","Suspended"]},"suspensionReason":{"anyOf":[{"type":"string","minLength":5},{"type":"null"}]}}}}}}}},"/api/v1/procurement/suppliers/{key}/documents/{name}":{"put":{"tags":["Procurement"],"operationId":"putProcurementSuppliersByKeyDocumentsByName","summary":"PUT /procurement/suppliers/{key}/documents/{name}","description":"Requires the **Procurement:Edit** permission.","x-permission":"Procurement:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["Verified","Pending","Missing","Rejected"]},"expiresOn":{}},"required":["state"]}}}}}},"/api/v1/procurement/requisitions":{"get":{"tags":["Procurement"],"operationId":"getProcurementRequisitions","summary":"GET /procurement/requisitions","description":"Requires the **Procurement:View** permission.","x-permission":"Procurement:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: code, raisedOn, needBy, status.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"status","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"departmentId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"requestedById","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Procurement"],"operationId":"postProcurementRequisitions","summary":"POST /procurement/requisitions","description":"Requires the **Procurement:Create** permission.","x-permission":"Procurement:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"departmentId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"requestedById":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"requestedByCode":{"type":"string","minLength":1},"raisedOn":{},"needBy":{},"purpose":{"type":"string","minLength":5},"lines":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1},"unit":{"type":"string","minLength":1},"quantity":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"estimatedPrice":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]}},"required":["description","unit","quantity","estimatedPrice"]}}},"required":["departmentId","needBy","purpose","lines"]}}}}}},"/api/v1/procurement/requisitions/{key}":{"get":{"tags":["Procurement"],"operationId":"getProcurementRequisitionsByKey","summary":"GET /procurement/requisitions/{key}","description":"Requires the **Procurement:View** permission.","x-permission":"Procurement:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Procurement"],"operationId":"patchProcurementRequisitionsByKey","summary":"PATCH /procurement/requisitions/{key}","description":"Requires the **Procurement:Edit** permission.","x-permission":"Procurement:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"requestedById":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"requestedByCode":{"type":"string","minLength":1},"raisedOn":{},"needBy":{},"purpose":{"type":"string","minLength":5},"lines":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1},"unit":{"type":"string","minLength":1},"quantity":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"estimatedPrice":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]}},"required":["description","unit","quantity","estimatedPrice"]}}}}}}}},"delete":{"tags":["Procurement"],"operationId":"deleteProcurementRequisitionsByKey","summary":"DELETE /procurement/requisitions/{key}","description":"Requires the **Procurement:DeleteCancel** permission.","x-permission":"Procurement:DeleteCancel","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done (no content)"},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/procurement/requisitions/{key}/budget":{"get":{"tags":["Procurement"],"operationId":"getProcurementRequisitionsByKeyBudget","summary":"GET /procurement/requisitions/{key}/budget","description":"Requires the **Procurement:View** permission.","x-permission":"Procurement:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/procurement/requisitions/{key}/submit":{"post":{"tags":["Procurement"],"operationId":"postProcurementRequisitionsByKeySubmit","summary":"POST /procurement/requisitions/{key}/submit","description":"Requires the **Procurement:Submit** permission.","x-permission":"Procurement:Submit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":5}},"required":["reason"]}}}}}},"/api/v1/procurement/requisitions/{key}/approve":{"post":{"tags":["Procurement"],"operationId":"postProcurementRequisitionsByKeyApprove","summary":"POST /procurement/requisitions/{key}/approve","description":"Requires the **Procurement:Edit** permission.","x-permission":"Procurement:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":5}},"required":["reason"]}}}}}},"/api/v1/procurement/requisitions/{key}/reject":{"post":{"tags":["Procurement"],"operationId":"postProcurementRequisitionsByKeyReject","summary":"POST /procurement/requisitions/{key}/reject","description":"Requires the **Procurement:Edit** permission.","x-permission":"Procurement:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":5}},"required":["reason"]}}}}}},"/api/v1/procurement/requisitions/{key}/rfq":{"post":{"tags":["Procurement"],"operationId":"postProcurementRequisitionsByKeyRfq","summary":"POST /procurement/requisitions/{key}/rfq","description":"Requires the **Procurement:Create** permission.","x-permission":"Procurement:Create","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1},"closesOn":{}},"required":["title","closesOn"]}}}}}},"/api/v1/procurement/rfqs/{key}":{"get":{"tags":["Procurement"],"operationId":"getProcurementRfqsByKey","summary":"GET /procurement/rfqs/{key}","description":"Requires the **Procurement:View** permission.","x-permission":"Procurement:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/procurement/rfqs/{key}/quotes":{"post":{"tags":["Procurement"],"operationId":"postProcurementRfqsByKeyQuotes","summary":"POST /procurement/rfqs/{key}/quotes","description":"Requires the **Procurement:Create** permission.","x-permission":"Procurement:Create","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"supplierId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"deliveryDays":{"type":"integer","minimum":0,"maximum":365},"paymentTerms":{"type":"string","minLength":1},"validityDays":{"type":"integer","minimum":1,"maximum":365},"receivedOn":{},"prices":{"minItems":1,"type":"array","items":{"type":"object","properties":{"requisitionLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"unitPrice":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]}},"required":["requisitionLineId","unitPrice"]}}},"required":["supplierId","deliveryDays","paymentTerms","validityDays","receivedOn","prices"]}}}}}},"/api/v1/procurement/rfqs/{key}/award":{"post":{"tags":["Procurement"],"operationId":"postProcurementRfqsByKeyAward","summary":"POST /procurement/rfqs/{key}/award","description":"Requires the **Procurement:Approve** permission.","x-permission":"Procurement:Approve","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"quoteId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"justification":{"type":"string","minLength":10}},"required":["quoteId"]}}}}}},"/api/v1/procurement/rfqs/{key}/close":{"post":{"tags":["Procurement"],"operationId":"postProcurementRfqsByKeyClose","summary":"POST /procurement/rfqs/{key}/close","description":"Requires the **Procurement:Edit** permission.","x-permission":"Procurement:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/procurement/rfqs/{key}/cancel":{"post":{"tags":["Procurement"],"operationId":"postProcurementRfqsByKeyCancel","summary":"POST /procurement/rfqs/{key}/cancel","description":"Requires the **Procurement:DeleteCancel** permission.","x-permission":"Procurement:DeleteCancel","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/procurement/rfqs":{"get":{"tags":["Procurement"],"operationId":"getProcurementRfqs","summary":"GET /procurement/rfqs","description":"Requires the **Procurement:View** permission.","x-permission":"Procurement:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: code, issuedOn, closesOn, status.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"status","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"departmentId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/procurement/purchase-orders":{"get":{"tags":["Procurement"],"operationId":"getProcurementPurchaseOrders","summary":"GET /procurement/purchase-orders","description":"Requires the **Procurement:View** permission.","x-permission":"Procurement:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/procurement/purchase-orders/{key}":{"get":{"tags":["Procurement"],"operationId":"getProcurementPurchaseOrdersByKey","summary":"GET /procurement/purchase-orders/{key}","description":"Requires the **Procurement:View** permission.","x-permission":"Procurement:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/procurement/purchase-orders/{key}/receipts":{"post":{"tags":["Procurement"],"operationId":"postProcurementPurchaseOrdersByKeyReceipts","summary":"POST /procurement/purchase-orders/{key}/receipts","description":"Requires the **Procurement:Edit** permission.","x-permission":"Procurement:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"receivedOn":{},"lines":{"minItems":1,"type":"array","items":{"type":"object","properties":{"poLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"quantity":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"rejected":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]}},"required":["poLineId","quantity"]}}},"required":["receivedOn","lines"]}}}}}},"/api/v1/procurement/purchase-orders/{key}/invoice":{"post":{"tags":["Procurement"],"operationId":"postProcurementPurchaseOrdersByKeyInvoice","summary":"POST /procurement/purchase-orders/{key}/invoice","description":"Requires the **Procurement:Edit** permission.","x-permission":"Procurement:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"invoiceNo":{"type":"string","minLength":1},"invoicedOn":{},"lines":{"minItems":1,"type":"array","items":{"type":"object","properties":{"poLineId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"quantity":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"unitPrice":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]}},"required":["poLineId","quantity","unitPrice"]}},"files":{"minItems":1,"type":"array","items":{"type":"object","properties":{"fileName":{"type":"string","minLength":1,"maxLength":200},"mimeType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"storageKey":{"type":"string","pattern":"^uploads\\/\\d{4}\\/\\d{2}\\/[0-9a-f-]{36}\\.(jpg|png|webp|heic|pdf|xlsx)$"},"checksum":{"type":"string"}},"required":["fileName","storageKey"]}}},"required":["invoiceNo","invoicedOn","lines","files"]}}}}}},"/api/v1/procurement/purchase-orders/{key}/approve-payment":{"post":{"tags":["Procurement"],"operationId":"postProcurementPurchaseOrdersByKeyApprovePayment","summary":"POST /procurement/purchase-orders/{key}/approve-payment","description":"Requires the **Procurement:Edit** permission.","x-permission":"Procurement:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"overrideReason":{"type":"string","minLength":10}}}}}}}},"/api/v1/procurement/purchase-orders/{key}/paid":{"post":{"tags":["Procurement"],"operationId":"postProcurementPurchaseOrdersByKeyPaid","summary":"POST /procurement/purchase-orders/{key}/paid","description":"Requires the **Procurement:Edit** permission.","x-permission":"Procurement:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"paidOn":{}},"required":["paidOn"]}}}}}},"/api/v1/procurement/budgets":{"get":{"tags":["Procurement"],"operationId":"getProcurementBudgets","summary":"GET /procurement/budgets","description":"Requires the **Procurement:View** permission.","x-permission":"Procurement:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/procurement/budgets/{departmentId}":{"put":{"tags":["Procurement"],"operationId":"putProcurementBudgetsByDepartmentId","summary":"PUT /procurement/budgets/{departmentId}","description":"Requires the **Procurement:Approve** permission.","x-permission":"Procurement:Approve","parameters":[{"name":"departmentId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"fiscalYear":{"type":"integer","minimum":2000,"maximum":2100},"amount":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]}},"required":["amount"]}}}}}},"/api/v1/crm/accounts":{"get":{"tags":["CRM"],"operationId":"getCrmAccounts","summary":"GET /crm/accounts","description":"Requires the **Crm:View** permission.","x-permission":"Crm:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: code, name, since, createdAt.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"type","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"region","in":"query","description":"Exact match (string); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"ownerId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["CRM"],"operationId":"postCrmAccounts","summary":"POST /crm/accounts","description":"Requires the **Crm:Create** permission.","x-permission":"Crm:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["Household","Corporate","InstitutionNgo","Dealer","ExportBuyer","VehicleBuyer"]},"region":{"type":"string","minLength":1},"city":{"type":"string","minLength":1},"phone":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"tin":{"type":"string","pattern":"^\\d{10}$"},"ownerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"since":{},"contacts":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"role":{"type":"string","minLength":1},"phone":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"isPrimary":{"default":false,"type":"boolean"}},"required":["name","role","phone"]}}},"required":["name","type","region","city","phone"]}}}}}},"/api/v1/crm/accounts/{key}":{"get":{"tags":["CRM"],"operationId":"getCrmAccountsByKey","summary":"GET /crm/accounts/{key}","description":"Requires the **Crm:View** permission.","x-permission":"Crm:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["CRM"],"operationId":"patchCrmAccountsByKey","summary":"PATCH /crm/accounts/{key}","description":"Requires the **Crm:Edit** permission.","x-permission":"Crm:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["Household","Corporate","InstitutionNgo","Dealer","ExportBuyer","VehicleBuyer"]},"region":{"type":"string","minLength":1},"city":{"type":"string","minLength":1},"phone":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"tin":{"type":"string","pattern":"^\\d{10}$"},"ownerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"since":{}}}}}}}},"/api/v1/crm/accounts/{key}/timeline":{"get":{"tags":["CRM"],"operationId":"getCrmAccountsByKeyTimeline","summary":"GET /crm/accounts/{key}/timeline","description":"Requires the **Crm:View** permission.","x-permission":"Crm:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm/accounts/{key}/contacts":{"post":{"tags":["CRM"],"operationId":"postCrmAccountsByKeyContacts","summary":"POST /crm/accounts/{key}/contacts","description":"Requires the **Crm:Edit** permission.","x-permission":"Crm:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"role":{"type":"string","minLength":1},"phone":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"isPrimary":{"default":false,"type":"boolean"}},"required":["name","role","phone"]}}}}}},"/api/v1/crm/accounts/{key}/contacts/{id}":{"patch":{"tags":["CRM"],"operationId":"patchCrmAccountsByKeyContactsById","summary":"PATCH /crm/accounts/{key}/contacts/{id}","description":"Requires the **Crm:Edit** permission.","x-permission":"Crm:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"role":{"type":"string","minLength":1},"phone":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"isPrimary":{"type":"boolean"}}}}}}},"delete":{"tags":["CRM"],"operationId":"deleteCrmAccountsByKeyContactsById","summary":"DELETE /crm/accounts/{key}/contacts/{id}","description":"Requires the **Crm:Edit** permission.","x-permission":"Crm:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm/leads":{"get":{"tags":["CRM"],"operationId":"getCrmLeads","summary":"GET /crm/leads","description":"Requires the **Crm:View** permission.","x-permission":"Crm:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: code, name, createdAt, nextFollowUp, estimatedValue, status.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"status","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"source","in":"query","description":"Exact match (string); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"customerType","in":"query","description":"Exact match (string); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"interest","in":"query","description":"Exact match (string); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"region","in":"query","description":"Exact match (string); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"ownerId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["CRM"],"operationId":"postCrmLeads","summary":"POST /crm/leads","description":"Requires the **Crm:Create** permission.","x-permission":"Crm:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"organization":{"type":"string","minLength":1},"phone":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"source":{"type":"string","minLength":1},"customerType":{"type":"string","minLength":1},"interest":{"type":"string","minLength":1},"region":{"type":"string","minLength":1},"estimatedValue":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"ownerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"nextFollowUp":{},"notes":{"type":"string","minLength":1},"ignoreDuplicates":{"default":false,"type":"boolean"}},"required":["name","phone","source","customerType","interest","region"]}}}}}},"/api/v1/crm/leads/{key}":{"get":{"tags":["CRM"],"operationId":"getCrmLeadsByKey","summary":"GET /crm/leads/{key}","description":"Requires the **Crm:View** permission.","x-permission":"Crm:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["CRM"],"operationId":"patchCrmLeadsByKey","summary":"PATCH /crm/leads/{key}","description":"Requires the **Crm:Edit** permission.","x-permission":"Crm:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"organization":{"type":"string","minLength":1},"phone":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"source":{"type":"string","minLength":1},"customerType":{"type":"string","minLength":1},"interest":{"type":"string","minLength":1},"region":{"type":"string","minLength":1},"estimatedValue":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"ownerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"nextFollowUp":{},"notes":{"type":"string","minLength":1},"status":{"type":"string","enum":["New","Contacted"]}}}}}}}},"/api/v1/crm/leads/{key}/qualify":{"post":{"tags":["CRM"],"operationId":"postCrmLeadsByKeyQualify","summary":"POST /crm/leads/{key}/qualify","description":"Requires the **Crm:Edit** permission.","x-permission":"Crm:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":5}},"required":["reason"]}}}}}},"/api/v1/crm/leads/{key}/disqualify":{"post":{"tags":["CRM"],"operationId":"postCrmLeadsByKeyDisqualify","summary":"POST /crm/leads/{key}/disqualify","description":"Requires the **Crm:Edit** permission.","x-permission":"Crm:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":5}},"required":["reason"]}}}}}},"/api/v1/crm/leads/{key}/convert":{"post":{"tags":["CRM"],"operationId":"postCrmLeadsByKeyConvert","summary":"POST /crm/leads/{key}/convert","description":"Requires the **Crm:Create** permission.","x-permission":"Crm:Create","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"account":{"type":"object","properties":{"name":{"type":"string","minLength":1},"type":{"type":"string","enum":["Household","Corporate","InstitutionNgo","Dealer","ExportBuyer","VehicleBuyer"]},"region":{"type":"string","minLength":1},"city":{"type":"string","minLength":1},"phone":{"type":"string"},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"tin":{"type":"string","pattern":"^\\d{10}$"},"ownerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"since":{}},"required":["name","type","region","city","phone"]},"opportunity":{"type":"object","properties":{"name":{"type":"string","minLength":1},"value":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"expectedClose":{},"probability":{"type":"integer","minimum":0,"maximum":100}},"required":["name","value","expectedClose"]}},"required":["opportunity"]}}}}}},"/api/v1/crm/opportunities":{"get":{"tags":["CRM"],"operationId":"getCrmOpportunities","summary":"GET /crm/opportunities","description":"Requires the **Crm:View** permission.","x-permission":"Crm:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: code, name, value, expectedClose, stage, createdAt.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"stage","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"accountId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"ownerId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"interest","in":"query","description":"Exact match (string); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["CRM"],"operationId":"postCrmOpportunities","summary":"POST /crm/opportunities","description":"Requires the **Crm:Create** permission.","x-permission":"Crm:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"interest":{"type":"string","minLength":1},"value":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"expectedClose":{},"ownerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"probability":{"type":"integer","minimum":0,"maximum":100}},"required":["name","accountId","interest","value","expectedClose"]}}}}}},"/api/v1/crm/opportunities/{key}":{"get":{"tags":["CRM"],"operationId":"getCrmOpportunitiesByKey","summary":"GET /crm/opportunities/{key}","description":"Requires the **Crm:View** permission.","x-permission":"Crm:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["CRM"],"operationId":"patchCrmOpportunitiesByKey","summary":"PATCH /crm/opportunities/{key}","description":"Requires the **Crm:Edit** permission.","x-permission":"Crm:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"interest":{"type":"string","minLength":1},"value":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"expectedClose":{},"ownerId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"probability":{"type":"integer","minimum":0,"maximum":100}}}}}}}},"/api/v1/crm/opportunities/{key}/stage":{"post":{"tags":["CRM"],"operationId":"postCrmOpportunitiesByKeyStage","summary":"POST /crm/opportunities/{key}/stage","description":"Requires the **Crm:Edit** permission.","x-permission":"Crm:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"stage":{"type":"string","enum":["New","Qualified","NeedsAssessment","Quotation","Negotiation","Won","Lost","OnHold"]},"lossReason":{"type":"string","minLength":1}},"required":["stage"]}}}}}},"/api/v1/crm/quotations":{"get":{"tags":["CRM"],"operationId":"getCrmQuotations","summary":"GET /crm/quotations","description":"Requires the **Crm:View** permission.","x-permission":"Crm:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["CRM"],"operationId":"postCrmQuotations","summary":"POST /crm/quotations","description":"Requires the **Crm:Create** permission.","x-permission":"Crm:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"opportunityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"issuedOn":{},"validUntil":{},"currency":{"type":"string","minLength":3,"maxLength":3},"lines":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sku":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"quantity":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"unitPrice":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"discount":{"default":0,"type":"number","minimum":0,"maximum":1}},"required":["description","quantity","unitPrice"]}}},"required":["opportunityId","validUntil","lines"]}}}}}},"/api/v1/crm/quotations/{key}":{"get":{"tags":["CRM"],"operationId":"getCrmQuotationsByKey","summary":"GET /crm/quotations/{key}","description":"Requires the **Crm:View** permission.","x-permission":"Crm:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["CRM"],"operationId":"patchCrmQuotationsByKey","summary":"PATCH /crm/quotations/{key}","description":"Requires the **Crm:Edit** permission.","x-permission":"Crm:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"issuedOn":{},"validUntil":{},"currency":{"type":"string","minLength":3,"maxLength":3},"lines":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"productId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"sku":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"quantity":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"unitPrice":{"anyOf":[{"type":"number"},{"type":"string","pattern":"^-?\\d+(\\.\\d+)?$"}]},"discount":{"default":0,"type":"number","minimum":0,"maximum":1}},"required":["description","quantity","unitPrice"]}}}}}}}}},"/api/v1/crm/quotations/{key}/submit":{"post":{"tags":["CRM"],"operationId":"postCrmQuotationsByKeySubmit","summary":"POST /crm/quotations/{key}/submit","description":"Requires the **Crm:Submit** permission.","x-permission":"Crm:Submit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm/quotations/{key}/approve":{"post":{"tags":["CRM"],"operationId":"postCrmQuotationsByKeyApprove","summary":"POST /crm/quotations/{key}/approve","description":"Requires the **Crm:Approve** permission.","x-permission":"Crm:Approve","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm/quotations/{key}/reject":{"post":{"tags":["CRM"],"operationId":"postCrmQuotationsByKeyReject","summary":"POST /crm/quotations/{key}/reject","description":"Requires the **Crm:Edit** permission.","x-permission":"Crm:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm/quotations/{key}/accept":{"post":{"tags":["CRM"],"operationId":"postCrmQuotationsByKeyAccept","summary":"POST /crm/quotations/{key}/accept","description":"Requires the **Crm:Edit** permission.","x-permission":"Crm:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm/quotations/{key}/revise":{"post":{"tags":["CRM"],"operationId":"postCrmQuotationsByKeyRevise","summary":"POST /crm/quotations/{key}/revise","description":"Requires the **Crm:Edit** permission.","x-permission":"Crm:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm/activities":{"get":{"tags":["CRM"],"operationId":"getCrmActivities","summary":"GET /crm/activities","description":"Requires the **Crm:View** permission.","x-permission":"Crm:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: at, type, status, priority, createdAt.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"type","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"status","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"priority","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"accountId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"leadId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"opportunityId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"byId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"assigneeId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["CRM"],"operationId":"postCrmActivities","summary":"POST /crm/activities","description":"Requires the **Crm:Create** permission.","x-permission":"Crm:Create","parameters":[],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["Call","Meeting","Task","Email","Note"]},"summary":{"type":"string","minLength":3,"maxLength":200},"details":{"type":"string","maxLength":4000},"at":{},"durationMin":{"type":"integer","minimum":5,"maximum":1440},"location":{"type":"string","maxLength":200},"reminderMin":{"type":"integer","minimum":0,"maximum":10080},"priority":{"default":"Normal","type":"string","enum":["Low","Normal","High"]},"assigneeId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"accountId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"leadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"opportunityId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"default":"Done","type":"string","enum":["Planned","Done"]}},"required":["type","summary"]}}}}}},"/api/v1/crm/activities/{key}":{"get":{"tags":["CRM"],"operationId":"getCrmActivitiesByKey","summary":"GET /crm/activities/{key}","description":"Requires the **Crm:View** permission.","x-permission":"Crm:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["CRM"],"operationId":"patchCrmActivitiesByKey","summary":"PATCH /crm/activities/{key}","description":"Requires the **Crm:Edit** permission.","x-permission":"Crm:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["Call","Meeting","Task","Email","Note"]},"summary":{"type":"string","minLength":3,"maxLength":200},"details":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"at":{},"durationMin":{"anyOf":[{"type":"integer","minimum":5,"maximum":1440},{"type":"null"}]},"location":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"reminderMin":{"anyOf":[{"type":"integer","minimum":0,"maximum":10080},{"type":"null"}]},"priority":{"type":"string","enum":["Low","Normal","High"]},"assigneeId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"accountId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"leadId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"opportunityId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}}}}}}},"delete":{"tags":["CRM"],"operationId":"deleteCrmActivitiesByKey","summary":"DELETE /crm/activities/{key}","description":"Requires the **Crm:DeleteCancel** permission.","x-permission":"Crm:DeleteCancel","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done (no content)"},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm/activities/{key}/complete":{"post":{"tags":["CRM"],"operationId":"postCrmActivitiesByKeyComplete","summary":"POST /crm/activities/{key}/complete","description":"Requires the **Crm:Edit** permission.","x-permission":"Crm:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"outcome":{"type":"string","maxLength":2000},"at":{}}}}}}}},"/api/v1/crm/activities/{key}/reschedule":{"post":{"tags":["CRM"],"operationId":"postCrmActivitiesByKeyReschedule","summary":"POST /crm/activities/{key}/reschedule","description":"Requires the **Crm:Edit** permission.","x-permission":"Crm:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"at":{},"reason":{"type":"string","maxLength":500}},"required":["at"]}}}}}},"/api/v1/crm/activities/{key}/cancel":{"post":{"tags":["CRM"],"operationId":"postCrmActivitiesByKeyCancel","summary":"POST /crm/activities/{key}/cancel","description":"Requires the **Crm:Edit** permission.","x-permission":"Crm:Edit","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The change breaks a business rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","maxLength":500}}}}}}}},"/api/v1/crm/sales-orders":{"get":{"tags":["CRM"],"operationId":"getCrmSalesOrders","summary":"GET /crm/sales-orders","description":"Requires the **Crm:View** permission.","x-permission":"Crm:View","parameters":[{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":25}},{"name":"sort","in":"query","description":"Field to sort by, prefix with \"-\" for descending. One of: code, orderedOn, amount, status.","schema":{"type":"string"}},{"name":"q","in":"query","description":"Case-insensitive text search","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date"}},{"name":"to","in":"query","schema":{"type":"string","format":"date"}},{"name":"status","in":"query","description":"Exact match (enum); comma-separate values for \"any of\".","schema":{"type":"string"}},{"name":"accountId","in":"query","description":"Exact match (uuid); comma-separate values for \"any of\".","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm/sales-orders/{key}":{"get":{"tags":["CRM"],"operationId":"getCrmSalesOrdersByKey","summary":"GET /crm/sales-orders/{key}","description":"Requires the **Crm:View** permission.","x-permission":"Crm:View","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm/owners":{"get":{"tags":["CRM"],"operationId":"getCrmOwners","summary":"GET /crm/owners","description":"Requires the **Crm:View** permission.","x-permission":"Crm:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm/my-day":{"get":{"tags":["CRM"],"operationId":"getCrmMyDay","summary":"GET /crm/my-day","description":"Requires the **Crm:View** permission.","x-permission":"Crm:View","parameters":[{"name":"tzOffset","in":"query","required":false,"schema":{"default":-180,"type":"integer","minimum":-840,"maximum":840}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"400":{"description":"Invalid input (`details` lists each field problem)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/crm/account-ledger":{"get":{"tags":["CRM"],"operationId":"getCrmAccountLedger","summary":"GET /crm/account-ledger","description":"Requires the **Crm:View** permission.","x-permission":"Crm:View","parameters":[],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{}}}},"401":{"description":"Not signed in, or the session expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Your role lacks the permission","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Session token from POST /api/v1/auth/login"}},"schemas":{"Error":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string","examples":["ValidationError"]},"message":{"type":"string"},"details":{"description":"Field problems for validation errors, or extra context"}}}}},"security":[{"bearerAuth":[]}]}