openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.1.0 description: API specification servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: auth description: Authentication - name: users description: User and role management - name: deployment-types description: Employee deployment categories - name: passports description: Passport OCR operations - name: companies description: Company management - name: loa description: Letter of Appointment operations - name: loa-options description: Reusable dropdown options for LOA form (work types, work sites, job titles) - name: clients description: Client / placement management (where candidates are allocated) - name: billing description: Invoices and quotations paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check description: Returns server health status responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /auth/me: get: operationId: getAuthStatus tags: [auth] summary: Returns current authenticated user with roles and permissions security: - bearerAuth: [] responses: "200": description: Auth status content: application/json: schema: $ref: "#/components/schemas/AuthStatus" "401": description: Not authenticated /users: get: operationId: listUsers tags: [users] summary: List all users with roles security: - bearerAuth: [] responses: "200": description: Users content: application/json: schema: type: array items: $ref: "#/components/schemas/AppUser" /roles: get: operationId: listRoles tags: [users] summary: List available roles security: - bearerAuth: [] responses: "200": description: Roles content: application/json: schema: type: array items: $ref: "#/components/schemas/Role" /users/{id}: patch: operationId: updateUser tags: [users] summary: Update user profile or active status security: - bearerAuth: [] parameters: - name: id in: path required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UserUpdateInput" responses: "204": description: Updated "400": description: Invalid input /users/{id}/roles: patch: operationId: updateUserRoles tags: [users] summary: Assign roles to a user security: - bearerAuth: [] parameters: - name: id in: path required: true schema: type: string format: uuid requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UserRolesInput" responses: "204": description: Roles updated /deployment-types: get: operationId: listDeploymentTypes tags: [deployment-types] summary: List deployment type categories security: - bearerAuth: [] responses: "200": description: Deployment types content: application/json: schema: type: array items: $ref: "#/components/schemas/DeploymentType" /system/settings: get: operationId: getSystemSettings tags: [system] summary: Read tenant system settings (app name, theme) responses: "200": description: System settings content: application/json: schema: $ref: "#/components/schemas/SystemSettings" patch: operationId: updateSystemSettings tags: [system] summary: Update tenant system settings requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SystemSettingsInput" responses: "200": description: Updated system settings content: application/json: schema: $ref: "#/components/schemas/SystemSettings" /passports: get: operationId: listPassports tags: [passports] summary: List all passport records parameters: - name: search in: query schema: type: string - name: nationality in: query schema: type: string - name: status in: query schema: type: string - name: clientId in: query description: Filter by allocated client. Pass `none` for unallocated candidates. schema: type: string - name: deploymentTypeId in: query description: Filter by deployment type (recruitment, casual, etc.) schema: type: string responses: "200": description: List of passport records content: application/json: schema: type: array items: $ref: "#/components/schemas/Passport" /passports/upload: post: operationId: uploadPassport tags: [passports] summary: Upload passport image/PDF for OCR extraction requestBody: required: true content: multipart/form-data: schema: $ref: "#/components/schemas/PassportUpload" responses: "201": description: Passport record created with extracted data content: application/json: schema: $ref: "#/components/schemas/Passport" "400": description: Invalid file /passports/stats: get: operationId: getPassportStats tags: [passports] summary: Get dashboard statistics responses: "200": description: Passport statistics content: application/json: schema: $ref: "#/components/schemas/PassportStats" /passports/{id}: get: operationId: getPassport tags: [passports] summary: Get a single passport record parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Passport record content: application/json: schema: $ref: "#/components/schemas/Passport" "404": description: Not found patch: operationId: updatePassport tags: [passports] summary: Update a passport record parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/PassportUpdate" responses: "200": description: Updated passport record content: application/json: schema: $ref: "#/components/schemas/Passport" "404": description: Not found delete: operationId: deletePassport tags: [passports] summary: Delete a passport record parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted "404": description: Not found /companies: get: operationId: listCompanies tags: [companies] summary: List all companies parameters: - name: withBranding in: query description: When true, include letterheadImage and signatureImage (heavy base64 fields). Defaults to false. schema: type: boolean responses: "200": description: List of companies content: application/json: schema: type: array items: $ref: "#/components/schemas/Company" post: operationId: createCompany tags: [companies] summary: Create a company requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CompanyInput" responses: "201": description: Created company content: application/json: schema: $ref: "#/components/schemas/Company" /companies/{id}: patch: operationId: updateCompany tags: [companies] summary: Update a company parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CompanyUpdate" responses: "200": description: Updated company content: application/json: schema: $ref: "#/components/schemas/Company" "404": description: Not found delete: operationId: deleteCompany tags: [companies] summary: Delete a company parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted "404": description: Not found /loa: get: operationId: listLoa tags: [loa] summary: List all LOA entries responses: "200": description: List of LOA entries content: application/json: schema: type: array items: $ref: "#/components/schemas/Loa" post: operationId: createLoa tags: [loa] summary: Create a LOA entry requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/LoaInput" responses: "201": description: Created LOA content: application/json: schema: $ref: "#/components/schemas/Loa" /loa/{id}: get: operationId: getLoa tags: [loa] summary: Get a single LOA entry parameters: - name: id in: path required: true schema: type: integer responses: "200": description: LOA entry content: application/json: schema: $ref: "#/components/schemas/Loa" "404": description: Not found patch: operationId: updateLoa tags: [loa] summary: Update a LOA entry parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/LoaUpdate" responses: "200": description: Updated LOA content: application/json: schema: $ref: "#/components/schemas/Loa" "404": description: Not found delete: operationId: deleteLoa tags: [loa] summary: Delete a LOA entry parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted "404": description: Not found /clients: get: operationId: listClients tags: [clients] summary: List all clients parameters: - name: search in: query schema: type: string responses: "200": description: List of clients content: application/json: schema: type: array items: $ref: "#/components/schemas/Client" post: operationId: createClient tags: [clients] summary: Create a client requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ClientInput" responses: "201": description: Created content: application/json: schema: $ref: "#/components/schemas/Client" /clients/{id}: patch: operationId: updateClient tags: [clients] summary: Update a client parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ClientUpdate" responses: "200": description: Updated content: application/json: schema: $ref: "#/components/schemas/Client" "404": description: Not found delete: operationId: deleteClient tags: [clients] summary: Delete a client (also unlinks any allocated candidates) parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted "404": description: Not found /expense-categories: get: operationId: listExpenseCategories tags: [expenses] summary: List expense categories responses: "200": description: List of categories content: application/json: schema: type: array items: $ref: "#/components/schemas/ExpenseCategory" post: operationId: createExpenseCategory tags: [expenses] summary: Create an expense category requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ExpenseCategoryInput" responses: "201": description: Created content: application/json: schema: $ref: "#/components/schemas/ExpenseCategory" "409": description: A category with this name already exists /expense-categories/{id}: patch: operationId: updateExpenseCategory tags: [expenses] summary: Update an expense category parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ExpenseCategoryUpdate" responses: "200": description: Updated content: application/json: schema: $ref: "#/components/schemas/ExpenseCategory" "404": description: Not found "409": description: Another category with this name already exists delete: operationId: deleteExpenseCategory tags: [expenses] summary: Delete an expense category (refused if expenses still reference it) parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted "404": description: Not found "409": description: Category is in use by one or more expenses /expenses: get: operationId: listExpenses tags: [expenses] summary: List expenses (newest first) parameters: - name: categoryId in: query schema: type: integer - name: search in: query schema: type: string responses: "200": description: List of expenses with joined category name content: application/json: schema: type: array items: $ref: "#/components/schemas/Expense" post: operationId: createExpense tags: [expenses] summary: Create an expense requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ExpenseInput" responses: "201": description: Created content: application/json: schema: $ref: "#/components/schemas/Expense" "400": description: Invalid input or unknown category /expenses/{id}: patch: operationId: updateExpense tags: [expenses] summary: Update an expense parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/ExpenseUpdate" responses: "200": description: Updated content: application/json: schema: $ref: "#/components/schemas/Expense" "400": description: Invalid input or unknown category "404": description: Not found delete: operationId: deleteExpense tags: [expenses] summary: Delete an expense parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted "404": description: Not found /billing/stats: get: operationId: getBillingStats tags: [billing] summary: Billing summary stats by status and deployment type security: - bearerAuth: [] responses: "200": description: Billing statistics content: application/json: schema: $ref: "#/components/schemas/BillingStats" /billing/documents: get: operationId: listBillingDocuments tags: [billing] summary: List invoices and quotations parameters: - name: kind in: query schema: type: string enum: [invoice, quotation] - name: search in: query schema: type: string - name: deploymentTypeId in: query schema: type: integer responses: "200": description: List of billing documents content: application/json: schema: type: array items: $ref: "#/components/schemas/BillingDocumentSummary" post: operationId: createBillingDocument tags: [billing] summary: Create an invoice or quotation requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/BillingDocumentInput" responses: "201": description: Created content: application/json: schema: $ref: "#/components/schemas/BillingDocumentCreated" "400": description: Invalid input /billing/documents/{id}: get: operationId: getBillingDocument tags: [billing] summary: Get an invoice or quotation with line items parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Document with items content: application/json: schema: $ref: "#/components/schemas/BillingDocument" "404": description: Not found patch: operationId: updateBillingDocument tags: [billing] summary: Update an invoice or quotation parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/BillingDocumentUpdate" responses: "204": description: Updated "400": description: Invalid input "404": description: Not found delete: operationId: deleteBillingDocument tags: [billing] summary: Delete an invoice or quotation parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted "404": description: Not found /loa-options: get: operationId: listLoaOptions tags: [loa-options] summary: List LOA dropdown options parameters: - name: category in: query description: Filter by category (work_type, work_site, job_title) schema: type: string enum: [work_type, work_site, job_title] responses: "200": description: List of options content: application/json: schema: type: array items: $ref: "#/components/schemas/LoaOption" post: operationId: createLoaOption tags: [loa-options] summary: Add a new LOA dropdown option requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/LoaOptionInput" responses: "201": description: Created option content: application/json: schema: $ref: "#/components/schemas/LoaOption" "409": description: Option already exists in this category /loa-options/{id}: patch: operationId: updateLoaOption tags: [loa-options] summary: Rename a LOA dropdown option parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/UpdateLoaOptionInput" responses: "200": description: Updated option content: application/json: schema: $ref: "#/components/schemas/LoaOption" "404": description: Not found "409": description: Another option with this value already exists in this category delete: operationId: deleteLoaOption tags: [loa-options] summary: Delete a LOA dropdown option parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted "404": description: Not found components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT schemas: HealthStatus: type: object properties: status: type: string required: - status AuthUser: type: object required: [id, email, roles, permissions] properties: id: type: string format: uuid email: type: string fullName: type: ["string", "null"] roles: type: array items: type: string permissions: type: array items: type: string AuthStatus: type: object required: [authenticated, user] properties: authenticated: type: boolean user: $ref: "#/components/schemas/AuthUser" Role: type: object required: [id, slug, name] properties: id: type: integer slug: type: string name: type: string description: type: ["string", "null"] AppUser: type: object required: [id, email, isActive, createdAt, roles] properties: id: type: string format: uuid email: type: string fullName: type: ["string", "null"] isActive: type: boolean createdAt: type: string roles: type: array items: type: object required: [slug, name] properties: slug: type: string name: type: string UserUpdateInput: type: object properties: fullName: type: string isActive: type: boolean UserRolesInput: type: object required: [roleSlugs] properties: roleSlugs: type: array items: type: string DeploymentType: type: object required: [id, slug, name] properties: id: type: integer slug: type: string name: type: string description: type: ["string", "null"] BillingStats: type: object required: [totalInvoices, totalQuotations, draft, sent, paid, void, totalRevenue] properties: totalInvoices: type: integer totalQuotations: type: integer draft: type: integer sent: type: integer paid: type: integer void: type: integer totalRevenue: type: string byDeploymentType: type: array items: type: object properties: deploymentTypeId: type: ["integer", "null"] deploymentTypeName: type: ["string", "null"] count: type: integer revenue: type: string SystemSettings: type: object required: [appName, accentHue, hasCustomPassword] properties: appName: type: string accentHue: type: integer minimum: 0 maximum: 360 companyName: type: string nullable: true companyAddress: type: string nullable: true companyPhone: type: string nullable: true companyEmail: type: string nullable: true companyWebsite: type: string nullable: true companyRegistrationNumber: type: string nullable: true logoImage: type: string nullable: true description: Inline base64 data URL (PNG/JPEG, ≤600KB). hasCustomPassword: type: boolean description: True if a DB-stored password override is set; false means env APP_PASSWORD is in use. SystemSettingsInput: type: object properties: appName: type: string minLength: 1 maxLength: 60 accentHue: type: integer minimum: 0 maximum: 360 companyName: type: string nullable: true maxLength: 200 companyAddress: type: string nullable: true maxLength: 500 companyPhone: type: string nullable: true maxLength: 50 companyEmail: type: string nullable: true maxLength: 200 companyWebsite: type: string nullable: true maxLength: 200 companyRegistrationNumber: type: string nullable: true maxLength: 100 logoImage: type: string nullable: true LoaOption: type: object required: [id, category, value, createdAt] properties: id: type: integer category: type: string enum: [work_type, work_site, job_title] value: type: string createdAt: type: string LoaOptionInput: type: object required: [category, value] properties: category: type: string enum: [work_type, work_site, job_title] value: type: string minLength: 1 UpdateLoaOptionInput: type: object required: [value] properties: value: type: string minLength: 1 Client: type: object required: [id, name, createdAt, updatedAt] properties: id: type: integer name: type: string contactPerson: type: ["string", "null"] phone: type: ["string", "null"] email: type: ["string", "null"] address: type: ["string", "null"] notes: type: ["string", "null"] createdAt: type: string updatedAt: type: string ClientInput: type: object required: [name] properties: name: type: string minLength: 1 contactPerson: type: string phone: type: string email: type: string address: type: string notes: type: string ClientUpdate: type: object properties: name: type: string minLength: 1 contactPerson: type: ["string", "null"] phone: type: ["string", "null"] email: type: ["string", "null"] address: type: ["string", "null"] notes: type: ["string", "null"] ExpenseCategory: type: object required: [id, name, createdAt, updatedAt] properties: id: type: integer name: type: string color: type: ["string", "null"] createdAt: type: string updatedAt: type: string ExpenseCategoryInput: type: object required: [name] properties: name: type: string minLength: 1 color: type: string ExpenseCategoryUpdate: type: object properties: name: type: string minLength: 1 color: type: ["string", "null"] Expense: type: object required: [id, categoryId, categoryName, amount, createdAt, updatedAt] properties: id: type: integer categoryId: type: integer categoryName: type: string # numeric(14,2) — sent as a string to preserve precision amount: type: string expenseDate: type: ["string", "null"] remarks: type: ["string", "null"] createdAt: type: string updatedAt: type: string ExpenseInput: type: object required: [categoryId, amount] properties: categoryId: type: integer amount: type: string minLength: 1 expenseDate: type: string remarks: type: string ExpenseUpdate: type: object properties: categoryId: type: integer amount: type: string minLength: 1 expenseDate: type: ["string", "null"] remarks: type: ["string", "null"] Passport: type: object required: [id, status, createdAt, updatedAt] properties: id: type: integer fullName: type: ["string", "null"] passportNumber: type: ["string", "null"] dateOfBirth: type: ["string", "null"] dateOfIssue: type: ["string", "null"] dateOfExpiry: type: ["string", "null"] address: type: ["string", "null"] nationality: type: ["string", "null"] description: "bangladesh or india" status: type: string enum: [processing, completed, failed] errorMessage: type: ["string", "null"] originalFilename: type: ["string", "null"] clientId: type: ["integer", "null"] description: ID of the client the candidate is allocated to. clientName: type: ["string", "null"] description: Joined client name for display (computed; ignored on writes). workPermitNumber: type: ["string", "null"] agent: type: ["string", "null"] deploymentTypeId: type: ["integer", "null"] description: Deployment category (recruitment, casual worker, etc.) deploymentTypeName: type: ["string", "null"] description: Joined deployment type name for display createdAt: type: string updatedAt: type: string PassportUpload: type: object required: [file] properties: file: type: string format: binary PassportUpdate: type: object properties: fullName: type: string passportNumber: type: string dateOfBirth: type: string dateOfIssue: type: string dateOfExpiry: type: string address: type: string nationality: type: string clientId: type: ["integer", "null"] workPermitNumber: type: ["string", "null"] agent: type: ["string", "null"] deploymentTypeId: type: ["integer", "null"] PassportStats: type: object required: [total, completed, processing, failed, bangladeshi, indian, recentUploads] properties: total: type: integer completed: type: integer processing: type: integer failed: type: integer bangladeshi: type: integer indian: type: integer recentUploads: type: array items: $ref: "#/components/schemas/Passport" Company: type: object required: [id, name, createdAt, updatedAt] properties: id: type: integer name: type: string address: type: ["string", "null"] email: type: ["string", "null"] phone: type: ["string", "null"] country: type: ["string", "null"] registrationNumber: type: ["string", "null"] signatoryName: type: ["string", "null"] signatoryDesignation: type: ["string", "null"] letterheadImage: type: ["string", "null"] description: Base64 data URL (image/png or image/jpeg) shown at the top of generated LOA PDFs signatureImage: type: ["string", "null"] description: Base64 data URL (image/png or image/jpeg) inserted on the signature line of generated LOA PDFs createdAt: type: string updatedAt: type: string CompanyInput: type: object required: [name] properties: name: type: string address: type: string email: type: string phone: type: string country: type: string registrationNumber: type: string signatoryName: type: string signatoryDesignation: type: string letterheadImage: type: string signatureImage: type: string CompanyUpdate: type: object properties: name: type: string address: type: string email: type: string phone: type: string country: type: string registrationNumber: type: string signatoryName: type: string signatoryDesignation: type: string letterheadImage: type: ["string", "null"] signatureImage: type: ["string", "null"] Loa: type: object required: [id, createdAt, updatedAt] properties: id: type: integer companyId: type: ["integer", "null"] passportId: type: ["integer", "null"] companyName: type: ["string", "null"] companyAddress: type: ["string", "null"] companyEmail: type: ["string", "null"] companyPhone: type: ["string", "null"] companyCountry: type: ["string", "null"] companyRegistrationNumber: type: ["string", "null"] candidateName: type: ["string", "null"] candidateAddress: type: ["string", "null"] candidateNationality: type: ["string", "null"] candidateDateOfBirth: type: ["string", "null"] candidatePassportNumber: type: ["string", "null"] candidateEmergencyContact: type: ["string", "null"] jobTitle: type: ["string", "null"] workType: type: ["string", "null"] basicSalary: type: ["string", "null"] salaryPaymentDate: type: ["string", "null"] workSite: type: ["string", "null"] dateOfCommence: type: ["string", "null"] jobDescription: type: ["string", "null"] workingHours: type: ["string", "null"] workStatus: type: ["string", "null"] contractDuration: type: ["string", "null"] signatoryName: type: ["string", "null"] signatoryDesignation: type: ["string", "null"] signatureDate: type: ["string", "null"] createdAt: type: string updatedAt: type: string LoaInput: type: object properties: companyId: type: integer passportId: type: integer companyName: type: string companyAddress: type: string companyEmail: type: string companyPhone: type: string companyCountry: type: string companyRegistrationNumber: type: string candidateName: type: string candidateAddress: type: string candidateNationality: type: string candidateDateOfBirth: type: string candidatePassportNumber: type: string candidateEmergencyContact: type: string jobTitle: type: string workType: type: string basicSalary: type: string salaryPaymentDate: type: string workSite: type: string dateOfCommence: type: string jobDescription: type: string workingHours: type: string workStatus: type: string contractDuration: type: string signatoryName: type: string signatoryDesignation: type: string signatureDate: type: string LoaUpdate: type: object properties: companyId: type: integer passportId: type: integer companyName: type: string companyAddress: type: string companyEmail: type: string companyPhone: type: string companyCountry: type: string companyRegistrationNumber: type: string candidateName: type: string candidateAddress: type: string candidateNationality: type: string candidateDateOfBirth: type: string candidatePassportNumber: type: string candidateEmergencyContact: type: string jobTitle: type: string workType: type: string basicSalary: type: string salaryPaymentDate: type: string workSite: type: string dateOfCommence: type: string jobDescription: type: string workingHours: type: string workStatus: type: string contractDuration: type: string signatoryName: type: string signatoryDesignation: type: string signatureDate: type: string BillingDocumentSummary: type: object required: [id, kind, number, companyId, companyName, customerName, issueDate, gstRate, gstInclusive, status, subtotal, createdAt, updatedAt] properties: id: { type: integer } kind: { type: string, enum: [invoice, quotation] } number: { type: string } companyId: { type: integer } companyName: { type: string } customerName: { type: string } customerAddress: { type: ["string", "null"] } customerTin: { type: ["string", "null"] } issueDate: { type: string } dueDate: { type: ["string", "null"] } terms: { type: ["string", "null"] } gstRate: { type: string } gstInclusive: { type: boolean } notes: { type: ["string", "null"] } status: { type: string } deploymentTypeId: { type: ["integer", "null"] } subtotal: { type: string } createdAt: { type: string } updatedAt: { type: string } BillingItem: type: object required: [id, documentId, position, description, qty, rate, amount] properties: id: { type: integer } documentId: { type: integer } position: { type: integer } description: { type: string } detail: { type: ["string", "null"] } qty: { type: string } rate: { type: string } amount: { type: string } BillingDocument: allOf: - $ref: "#/components/schemas/BillingDocumentSummary" - type: object required: [items] properties: items: type: array items: $ref: "#/components/schemas/BillingItem" BillingItemInput: type: object required: [description] properties: description: { type: string, minLength: 1 } detail: { type: string } qty: { type: string } rate: { type: string } BillingDocumentInput: type: object required: [kind, companyId, customerName, issueDate, items] properties: kind: { type: string, enum: [invoice, quotation] } companyId: { type: integer } customerName: { type: string, minLength: 1 } customerAddress: { type: string } customerTin: { type: string } issueDate: { type: string } dueDate: { type: string } terms: { type: string } gstRate: { type: string } gstInclusive: { type: boolean } notes: { type: string } status: { type: string } deploymentTypeId: { type: ["integer", "null"] } items: type: array minItems: 1 items: $ref: "#/components/schemas/BillingItemInput" BillingDocumentUpdate: type: object properties: companyId: { type: integer } customerName: { type: string, minLength: 1 } customerAddress: { type: ["string", "null"] } customerTin: { type: ["string", "null"] } issueDate: { type: string } dueDate: { type: ["string", "null"] } terms: { type: ["string", "null"] } gstRate: { type: string } gstInclusive: { type: boolean } notes: { type: ["string", "null"] } status: { type: string } deploymentTypeId: { type: ["integer", "null"] } items: type: array minItems: 1 items: $ref: "#/components/schemas/BillingItemInput" BillingDocumentCreated: type: object required: [id] properties: id: { type: integer }