openapi: '3.1.1' info: title: Squirrel.Projects.Api version: feature/projects/1:cb703447 servers: - url: https://api-prj.squirrel.co.nz/ paths: /: get: tags: - Squirrel.Projects.Api description: "**Authorization:** `AuthenticatedUser`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." responses: '200': description: OK '401': description: Unauthorized - Authentication required x-policy: AuthenticatedUser /squirrel/demo-data: get: tags: - DemoData summary: Returns the current status of demo data in the database. description: "Lists all projects with the DEMO- prefix and their associated payment requests.\nUse this to verify existing demo data before seeding or cleanup.\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetStatus responses: '200': description: Returns the current demo data status. content: text/plain: schema: $ref: '#/components/schemas/DemoDataStatusResult' application/json: schema: $ref: '#/components/schemas/DemoDataStatusResult' text/json: schema: $ref: '#/components/schemas/DemoDataStatusResult' '401': description: Unauthorized - Authentication required post: tags: - DemoData summary: "Seeds demo data by running every scenario in EngineScenarios\nthrough IScenarioRunner. Existing demo data is removed first\nso the result is deterministic." description: " One runTag is generated per seed call and shared across every scenario, so\n project references look like `DEMO-AA-{runTag}`, `DEMO-MD-{runTag}`, etc.\n Per-scenario evidence (borrower email, draft notes) is also tagged with the\n runTag so multiple scenarios under one seed do not collide on unique-index keys.\n Streams Server-Sent Events (cleanup → per-scenario and per-step progress → a terminal\nseed-completed event carrying the DemoDataSeedResult) by default, so an\nundecorated curl watches the seed live. Send Accept: application/json to instead\nget the single DemoDataSeedResult JSON body once seeding finishes.\nA scenario that fails is skipped (not fatal) and listed in IncompleteScenarios." operationId: Seed parameters: - name: suppress in: query description: 'When true (default), the seed runs inside a notification-suppression scope so no real emails are sent. Set `?suppress=false` to exercise the full email path.' schema: type: boolean default: true responses: '200': description: Returns the demo data status after seeding. content: text/plain: schema: $ref: '#/components/schemas/DemoDataSeedResult' application/json: schema: $ref: '#/components/schemas/DemoDataSeedResult' text/json: schema: $ref: '#/components/schemas/DemoDataSeedResult' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' delete: tags: - DemoData summary: Removes all demo data (projects with DEMO- prefix). description: "Hard-deletes all projects with the DEMO- prefix and all related entities.\nData is permanently removed from the database to allow clean re-seeding." operationId: Cleanup responses: '200': description: Returns summary of deleted demo data. content: text/plain: schema: $ref: '#/components/schemas/DemoDataCleanupResult' application/json: schema: $ref: '#/components/schemas/DemoDataCleanupResult' text/json: schema: $ref: '#/components/schemas/DemoDataCleanupResult' '401': description: Unauthorized - Authentication required /squirrel/demo-data/engine-smoke: post: tags: - DemoData summary: "Runs the engine smoke scenario: materialises a project through the real inbound\nCreateProject handler, then dispatches a real `CreateBankAccount` mediator\nrequest against it through IScenarioRunner to confirm the DSL/engine\nplumbing is wired correctly." description: "Intended for dev/staging only. Each call writes a fresh project referenced\n`DEMO-SMOKE-{guid}`, so it is removed by the regular\n`DELETE /squirrel/demo-data` cleanup (which keys off the `DEMO-` prefix)." operationId: RunEngineSmoke responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-new-project: post: tags: - DemoData operationId: RunEngineNewProject responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-first-draw: post: tags: - DemoData operationId: RunEngineFirstDraw responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-pending-decision: post: tags: - DemoData operationId: RunEnginePendingDecision responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-auto-approved: post: tags: - DemoData operationId: RunEngineAutoApproved responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-manual-review: post: tags: - DemoData operationId: RunEngineManualReview responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-rejected: post: tags: - DemoData operationId: RunEngineRejected responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-ops-approved: post: tags: - DemoData operationId: RunEngineOpsApproved responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-credit-approved: post: tags: - DemoData operationId: RunEngineCreditApproved responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-paid: post: tags: - DemoData operationId: RunEnginePaid responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-pending-extraction: post: tags: - DemoData operationId: RunEnginePendingExtraction responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-multi-draw: post: tags: - DemoData operationId: RunEngineMultiDraw responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-conditions-mixed: post: tags: - DemoData operationId: RunEngineConditionsMixed responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-archived-done: post: tags: - DemoData operationId: RunEngineArchivedDone responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-archived-mid: post: tags: - DemoData operationId: RunEngineArchivedMid responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-multi-loan: post: tags: - DemoData operationId: RunEngineMultiLoan responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-multi-no-cost: post: tags: - DemoData operationId: RunEngineMultiNoCost responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-deep-loans: post: tags: - DemoData operationId: RunEngineDeepLoans responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-cost-to-complete: post: tags: - DemoData operationId: RunEngineCostToComplete responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-advance: post: tags: - DemoData operationId: RunEngineAdvance responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-contingency: post: tags: - DemoData operationId: RunEngineContingency responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-supplementary-costs: post: tags: - DemoData operationId: RunEngineSupplementaryCosts responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-supp-costs-review: post: tags: - DemoData operationId: RunEngineSuppCostsReview responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-advance-review: post: tags: - DemoData operationId: RunEngineAdvanceReview responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-supp-costs-pending: post: tags: - DemoData operationId: RunEngineSuppCostsPending responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-ctc-review: post: tags: - DemoData operationId: RunEngineCtcReview responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-no-borrower-pay: post: tags: - DemoData operationId: RunEngineNoBorrowerPay responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-no-auto-approve: post: tags: - DemoData operationId: RunEngineNoAutoApprove responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-multi-bank-account: post: tags: - DemoData operationId: RunEngineMultiBankAccount responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /squirrel/demo-data/engine-bare-project: post: tags: - DemoData operationId: RunEngineBareProject responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' /addresses: get: tags: - Address summary: Retrieves a paged list of addresses. description: "**Authorization:** `AuthenticatedUser`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListAddresses parameters: - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged list of AddressDto entries. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfAddressDto' application/json: schema: $ref: '#/components/schemas/PagedListOfAddressDto' text/json: schema: $ref: '#/components/schemas/PagedListOfAddressDto' '401': description: Unauthorized - Authentication required x-policy: AuthenticatedUser post: tags: - Address summary: Creates a new address. description: '**Authorization:** `AuthenticatedUser`' operationId: CreateAddress requestBody: description: The address details to create. content: application/json: schema: $ref: '#/components/schemas/CreateAddress' text/json: schema: $ref: '#/components/schemas/CreateAddress' application/*+json: schema: $ref: '#/components/schemas/CreateAddress' required: true responses: '201': description: A response indicating the newly created resource. content: text/plain: schema: $ref: '#/components/schemas/Created' application/json: schema: $ref: '#/components/schemas/Created' text/json: schema: $ref: '#/components/schemas/Created' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: AuthenticatedUser '/addresses/{addressId}': get: tags: - Address summary: Retrieves a single address by its identifier. description: "**Authorization:** `AuthenticatedUser`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetAddress parameters: - name: addressId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: The requested AddressDto or a 404 response. content: text/plain: schema: $ref: '#/components/schemas/AddressDto' application/json: schema: $ref: '#/components/schemas/AddressDto' text/json: schema: $ref: '#/components/schemas/AddressDto' '401': description: Unauthorized - Authentication required x-policy: AuthenticatedUser put: tags: - Address summary: Updates an existing address. description: '**Authorization:** `UpdateExistingAddress`' operationId: UpdateAddress parameters: - name: addressId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The address updates to apply. content: application/json: schema: $ref: '#/components/schemas/UpdateAddress' text/json: schema: $ref: '#/components/schemas/UpdateAddress' application/*+json: schema: $ref: '#/components/schemas/UpdateAddress' required: true responses: '202': description: An accepted response describing the update. content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: UpdateExistingAddress '/borrowers/{borrowerId}/projects/{projectId}/bank-accounts': get: tags: - BankAccount summary: Lists bank accounts for a project. description: "**Authorization:** `ManageBankAccounts`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListBankAccounts parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged collection of BankAccountDto objects. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfBankAccountDto' application/json: schema: $ref: '#/components/schemas/PagedListOfBankAccountDto' text/json: schema: $ref: '#/components/schemas/PagedListOfBankAccountDto' '401': description: Unauthorized - Authentication required x-policy: ManageBankAccounts post: tags: - BankAccount summary: Creates a new bank account for the project. description: '**Authorization:** `ManageBankAccounts`' operationId: CreateBankAccount parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The bank account details to create. content: application/json: schema: $ref: '#/components/schemas/CreateBankAccount' text/json: schema: $ref: '#/components/schemas/CreateBankAccount' application/*+json: schema: $ref: '#/components/schemas/CreateBankAccount' required: true responses: '201': description: A created response including the location of the new account. content: text/plain: schema: $ref: '#/components/schemas/Created' application/json: schema: $ref: '#/components/schemas/Created' text/json: schema: $ref: '#/components/schemas/Created' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ManageBankAccounts '/borrowers/{borrowerId}/projects/{projectId}/bank-accounts/timeline': get: tags: - BankAccount summary: 'Lists the history of every bank account on a project, newest first.' description: "**Authorization:** `ManageBankAccounts`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListBankAccountTimeline parameters: - name: borrowerId in: path description: The borrower identifier. required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path description: The project identifier. required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged collection of BankAccountTimelineEntryDto entries. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfBankAccountTimelineEntryDto' application/json: schema: $ref: '#/components/schemas/PagedListOfBankAccountTimelineEntryDto' text/json: schema: $ref: '#/components/schemas/PagedListOfBankAccountTimelineEntryDto' '401': description: Unauthorized - Authentication required x-policy: ManageBankAccounts '/borrowers/{borrowerId}/projects/{projectId}/bank-accounts/{bankAccountId}': get: tags: - BankAccount summary: Gets a specific bank account. description: "**Authorization:** `ManageBankAccounts`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetBankAccount parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: bankAccountId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: The requested BankAccountDto when found. content: text/plain: schema: $ref: '#/components/schemas/BankAccountDto' application/json: schema: $ref: '#/components/schemas/BankAccountDto' text/json: schema: $ref: '#/components/schemas/BankAccountDto' '401': description: Unauthorized - Authentication required x-policy: ManageBankAccounts put: tags: - BankAccount summary: Updates an existing bank account. description: '**Authorization:** `ManageBankAccounts`' operationId: UpdateBankAccount parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: bankAccountId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The bank account changes to apply. content: application/json: schema: $ref: '#/components/schemas/UpdateBankAccount' text/json: schema: $ref: '#/components/schemas/UpdateBankAccount' application/*+json: schema: $ref: '#/components/schemas/UpdateBankAccount' required: true responses: '202': description: An accepted response indicating the update result. content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ManageBankAccounts delete: tags: - BankAccount summary: Deletes a bank account. description: '**Authorization:** `ManageBankAccounts`' operationId: DeleteBankAccount parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: bankAccountId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '202': description: An accepted response once the deletion is queued. '401': description: Unauthorized - Authentication required x-policy: ManageBankAccounts '/borrowers/{borrowerId}/projects/{projectId}/bank-accounts/{bankAccountId}/rename': put: tags: - BankAccount summary: "Renames a bank account (updates its display name only). Does not reset\n the account's verification state — rename is cosmetic." description: '**Authorization:** `ManageBankAccounts`' operationId: RenameBankAccount parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: bankAccountId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The new display name. content: application/json: schema: $ref: '#/components/schemas/RenameBankAccount' text/json: schema: $ref: '#/components/schemas/RenameBankAccount' application/*+json: schema: $ref: '#/components/schemas/RenameBankAccount' required: true responses: '202': description: An accepted response indicating the rename result. content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ManageBankAccounts '/borrowers/{borrowerId}/projects/{projectId}/bank-accounts/{bankAccountId}/verify': put: tags: - BankAccount summary: Verify a bank account. description: '**Authorization:** `VerifyBankAccount`' operationId: VerifyBankAccount parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: bankAccountId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '202': description: An accepted response indicating the verification result. content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: VerifyBankAccount '/borrowers/{borrowerId}/projects/{projectId}/bank-accounts/{bankAccountId}/statements': get: tags: - BankAccount summary: Lists bank-statement documents uploaded for this bank account. description: "**Authorization:** `ManageBankAccounts`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListBankStatements parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: bankAccountId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: 'Uploaded statement documents, or 404 if the bank account does not exist.' content: text/plain: schema: type: array items: $ref: '#/components/schemas/DocumentDto' application/json: schema: type: array items: $ref: '#/components/schemas/DocumentDto' text/json: schema: type: array items: $ref: '#/components/schemas/DocumentDto' '401': description: Unauthorized - Authentication required x-policy: ManageBankAccounts post: tags: - BankAccount summary: "Attaches an already-uploaded document (reserved against this bank account via\n `POST …/documents`) as a statement, confirming the upload landed. Bank statements carry no\n AI extraction." description: '**Authorization:** `ManageBankAccounts`' operationId: AddBankStatement parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: bankAccountId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The document identifier returned from the reserve call. content: application/json: schema: $ref: '#/components/schemas/AddBankStatement' text/json: schema: $ref: '#/components/schemas/AddBankStatement' application/*+json: schema: $ref: '#/components/schemas/AddBankStatement' required: true responses: '202': description: Accepted content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '404': description: Not Found content: text/plain: schema: $ref: '#/components/schemas/ProblemDetails' application/json: schema: $ref: '#/components/schemas/ProblemDetails' text/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ManageBankAccounts '/borrowers/{borrowerId}/app-users': get: tags: - BorrowerAppUser summary: Lists application users for a borrower. description: "**Authorization:** `AppUserAdministration`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListAppUsers parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged collection of AppUserDto records. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfAppUserDto' application/json: schema: $ref: '#/components/schemas/PagedListOfAppUserDto' text/json: schema: $ref: '#/components/schemas/PagedListOfAppUserDto' '401': description: Unauthorized - Authentication required x-policy: AppUserAdministration '/borrowers/{borrowerId}/app-users/{userId}': get: tags: - BorrowerAppUser summary: Gets a specific application user. description: "**Authorization:** `AppUserAdministration`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetAppUser parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: userId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: The requested AppUserDto or a 404 response. content: text/plain: schema: $ref: '#/components/schemas/AppUserDto' application/json: schema: $ref: '#/components/schemas/AppUserDto' text/json: schema: $ref: '#/components/schemas/AppUserDto' '401': description: Unauthorized - Authentication required x-policy: AppUserAdministration put: tags: - BorrowerAppUser summary: 'Updates an existing application user''s link to this borrower (name, email, roles).' description: '**Authorization:** `AppUserAdministration`' operationId: UpdateBorrowerAppUser parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: userId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The updated user details. content: application/json: schema: $ref: '#/components/schemas/UpdateBorrowerAppUser' text/json: schema: $ref: '#/components/schemas/UpdateBorrowerAppUser' application/*+json: schema: $ref: '#/components/schemas/UpdateBorrowerAppUser' required: true responses: '202': description: An accepted response describing the update. content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: AppUserAdministration delete: tags: - BorrowerAppUser summary: Removes the application user's link to this borrower. description: '**Authorization:** `AppUserAdministration`' operationId: DeleteBorrowerAppUser parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: userId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '202': description: An accepted response once the delete request is processed. '401': description: Unauthorized - Authentication required x-policy: AppUserAdministration /borrowers: get: tags: - Borrower summary: Retrieves a paged list of borrowers. description: "**Authorization:** `StaffOnly`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListBorrowers parameters: - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged collection of BorrowerDto records. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfBorrowerDto' application/json: schema: $ref: '#/components/schemas/PagedListOfBorrowerDto' text/json: schema: $ref: '#/components/schemas/PagedListOfBorrowerDto' '401': description: Unauthorized - Authentication required x-policy: StaffOnly post: tags: - Borrower summary: Creates a borrower record. description: '**Authorization:** `BorrowerAdministration`' operationId: CreateBorrower requestBody: description: The borrower details to create. content: application/json: schema: $ref: '#/components/schemas/CreateBorrower' text/json: schema: $ref: '#/components/schemas/CreateBorrower' application/*+json: schema: $ref: '#/components/schemas/CreateBorrower' required: true responses: '201': description: A created response containing the new borrower location. content: text/plain: schema: $ref: '#/components/schemas/Created' application/json: schema: $ref: '#/components/schemas/Created' text/json: schema: $ref: '#/components/schemas/Created' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: BorrowerAdministration '/borrowers/{borrowerId}': get: tags: - Borrower summary: Gets a borrower by identifier. description: "**Authorization:** `BelongsToBorrower`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetBorrower parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: The requested borrower or a 404 response. content: text/plain: schema: $ref: '#/components/schemas/BorrowerDto' application/json: schema: $ref: '#/components/schemas/BorrowerDto' text/json: schema: $ref: '#/components/schemas/BorrowerDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToBorrower put: tags: - Borrower summary: Updates a borrower. description: '**Authorization:** `BorrowerAdministration`' operationId: UpdateBorrower parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The borrower changes to apply. content: application/json: schema: $ref: '#/components/schemas/UpdateBorrower' text/json: schema: $ref: '#/components/schemas/UpdateBorrower' application/*+json: schema: $ref: '#/components/schemas/UpdateBorrower' required: true responses: '202': description: An accepted response for the update request. content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: BorrowerAdministration /budget-transfers/approved: get: tags: - BudgetTransfers summary: 'Lists budget transfers somebody has signed off, most recently approved first.' description: "Includes transfers the system approved by itself as well as those Credit approved; who signed\n each one is on `ApprovedBy`. A null `AppliedAtNzt` is a transfer whose budget has not moved\n yet — approved out of band and waiting on the applier — and it holds claims on both its loans up until\n it does.\n\n**Authorization:** `StaffOnly`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListApprovedBudgetTransfers parameters: - name: borrowerId in: query description: Optional. Restrict to transfers on this borrower's projects. schema: type: integer format: int32 - name: projectId in: query description: Optional. Restrict to transfers on this project. schema: type: integer format: int32 - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged collection of ApprovedBudgetTransferDto objects. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfApprovedBudgetTransferDto' application/json: schema: $ref: '#/components/schemas/PagedListOfApprovedBudgetTransferDto' text/json: schema: $ref: '#/components/schemas/PagedListOfApprovedBudgetTransferDto' '401': description: Unauthorized - Authentication required x-policy: StaffOnly /budget-transfers/proposed: get: tags: - BudgetTransfers summary: "Lists budget transfers the system would not approve by itself, waiting on Credit,\n longest-waiting first." description: "Nothing on this list has moved. While a transfer waits, a claim placed on either of its loans\n cannot be approved, so the list is work rather than a record.\n\n**Authorization:** `StaffOnly`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListProposedBudgetTransfers parameters: - name: borrowerId in: query description: Optional. Restrict to transfers on this borrower's projects. schema: type: integer format: int32 - name: projectId in: query description: Optional. Restrict to transfers on this project. schema: type: integer format: int32 - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged collection of ProposedBudgetTransferDto objects. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfProposedBudgetTransferDto' application/json: schema: $ref: '#/components/schemas/PagedListOfProposedBudgetTransferDto' text/json: schema: $ref: '#/components/schemas/PagedListOfProposedBudgetTransferDto' '401': description: Unauthorized - Authentication required x-policy: StaffOnly '/borrowers/{borrowerId}/projects/{projectId}/budget-transfers/{budgetTransferId}/approve': post: tags: - BudgetTransfers summary: "Approves a proposed budget transfer, which is what moves it: the spend, the limit it\n displaces and the GST float all change hands." description: '**Authorization:** `ApproveProgressPayment`' operationId: ApproveBudgetTransfer parameters: - name: budgetTransferId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: borrowerId in: path required: true schema: type: integer format: int32 - name: projectId in: path required: true schema: type: integer format: int32 responses: '202': description: Accepted content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '409': description: The transfer has already been approved. content: text/plain: schema: $ref: '#/components/schemas/ProblemDetails' application/json: schema: $ref: '#/components/schemas/ProblemDetails' text/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ApproveProgressPayment '/borrowers/{borrowerId}/projects/{projectId}/conditions': get: tags: - Condition summary: 'Lists conditions for a project (all loans, all statuses).' description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListConditions parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: 'A paged list of ConditionDto values, ordered outstanding-first.' content: text/plain: schema: $ref: '#/components/schemas/PagedListOfConditionDto' application/json: schema: $ref: '#/components/schemas/PagedListOfConditionDto' text/json: schema: $ref: '#/components/schemas/PagedListOfConditionDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/conditions/{conditionId}/evidence': post: tags: - Condition summary: "Confirms an uploaded document as evidence against a credit\n condition. Transitions the condition status to Reviewing (if currently\n Unmet) and publishes the evidence event back to MMS." description: '**Authorization:** `BelongsToProject`' operationId: AddEvidence parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: conditionId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The document identifier of the already-uploaded evidence file. content: application/json: schema: $ref: '#/components/schemas/AddConditionEvidence' text/json: schema: $ref: '#/components/schemas/AddConditionEvidence' application/*+json: schema: $ref: '#/components/schemas/AddConditionEvidence' required: true responses: '202': description: An accepted response on success. '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/documents': get: tags: - Document summary: Lists documents for a project. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListDocuments parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged list of DocumentDto entries. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfDocumentDto' application/json: schema: $ref: '#/components/schemas/PagedListOfDocumentDto' text/json: schema: $ref: '#/components/schemas/PagedListOfDocumentDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject post: tags: - Document summary: Reserves a document slot and returns a pre-signed upload URL for the caller to PUT the file to. description: '**Authorization:** `BelongsToProject`' operationId: CreateDocument parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: 'Filename, MIME type, and content length for the document to be uploaded.' content: application/json: schema: $ref: '#/components/schemas/CreateDocument' text/json: schema: $ref: '#/components/schemas/CreateDocument' application/*+json: schema: $ref: '#/components/schemas/CreateDocument' required: true responses: '201': description: 'A created response including the upload URL, headers, and expiry.' content: text/plain: schema: $ref: '#/components/schemas/CreatedDocument' application/json: schema: $ref: '#/components/schemas/CreatedDocument' text/json: schema: $ref: '#/components/schemas/CreatedDocument' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/documents/{documentId}': get: tags: - Document summary: Retrieves a single document. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetDocument parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: documentId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: The requested document or a 404 response. content: text/plain: schema: $ref: '#/components/schemas/DocumentDto' application/json: schema: $ref: '#/components/schemas/DocumentDto' text/json: schema: $ref: '#/components/schemas/DocumentDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject delete: tags: - Document summary: Soft-deletes a document. description: '**Authorization:** `BelongsToProject`' operationId: DeleteDocument parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: documentId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '202': description: Accepted '404': description: Not Found content: text/plain: schema: $ref: '#/components/schemas/ProblemDetails' application/json: schema: $ref: '#/components/schemas/ProblemDetails' text/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/documents/{documentId}/detail': get: tags: - Document summary: Retrieves a document with structured AI inference results (builder report and photo classification). description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetDocumentDetail parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: documentId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: The document detail or a 404 response. content: text/plain: schema: $ref: '#/components/schemas/DocumentDetailDto' application/json: schema: $ref: '#/components/schemas/DocumentDetailDto' text/json: schema: $ref: '#/components/schemas/DocumentDetailDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/documents/{documentId}/rename': put: tags: - Document summary: Renames a document. description: '**Authorization:** `BelongsToProject`' operationId: RenameDocument parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: documentId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The document updates to apply. content: application/json: schema: $ref: '#/components/schemas/RenameDocument' text/json: schema: $ref: '#/components/schemas/RenameDocument' application/*+json: schema: $ref: '#/components/schemas/RenameDocument' required: true responses: '202': description: Accepted content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '404': description: Not Found content: text/plain: schema: $ref: '#/components/schemas/ProblemDetails' application/json: schema: $ref: '#/components/schemas/ProblemDetails' text/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/documents/{documentId}/approve': put: tags: - Document summary: Approves a document. description: '**Authorization:** `ManuallyApproveDocument`' operationId: ApproveDocument parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: documentId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: Any document overrides to apply. content: application/json: schema: $ref: '#/components/schemas/ApproveDocument' text/json: schema: $ref: '#/components/schemas/ApproveDocument' application/*+json: schema: $ref: '#/components/schemas/ApproveDocument' required: true responses: '202': description: Accepted content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '404': description: Not Found content: text/plain: schema: $ref: '#/components/schemas/ProblemDetails' application/json: schema: $ref: '#/components/schemas/ProblemDetails' text/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ManuallyApproveDocument '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/drafts': get: tags: - DraftProgressPayment summary: Lists progress payment drafts for a project. description: "**Authorization:** `RequestProgressPayment`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListDraftProgressPayments parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged list of DraftProgressPaymentRequestDto entries. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfDraftProgressPaymentRequestDto' application/json: schema: $ref: '#/components/schemas/PagedListOfDraftProgressPaymentRequestDto' text/json: schema: $ref: '#/components/schemas/PagedListOfDraftProgressPaymentRequestDto' '401': description: Unauthorized - Authentication required x-policy: RequestProgressPayment post: tags: - DraftProgressPayment summary: Creates a new progress payment draft. description: '**Authorization:** `RequestProgressPayment`' operationId: CreateProgressPaymentDraft parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The draft creation payload. content: application/json: schema: $ref: '#/components/schemas/CreateDraftProgressPaymentRequest' text/json: schema: $ref: '#/components/schemas/CreateDraftProgressPaymentRequest' application/*+json: schema: $ref: '#/components/schemas/CreateDraftProgressPaymentRequest' required: true responses: '201': description: A created response describing the new draft. content: text/plain: schema: $ref: '#/components/schemas/Created' application/json: schema: $ref: '#/components/schemas/Created' text/json: schema: $ref: '#/components/schemas/Created' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: RequestProgressPayment '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/drafts/details': get: tags: - DraftProgressPayment summary: Lists progress payment drafts with the per-draft draw line items their cards render. description: "**Authorization:** `RequestProgressPayment`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListDraftProgressPaymentDetails parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged list of DraftProgressPaymentRequestListDetailDto entries. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfDraftProgressPaymentRequestListDetailDto' application/json: schema: $ref: '#/components/schemas/PagedListOfDraftProgressPaymentRequestListDetailDto' text/json: schema: $ref: '#/components/schemas/PagedListOfDraftProgressPaymentRequestListDetailDto' '401': description: Unauthorized - Authentication required x-policy: RequestProgressPayment '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/drafts/{draftProgressPaymentRequestId}': get: tags: - DraftProgressPayment summary: Retrieves a single progress payment draft. description: "**Authorization:** `RequestProgressPayment`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetDraftProgressPayment parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: draftProgressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: The requested draft or a 404 response. content: text/plain: schema: $ref: '#/components/schemas/DraftProgressPaymentRequestDto' application/json: schema: $ref: '#/components/schemas/DraftProgressPaymentRequestDto' text/json: schema: $ref: '#/components/schemas/DraftProgressPaymentRequestDto' '401': description: Unauthorized - Authentication required x-policy: RequestProgressPayment put: tags: - DraftProgressPayment summary: Updates a progress payment draft. description: '**Authorization:** `RequestProgressPayment`' operationId: UpdateProgressPaymentDraft parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: draftProgressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The draft updates to apply. content: application/json: schema: $ref: '#/components/schemas/UpdateDraftProgressPaymentRequest' text/json: schema: $ref: '#/components/schemas/UpdateDraftProgressPaymentRequest' application/*+json: schema: $ref: '#/components/schemas/UpdateDraftProgressPaymentRequest' required: true responses: '202': description: An accepted response describing the updated draft. content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: RequestProgressPayment delete: tags: - DraftProgressPayment summary: Deletes a progress payment draft. description: '**Authorization:** `RequestProgressPayment`' operationId: DeleteProgressPaymentDraft parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: draftProgressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '202': description: An accepted response once deletion is processed. '401': description: Unauthorized - Authentication required x-policy: RequestProgressPayment '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/drafts/{draftProgressPaymentRequestId}/detail': get: tags: - DraftProgressPayment summary: Retrieves a progress payment draft with type-specific draw details. description: "**Authorization:** `RequestProgressPayment`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetDraftProgressPaymentDetail parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: draftProgressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/DraftProgressPaymentRequestDetailDto' application/json: schema: $ref: '#/components/schemas/DraftProgressPaymentRequestDetailDto' text/json: schema: $ref: '#/components/schemas/DraftProgressPaymentRequestDetailDto' '401': description: Unauthorized - Authentication required x-policy: RequestProgressPayment '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/drafts/{draftProgressPaymentRequestId}/evidence': get: tags: - DraftProgressPayment summary: Retrieves evidence status for a draft's requirements. description: "**Authorization:** `RequestProgressPayment`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetDraftEvidence parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: draftProgressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: OK content: text/plain: schema: type: array items: $ref: '#/components/schemas/MilestoneEvidenceDto' application/json: schema: type: array items: $ref: '#/components/schemas/MilestoneEvidenceDto' text/json: schema: type: array items: $ref: '#/components/schemas/MilestoneEvidenceDto' '401': description: Unauthorized - Authentication required x-policy: RequestProgressPayment '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/drafts/{draftProgressPaymentRequestId}/documents': get: tags: - DraftProgressPayment summary: 'Lists all documents associated with a draft, including evidence.' description: "**Authorization:** `RequestProgressPayment`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListDraftDocuments parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: draftProgressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: OK content: text/plain: schema: type: array items: $ref: '#/components/schemas/ProgressPaymentDocumentDto' application/json: schema: type: array items: $ref: '#/components/schemas/ProgressPaymentDocumentDto' text/json: schema: type: array items: $ref: '#/components/schemas/ProgressPaymentDocumentDto' '401': description: Unauthorized - Authentication required x-policy: RequestProgressPayment post: tags: - DraftProgressPaymentDocuments summary: Attaches a document to the draft as evidence for the target named in the body. description: '**Authorization:** `RequestProgressPayment`' operationId: AddDocument parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: draftProgressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The document to attach and its evidence target. content: application/json: schema: $ref: '#/components/schemas/AddDocument' text/json: schema: $ref: '#/components/schemas/AddDocument' application/*+json: schema: $ref: '#/components/schemas/AddDocument' required: true responses: '202': description: An accepted response once the document is attached. '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: RequestProgressPayment '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/drafts/{draftProgressPaymentRequestId}/documents/{documentId}': delete: tags: - DraftProgressPaymentDocuments summary: Removes a document from the draft. description: '**Authorization:** `RequestProgressPayment`' operationId: RemoveDocument parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: draftProgressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: documentId in: path description: The document identifier to remove. required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '202': description: An accepted response once the document is removed. '401': description: Unauthorized - Authentication required x-policy: RequestProgressPayment put: tags: - DraftProgressPaymentDocuments summary: 'Swaps a document on the draft for a new one, keeping its evidence association.' description: '**Authorization:** `RequestProgressPayment`' operationId: ReplaceDocument parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: draftProgressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: documentId in: path description: The document identifier to replace. required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The replacement document details. content: application/json: schema: $ref: '#/components/schemas/ReplaceDocument' text/json: schema: $ref: '#/components/schemas/ReplaceDocument' application/*+json: schema: $ref: '#/components/schemas/ReplaceDocument' required: true responses: '202': description: An accepted response once the document is replaced. '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: RequestProgressPayment /invitations/accept: post: tags: - InvitationAccept summary: Accept an invitation on behalf of the authenticated Squirrel Money caller. description: "The point of redemption is to wire the SM principal to the AppUser if it isn't yet —\nso we require an authenticated SM caller but deliberately bypass the\npolicy layer (BelongsToBorrower etc. would fail for pre-redemption callers).\n\n**Authorization:** `AuthenticatedUser`" operationId: Accept requestBody: description: The raw invitation token delivered to the borrower out-of-band. content: application/json: schema: $ref: '#/components/schemas/AcceptInvitationRequest' text/json: schema: $ref: '#/components/schemas/AcceptInvitationRequest' application/*+json: schema: $ref: '#/components/schemas/AcceptInvitationRequest' required: true responses: '200': description: The accepted invitation's id + the AppUser it resolved to. content: text/plain: schema: $ref: '#/components/schemas/InvitationAcceptedDto' application/json: schema: $ref: '#/components/schemas/InvitationAcceptedDto' text/json: schema: $ref: '#/components/schemas/InvitationAcceptedDto' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: AuthenticatedUser '/borrowers/{borrowerId}/invitations': post: tags: - Invitation summary: Issue a new invitation for a borrower contact. description: '**Authorization:** `AppUserAdministration`' operationId: CreateInvitation parameters: - name: borrowerId in: path description: The borrower the invitee belongs to. required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The invitee's name + delivery email. content: application/json: schema: $ref: '#/components/schemas/CreateInvitation' text/json: schema: $ref: '#/components/schemas/CreateInvitation' application/*+json: schema: $ref: '#/components/schemas/CreateInvitation' required: true responses: '201': description: The issued invitation metadata. The raw token is delivered via email. content: text/plain: schema: $ref: '#/components/schemas/InvitationIssuedDto' application/json: schema: $ref: '#/components/schemas/InvitationIssuedDto' text/json: schema: $ref: '#/components/schemas/InvitationIssuedDto' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: AppUserAdministration '/borrowers/{borrowerId}/invitations/{invitationId}/resend': post: tags: - Invitation summary: 'Resend a pending invitation, or grant access outright if the contact can already sign in.' description: '**Authorization:** `AppUserAdministration`' operationId: ResendInvitation parameters: - name: borrowerId in: path description: The borrower the invitation belongs to. required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: invitationId in: path description: The invitation to resend. Must not be already accepted. required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: "What the resend did. A contact who has since set up their Squirrel Money login gets borrower\naccess and a project-available notification instead of another link; otherwise a fresh\ninvitation is issued. Either way the prior row is marked Revoked." content: text/plain: schema: $ref: '#/components/schemas/InvitationResendResultDto' application/json: schema: $ref: '#/components/schemas/InvitationResendResultDto' text/json: schema: $ref: '#/components/schemas/InvitationResendResultDto' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: AppUserAdministration '/borrowers/{borrowerId}/projects/{projectId}/loans': post: tags: - Loan summary: "Tops up a project with a loan facility Squirrel Money already holds. The facility becomes\n contingency in its entirety — its limit and the drawdowns already advanced on it come from Money, so\n the request names the loan and nothing else." description: '**Authorization:** `ProjectAdministration`' operationId: TopupLoan parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The loan facility to top the project up with. content: application/json: schema: $ref: '#/components/schemas/TopupLoanRequest' text/json: schema: $ref: '#/components/schemas/TopupLoanRequest' application/*+json: schema: $ref: '#/components/schemas/TopupLoanRequest' required: true responses: '201': description: A created response containing the location of the new loan. content: text/plain: schema: $ref: '#/components/schemas/Created' application/json: schema: $ref: '#/components/schemas/Created' text/json: schema: $ref: '#/components/schemas/Created' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ProjectAdministration get: tags: - Loan summary: Retrieves loans for a project. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListLoans parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged list of LoanDto values. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfLoanDto' application/json: schema: $ref: '#/components/schemas/PagedListOfLoanDto' text/json: schema: $ref: '#/components/schemas/PagedListOfLoanDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/loans/{loanId}': get: tags: - Loan summary: Gets a loan by numeric identifier. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetLoanById parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: loanId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: The loan details or a 404 response. content: text/plain: schema: $ref: '#/components/schemas/LoanDetailDto' application/json: schema: $ref: '#/components/schemas/LoanDetailDto' text/json: schema: $ref: '#/components/schemas/LoanDetailDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/loans/{reference}': get: tags: - Loan summary: Gets a loan by its reference. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetLoanByReference parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: reference in: path description: The loan reference (must start with a letter). required: true schema: maxLength: 12 pattern: '^[a-zA-Z][a-zA-Z0-9]*$' type: string responses: '200': description: The loan details or a 404 response. content: text/plain: schema: $ref: '#/components/schemas/LoanDetailDto' application/json: schema: $ref: '#/components/schemas/LoanDetailDto' text/json: schema: $ref: '#/components/schemas/LoanDetailDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/loans/{loanId}/supplementary-costs': get: tags: - Loan summary: Lists supplementary costs for a loan. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListSupplementaryCosts parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: loanId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/PagedListOfSupplementaryCostDto' application/json: schema: $ref: '#/components/schemas/PagedListOfSupplementaryCostDto' text/json: schema: $ref: '#/components/schemas/PagedListOfSupplementaryCostDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/loans/{loanId}/supplementary-costs/{id}': get: tags: - Loan summary: Gets a supplementary cost by identifier. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetSupplementaryCost parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: loanId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: id in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/SupplementaryCostDto' application/json: schema: $ref: '#/components/schemas/SupplementaryCostDto' text/json: schema: $ref: '#/components/schemas/SupplementaryCostDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/loans/{loanId}/supplementary-costs/{id}/detail': get: tags: - Loan summary: 'Gets a supplementary cost with its funded payment history (paid date, amount, account, evidence).' description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetSupplementaryCostDetail parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: loanId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: id in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/SupplementaryCostDetailDto' application/json: schema: $ref: '#/components/schemas/SupplementaryCostDetailDto' text/json: schema: $ref: '#/components/schemas/SupplementaryCostDetailDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/loans/{loanId}/securities': get: tags: - Loan summary: Lists securities for a loan. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListLoanSecurities parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: loanId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/PagedListOfLoanSecurityDto' application/json: schema: $ref: '#/components/schemas/PagedListOfLoanSecurityDto' text/json: schema: $ref: '#/components/schemas/PagedListOfLoanSecurityDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/loans/{loanId}/securities/{id}': get: tags: - Loan summary: Gets a loan security by identifier. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetLoanSecurity parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: loanId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: id in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/LoanSecurityDto' application/json: schema: $ref: '#/components/schemas/LoanSecurityDto' text/json: schema: $ref: '#/components/schemas/LoanSecurityDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/loans/{loanId}/transactions': get: tags: - Loan summary: Lists transactions for a loan. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListLoanTransactions parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: loanId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/PagedListOfLoanTransactionDto' application/json: schema: $ref: '#/components/schemas/PagedListOfLoanTransactionDto' text/json: schema: $ref: '#/components/schemas/PagedListOfLoanTransactionDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/loans/{loanId}/transactions/{id}': get: tags: - Loan summary: Gets a loan transaction by identifier. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetLoanTransaction parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: loanId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: id in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/LoanTransactionDto' application/json: schema: $ref: '#/components/schemas/LoanTransactionDto' text/json: schema: $ref: '#/components/schemas/LoanTransactionDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/requests/{progressPaymentRequestId}/manual-review/approve': post: tags: - ManualReview summary: 'Approves a progress payment request, creating a payment record.' description: '**Authorization:** `ApproveProgressPayment`' operationId: Approve parameters: - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: borrowerId in: path required: true schema: type: integer format: int32 - name: projectId in: path required: true schema: type: integer format: int32 requestBody: content: application/json: schema: oneOf: - type: 'null' - $ref: '#/components/schemas/ApproveProgressPaymentRequest' text/json: schema: oneOf: - type: 'null' - $ref: '#/components/schemas/ApproveProgressPaymentRequest' application/*+json: schema: oneOf: - type: 'null' - $ref: '#/components/schemas/ApproveProgressPaymentRequest' responses: '202': description: Accepted content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '409': description: The request has already been approved. content: text/plain: schema: $ref: '#/components/schemas/ProblemDetails' application/json: schema: $ref: '#/components/schemas/ProblemDetails' text/json: schema: $ref: '#/components/schemas/ProblemDetails' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ApproveProgressPayment '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/requests/{progressPaymentRequestId}/manual-review/refer-to-credit': post: tags: - ManualReview summary: Refers a progress payment request to the credit team. description: '**Authorization:** `ManageProgressPayments`' operationId: ReferToCredit parameters: - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: borrowerId in: path required: true schema: type: integer format: int32 - name: projectId in: path required: true schema: type: integer format: int32 requestBody: content: application/json: schema: $ref: '#/components/schemas/ReferProgressPaymentRequest' text/json: schema: $ref: '#/components/schemas/ReferProgressPaymentRequest' application/*+json: schema: $ref: '#/components/schemas/ReferProgressPaymentRequest' required: true responses: '202': description: Accepted content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ManageProgressPayments '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/requests/{progressPaymentRequestId}/manual-review/refer-to-adviser': post: tags: - ManualReview summary: Refers a progress payment request to the project's adviser. description: '**Authorization:** `ManageProgressPayments`' operationId: ReferToAdviser parameters: - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: borrowerId in: path required: true schema: type: integer format: int32 - name: projectId in: path required: true schema: type: integer format: int32 requestBody: content: application/json: schema: $ref: '#/components/schemas/ReferProgressPaymentRequest' text/json: schema: $ref: '#/components/schemas/ReferProgressPaymentRequest' application/*+json: schema: $ref: '#/components/schemas/ReferProgressPaymentRequest' required: true responses: '202': description: Accepted content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ManageProgressPayments /me: get: tags: - Me description: "**Authorization:** `AuthenticatedUser`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetMe responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/MeResponse' application/json: schema: $ref: '#/components/schemas/MeResponse' text/json: schema: $ref: '#/components/schemas/MeResponse' '401': description: Unauthorized - Authentication required x-policy: AuthenticatedUser '/borrowers/{borrowerId}/projects/{projectId}/milestones': get: tags: - Milestone summary: Lists milestones for a project. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListMilestones parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: A paged list of MilestoneDto entries. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfMilestoneDto' application/json: schema: $ref: '#/components/schemas/PagedListOfMilestoneDto' text/json: schema: $ref: '#/components/schemas/PagedListOfMilestoneDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/milestones/details': get: tags: - Milestone summary: Lists milestones with their requirements and the evidence loaded against each. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListMilestoneDetails parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: A paged list of MilestoneListDetailDto entries. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfMilestoneListDetailDto' application/json: schema: $ref: '#/components/schemas/PagedListOfMilestoneListDetailDto' text/json: schema: $ref: '#/components/schemas/PagedListOfMilestoneListDetailDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/milestones/{milestoneId}': get: tags: - Milestone summary: Retrieves a single milestone. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetMilestone parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: milestoneId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: The requested milestone or a 404 response. content: text/plain: schema: $ref: '#/components/schemas/MilestoneDto' application/json: schema: $ref: '#/components/schemas/MilestoneDto' text/json: schema: $ref: '#/components/schemas/MilestoneDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject put: tags: - Milestone summary: Updates a milestone. description: '**Authorization:** `ManageMilestones`' operationId: UpdateMilestone parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: milestoneId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The updated milestone. content: application/json: schema: $ref: '#/components/schemas/UpdateMilestone' text/json: schema: $ref: '#/components/schemas/UpdateMilestone' application/*+json: schema: $ref: '#/components/schemas/UpdateMilestone' required: true responses: '202': description: An accepted response describing the updated milestone. content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ManageMilestones delete: tags: - Milestone summary: Deletes a milestone. description: '**Authorization:** `ManageMilestones`' operationId: DeleteMilestone parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: milestoneId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '202': description: An accepted response confirming the deletion. content: text/plain: schema: $ref: '#/components/schemas/Deleted' application/json: schema: $ref: '#/components/schemas/Deleted' text/json: schema: $ref: '#/components/schemas/Deleted' '401': description: Unauthorized - Authentication required x-policy: ManageMilestones '/borrowers/{borrowerId}/projects/{projectId}/milestones/{milestoneId}/detail': get: tags: - Milestone summary: Retrieves a single milestone with its requirements and the evidence loaded against each. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetMilestoneDetail parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: milestoneId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: The requested milestone detail or a 404 response. content: text/plain: schema: $ref: '#/components/schemas/MilestoneDetailDto' application/json: schema: $ref: '#/components/schemas/MilestoneDetailDto' text/json: schema: $ref: '#/components/schemas/MilestoneDetailDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject /squirrel/milestone-types: get: tags: - MilestoneType summary: Lists the milestone types that can be enabled on a project. description: "**Authorization:** `ManageMilestones`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListMilestoneTypes responses: '200': description: The active milestone types with their display names. content: text/plain: schema: type: array items: $ref: '#/components/schemas/MilestoneTypeDto' application/json: schema: type: array items: $ref: '#/components/schemas/MilestoneTypeDto' text/json: schema: type: array items: $ref: '#/components/schemas/MilestoneTypeDto' '401': description: Unauthorized - Authentication required x-policy: ManageMilestones /notifications: get: tags: - Notifications summary: 'List all notifications for the current user, newest first.' description: "**Authorization:** `AuthenticatedUser`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListNotifications parameters: - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/PagedListOfNotificationDto' application/json: schema: $ref: '#/components/schemas/PagedListOfNotificationDto' text/json: schema: $ref: '#/components/schemas/PagedListOfNotificationDto' '401': description: Unauthorized - Authentication required x-policy: AuthenticatedUser /notifications/unread: get: tags: - Notifications summary: 'List unread notifications for the current user, newest first.' description: "**Authorization:** `AuthenticatedUser`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListUnreadNotifications parameters: - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/PagedListOfNotificationDto' application/json: schema: $ref: '#/components/schemas/PagedListOfNotificationDto' text/json: schema: $ref: '#/components/schemas/PagedListOfNotificationDto' '401': description: Unauthorized - Authentication required x-policy: AuthenticatedUser '/notifications/{notificationId}/read': post: tags: - Notifications summary: Mark a single notification as read. 404 when the notification doesn't exist or belongs to another user. description: '**Authorization:** `AuthenticatedUser`' operationId: MarkNotificationRead parameters: - name: notificationId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: AuthenticatedUser /notifications/mark-all-read: post: tags: - Notifications summary: Mark all of the current user's unread notifications as read. description: '**Authorization:** `AuthenticatedUser`' operationId: MarkAllNotificationsRead responses: '200': description: OK '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: AuthenticatedUser '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/requests/{progressPaymentRequestId}/splits': get: tags: - PaymentSplit summary: Lists payment splits for a request. description: "**Authorization:** `ManageProgressPayments`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListPaymentSplits parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: A list of ProgressPaymentRequestSplitDto objects. content: text/plain: schema: type: array items: $ref: '#/components/schemas/ProgressPaymentRequestSplitDto' application/json: schema: type: array items: $ref: '#/components/schemas/ProgressPaymentRequestSplitDto' text/json: schema: type: array items: $ref: '#/components/schemas/ProgressPaymentRequestSplitDto' '401': description: Unauthorized - Authentication required x-policy: ManageProgressPayments post: tags: - PaymentSplit summary: Creates a new payment split. description: '**Authorization:** `ManageProgressPayments`' operationId: CreatePaymentSplit parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The payment split to create. content: application/json: schema: $ref: '#/components/schemas/CreatePaymentSplit' text/json: schema: $ref: '#/components/schemas/CreatePaymentSplit' application/*+json: schema: $ref: '#/components/schemas/CreatePaymentSplit' required: true responses: '201': description: A created response including the location of the new split. content: text/plain: schema: $ref: '#/components/schemas/Created' application/json: schema: $ref: '#/components/schemas/Created' text/json: schema: $ref: '#/components/schemas/Created' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ManageProgressPayments '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/requests/{progressPaymentRequestId}/splits/{splitId}': get: tags: - PaymentSplit summary: Gets a specific payment split. description: "**Authorization:** `ManageProgressPayments`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetPaymentSplit parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: splitId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: The requested ProgressPaymentRequestSplitDto when found. content: text/plain: schema: $ref: '#/components/schemas/ProgressPaymentRequestSplitDto' application/json: schema: $ref: '#/components/schemas/ProgressPaymentRequestSplitDto' text/json: schema: $ref: '#/components/schemas/ProgressPaymentRequestSplitDto' '401': description: Unauthorized - Authentication required x-policy: ManageProgressPayments put: tags: - PaymentSplit summary: Updates an existing payment split. description: '**Authorization:** `ManageProgressPayments`' operationId: UpdatePaymentSplit parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: splitId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The payment split changes to apply. content: application/json: schema: $ref: '#/components/schemas/UpdatePaymentSplit' text/json: schema: $ref: '#/components/schemas/UpdatePaymentSplit' application/*+json: schema: $ref: '#/components/schemas/UpdatePaymentSplit' required: true responses: '202': description: An accepted response indicating the update result. content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ManageProgressPayments delete: tags: - PaymentSplit summary: Deletes a payment split. description: '**Authorization:** `ManageProgressPayments`' operationId: DeletePaymentSplit parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: splitId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '202': description: An accepted response once the deletion is complete. '401': description: Unauthorized - Authentication required x-policy: ManageProgressPayments '/borrowers/{borrowerId}/projects/{projectId}/progress-payments': get: tags: - ProgressPaymentEntity summary: Lists approved progress payments for a project. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListProgressPayments parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged list of ProgressPaymentDto entries. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfProgressPaymentDto' application/json: schema: $ref: '#/components/schemas/PagedListOfProgressPaymentDto' text/json: schema: $ref: '#/components/schemas/PagedListOfProgressPaymentDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/{progressPaymentId}': get: tags: - ProgressPaymentEntity summary: Retrieves a single approved progress payment. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetProgressPayment parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: progressPaymentId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: The requested progress payment or a 404 response. content: text/plain: schema: $ref: '#/components/schemas/ProgressPaymentDto' application/json: schema: $ref: '#/components/schemas/ProgressPaymentDto' text/json: schema: $ref: '#/components/schemas/ProgressPaymentDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/{progressPaymentId}/detail': get: tags: - ProgressPaymentEntity summary: Retrieves an approved progress payment with milestone draw details. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetProgressPaymentDetail parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: progressPaymentId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/ProgressPaymentDetailDto' application/json: schema: $ref: '#/components/schemas/ProgressPaymentDetailDto' text/json: schema: $ref: '#/components/schemas/ProgressPaymentDetailDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/{progressPaymentId}/documents': get: tags: - ProgressPaymentEntity summary: 'Lists all documents associated with an approved payment, including evidence.' description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListProgressPaymentDocuments parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: progressPaymentId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: OK content: text/plain: schema: type: array items: $ref: '#/components/schemas/ProgressPaymentDocumentDto' application/json: schema: type: array items: $ref: '#/components/schemas/ProgressPaymentDocumentDto' text/json: schema: type: array items: $ref: '#/components/schemas/ProgressPaymentDocumentDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/requests/{progressPaymentRequestId}/change/amount': post: tags: - ProgressPaymentRequestChange summary: Changes the amount on a progress payment request. description: '**Authorization:** `ManageProgressPayments`' operationId: ChangeAmount parameters: - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: borrowerId in: path required: true schema: type: integer format: int32 - name: projectId in: path required: true schema: type: integer format: int32 requestBody: content: application/json: schema: $ref: '#/components/schemas/ChangeProgressPaymentAmountRequest' text/json: schema: $ref: '#/components/schemas/ChangeProgressPaymentAmountRequest' application/*+json: schema: $ref: '#/components/schemas/ChangeProgressPaymentAmountRequest' required: true responses: '202': description: Accepted content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ManageProgressPayments '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/requests/{progressPaymentRequestId}/change/payment-date': post: tags: - ProgressPaymentRequestChange summary: Changes the target payment date on a progress payment request. description: '**Authorization:** `ManageProgressPayments`' operationId: ChangePaymentDate parameters: - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: borrowerId in: path required: true schema: type: integer format: int32 - name: projectId in: path required: true schema: type: integer format: int32 requestBody: content: application/json: schema: $ref: '#/components/schemas/ChangeProgressPaymentPaymentDateRequest' text/json: schema: $ref: '#/components/schemas/ChangeProgressPaymentPaymentDateRequest' application/*+json: schema: $ref: '#/components/schemas/ChangeProgressPaymentPaymentDateRequest' required: true responses: '202': description: Accepted content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ManageProgressPayments '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/requests/{progressPaymentRequestId}/change/gst-requested': post: tags: - ProgressPaymentRequestChange summary: Changes whether GST is requested on a progress payment request. description: '**Authorization:** `ManageProgressPayments`' operationId: ChangeGstRequested parameters: - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: borrowerId in: path required: true schema: type: integer format: int32 - name: projectId in: path required: true schema: type: integer format: int32 requestBody: content: application/json: schema: $ref: '#/components/schemas/ChangeProgressPaymentGstRequestedRequest' text/json: schema: $ref: '#/components/schemas/ChangeProgressPaymentGstRequestedRequest' application/*+json: schema: $ref: '#/components/schemas/ChangeProgressPaymentGstRequestedRequest' required: true responses: '202': description: Accepted content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ManageProgressPayments '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/requests/{progressPaymentRequestId}/change/milestones': post: tags: - ProgressPaymentRequestChange summary: 'Changes which milestones are included in a progress payment request, adjusting the amount accordingly.' description: '**Authorization:** `ManageProgressPayments`' operationId: ChangeMilestones parameters: - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: borrowerId in: path required: true schema: type: integer format: int32 - name: projectId in: path required: true schema: type: integer format: int32 requestBody: content: application/json: schema: $ref: '#/components/schemas/ChangeProgressPaymentMilestonesRequest' text/json: schema: $ref: '#/components/schemas/ChangeProgressPaymentMilestonesRequest' application/*+json: schema: $ref: '#/components/schemas/ChangeProgressPaymentMilestonesRequest' required: true responses: '202': description: Accepted content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ManageProgressPayments '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/requests/{progressPaymentRequestId}/change/supplementary-costs': post: tags: - ProgressPaymentRequestChange summary: Changes individual supplementary cost draw amounts on a progress payment request. description: '**Authorization:** `ManageProgressPayments`' operationId: ChangeSupplementaryCostAmounts parameters: - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: borrowerId in: path required: true schema: type: integer format: int32 - name: projectId in: path required: true schema: type: integer format: int32 requestBody: content: application/json: schema: $ref: '#/components/schemas/ChangeSupplementaryCostAmountsRequest' text/json: schema: $ref: '#/components/schemas/ChangeSupplementaryCostAmountsRequest' application/*+json: schema: $ref: '#/components/schemas/ChangeSupplementaryCostAmountsRequest' required: true responses: '202': description: Accepted content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ManageProgressPayments '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/requests': get: tags: - ProgressPaymentRequest summary: Lists progress payments for a project. description: "**Authorization:** `RequestProgressPayment`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListProgressPaymentRequests parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged list of ProgressPaymentRequestDto entries. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfProgressPaymentRequestDto' application/json: schema: $ref: '#/components/schemas/PagedListOfProgressPaymentRequestDto' text/json: schema: $ref: '#/components/schemas/PagedListOfProgressPaymentRequestDto' '401': description: Unauthorized - Authentication required x-policy: RequestProgressPayment post: tags: - ProgressPaymentRequest summary: Creates a progress payment request from a draft. description: '**Authorization:** `RequestProgressPayment`' operationId: CreateProgressPaymentRequest parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The request creation payload containing the draft identifier. content: application/json: schema: $ref: '#/components/schemas/CreateProgressPaymentRequest' text/json: schema: $ref: '#/components/schemas/CreateProgressPaymentRequest' application/*+json: schema: $ref: '#/components/schemas/CreateProgressPaymentRequest' required: true responses: '201': description: A created response with the location of the new progress payment request. content: text/plain: schema: $ref: '#/components/schemas/Created' application/json: schema: $ref: '#/components/schemas/Created' text/json: schema: $ref: '#/components/schemas/Created' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: RequestProgressPayment '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/requests/details': get: tags: - ProgressPaymentRequest summary: Lists progress payments with the per-request draw line items their cards render. description: "**Authorization:** `RequestProgressPayment`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListProgressPaymentRequestSplits parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged list of ProgressPaymentRequestListDetailDto entries. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfProgressPaymentRequestListDetailDto' application/json: schema: $ref: '#/components/schemas/PagedListOfProgressPaymentRequestListDetailDto' text/json: schema: $ref: '#/components/schemas/PagedListOfProgressPaymentRequestListDetailDto' '401': description: Unauthorized - Authentication required x-policy: RequestProgressPayment '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/requests/{progressPaymentRequestId}': get: tags: - ProgressPaymentRequest summary: Retrieves a single progress payment. description: "**Authorization:** `RequestProgressPayment`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetProgressPaymentRequest parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: The requested progress payment request or a 404 response. content: text/plain: schema: $ref: '#/components/schemas/ProgressPaymentRequestDto' application/json: schema: $ref: '#/components/schemas/ProgressPaymentRequestDto' text/json: schema: $ref: '#/components/schemas/ProgressPaymentRequestDto' '401': description: Unauthorized - Authentication required x-policy: RequestProgressPayment '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/requests/{progressPaymentRequestId}/detail': get: tags: - ProgressPaymentRequest summary: Retrieves a progress payment request with type-specific draw details. description: "**Authorization:** `RequestProgressPayment`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetProgressPaymentRequestSplit parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: OK content: text/plain: schema: $ref: '#/components/schemas/ProgressPaymentRequestDetailDto' application/json: schema: $ref: '#/components/schemas/ProgressPaymentRequestDetailDto' text/json: schema: $ref: '#/components/schemas/ProgressPaymentRequestDetailDto' '401': description: Unauthorized - Authentication required x-policy: RequestProgressPayment '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/requests/{progressPaymentRequestId}/documents': get: tags: - ProgressPaymentRequest summary: 'Lists all documents associated with a request, including evidence.' description: "**Authorization:** `RequestProgressPayment`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListProgressPaymentRequestDocuments parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: OK content: text/plain: schema: type: array items: $ref: '#/components/schemas/ProgressPaymentDocumentDto' application/json: schema: type: array items: $ref: '#/components/schemas/ProgressPaymentDocumentDto' text/json: schema: type: array items: $ref: '#/components/schemas/ProgressPaymentDocumentDto' '401': description: Unauthorized - Authentication required x-policy: RequestProgressPayment post: tags: - ProgressPaymentRequestDocuments summary: Attaches a document to the request as evidence for the target named in the body. description: '**Authorization:** `ManageProgressPayments`' operationId: AddRequestDocument parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The document to attach and its evidence target. content: application/json: schema: $ref: '#/components/schemas/AddDocument' text/json: schema: $ref: '#/components/schemas/AddDocument' application/*+json: schema: $ref: '#/components/schemas/AddDocument' required: true responses: '202': description: An accepted response once the document is attached. '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ManageProgressPayments '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/requests/submit': post: tags: - ProgressPaymentRequest summary: Submits a progress payment request directly (bypasses draft). description: '**Authorization:** `RequestProgressPayment`' operationId: SubmitProgressPaymentRequest parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The payment request submission payload. content: application/json: schema: $ref: '#/components/schemas/SubmitProgressPaymentRequest' text/json: schema: $ref: '#/components/schemas/SubmitProgressPaymentRequest' application/*+json: schema: $ref: '#/components/schemas/SubmitProgressPaymentRequest' required: true responses: '201': description: A created response with the location of the new progress payment request. content: text/plain: schema: $ref: '#/components/schemas/Created' application/json: schema: $ref: '#/components/schemas/Created' text/json: schema: $ref: '#/components/schemas/Created' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: RequestProgressPayment '/borrowers/{borrowerId}/projects/{projectId}/progress-payments/requests/{progressPaymentRequestId}/documents/{documentId}': delete: tags: - ProgressPaymentRequestDocuments summary: Removes a document from the request. description: '**Authorization:** `ManageProgressPayments`' operationId: RemoveRequestDocument parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: documentId in: path description: The document identifier to remove. required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '202': description: An accepted response once the document is removed. '401': description: Unauthorized - Authentication required x-policy: ManageProgressPayments put: tags: - ProgressPaymentRequestDocuments summary: 'Swaps a document on the request for a new one, keeping its evidence association.' description: '**Authorization:** `ManageProgressPayments`' operationId: ReplaceRequestDocument parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: progressPaymentRequestId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: documentId in: path description: The document identifier to replace. required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The replacement document details. content: application/json: schema: $ref: '#/components/schemas/ReplaceDocument' text/json: schema: $ref: '#/components/schemas/ReplaceDocument' application/*+json: schema: $ref: '#/components/schemas/ReplaceDocument' required: true responses: '202': description: An accepted response once the document is replaced. '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ManageProgressPayments '/borrowers/{borrowerId}/projects': get: tags: - Project summary: Retrieves projects for a borrower. description: "**Authorization:** `BelongsToBorrower`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListProjects parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged list of ProjectDto values. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfProjectDto' application/json: schema: $ref: '#/components/schemas/PagedListOfProjectDto' text/json: schema: $ref: '#/components/schemas/PagedListOfProjectDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToBorrower post: tags: - Project summary: Creates a new project. description: '**Authorization:** `ProjectAdministration`' operationId: CreateProject parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The project details to create. content: application/json: schema: $ref: '#/components/schemas/CreateProject' text/json: schema: $ref: '#/components/schemas/CreateProject' application/*+json: schema: $ref: '#/components/schemas/CreateProject' required: true responses: '201': description: A created response containing the location of the new project. content: text/plain: schema: $ref: '#/components/schemas/Created' application/json: schema: $ref: '#/components/schemas/Created' text/json: schema: $ref: '#/components/schemas/Created' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ProjectAdministration '/borrowers/{borrowerId}/projects/{projectId}': get: tags: - Project summary: Gets a project by numeric identifier. description: "**Authorization:** `BelongsToBorrower`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetProjectById parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: The project details or a 404 response. content: text/plain: schema: $ref: '#/components/schemas/ProjectDetailDto' application/json: schema: $ref: '#/components/schemas/ProjectDetailDto' text/json: schema: $ref: '#/components/schemas/ProjectDetailDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToBorrower put: tags: - Project summary: Updates an existing project. description: '**Authorization:** `ProjectAdministration`' operationId: UpdateProject parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The project details to update. content: application/json: schema: $ref: '#/components/schemas/UpdateProject' text/json: schema: $ref: '#/components/schemas/UpdateProject' application/*+json: schema: $ref: '#/components/schemas/UpdateProject' required: true responses: '202': description: An accepted response capturing the update. content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ProjectAdministration delete: tags: - Project summary: Soft-deletes a project. description: '**Authorization:** `ProjectAdministration`' operationId: DeleteProject parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '202': description: An accepted response indicating the project has been soft-deleted. content: text/plain: schema: $ref: '#/components/schemas/Deleted' application/json: schema: $ref: '#/components/schemas/Deleted' text/json: schema: $ref: '#/components/schemas/Deleted' '401': description: Unauthorized - Authentication required x-policy: ProjectAdministration '/borrowers/{borrowerId}/projects/{key}': get: tags: - Project summary: Gets a project by its unique key. description: "**Authorization:** `BelongsToBorrower`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetProjectByKey parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: key in: path description: The unique project key. required: true schema: type: string format: uuid responses: '200': description: The project details or a 404 response. content: text/plain: schema: $ref: '#/components/schemas/ProjectDetailDto' application/json: schema: $ref: '#/components/schemas/ProjectDetailDto' text/json: schema: $ref: '#/components/schemas/ProjectDetailDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToBorrower '/borrowers/{borrowerId}/projects/{reference}': get: tags: - Project summary: Gets a project by its reference code. description: "**Authorization:** `BelongsToBorrower`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetProjectByReference parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: reference in: path description: The project reference code. required: true schema: maxLength: 20 pattern: '^[a-zA-Z][-\w]+$' type: string responses: '200': description: The project details or a 404 response. content: text/plain: schema: $ref: '#/components/schemas/ProjectDetailDto' application/json: schema: $ref: '#/components/schemas/ProjectDetailDto' text/json: schema: $ref: '#/components/schemas/ProjectDetailDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToBorrower '/borrowers/{borrowerId}/projects/{projectId}/user-fields': put: tags: - Project summary: Updates the project fields a borrower may edit themselves. description: '**Authorization:** `BelongsToBorrower`' operationId: UpdateProjectUserFields parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The borrower-editable fields to update. content: application/json: schema: $ref: '#/components/schemas/UpdateProjectUserFields' text/json: schema: $ref: '#/components/schemas/UpdateProjectUserFields' application/*+json: schema: $ref: '#/components/schemas/UpdateProjectUserFields' required: true responses: '202': description: An accepted response capturing the update. content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: BelongsToBorrower '/borrowers/{borrowerId}/projects/{projectId}/archive': post: tags: - Project summary: Archives a project. description: '**Authorization:** `ProjectAdministration`' operationId: ArchiveProject parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '202': description: An accepted response indicating the project has been archived. content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: ProjectAdministration '/borrowers/{borrowerId}/projects/{projectId}/timeline': get: tags: - ProjectTimeline summary: Lists timeline entries for a project. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListTimeline parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged list of ProjectTimelineEntryDto entries. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfProjectTimelineEntryDto' application/json: schema: $ref: '#/components/schemas/PagedListOfProjectTimelineEntryDto' text/json: schema: $ref: '#/components/schemas/PagedListOfProjectTimelineEntryDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject '/borrowers/{borrowerId}/projects/{projectId}/timeline/{timelineRowId}': get: tags: - ProjectTimeline summary: Retrieves a single timeline entry. description: "**Authorization:** `BelongsToProject`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetTimelineEntry parameters: - name: borrowerId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: projectId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 - name: timelineRowId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: The requested timeline entry or a 404 response. content: text/plain: schema: $ref: '#/components/schemas/ProjectTimelineEntryDto' application/json: schema: $ref: '#/components/schemas/ProjectTimelineEntryDto' text/json: schema: $ref: '#/components/schemas/ProjectTimelineEntryDto' '401': description: Unauthorized - Authentication required x-policy: BelongsToProject /queues/manual-review: get: tags: - Queues summary: Lists all progress payment requests in the manual review queue. description: "Returns all requests with `ManualReview` status, including those that have\nbeen referred to Adviser or Credit. Use the `HasActiveReferral` property\nto filter or the `/manual-review/unreferred` endpoint for only unreferred requests.\n\n**Authorization:** `StaffOnly`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListManualReviewQueue parameters: - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 - name: referredToUser in: query description: "Optional. Restrict to PPRs whose active referral targets `Adviser`\n AND whose project's adviser matches this value. Matched as a string against\n `Adviser.Email` or `UserIdentity.Identifier` (Entra OID)." schema: type: string - name: declineReason in: query description: "Optional, repeatable. Restrict to PPRs that have at least one\n `AutoApprovalDeclinedReason.ErrorCode` matching one of the supplied values (OR semantics)." schema: type: array items: type: string responses: '200': description: A QueueSummary<T> of ManualReviewQueueItemDto objects. content: text/plain: schema: $ref: '#/components/schemas/QueueSummaryOfManualReviewQueueItemDto' application/json: schema: $ref: '#/components/schemas/QueueSummaryOfManualReviewQueueItemDto' text/json: schema: $ref: '#/components/schemas/QueueSummaryOfManualReviewQueueItemDto' '401': description: Unauthorized - Authentication required x-policy: StaffOnly /queues/manual-review/unreferred: get: tags: - Queues summary: Lists progress payment requests in the manual review queue that have not been referred elsewhere. description: "This is the \"my responsibility\" view - requests that are awaiting Ops action\nand have not been referred to Adviser or Credit.\n\n**Authorization:** `StaffOnly`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListManualReviewQueueUnreferred parameters: - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 - name: declineReason in: query description: "Optional, repeatable. Restrict to PPRs that have at least one\n `AutoApprovalDeclinedReason.ErrorCode` matching one of the supplied values (OR semantics)." schema: type: array items: type: string responses: '200': description: A QueueSummary<T> of ManualReviewQueueItemDto objects. content: text/plain: schema: $ref: '#/components/schemas/QueueSummaryOfManualReviewQueueItemDto' application/json: schema: $ref: '#/components/schemas/QueueSummaryOfManualReviewQueueItemDto' text/json: schema: $ref: '#/components/schemas/QueueSummaryOfManualReviewQueueItemDto' '401': description: Unauthorized - Authentication required x-policy: StaffOnly '/queues/manual-review/referred/{target}': get: tags: - Queues summary: Lists manual review progress payment requests currently sitting with a given team. description: "Drives the per-referral dashboard columns from a single contract, all sharing the\nManualReviewQueueItemDto shape. This is the team-wide view; an adviser's own\nscoped queue is served by `GET /queues/adviser-referrals/{adviserOid}`.\n\n**Authorization:** `StaffOnly`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListReferralQueue parameters: - name: target in: path description: "Which team's column to return: `Credit` or `Adviser` for requests\n whose latest referral targets that team, or `Operations` for requests not yet referred\n (the Ops default)." required: true schema: $ref: '#/components/schemas/ReferralTarget' - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 - name: declineReason in: query description: "Optional, repeatable. Restrict to PPRs that have at least one\n `AutoApprovalDeclinedReason.ErrorCode` matching one of the supplied values (OR semantics)." schema: type: array items: type: string responses: '200': description: A QueueSummary<T> of ManualReviewQueueItemDto objects. content: text/plain: schema: $ref: '#/components/schemas/QueueSummaryOfManualReviewQueueItemDto' application/json: schema: $ref: '#/components/schemas/QueueSummaryOfManualReviewQueueItemDto' text/json: schema: $ref: '#/components/schemas/QueueSummaryOfManualReviewQueueItemDto' '401': description: Unauthorized - Authentication required x-policy: StaffOnly /queues/adviser-referrals: get: tags: - Queues summary: Lists progress payment requests that have been referred to the calling staff member's adviser queue. description: "Deprecated: derives the adviser id from the bearer token, which means portal\n\"View As\" impersonation always returns the impersonator's queue (not the\nimpersonated adviser's). Use `GET /queues/adviser-referrals/{adviserOid}`\nwith an explicit subject instead.\n\n**Authorization:** `StaffOnly`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListAdviserReferralQueue parameters: - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 - name: declineReason in: query description: "Optional, repeatable. Restrict to PPRs that have at least one\n `AutoApprovalDeclinedReason.ErrorCode` matching one of the supplied values (OR semantics)." schema: type: array items: type: string responses: '200': description: A paged collection of AdviserReferralQueueItemDto objects. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfAdviserReferralQueueItemDto' application/json: schema: $ref: '#/components/schemas/PagedListOfAdviserReferralQueueItemDto' text/json: schema: $ref: '#/components/schemas/PagedListOfAdviserReferralQueueItemDto' '401': description: Unauthorized - Authentication required deprecated: true x-policy: StaffOnly '/queues/adviser-referrals/{adviserOid}': get: tags: - Queues summary: "Lists progress payment requests that have been referred to the adviser\nidentified by their Entra object id." description: "Returns requests where a referral to `Adviser` exists and the request's\nproject is assigned to the adviser whose `EntraOid` matches\nadviserOid. Callable by any authenticated staff member\nor by the MMS service principal so portal \"View As\" can request another\nadviser's queue. Routing by oid (not the surrogate staff member id) keeps\nthe contract stable regardless of which directory of record the caller\nuses to identify advisers.\n\n**Authorization:** `StaffOrMmsClient`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListAdviserReferralQueueForAdviser parameters: - name: adviserOid in: path description: The adviser's Entra object id (oid claim). required: true schema: type: string format: uuid - name: declineReason in: query description: "Optional, repeatable. Restrict to PPRs that have at least one\n `AutoApprovalDeclinedReason.ErrorCode` matching one of the supplied values (OR semantics)." schema: type: array items: type: string - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged collection of AdviserReferralQueueItemDto objects. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfAdviserReferralQueueItemDto' application/json: schema: $ref: '#/components/schemas/PagedListOfAdviserReferralQueueItemDto' text/json: schema: $ref: '#/components/schemas/PagedListOfAdviserReferralQueueItemDto' '401': description: Unauthorized - Authentication required x-policy: StaffOrMmsClient /queues/bank-accounts/unverified: get: tags: - Queues summary: Lists unverified bank accounts for the Ops verification queue. description: "**Authorization:** `VerifyBankAccount`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListUnverifiedBankAccounts parameters: - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged collection of UnverifiedBankAccountDto objects. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfUnverifiedBankAccountDto' application/json: schema: $ref: '#/components/schemas/PagedListOfUnverifiedBankAccountDto' text/json: schema: $ref: '#/components/schemas/PagedListOfUnverifiedBankAccountDto' '401': description: Unauthorized - Authentication required x-policy: VerifyBankAccount /queues/approved: get: tags: - Queues summary: Lists approved progress payments that have not yet been paid. description: "**Authorization:** `StaffOnly`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListApprovedQueue parameters: - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A QueueSummary<T> of ApprovedQueueItemDto objects. content: text/plain: schema: $ref: '#/components/schemas/QueueSummaryOfApprovedQueueItemDto' application/json: schema: $ref: '#/components/schemas/QueueSummaryOfApprovedQueueItemDto' text/json: schema: $ref: '#/components/schemas/QueueSummaryOfApprovedQueueItemDto' '401': description: Unauthorized - Authentication required x-policy: StaffOnly /queues/paid: get: tags: - Queues summary: Lists recently paid progress payments. description: "**Authorization:** `StaffOnly`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListPaidQueue parameters: - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A QueueSummary<T> of PaidQueueItemDto objects. content: text/plain: schema: $ref: '#/components/schemas/QueueSummaryOfPaidQueueItemDto' application/json: schema: $ref: '#/components/schemas/QueueSummaryOfPaidQueueItemDto' text/json: schema: $ref: '#/components/schemas/QueueSummaryOfPaidQueueItemDto' '401': description: Unauthorized - Authentication required x-policy: StaffOnly /queues/projects: get: tags: - Queues summary: Lists all active (non-archived) projects. description: "**Authorization:** `StaffOnly`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListActiveProjects parameters: - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged collection of ProjectQueueItemDto objects. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfProjectQueueItemDto' application/json: schema: $ref: '#/components/schemas/PagedListOfProjectQueueItemDto' text/json: schema: $ref: '#/components/schemas/PagedListOfProjectQueueItemDto' '401': description: Unauthorized - Authentication required x-policy: StaffOnly /queues/projects/archived: get: tags: - Queues summary: Lists all archived projects. description: "**Authorization:** `StaffOnly`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListArchivedProjects parameters: - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged collection of ProjectQueueItemDto objects. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfProjectQueueItemDto' application/json: schema: $ref: '#/components/schemas/PagedListOfProjectQueueItemDto' text/json: schema: $ref: '#/components/schemas/PagedListOfProjectQueueItemDto' '401': description: Unauthorized - Authentication required x-policy: StaffOnly /search/projects/by-reference: get: tags: - Search summary: Resolves a project by a project reference or a loan reference. description: "**Authorization:** `MmsClient`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: LookupProjectByReference parameters: - name: query in: query description: 'The reference to resolve. Tried as a project reference first, then as a loan reference.' schema: type: string responses: '200': description: 'The project details for the matched project, or a 404 response if no match is found.' content: text/plain: schema: $ref: '#/components/schemas/ProjectDetailDto' application/json: schema: $ref: '#/components/schemas/ProjectDetailDto' text/json: schema: $ref: '#/components/schemas/ProjectDetailDto' '401': description: Unauthorized - Authentication required x-policy: MmsClient /squirrel/staff-members: get: tags: - StaffMember summary: Lists staff members. description: "**Authorization:** `StaffAdministration`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: ListStaffMembers parameters: - name: Skip in: query schema: type: integer format: int32 - name: Take in: query schema: type: integer format: int32 responses: '200': description: A paged collection of StaffMemberDto items. content: text/plain: schema: $ref: '#/components/schemas/PagedListOfStaffMemberDto' application/json: schema: $ref: '#/components/schemas/PagedListOfStaffMemberDto' text/json: schema: $ref: '#/components/schemas/PagedListOfStaffMemberDto' '401': description: Unauthorized - Authentication required x-policy: StaffAdministration post: tags: - StaffMember summary: Creates a new staff member. description: '**Authorization:** `StaffAdministration`' operationId: CreateStaffMember requestBody: description: The staff member details to create. content: application/json: schema: $ref: '#/components/schemas/CreateStaffMember' text/json: schema: $ref: '#/components/schemas/CreateStaffMember' application/*+json: schema: $ref: '#/components/schemas/CreateStaffMember' required: true responses: '201': description: A created response describing the staff member. content: text/plain: schema: $ref: '#/components/schemas/Created' application/json: schema: $ref: '#/components/schemas/Created' text/json: schema: $ref: '#/components/schemas/Created' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: StaffAdministration '/squirrel/staff-members/{staffMemberId}': get: tags: - StaffMember summary: Gets a staff member by identifier. description: "**Authorization:** `StaffAdministration`\n\n**Read Access:** All authenticated staff members and client applications can access this endpoint." operationId: GetStaffMember parameters: - name: staffMemberId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '200': description: The requested staff member or a 404 response. content: text/plain: schema: $ref: '#/components/schemas/StaffMemberDto' application/json: schema: $ref: '#/components/schemas/StaffMemberDto' text/json: schema: $ref: '#/components/schemas/StaffMemberDto' '401': description: Unauthorized - Authentication required x-policy: StaffAdministration put: tags: - StaffMember summary: Updates an existing staff member. description: '**Authorization:** `StaffAdministration`' operationId: UpdateStaffMember parameters: - name: staffMemberId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 requestBody: description: The staff member details to update. content: application/json: schema: $ref: '#/components/schemas/UpdateStaffMember' text/json: schema: $ref: '#/components/schemas/UpdateStaffMember' application/*+json: schema: $ref: '#/components/schemas/UpdateStaffMember' required: true responses: '202': description: An accepted response describing the update. content: text/plain: schema: $ref: '#/components/schemas/Updated' application/json: schema: $ref: '#/components/schemas/Updated' text/json: schema: $ref: '#/components/schemas/Updated' '401': description: Unauthorized - Authentication required '400': description: Bad Request - Validation failed content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' '422': description: Unprocessable Entity - Business rule violation content: application/problem+json: schema: $ref: '#/components/schemas/ProblemDetails' x-policy: StaffAdministration delete: tags: - StaffMember summary: Deletes a staff member. description: '**Authorization:** `StaffAdministration`' operationId: DeleteStaffMember parameters: - name: staffMemberId in: path required: true schema: pattern: '^-?(?:0|[1-9]\d*)$' type: integer format: int32 responses: '202': description: An accepted response when the delete is processed. '401': description: Unauthorized - Authentication required x-policy: StaffAdministration components: schemas: AcceptInvitationRequest: required: - token type: object properties: token: type: string AddBankStatement: required: - documentId type: object properties: documentId: type: integer format: int32 AddConditionEvidence: required: - documentId type: object properties: documentId: type: integer format: int32 AddDocument: required: - documentId - kind type: object properties: documentId: type: integer format: int32 kind: $ref: '#/components/schemas/ProgressPaymentEvidenceKind' milestoneRequirementId: type: - 'null' - integer format: int32 supplementaryCostId: type: - 'null' - integer format: int32 AddressDto: required: - addressId type: object properties: addressId: type: integer format: int32 standardAddress: oneOf: - type: 'null' - $ref: '#/components/schemas/StandardAddress' nonStandardAddress: oneOf: - type: 'null' - $ref: '#/components/schemas/NonStandardAddress' location: oneOf: - type: 'null' - $ref: '#/components/schemas/GpsLocation' AdvanceRequestDetail: required: - amount - milestone type: object properties: amount: $ref: '#/components/schemas/CashValue' milestone: $ref: '#/components/schemas/MilestoneDetailDto' reason: type: - 'null' - string AdviserReferralQueueItemDto: required: - progressPaymentRequestId - projectLocalId - squirrelReference - projectId - borrowerId - projectReference - projectKey - borrowerName - amount - referredAtNzt - declineReasons type: object properties: progressPaymentRequestId: type: integer format: int32 projectLocalId: type: integer format: int32 squirrelReference: type: string projectId: type: integer format: int32 borrowerId: type: integer format: int32 projectReference: type: string projectKey: type: string format: uuid borrowerName: type: string amount: $ref: '#/components/schemas/CashValue' referredAtNzt: type: string format: date-time declineReasons: type: array items: type: string ApprovedBudgetTransferDto: required: - budgetTransferId - borrowerId - projectId - projectReference - projectName - amount - fromLoanReference - toLoanReference - recoveredInRequestId - proposedAtNzt - approvedAtNzt - approvedBy type: object properties: budgetTransferId: type: integer format: int32 borrowerId: type: integer format: int32 projectId: type: integer format: int32 projectReference: type: string projectName: type: string amount: $ref: '#/components/schemas/CashValue' fromLoanReference: type: string toLoanReference: type: string recoveredInRequestId: type: integer format: int32 proposedAtNzt: type: string format: date-time approvedAtNzt: type: string format: date-time approvedBy: $ref: '#/components/schemas/ChangeSource' approvedByStaffMemberName: type: - 'null' - string appliedAtNzt: type: - 'null' - string format: date-time ApproveDocument: type: object properties: overrideLocation: oneOf: - type: 'null' - $ref: '#/components/schemas/GpsLocation' overrideOcrData: type: - 'null' - string ApprovedQueueItemDto: required: - progressPaymentRequestId - projectLocalId - squirrelReference - projectId - borrowerId - projectName - type - amount - wasAutoApproved - approvedAtNzt type: object properties: progressPaymentRequestId: type: integer format: int32 projectLocalId: type: integer format: int32 squirrelReference: type: string projectId: type: integer format: int32 borrowerId: type: integer format: int32 projectName: type: string type: $ref: '#/components/schemas/ProgressPaymentType' amount: $ref: '#/components/schemas/CashValue' wasAutoApproved: type: boolean approvedByStaffMemberName: type: - 'null' - string targetPaymentDate: type: - 'null' - string format: date approvedAtNzt: type: string format: date-time ApproveProgressPaymentRequest: type: object properties: approvalNote: type: - 'null' - string AppUserDto: required: - userId - name - email - isActive type: object properties: userId: type: integer format: int32 name: type: string email: type: string isActive: type: boolean deletedAtNzt: type: - 'null' - string format: date-time AppUserRole: enum: - 1 - 2 - 3 - 4 - 5 type: integer x-enum-varnames: - RequestLoanConditionReview - CreateProgressPaymentRequest - SubmitProgressPaymentRequest - ReadOnly - Administration x-enum-order: - 0 - 1 - 2 - 3 - 4 AutoApprovalDeclinedReasonDto: required: - errorCode - description type: object properties: errorCode: type: string description: type: string AvailableFunds: type: object properties: limit: $ref: '#/components/schemas/CashValue' drawn: $ref: '#/components/schemas/CashValue' balance: $ref: '#/components/schemas/CashValue' Bank: enum: - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 type: integer x-enum-varnames: - ANZ - ASB - BankDirect - BNZ - HSBC - KiwiBank - Sovereign - TSB - Westpac - CoOperative - Rabobank - Citibank - SBS - Other - Resimac x-enum-order: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 BankAccountChangeType: enum: - 1 - 2 - 3 - 4 - 5 type: integer x-enum-varnames: - Created - Updated - Renamed - Verified - Deleted x-enum-order: - 0 - 1 - 2 - 3 - 4 BankAccountDto: required: - bankAccountId - projectId - accountNumber - bank - accountName - loadedAtNzt - loadedBy - updatedAtNzt - updatedBy - isCustomerBankAccount - isVerified type: object properties: bankAccountId: type: integer format: int32 projectId: type: integer format: int32 accountNumber: type: string bank: $ref: '#/components/schemas/Bank' displayName: type: - 'null' - string accountName: type: string loadedAtNzt: type: string format: date-time loadedBy: $ref: '#/components/schemas/ChangeSource' loadedByUserId: type: - 'null' - integer format: int32 updatedAtNzt: type: string format: date-time updatedBy: $ref: '#/components/schemas/ChangeSource' updatedByUserId: type: - 'null' - integer format: int32 isCustomerBankAccount: type: boolean verifiedAtNzt: type: - 'null' - string format: date-time verifiedByStaffMemberId: type: - 'null' - integer format: int32 isVerified: type: boolean BankAccountField: enum: - 1 - 2 - 3 - 4 type: integer x-enum-varnames: - AccountNumber - Bank - DisplayName - AccountName x-enum-order: - 0 - 1 - 2 - 3 BankAccountFieldChangeDto: required: - field type: object properties: field: $ref: '#/components/schemas/BankAccountField' from: type: - 'null' - string to: type: - 'null' - string BankAccountTimelineEntryDto: required: - bankAccountChangeId - current - changedAtNzt - changeType - changeSource - fieldChanges type: object properties: bankAccountChangeId: type: integer format: int32 current: $ref: '#/components/schemas/BankAccountDto' changedAtNzt: type: string format: date-time changeType: $ref: '#/components/schemas/BankAccountChangeType' changeSource: $ref: '#/components/schemas/ChangeSource' changedByUserId: type: - 'null' - integer format: int32 changedByUserName: type: - 'null' - string fieldChanges: type: array items: $ref: '#/components/schemas/BankAccountFieldChangeDto' BorrowerDto: required: - borrowerId - name type: object properties: borrowerId: type: integer format: int32 name: type: string BorrowerRoles: required: - borrowerId - roles type: object properties: borrowerId: type: integer format: int32 roles: type: array items: type: string BuilderReportDto: required: - inspections - validation type: object properties: inspections: type: array items: $ref: '#/components/schemas/InspectionRecordDto' validation: oneOf: - type: 'null' - $ref: '#/components/schemas/BuilderReportValidationDto' BuilderReportValidationDto: required: - passed - inspectionTypeMatched - outcomePassed type: object properties: passed: type: boolean inspectionTypeMatched: type: boolean addressMatched: type: - 'null' - boolean dateValid: type: - 'null' - boolean outcomePassed: type: boolean matchedInspectionType: type: - 'null' - string CashValue: type: number additionalProperties: false description: Currency amount with cents precision (2 decimal places) format: decimal ChangeProgressPaymentAmountRequest: required: - newAmount type: object properties: newAmount: $ref: '#/components/schemas/CashValue' changeNotes: type: - 'null' - string ChangeProgressPaymentGstRequestedRequest: required: - gstRequested type: object properties: gstRequested: type: boolean changeNotes: type: - 'null' - string ChangeProgressPaymentMilestonesRequest: required: - milestones type: object properties: milestones: type: array items: $ref: '#/components/schemas/MilestoneRequestedChange' changeNotes: type: - 'null' - string ChangeProgressPaymentPaymentDateRequest: type: object properties: newTargetPaymentDate: type: - 'null' - string format: date changeNotes: type: - 'null' - string ChangeSource: enum: - 0 - 1 - 2 - 3 - 4 - 5 - 6 type: integer x-enum-varnames: - Manual - AppUser - StaffMember - ViaSquirrelMoney - ViaMms - ViaDecisionEngine - System x-enum-order: - 0 - 1 - 2 - 3 - 4 - 5 - 6 ChangeSupplementaryCostAmountsRequest: required: - changes type: object properties: changes: type: array items: $ref: '#/components/schemas/SupplementaryCostAmountChange' changeNotes: type: - 'null' - string ConditionDto: required: - conditionId - reference - type - status type: object properties: conditionId: type: integer format: int32 reference: type: string type: $ref: '#/components/schemas/ConditionType' description: type: - 'null' - string status: $ref: '#/components/schemas/ConditionStatus' evidenceSubmittedAtNzt: type: - 'null' - string format: date-time conditionMetAtNzt: type: - 'null' - string format: date-time hasEvidence: type: boolean ConditionStatus: enum: - 0 - 1 - 2 - 3 type: integer x-enum-varnames: - NotApplicable - Met - Reviewing - Unmet x-enum-order: - 0 - 1 - 2 - 3 ConditionType: enum: - 1 - 2 - 3 type: integer x-enum-varnames: - ConditionalApproval - Drawdown - PostSettlement x-enum-order: - 0 - 1 - 2 ConstructionCost: required: - construction - contingency type: object properties: construction: $ref: '#/components/schemas/AvailableFunds' contingency: $ref: '#/components/schemas/AvailableFunds' ContingencyRequestDetail: required: - amount - hasInsufficientFunds type: object properties: amount: $ref: '#/components/schemas/CashValue' hasInsufficientFunds: type: boolean reason: type: - 'null' - string insufficientFundsDetails: type: - 'null' - string CostToCompleteRequestDetail: required: - amount type: object properties: amount: $ref: '#/components/schemas/CashValue' CountryCode: enum: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 - 60 - 61 - 62 - 63 - 64 - 65 - 66 - 67 - 68 - 69 - 70 - 71 - 72 - 73 - 74 - 75 - 76 - 77 - 78 - 79 - 80 - 81 - 82 - 83 - 84 - 85 - 86 - 87 - 88 - 89 - 90 - 91 - 92 - 93 - 94 - 95 - 96 - 97 - 98 - 99 - 100 - 101 - 102 - 103 - 104 - 105 - 106 - 107 - 108 - 109 - 110 - 111 - 112 - 113 - 114 - 115 - 116 - 117 - 118 - 119 - 120 - 121 - 122 - 123 - 124 - 125 - 126 - 127 - 128 - 129 - 130 - 131 - 132 - 133 - 134 - 135 - 136 - 137 - 138 - 139 - 140 - 141 - 142 - 143 - 144 - 145 - 146 - 147 - 148 - 149 - 150 - 151 - 152 - 153 - 154 - 155 - 156 - 157 - 158 - 159 - 160 - 161 - 162 - 163 - 164 - 165 - 166 - 167 - 168 - 169 - 170 - 171 - 172 - 173 - 174 - 175 - 176 - 177 - 178 - 179 - 180 - 181 - 182 - 183 - 184 - 185 - 186 - 187 - 188 - 189 - 190 - 191 - 192 - 193 - 194 - 195 - 196 - 197 - 198 - 199 - 200 - 201 - 202 - 203 - 204 - 205 - 206 - 207 - 208 - 209 - 210 - 211 - 212 - 213 - 214 - 215 - 216 - 217 - 218 - 219 - 220 - 221 - 222 - 223 - 224 - 225 - 226 - 227 - 228 - 229 - 230 - 231 - 232 - 233 - 234 - 235 - 236 - 237 - 238 - 239 - 240 - 241 - 242 - 243 - 244 - 245 - 246 - 247 - 248 - 249 type: integer x-enum-varnames: - NZ - AD - AE - AF - AG - AI - AL - AM - AO - AQ - AR - AS - AT - AU - AW - AX - AZ - BA - BB - BD - BE - BF - BG - BH - BI - BJ - BL - BM - BN - BO - BQ - BR - BS - BT - BV - BW - BY - BZ - CA - CC - CD - CF - CG - CH - CI - CK - CL - CM - CN - CO - CR - CU - CV - CW - CX - CY - CZ - DE - DJ - DK - DM - DO - DZ - EC - EE - EG - EH - ER - ES - ET - FI - FJ - FK - FM - FO - FR - GA - GB - GD - GE - GF - GG - GH - GI - GL - GM - GN - GP - GQ - GR - GS - GT - GU - GW - GY - HK - HM - HN - HR - HT - HU - ID - IE - IL - IM - IN - IO - IQ - IR - IS - IT - JE - JM - JO - JP - KE - KG - KH - KI - KM - KN - KP - KR - KW - KY - KZ - LA - LB - LC - LI - LK - LR - LS - LT - LU - LV - LY - MA - MC - MD - ME - MF - MG - MH - MK - ML - MM - MN - MO - MP - MQ - MR - MS - MT - MU - MV - MW - MX - MY - MZ - NA - NC - NE - NF - NG - NI - NL - NO - NP - NR - NU - OM - PA - PE - PF - PG - PH - PK - PL - PM - PN - PR - PS - PT - PW - PY - QA - RE - RO - RS - RU - RW - SA - SB - SC - SD - SE - SG - SH - SI - SJ - SK - SL - SM - SN - SO - SR - SS - ST - SV - SX - SY - SZ - TC - TD - TF - TG - TH - TJ - TK - TL - TM - TN - TO - TR - TT - TV - TW - TZ - UA - UG - UM - US - UY - UZ - VA - VC - VE - VG - VI - VN - VU - WF - WS - XK - YE - YT - ZA - ZM - ZW x-enum-order: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35 - 36 - 37 - 38 - 39 - 40 - 41 - 42 - 43 - 44 - 45 - 46 - 47 - 48 - 49 - 50 - 51 - 52 - 53 - 54 - 55 - 56 - 57 - 58 - 59 - 60 - 61 - 62 - 63 - 64 - 65 - 66 - 67 - 68 - 69 - 70 - 71 - 72 - 73 - 74 - 75 - 76 - 77 - 78 - 79 - 80 - 81 - 82 - 83 - 84 - 85 - 86 - 87 - 88 - 89 - 90 - 91 - 92 - 93 - 94 - 95 - 96 - 97 - 98 - 99 - 100 - 101 - 102 - 103 - 104 - 105 - 106 - 107 - 108 - 109 - 110 - 111 - 112 - 113 - 114 - 115 - 116 - 117 - 118 - 119 - 120 - 121 - 122 - 123 - 124 - 125 - 126 - 127 - 128 - 129 - 130 - 131 - 132 - 133 - 134 - 135 - 136 - 137 - 138 - 139 - 140 - 141 - 142 - 143 - 144 - 145 - 146 - 147 - 148 - 149 - 150 - 151 - 152 - 153 - 154 - 155 - 156 - 157 - 158 - 159 - 160 - 161 - 162 - 163 - 164 - 165 - 166 - 167 - 168 - 169 - 170 - 171 - 172 - 173 - 174 - 175 - 176 - 177 - 178 - 179 - 180 - 181 - 182 - 183 - 184 - 185 - 186 - 187 - 188 - 189 - 190 - 191 - 192 - 193 - 194 - 195 - 196 - 197 - 198 - 199 - 200 - 201 - 202 - 203 - 204 - 205 - 206 - 207 - 208 - 209 - 210 - 211 - 212 - 213 - 214 - 215 - 216 - 217 - 218 - 219 - 220 - 221 - 222 - 223 - 224 - 225 - 226 - 227 - 228 - 229 - 230 - 231 - 232 - 233 - 234 - 235 - 236 - 237 - 238 - 239 - 240 - 241 - 242 - 243 - 244 - 245 - 246 - 247 - 248 - 249 CreateAddress: type: object properties: standardAddress: oneOf: - type: 'null' - $ref: '#/components/schemas/StandardAddress' nonStandardAddress: oneOf: - type: 'null' - $ref: '#/components/schemas/NonStandardAddress' location: oneOf: - type: 'null' - $ref: '#/components/schemas/GpsLocation' CreateBankAccount: required: - accountNumber - bank - accountName type: object properties: accountNumber: type: string bank: $ref: '#/components/schemas/Bank' displayName: type: - 'null' - string accountName: type: string isCustomerBankAccount: type: boolean default: true CreateBorrower: required: - name - externalIdSource - externalIdentifier type: object properties: name: type: string externalIdSource: $ref: '#/components/schemas/ExternalIdSource' externalIdentifier: type: string Created: required: - id type: object properties: id: type: integer format: int32 CreatedDocument: required: - documentId - key - uploadUrl - method - headers - expiresAtNzt type: object properties: documentId: type: integer format: int32 key: type: string format: uuid uploadUrl: type: string method: type: string headers: type: object additionalProperties: type: string expiresAtNzt: type: string format: date-time CreateDocument: required: - filename - contentType - contentLength type: object properties: filename: type: string contentType: type: string contentLength: type: integer format: int64 conditionId: type: - 'null' - integer format: int32 bankAccountId: type: - 'null' - integer format: int32 CreateDraftProgressPaymentRequest: type: object properties: milestone: oneOf: - type: 'null' - $ref: '#/components/schemas/DraftMilestoneRequest' advance: oneOf: - type: 'null' - $ref: '#/components/schemas/DraftAdvanceRequest' contingency: oneOf: - type: 'null' - $ref: '#/components/schemas/DraftContingencyRequest' supplementaryCost: oneOf: - type: 'null' - $ref: '#/components/schemas/DraftSupplementaryCostRequest' costToComplete: oneOf: - type: 'null' - $ref: '#/components/schemas/DraftCostToCompleteRequest' CreateInvitation: required: - name - email - roles type: object properties: name: type: string email: type: string roles: type: array items: $ref: '#/components/schemas/AppUserRole' CreateMilestone: required: - milestoneType - limit type: object properties: milestoneType: $ref: '#/components/schemas/MilestoneType' limit: $ref: '#/components/schemas/CashValue' CreatePaymentSplit: required: - amount - bankAccountId type: object properties: amount: $ref: '#/components/schemas/CashValue' code: type: - 'null' - string particulars: type: - 'null' - string bankAccountId: type: integer format: int32 CreateProgressPaymentRequest: required: - draftProgressPaymentRequestId type: object properties: draftProgressPaymentRequestId: type: integer format: int32 conditionsPrecedentAccepted: type: boolean default: false CreateProject: required: - reference - key - name - projectType - allowPaymentToBorrower - allowAutoApprove - isMasterBuild - addressId - borrowerId - adviserId - milestones type: object properties: reference: type: string key: type: string format: uuid name: type: string projectType: $ref: '#/components/schemas/ProjectType' allowPaymentToBorrower: type: boolean allowAutoApprove: type: boolean isMasterBuild: type: boolean addressId: type: integer format: int32 borrowerId: type: integer format: int32 adviserId: type: integer format: int32 milestones: type: array items: $ref: '#/components/schemas/CreateMilestone' CreateStaffMember: required: - name - roles type: object properties: name: type: string roles: type: array items: $ref: '#/components/schemas/StaffMemberRole' CreditRiskGrade: enum: - 1 - 2 - 3 - 4 - 5 - 6 type: integer x-enum-varnames: - A - B - C - D - E - F x-enum-order: - 0 - 1 - 2 - 3 - 4 - 5 Deleted: required: - id type: object properties: id: type: integer format: int32 DemoDataCleanupResult: required: - projectsDeleted - paymentRequestsDeleted - draftsDeleted type: object properties: projectsDeleted: type: integer description: Number of projects hard-deleted. format: int32 paymentRequestsDeleted: type: integer description: Number of payment requests on those projects. format: int32 draftsDeleted: type: integer description: Number of draft payment requests on those projects. format: int32 description: Result of cleaning up demo data. DemoDataSeedResult: required: - projectsCreated - paymentRequestsCreated - draftsCreated - projects - incompleteScenarios type: object properties: projectsCreated: type: integer description: Number of projects created. format: int32 paymentRequestsCreated: type: integer description: Number of payment requests created. format: int32 draftsCreated: type: integer description: Number of draft payment requests created. format: int32 projects: type: array items: $ref: '#/components/schemas/DemoProjectSummary' description: Summary of each project created. incompleteScenarios: type: array items: $ref: '#/components/schemas/DemoScenarioFailure' description: "Scenarios that did not complete (skipped after a failure);\n empty on a fully successful seed." description: Result of seeding demo data. DemoDataStatusResult: required: - projectCount - paymentRequestCount - draftCount - projects type: object properties: projectCount: type: integer description: Number of active demo projects. format: int32 paymentRequestCount: type: integer description: Number of payment requests on demo projects. format: int32 draftCount: type: integer description: Number of draft payment requests on demo projects. format: int32 projects: type: array items: $ref: '#/components/schemas/DemoProjectSummary' description: Summary of each demo project. description: Status of existing demo data. DemoDraftSummary: required: - draftProgressPaymentRequestId - amount type: object properties: draftProgressPaymentRequestId: type: integer description: The draft ID. format: int32 amount: description: The draft amount. $ref: '#/components/schemas/CashValue' milestoneDraws: type: - 'null' - array items: $ref: '#/components/schemas/DemoMilestoneDrawSummary' description: Milestone draws associated with this draft. description: Summary of a demo draft payment request. DemoMilestoneDrawSummary: required: - milestoneType - amount type: object properties: milestoneType: description: The milestone type being drawn from. $ref: '#/components/schemas/MilestoneType' amount: description: The draw amount. $ref: '#/components/schemas/CashValue' description: Summary of a milestone draw on a demo payment request or draft. DemoPaymentRequestSummary: required: - progressPaymentRequestId - squirrelReference - status type: object properties: progressPaymentRequestId: type: integer description: The payment request ID. format: int32 squirrelReference: type: string description: 'The Squirrel reference (e.g., PP-0000001).' status: description: Current status of the payment request. $ref: '#/components/schemas/ProgressPaymentRequestStatus' hasDecision: type: boolean description: Whether a decision engine decision exists for this request. default: false hasProgressPayment: type: boolean description: Whether a ProgressPayment record exists (appears in approved/paid queues). default: false milestoneDraws: type: - 'null' - array items: $ref: '#/components/schemas/DemoMilestoneDrawSummary' description: Milestone draws associated with this request. description: Summary of a demo payment request. DemoProjectSummary: required: - projectId - reference - scenario - paymentRequests - drafts type: object properties: projectId: type: integer description: The project ID. format: int32 reference: type: string description: The project reference (prefixed with DEMO-). scenario: type: string description: Description of the scenario this project represents. paymentRequests: type: array items: $ref: '#/components/schemas/DemoPaymentRequestSummary' description: Summary of payment requests on this project. drafts: type: array items: $ref: '#/components/schemas/DemoDraftSummary' description: Summary of draft payment requests on this project. description: Summary of a demo project. DemoScenarioFailure: required: - scenario - error type: object properties: scenario: type: string description: Scenario name (e.g. `"MegaBorrower"`). error: type: string description: Failure message. description: 'A scenario that failed to seed, so its data is absent or partial.' DocumentDetailDto: required: - document - extractionStatus - builderReport - photoClassification type: object properties: document: $ref: '#/components/schemas/DocumentDto' extractionStatus: $ref: '#/components/schemas/DocumentExtractionStatus' extractedAtNzt: type: - 'null' - string format: date-time builderReport: oneOf: - type: 'null' - $ref: '#/components/schemas/BuilderReportDto' photoClassification: oneOf: - type: 'null' - $ref: '#/components/schemas/PhotoClassificationDto' DocumentDto: required: - documentId - name - location - uploadedAtNzt - extractionStatus - wasAutoApproved type: object properties: documentId: type: integer format: int32 projectId: type: - 'null' - integer format: int32 bankAccountId: type: - 'null' - integer format: int32 milestoneRequirementId: type: - 'null' - integer format: int32 supplementaryCostId: type: - 'null' - integer format: int32 conditionId: type: - 'null' - integer format: int32 progressPaymentRequestId: type: - 'null' - integer format: int32 draftProgressPaymentRequestId: type: - 'null' - integer format: int32 name: type: string location: type: string uploadedAtNzt: type: string format: date-time extractionStatus: $ref: '#/components/schemas/DocumentExtractionStatus' approvedAtNzt: type: - 'null' - string format: date-time manuallyApproveByStaffMemberId: type: - 'null' - integer format: int32 wasAutoApproved: type: boolean deletedAtNzt: type: - 'null' - string format: date-time deletedByUserId: type: - 'null' - integer format: int32 source: $ref: '#/components/schemas/DocumentSource' DocumentExtractionStatus: enum: - 0 - 1 - 2 - 3 - 4 - 5 type: integer x-enum-varnames: - None - Pending - Scheduled - Processing - Completed - Failed x-enum-order: - 0 - 1 - 2 - 3 - 4 - 5 DocumentSource: enum: - 0 - 1 - 2 - 3 type: integer x-enum-varnames: - Project - BankStatement - Condition - Payment x-enum-order: - 0 - 1 - 2 - 3 DraftAdvanceRequest: required: - base - amount - milestoneId type: object properties: base: $ref: '#/components/schemas/DraftPaymentRequestBase' amount: $ref: '#/components/schemas/CashValue' milestoneId: type: integer format: int32 reason: type: - 'null' - string documentIds: type: - 'null' - array items: type: integer format: int32 DraftAdvanceRequestDetail: required: - amount - milestone type: object properties: amount: $ref: '#/components/schemas/CashValue' milestone: $ref: '#/components/schemas/MilestoneDetailDto' reason: type: - 'null' - string DraftContingencyRequest: required: - base - amount - hasInsufficientFunds type: object properties: base: $ref: '#/components/schemas/DraftPaymentRequestBase' amount: $ref: '#/components/schemas/CashValue' hasInsufficientFunds: type: boolean reason: type: - 'null' - string insufficientFundsDetails: type: - 'null' - string documentIds: type: - 'null' - array items: type: integer format: int32 DraftContingencyRequestDetail: required: - amount - hasInsufficientFunds type: object properties: amount: $ref: '#/components/schemas/CashValue' hasInsufficientFunds: type: boolean reason: type: - 'null' - string insufficientFundsDetails: type: - 'null' - string DraftCostToCompleteRequest: required: - base - amount type: object properties: base: $ref: '#/components/schemas/DraftPaymentRequestBase' amount: $ref: '#/components/schemas/CashValue' documentIds: type: - 'null' - array items: type: integer format: int32 DraftCostToCompleteRequestDetail: required: - amount type: object properties: amount: $ref: '#/components/schemas/CashValue' DraftMilestoneDrawDetailDto: required: - amount - isComplete - milestone type: object properties: amount: $ref: '#/components/schemas/CashValue' isComplete: type: boolean milestone: $ref: '#/components/schemas/MilestoneDetailDto' DraftMilestoneRequest: required: - base - milestones type: object properties: base: $ref: '#/components/schemas/DraftPaymentRequestBase' milestones: type: array items: $ref: '#/components/schemas/MilestoneDrawRequest' DraftMilestoneRequestDetail: required: - amount - milestoneDraws type: object properties: amount: $ref: '#/components/schemas/CashValue' milestoneDraws: type: array items: $ref: '#/components/schemas/DraftMilestoneDrawDetailDto' DraftPaymentRequestBase: required: - gstRequested type: object properties: targetPaymentDate: type: - 'null' - string format: date gstRequested: type: boolean transactionReference: type: - 'null' - string bankAccountId: type: - 'null' - integer format: int32 requestNotes: type: - 'null' - string DraftProgressPaymentCostDrawDto: required: - amount - costType type: object properties: amount: oneOf: - type: 'null' - $ref: '#/components/schemas/CashValue' costType: type: string DraftProgressPaymentGstDto: required: - gstAmount - gstBackOutAmount - netPayment - facilityHeadroom type: object properties: gstAmount: $ref: '#/components/schemas/CashValue' gstBackOutAmount: $ref: '#/components/schemas/CashValue' netPayment: $ref: '#/components/schemas/CashValue' facilityHeadroom: oneOf: - type: 'null' - $ref: '#/components/schemas/CashValue' DraftProgressPaymentMilestoneDrawDto: required: - amount - isComplete - milestoneType type: object properties: amount: $ref: '#/components/schemas/CashValue' isComplete: type: boolean milestoneType: $ref: '#/components/schemas/MilestoneType' DraftProgressPaymentRequestDetailDto: required: - summary - gst type: object properties: summary: $ref: '#/components/schemas/DraftProgressPaymentRequestDto' gst: $ref: '#/components/schemas/DraftProgressPaymentGstDto' milestone: oneOf: - type: 'null' - $ref: '#/components/schemas/DraftMilestoneRequestDetail' advance: oneOf: - type: 'null' - $ref: '#/components/schemas/DraftAdvanceRequestDetail' contingency: oneOf: - type: 'null' - $ref: '#/components/schemas/DraftContingencyRequestDetail' supplementaryCost: oneOf: - type: 'null' - $ref: '#/components/schemas/DraftSupplementaryCostRequestDetail' costToComplete: oneOf: - type: 'null' - $ref: '#/components/schemas/DraftCostToCompleteRequestDetail' DraftProgressPaymentRequestDto: required: - draftProgressPaymentRequestId - projectId - type - amount - gstRequested - requestedAtNzt - requestedByUserId type: object properties: draftProgressPaymentRequestId: type: integer format: int32 projectId: type: integer format: int32 type: $ref: '#/components/schemas/ProgressPaymentType' targetPaymentDate: type: - 'null' - string format: date amount: $ref: '#/components/schemas/CashValue' gstRequested: type: boolean transactionReference: type: - 'null' - string bankAccountId: type: - 'null' - integer format: int32 supplementaryCostId: type: - 'null' - integer format: int32 requestNotes: type: - 'null' - string requestedAtNzt: type: string format: date-time requestedByUserId: type: integer format: int32 lastUpdatedAtNzt: type: - 'null' - string format: date-time lastUpdatedByUserId: type: - 'null' - integer format: int32 publishedPaymentRequestId: type: - 'null' - integer format: int32 hasInsufficientFunds: type: boolean default: false advanceOrContingencyReason: type: - 'null' - string insufficientFundsDetails: type: - 'null' - string DraftProgressPaymentRequestListDetailDto: required: - summary - milestoneDraws - costDraws - advanceMilestoneType type: object properties: summary: $ref: '#/components/schemas/DraftProgressPaymentRequestDto' milestoneDraws: type: array items: $ref: '#/components/schemas/DraftProgressPaymentMilestoneDrawDto' costDraws: type: array items: $ref: '#/components/schemas/DraftProgressPaymentCostDrawDto' advanceMilestoneType: oneOf: - type: 'null' - $ref: '#/components/schemas/MilestoneType' DraftSupplementaryCostDrawDetailDto: required: - amount - cost type: object properties: amount: oneOf: - type: 'null' - $ref: '#/components/schemas/CashValue' notes: type: - 'null' - string cost: $ref: '#/components/schemas/SupplementaryCostDto' DraftSupplementaryCostRequest: required: - base - costDraws type: object properties: base: $ref: '#/components/schemas/DraftPaymentRequestBase' costDraws: type: array items: $ref: '#/components/schemas/SupplementaryCostDrawRequest' DraftSupplementaryCostRequestDetail: required: - costDraws type: object properties: costDraws: type: array items: $ref: '#/components/schemas/DraftSupplementaryCostDrawDetailDto' DrawdownStatus: enum: - 1 - 2 - 3 - 4 - 5 - 6 type: integer x-enum-varnames: - Pending - Submitted - Accepted - Rejected - Completed - PartiallyRejected x-enum-order: - 0 - 1 - 2 - 3 - 4 - 5 EvidenceDocument: required: - requirementId type: object properties: requirementId: type: integer format: int32 documentIds: type: - 'null' - array items: type: integer format: int32 ExternalIdSource: enum: - 1 type: integer x-enum-varnames: - SquirrelMoney x-enum-order: - 0 FacilityType: enum: - 1 - 2 - 3 type: integer x-enum-varnames: - InterestOnly - InterestCapitalised - PrincipalAndInterest x-enum-order: - 0 - 1 - 2 GpsLocation: type: object properties: latitude: pattern: '^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$' type: - number - string format: double longitude: pattern: '^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$' type: - number - string format: double GstFilingFrequency: enum: - 1 - 2 - 3 type: integer x-enum-varnames: - Monthly - TwoMonthly - SixMonthly x-enum-descriptions: - Monthly - 2-monthly - 6-monthly x-enum-order: - 0 - 1 - 2 InspectionRecordDto: type: object properties: region: type: - 'null' - string council: type: - 'null' - string inspectionType: type: - 'null' - string date: type: - 'null' - string format: date location: type: - 'null' - string outcome: type: - 'null' - string buildingConsentNumber: type: - 'null' - string failReason: type: - 'null' - string errata: type: - 'null' - string InterestRate: type: number additionalProperties: false description: Interest rate as a decimal value format: decimal InvitationAcceptedDto: required: - invitationId - createdAppUserId type: object properties: invitationId: type: integer format: int32 createdAppUserId: type: integer format: int32 InvitationIssuedDto: required: - invitationId - borrowerId - name - email - roles - expiresAtNzt type: object properties: invitationId: type: integer format: int32 borrowerId: type: integer format: int32 name: type: string email: type: string roles: type: array items: $ref: '#/components/schemas/AppUserRole' expiresAtNzt: type: string format: date-time InvitationResendOutcome: enum: - 0 - 1 - 2 type: integer x-enum-varnames: - Reissued - AccessGranted - AlreadyHadAccess x-enum-order: - 0 - 1 - 2 InvitationResendResultDto: required: - outcome - invitation type: object properties: outcome: $ref: '#/components/schemas/InvitationResendOutcome' invitation: oneOf: - type: 'null' - $ref: '#/components/schemas/InvitationIssuedDto' appUserId: type: - 'null' - integer format: int32 LoanBalanceDto: required: - principalLimit - limitBalance - closingBalance - drawn - available - interestCharged - lineFeeCharged - netGstAdvanced type: object properties: principalLimit: $ref: '#/components/schemas/CashValue' limitBalance: $ref: '#/components/schemas/CashValue' closingBalance: $ref: '#/components/schemas/CashValue' drawn: $ref: '#/components/schemas/CashValue' available: $ref: '#/components/schemas/CashValue' interestCharged: $ref: '#/components/schemas/CashValue' lineFeeCharged: $ref: '#/components/schemas/CashValue' netGstAdvanced: $ref: '#/components/schemas/CashValue' LoanDetailDto: required: - loan - funding type: object properties: loan: $ref: '#/components/schemas/LoanDto' funding: oneOf: - type: 'null' - $ref: '#/components/schemas/LoanFundingDto' balance: oneOf: - type: 'null' - $ref: '#/components/schemas/LoanBalanceDto' constructionCost: oneOf: - type: 'null' - $ref: '#/components/schemas/ConstructionCost' nextRepaymentAmount: oneOf: - type: 'null' - $ref: '#/components/schemas/CashValue' arrearsAmount: oneOf: - type: 'null' - $ref: '#/components/schemas/CashValue' closingArrearsAmount: oneOf: - type: 'null' - $ref: '#/components/schemas/CashValue' arrearsAsAtNzt: type: - 'null' - string format: date-time fees: type: array items: $ref: '#/components/schemas/LoanFeeDto' parties: oneOf: - type: 'null' - $ref: '#/components/schemas/PartiesDto' LoanDto: required: - loanId - reference - projectId - loanStatus - isInArrears type: object properties: loanId: type: integer format: int32 reference: type: string projectId: type: integer format: int32 nextRepaymentDate: type: - 'null' - string format: date loanStatus: oneOf: - type: 'null' - $ref: '#/components/schemas/LoanStatus' settledAtNzt: type: - 'null' - string format: date-time isInArrears: type: boolean LoanFeeDto: required: - feeType - amount - rate type: object properties: feeType: $ref: '#/components/schemas/LoanFeeType' amount: oneOf: - type: 'null' - $ref: '#/components/schemas/CashValue' rate: oneOf: - type: 'null' - $ref: '#/components/schemas/InterestRate' LoanFeeType: enum: - 1 - 2 - 3 - 4 - 5 type: integer x-enum-varnames: - Establishment - Finance - Line - ProgressFeeLimit - Discharge x-enum-order: - 0 - 1 - 2 - 3 - 4 LoanFundingDto: required: - externalId - facilityType - principalLimit - riskGrade - interestRate - maturityDate - product - repaymentFrequency type: object properties: externalId: type: integer format: int32 facilityType: $ref: '#/components/schemas/FacilityType' principalLimit: type: number format: double totalLoanLimit: type: - 'null' - number format: double riskGrade: oneOf: - type: 'null' - $ref: '#/components/schemas/CreditRiskGrade' interestRate: type: number format: double lineFee: type: - 'null' - number format: double maturityDate: type: string format: date interestCapitalisationAllocation: type: - 'null' - number format: double lineFeeCapitalisationAllocation: type: - 'null' - number format: double product: type: string termMonths: type: - 'null' - integer format: int32 repaymentFrequency: $ref: '#/components/schemas/RepaymentFrequency' LoanPartyDto: required: - name - address type: object properties: name: type: string address: oneOf: - type: 'null' - $ref: '#/components/schemas/AddressDto' isGuaranteeLimited: type: - 'null' - boolean guaranteeLimit: oneOf: - type: 'null' - $ref: '#/components/schemas/CashValue' LoanSecurityDto: required: - loanSecurityId - loanId - externalId - securityRanking - address - includeInDisplay type: object properties: loanSecurityId: type: integer format: int32 loanId: type: integer format: int32 externalId: type: integer format: int32 securityRanking: oneOf: - type: 'null' - $ref: '#/components/schemas/SecurityRanking' address: $ref: '#/components/schemas/AddressDto' includeInDisplay: type: boolean dischargedAtNzt: type: - 'null' - string format: date-time LoanStatus: enum: - 1 - 2 - 3 - 4 type: integer x-enum-varnames: - AwaitingFunding - Active - Closed - WrittenOff x-enum-order: - 0 - 1 - 2 - 3 LoanTransactionDto: required: - loanTransactionId - loanId - externalId - transactionDate - transactionType - amount - closingBalance - limitBalance - isInArrears type: object properties: loanTransactionId: type: integer format: int32 loanId: type: integer format: int32 externalId: type: integer format: int32 transactionDate: type: string format: date transactionType: $ref: '#/components/schemas/TransactionType' amount: $ref: '#/components/schemas/CashValue' closingBalance: $ref: '#/components/schemas/CashValue' limitBalance: $ref: '#/components/schemas/CashValue' isInArrears: type: boolean ManualReviewQueueItemDto: required: - progressPaymentRequestId - projectLocalId - squirrelReference - projectId - borrowerId - projectName - projectReference - projectKey - borrowerName - type - amount - requestedAtNzt - hasActiveReferral - referredTo - projectAdviser - declineReasons type: object properties: progressPaymentRequestId: type: integer format: int32 projectLocalId: type: integer format: int32 squirrelReference: type: string projectId: type: integer format: int32 borrowerId: type: integer format: int32 projectName: type: string projectReference: type: string projectKey: type: string format: uuid borrowerName: type: string type: $ref: '#/components/schemas/ProgressPaymentType' amount: $ref: '#/components/schemas/CashValue' requestedAtNzt: type: string format: date-time hasActiveReferral: type: boolean referredAtNzt: type: - 'null' - string format: date-time referredTo: oneOf: - type: 'null' - $ref: '#/components/schemas/ReferralTarget' projectAdviser: $ref: '#/components/schemas/ProjectAdviserDto' declineReasons: type: array items: type: string MeResponse: required: - userId - userType - roles - borrowers - policies type: object properties: userId: type: integer format: int32 name: type: - 'null' - string userType: type: string scheme: type: - 'null' - string roles: type: array items: type: string borrowers: type: array items: $ref: '#/components/schemas/BorrowerRoles' policies: type: object additionalProperties: $ref: '#/components/schemas/PolicyEvaluationResult' MilestoneDetailDto: required: - milestoneId - milestoneType - status - availableFunds - isKeyMilestone - requirements type: object properties: milestoneId: type: integer format: int32 milestoneType: $ref: '#/components/schemas/MilestoneType' status: $ref: '#/components/schemas/MilestoneStatus' availableFunds: $ref: '#/components/schemas/AvailableFunds' isKeyMilestone: type: boolean submittedAtNzt: type: - 'null' - string format: date-time requirements: type: array items: $ref: '#/components/schemas/MilestoneRequirementEvidenceDto' MilestoneDrawDetailDto: required: - amount - isRequested - milestone type: object properties: amount: $ref: '#/components/schemas/CashValue' isRequested: type: boolean milestone: $ref: '#/components/schemas/MilestoneDetailDto' MilestoneDrawRequest: required: - milestoneId - evidence type: object properties: milestoneId: type: integer format: int32 evidence: type: array items: $ref: '#/components/schemas/EvidenceDocument' MilestoneDto: required: - milestoneId - milestoneType - status - availableFunds - paidAmount type: object properties: milestoneId: type: integer format: int32 milestoneType: $ref: '#/components/schemas/MilestoneType' status: $ref: '#/components/schemas/MilestoneStatus' availableFunds: $ref: '#/components/schemas/AvailableFunds' submittedAtNzt: type: - 'null' - string format: date-time paidAtNzt: type: - 'null' - string format: date-time paidAmount: oneOf: - type: 'null' - $ref: '#/components/schemas/CashValue' MilestoneEvidenceDto: required: - milestoneId - milestoneType - isComplete - requirements type: object properties: milestoneId: type: integer format: int32 milestoneType: $ref: '#/components/schemas/MilestoneType' isComplete: type: boolean requirements: type: array items: $ref: '#/components/schemas/MilestoneRequirementEvidenceDto' MilestoneListDetailDto: required: - milestoneId - milestoneType - status - availableFunds - isKeyMilestone - paidAmount - requirements type: object properties: milestoneId: type: integer format: int32 milestoneType: $ref: '#/components/schemas/MilestoneType' status: $ref: '#/components/schemas/MilestoneStatus' availableFunds: $ref: '#/components/schemas/AvailableFunds' isKeyMilestone: type: boolean submittedAtNzt: type: - 'null' - string format: date-time paidAtNzt: type: - 'null' - string format: date-time paidAmount: oneOf: - type: 'null' - $ref: '#/components/schemas/CashValue' requirements: type: array items: $ref: '#/components/schemas/MilestoneRequirementEvidenceDto' MilestoneRequestDetail: required: - amount - milestoneDraws type: object properties: amount: $ref: '#/components/schemas/CashValue' milestoneDraws: type: array items: $ref: '#/components/schemas/MilestoneDrawDetailDto' MilestoneRequestedChange: required: - milestoneId - isRequested type: object properties: milestoneId: type: integer format: int32 isRequested: type: boolean MilestoneRequirementEvidenceDto: required: - milestoneRequirementId - type - documents type: object properties: milestoneRequirementId: type: integer format: int32 type: $ref: '#/components/schemas/MilestoneRequirementType' title: type: - 'null' - string description: type: - 'null' - string documents: type: array items: $ref: '#/components/schemas/DocumentDto' MilestoneRequirementType: enum: - 1 - 2 - 3 type: integer x-enum-varnames: - Photographic - PdfDocument - Other x-enum-order: - 0 - 1 - 2 MilestoneStatus: enum: - 0 - 1 - 2 - 3 - 4 - 5 - 6 type: integer x-enum-varnames: - NotAvailable - NotRequested - Draft - Reviewing - Approved - PartiallyPaid - Paid x-enum-order: - 0 - 1 - 2 - 3 - 4 - 5 - 6 MilestoneType: enum: - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 type: integer x-enum-varnames: - PrePour - Floor - FramingAndTrusses - RoofAndFascia - ExteriorCladding - LockUp - ElectricalAndPlumbing - InternalLinings - CarpetAndFlooring - KitchenAndBathrooms - LandscapeAndPracticalCompletion - SiteEstablishment - ExcavationAndGroundPreparation x-enum-deprecated: - false - false - false - false - false - false - true - false - false - false - false - false - false x-enum-order: - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 1 - 2 MilestoneTypeDto: required: - milestoneType - name type: object properties: milestoneType: $ref: '#/components/schemas/MilestoneType' name: type: string NonStandardAddress: required: - line1 - city - postCode - suburb - country type: object properties: line1: type: string line2: type: - 'null' - string city: type: string postCode: type: string suburb: type: string country: $ref: '#/components/schemas/CountryCode' NotificationDto: required: - notificationId - notificationType - body - createdAtNzt type: object properties: notificationId: type: integer format: int32 notificationType: type: string subject: type: - 'null' - string body: type: string contextKind: type: - 'null' - string contextId: type: - 'null' - integer format: int32 createdAtNzt: type: string format: date-time readAtNzt: type: - 'null' - string format: date-time PagedListOfAddressDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/AddressDto' totalRecordCount: type: integer format: int32 PagedListOfAdviserReferralQueueItemDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/AdviserReferralQueueItemDto' totalRecordCount: type: integer format: int32 PagedListOfApprovedBudgetTransferDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/ApprovedBudgetTransferDto' totalRecordCount: type: integer format: int32 PagedListOfAppUserDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/AppUserDto' totalRecordCount: type: integer format: int32 PagedListOfBankAccountDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/BankAccountDto' totalRecordCount: type: integer format: int32 PagedListOfBankAccountTimelineEntryDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/BankAccountTimelineEntryDto' totalRecordCount: type: integer format: int32 PagedListOfBorrowerDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/BorrowerDto' totalRecordCount: type: integer format: int32 PagedListOfConditionDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/ConditionDto' totalRecordCount: type: integer format: int32 PagedListOfDocumentDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/DocumentDto' totalRecordCount: type: integer format: int32 PagedListOfDraftProgressPaymentRequestDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/DraftProgressPaymentRequestDto' totalRecordCount: type: integer format: int32 PagedListOfDraftProgressPaymentRequestListDetailDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/DraftProgressPaymentRequestListDetailDto' totalRecordCount: type: integer format: int32 PagedListOfLoanDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/LoanDto' totalRecordCount: type: integer format: int32 PagedListOfLoanSecurityDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/LoanSecurityDto' totalRecordCount: type: integer format: int32 PagedListOfLoanTransactionDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/LoanTransactionDto' totalRecordCount: type: integer format: int32 PagedListOfMilestoneDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/MilestoneDto' totalRecordCount: type: integer format: int32 PagedListOfMilestoneListDetailDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/MilestoneListDetailDto' totalRecordCount: type: integer format: int32 PagedListOfNotificationDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/NotificationDto' totalRecordCount: type: integer format: int32 PagedListOfProgressPaymentDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/ProgressPaymentDto' totalRecordCount: type: integer format: int32 PagedListOfProgressPaymentRequestDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/ProgressPaymentRequestDto' totalRecordCount: type: integer format: int32 PagedListOfProgressPaymentRequestListDetailDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/ProgressPaymentRequestListDetailDto' totalRecordCount: type: integer format: int32 PagedListOfProjectDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/ProjectDto' totalRecordCount: type: integer format: int32 PagedListOfProjectQueueItemDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/ProjectQueueItemDto' totalRecordCount: type: integer format: int32 PagedListOfProjectTimelineEntryDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/ProjectTimelineEntryDto' totalRecordCount: type: integer format: int32 PagedListOfProposedBudgetTransferDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/ProposedBudgetTransferDto' totalRecordCount: type: integer format: int32 PagedListOfStaffMemberDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/StaffMemberDto' totalRecordCount: type: integer format: int32 PagedListOfSupplementaryCostDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/SupplementaryCostDto' totalRecordCount: type: integer format: int32 PagedListOfUnverifiedBankAccountDto: required: - items - totalRecordCount type: object properties: items: type: array items: $ref: '#/components/schemas/UnverifiedBankAccountDto' totalRecordCount: type: integer format: int32 PaidQueueItemDto: required: - progressPaymentRequestId - projectLocalId - squirrelReference - projectId - borrowerId - projectName - type - amount - paidAtNzt type: object properties: progressPaymentRequestId: type: integer format: int32 projectLocalId: type: integer format: int32 squirrelReference: type: string projectId: type: integer format: int32 borrowerId: type: integer format: int32 projectName: type: string type: $ref: '#/components/schemas/ProgressPaymentType' amount: $ref: '#/components/schemas/CashValue' paidAtNzt: type: string format: date-time PartiesDto: required: - borrowers - guarantors type: object properties: borrowers: type: array items: $ref: '#/components/schemas/LoanPartyDto' guarantors: type: array items: $ref: '#/components/schemas/LoanPartyDto' PaymentAllocationDto: required: - accountNumber - amount type: object properties: accountNumber: type: string amount: $ref: '#/components/schemas/CashValue' PaymentEvidenceDto: required: - fileName - documentId type: object properties: date: type: - 'null' - string format: date-time fileName: type: string documentId: type: integer format: int32 PhotoClassificationDto: required: - relevantFeatures - exif type: object properties: claimedCategory: type: - 'null' - string outcome: type: - 'null' - string confidence: type: - 'null' - string actualContent: type: - 'null' - string relevantFeatures: type: array items: type: string failReason: type: - 'null' - string notes: type: - 'null' - string exif: oneOf: - type: 'null' - $ref: '#/components/schemas/PhotoExifDataDto' PhotoExifDataDto: required: - location type: object properties: location: oneOf: - type: 'null' - $ref: '#/components/schemas/GpsLocation' distanceMetersFromProjectAddress: type: - 'null' - number format: double PolicyEvaluationResult: required: - passed - description - access type: object properties: passed: type: boolean description: type: string access: type: array items: type: string ProblemDetails: type: object properties: type: type: - 'null' - string title: type: - 'null' - string status: type: - 'null' - integer format: int32 detail: type: - 'null' - string instance: type: - 'null' - string ProgressPaymentAllocationDto: required: - progressPaymentAllocationId - progressPaymentId - loanId - amount - claimAmount - bankAccountId - accountNumber - accountName - drawdownStatus type: object properties: progressPaymentAllocationId: type: integer format: int32 progressPaymentId: type: integer format: int32 loanId: type: integer format: int32 amount: $ref: '#/components/schemas/CashValue' claimAmount: $ref: '#/components/schemas/CashValue' code: type: - 'null' - string particulars: type: - 'null' - string bankAccountId: type: integer format: int32 accountNumber: type: string accountName: type: string drawdownStatus: $ref: '#/components/schemas/DrawdownStatus' drawdownId: type: - 'null' - integer format: int32 drawdownRejectionReason: type: - 'null' - string settledAtNzt: type: - 'null' - string format: date-time ProgressPaymentCostDrawDto: required: - amount - costType type: object properties: amount: $ref: '#/components/schemas/CashValue' costType: type: string ProgressPaymentDetailDto: required: - summary - milestoneDraws type: object properties: summary: $ref: '#/components/schemas/ProgressPaymentDto' milestoneDraws: type: array items: $ref: '#/components/schemas/MilestoneDrawDetailDto' ProgressPaymentDocumentDto: required: - document type: object properties: document: $ref: '#/components/schemas/DocumentDto' milestoneRequirementId: type: - 'null' - integer format: int32 supplementaryCostId: type: - 'null' - integer format: int32 ProgressPaymentDto: required: - progressPaymentId - progressPaymentRequestId - squirrelReference - approvedAtNzt - wasAutoApproved - targetPaymentDateNzt - transactionReference - drawdownStatus - requestedAmount - gstRequested - gstAmount - gstBackedOutAmount - netPayment - fundedAmount - fundedAmountDiffers - allocations type: object properties: progressPaymentId: type: integer format: int32 progressPaymentRequestId: type: integer format: int32 squirrelReference: type: string approvedAtNzt: type: string format: date-time wasAutoApproved: type: boolean approvedByStaffMemberId: type: - 'null' - integer format: int32 approvalNote: type: - 'null' - string approvalDecisionId: type: - 'null' - integer format: int32 paidAtNzt: type: - 'null' - string format: date-time targetPaymentDateNzt: type: string format: date-time transactionReference: type: string drawdownStatus: $ref: '#/components/schemas/DrawdownStatus' requestedAmount: $ref: '#/components/schemas/CashValue' gstRequested: type: boolean gstAmount: $ref: '#/components/schemas/CashValue' gstBackedOutAmount: $ref: '#/components/schemas/CashValue' netPayment: $ref: '#/components/schemas/CashValue' fundedAmount: oneOf: - type: 'null' - $ref: '#/components/schemas/CashValue' fundedAmountDiffers: type: boolean completedAtNzt: type: - 'null' - string format: date-time allocations: type: array items: $ref: '#/components/schemas/ProgressPaymentAllocationDto' ProgressPaymentEvidenceKind: enum: - 0 - 1 - 2 type: integer x-enum-varnames: - RequestLevel - MilestoneRequirement - SupplementaryCost x-enum-order: - 0 - 1 - 2 ProgressPaymentMilestoneDrawDto: required: - amount - isRequested - milestoneType type: object properties: amount: $ref: '#/components/schemas/CashValue' isRequested: type: boolean milestoneType: $ref: '#/components/schemas/MilestoneType' ProgressPaymentRequestDetailDto: required: - summary - paymentSplit type: object properties: summary: $ref: '#/components/schemas/ProgressPaymentRequestDto' paymentSplit: type: array items: $ref: '#/components/schemas/ProgressPaymentSplitDetailDto' milestone: oneOf: - type: 'null' - $ref: '#/components/schemas/MilestoneRequestDetail' advance: oneOf: - type: 'null' - $ref: '#/components/schemas/AdvanceRequestDetail' contingency: oneOf: - type: 'null' - $ref: '#/components/schemas/ContingencyRequestDetail' supplementaryCost: oneOf: - type: 'null' - $ref: '#/components/schemas/SupplementaryCostRequestDetail' costToComplete: oneOf: - type: 'null' - $ref: '#/components/schemas/CostToCompleteRequestDetail' payment: oneOf: - type: 'null' - $ref: '#/components/schemas/ProgressPaymentDto' ProgressPaymentRequestDto: required: - progressPaymentRequestId - projectId - projectLocalId - projectReference - projectKey - type - status - squirrelReference - targetPaymentDateType - originalTargetPaymentDateType - amount - originalRequestedAmount - gstRequested - gstAmount - gstBackedOutAmount - netPayment - bankAccountId - requestedAtNzt - requestedByUserId - hasInsufficientFunds - autoApprovalDeclinedReasons type: object properties: progressPaymentRequestId: type: integer format: int32 projectId: type: integer format: int32 projectLocalId: type: integer format: int32 projectReference: type: string projectKey: type: string format: uuid type: $ref: '#/components/schemas/ProgressPaymentType' status: $ref: '#/components/schemas/ProgressPaymentRequestStatus' squirrelReference: type: string targetPaymentDateType: $ref: '#/components/schemas/TargetPaymentDateType' targetPaymentDate: type: - 'null' - string format: date originalTargetPaymentDateType: oneOf: - type: 'null' - $ref: '#/components/schemas/TargetPaymentDateType' originalTargetPaymentDate: type: - 'null' - string format: date amount: $ref: '#/components/schemas/CashValue' originalRequestedAmount: oneOf: - type: 'null' - $ref: '#/components/schemas/CashValue' gstRequested: type: boolean gstAmount: $ref: '#/components/schemas/CashValue' gstBackedOutAmount: $ref: '#/components/schemas/CashValue' netPayment: $ref: '#/components/schemas/CashValue' transactionReference: type: - 'null' - string bankAccountId: type: integer format: int32 supplementaryCostId: type: - 'null' - integer format: int32 requestNotes: type: - 'null' - string requestedAtNzt: type: string format: date-time requestedByUserId: type: integer format: int32 hasInsufficientFunds: type: boolean advanceOrContingencyReason: type: - 'null' - string insufficientFundsDetails: type: - 'null' - string autoApprovalDeclinedReasons: type: array items: $ref: '#/components/schemas/AutoApprovalDeclinedReasonDto' ProgressPaymentRequestListDetailDto: required: - summary - milestoneDraws - costDraws - advanceMilestoneType type: object properties: summary: $ref: '#/components/schemas/ProgressPaymentRequestDto' milestoneDraws: type: array items: $ref: '#/components/schemas/ProgressPaymentMilestoneDrawDto' costDraws: type: array items: $ref: '#/components/schemas/ProgressPaymentCostDrawDto' advanceMilestoneType: oneOf: - type: 'null' - $ref: '#/components/schemas/MilestoneType' ProgressPaymentRequestSplitDto: required: - progressPaymentRequestSplitId - progressPaymentRequestId - amount - bankAccountId - accountNumber type: object properties: progressPaymentRequestSplitId: type: integer format: int32 progressPaymentRequestId: type: integer format: int32 amount: $ref: '#/components/schemas/CashValue' code: type: - 'null' - string particulars: type: - 'null' - string bankAccountId: type: integer format: int32 accountNumber: type: string ProgressPaymentRequestStatus: enum: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 type: integer x-enum-varnames: - Draft - PendingExtraction - PendingDecision - AutoApproved - ManualReview - OpsApproved - CreditApproved - Rejected - Paid x-enum-order: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 ProgressPaymentSplitDetailDto: required: - progressPaymentRequestSplitId - progressPaymentRequestId - amount - bankAccountId - accountNumber - bank - accountName - isVerified type: object properties: progressPaymentRequestSplitId: type: integer format: int32 progressPaymentRequestId: type: integer format: int32 amount: $ref: '#/components/schemas/CashValue' code: type: - 'null' - string particulars: type: - 'null' - string bankAccountId: type: integer format: int32 accountNumber: type: string bank: $ref: '#/components/schemas/Bank' displayName: type: - 'null' - string accountName: type: string isVerified: type: boolean ProgressPaymentType: enum: - 1 - 2 - 3 - 4 - 5 type: integer x-enum-varnames: - Advance - Milestone - Contingency - SupplementaryCosts - CostToComplete x-enum-order: - 0 - 1 - 2 - 3 - 4 ProjectAdviserDto: required: - userId - email type: object properties: userId: type: integer format: int32 email: type: string entraOid: type: - 'null' - string ProjectBudgetDto: required: - construction - contingency - supplementary type: object properties: construction: $ref: '#/components/schemas/AvailableFunds' contingency: $ref: '#/components/schemas/AvailableFunds' supplementary: $ref: '#/components/schemas/AvailableFunds' interestCapitalisationAllocation: $ref: '#/components/schemas/CashValue' lineFeeCapitalisationAllocation: $ref: '#/components/schemas/CashValue' total: $ref: '#/components/schemas/AvailableFunds' ProjectDetailDto: required: - project - borrowerName - address - budget - gstFloat - loanFunding - supplementaryCosts - securities - bankAccounts - unappliedBudgetTransfers type: object properties: project: $ref: '#/components/schemas/ProjectDto' balance: $ref: '#/components/schemas/CashValue' costToComplete: $ref: '#/components/schemas/CashValue' borrowerName: maxLength: 100 type: string lastTouchedByUserName: maxLength: 100 type: - 'null' - string address: $ref: '#/components/schemas/AddressDto' budget: $ref: '#/components/schemas/ProjectBudgetDto' gstFloat: $ref: '#/components/schemas/ProjectGstFloatDto' loanFunding: type: array items: $ref: '#/components/schemas/ProjectLoanFundingDto' supplementaryCosts: type: array items: $ref: '#/components/schemas/SupplementaryCostDto' securities: type: array items: $ref: '#/components/schemas/ProjectSecurityDto' bankAccounts: type: array items: $ref: '#/components/schemas/BankAccountDto' unappliedBudgetTransfers: type: array items: $ref: '#/components/schemas/UnappliedBudgetTransferDto' ProjectDto: required: - projectId - reference - key - name - projectType - addressId - borrowerId - allowPaymentToBorrower - allowAutoApprove - isMasterBuild - adviserId - gstFilingFrequency type: object properties: projectId: type: integer format: int32 reference: type: string key: type: string format: uuid name: type: string projectType: $ref: '#/components/schemas/ProjectType' addressId: type: integer format: int32 borrowerId: type: integer format: int32 allowPaymentToBorrower: type: boolean allowAutoApprove: type: boolean isMasterBuild: type: boolean adviserId: type: integer format: int32 lastTouchedAtNzt: type: - 'null' - string format: date-time lastTouchedByUserId: type: - 'null' - integer format: int32 gstFilingFrequency: oneOf: - type: 'null' - $ref: '#/components/schemas/GstFilingFrequency' archivedAtNzt: type: - 'null' - string format: date-time archivedByUserId: type: - 'null' - integer format: int32 ProjectGstFloatDto: required: - unrecovered - overdue type: object properties: unrecovered: $ref: '#/components/schemas/CashValue' overdue: $ref: '#/components/schemas/CashValue' oldestAdvanceAtNzt: type: - 'null' - string format: date-time ProjectLoanFundingDto: required: - loanId - loanReference - facilityType - interestRate - principalLimit - available - maturityDate - interestCapitalisationAllocation - lineFeeCapitalisationAllocation type: object properties: loanId: type: integer format: int32 loanReference: type: string facilityType: $ref: '#/components/schemas/FacilityType' interestRate: $ref: '#/components/schemas/InterestRate' principalLimit: $ref: '#/components/schemas/CashValue' available: $ref: '#/components/schemas/CashValue' maturityDate: type: string format: date interestCapitalisationAllocation: oneOf: - type: 'null' - $ref: '#/components/schemas/CashValue' lineFeeCapitalisationAllocation: oneOf: - type: 'null' - $ref: '#/components/schemas/CashValue' ProjectQueueItemDto: required: - projectId - borrowerId - reference - key - name - projectType - borrowerName - adviserName - createdAtNzt type: object properties: projectId: type: integer format: int32 borrowerId: type: integer format: int32 reference: type: string key: type: string format: uuid name: type: string projectType: $ref: '#/components/schemas/ProjectType' borrowerName: type: string adviserName: type: string createdAtNzt: type: string format: date-time archivedAtNzt: type: - 'null' - string format: date-time balance: $ref: '#/components/schemas/CashValue' ProjectSecurityDto: required: - loanSecurityId - loanId - securityRanking - address - includeInDisplay type: object properties: loanSecurityId: type: integer format: int32 loanId: type: integer format: int32 securityRanking: oneOf: - type: 'null' - $ref: '#/components/schemas/SecurityRanking' address: $ref: '#/components/schemas/AddressDto' includeInDisplay: type: boolean dischargedAtNzt: type: - 'null' - string format: date-time ProjectTimelineAction: enum: - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 type: integer x-enum-varnames: - Created - LoanConditionReviewRequested - LoanConditionApproved - MilestoneCreated - MilestoneApproved - ProgressPaymentRequested - ProgressPaymentApproved - ProgressPaymentReferred - ProgressPaymentPaid - LoanCreated - MilestoneRemoved - MilestoneLimitChanged - ProgressPaymentAmountChanged - ProgressPaymentTargetDateChanged - DrawdownRejected - ProjectArchived - ProjectToppedUp - LoanStatusChanged - LoanSecurityDischarged - ConstructionBudgetChanged - AdviserChanged - LoanEnteredArrears - LoanClearedArrears - GstAdjustment x-enum-order: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 ProjectTimelineActionSource: enum: - 1 - 2 - 3 type: integer x-enum-varnames: - System - StaffMember - App x-enum-order: - 0 - 1 - 2 ProjectTimelineEntryDto: required: - projectTimelineRowId - occurredAtNzt - action - source - referredTo - previousAmount - newAmount - milestones type: object properties: projectTimelineRowId: type: integer format: int32 occurredAtNzt: type: string format: date-time action: $ref: '#/components/schemas/ProjectTimelineAction' source: $ref: '#/components/schemas/ProjectTimelineActionSource' actionByUserName: type: - 'null' - string description: type: - 'null' - string progressPaymentRequestId: type: - 'null' - integer format: int32 progressPaymentId: type: - 'null' - integer format: int32 loanId: type: - 'null' - integer format: int32 loanConditionId: type: - 'null' - integer format: int32 referredTo: oneOf: - type: 'null' - $ref: '#/components/schemas/ReferralTarget' previousAmount: oneOf: - type: 'null' - $ref: '#/components/schemas/CashValue' newAmount: oneOf: - type: 'null' - $ref: '#/components/schemas/CashValue' previousDate: type: - 'null' - string format: date newDate: type: - 'null' - string format: date milestones: type: array items: $ref: '#/components/schemas/ProjectTimelineMilestoneDto' noNoteSupplied: type: boolean ProjectTimelineMilestoneDto: required: - milestoneId - milestoneType type: object properties: milestoneId: type: integer format: int32 milestoneType: $ref: '#/components/schemas/MilestoneType' ProjectType: enum: - 1 - 2 type: integer x-enum-varnames: - Milestone - CostToComplete x-enum-order: - 0 - 1 ProposedBudgetTransferDto: required: - budgetTransferId - borrowerId - projectId - projectReference - projectName - amount - fromLoanReference - toLoanReference - recoveredInRequestId - proposedAtNzt - reason type: object properties: budgetTransferId: type: integer format: int32 borrowerId: type: integer format: int32 projectId: type: integer format: int32 projectReference: type: string projectName: type: string amount: $ref: '#/components/schemas/CashValue' fromLoanReference: type: string toLoanReference: type: string recoveredInRequestId: type: integer format: int32 proposedAtNzt: type: string format: date-time reason: type: string QueueSummaryOfApprovedQueueItemDto: required: - totalAmount - items - totalRecordCount type: object properties: totalAmount: $ref: '#/components/schemas/CashValue' items: type: array items: $ref: '#/components/schemas/ApprovedQueueItemDto' totalRecordCount: type: integer format: int32 QueueSummaryOfManualReviewQueueItemDto: required: - totalAmount - items - totalRecordCount type: object properties: totalAmount: $ref: '#/components/schemas/CashValue' items: type: array items: $ref: '#/components/schemas/ManualReviewQueueItemDto' totalRecordCount: type: integer format: int32 QueueSummaryOfPaidQueueItemDto: required: - totalAmount - items - totalRecordCount type: object properties: totalAmount: $ref: '#/components/schemas/CashValue' items: type: array items: $ref: '#/components/schemas/PaidQueueItemDto' totalRecordCount: type: integer format: int32 ReferProgressPaymentRequest: type: object properties: note: type: - 'null' - string ReferralTarget: enum: - 1 - 2 - 3 type: integer x-enum-varnames: - Adviser - Credit - Operations x-enum-order: - 0 - 1 - 2 RenameBankAccount: type: object properties: displayName: type: - 'null' - string RenameDocument: required: - name type: object properties: name: type: string RepaymentFrequency: enum: - 1 - 2 - 3 - 4 - 5 type: integer x-enum-varnames: - Weekly - Fortnightly - Monthly - Quarterly - Yearly x-enum-order: - 0 - 1 - 2 - 3 - 4 ReplaceDocument: required: - newDocumentId type: object properties: newDocumentId: type: integer format: int32 SecurityRanking: enum: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 type: integer x-enum-varnames: - None - RegisteredFirstRankingExclusive - FirstRankingExclusive - RegisteredFirstRankingSecurity - FirstRankingSecurity - SubordinatedFirstRankingSecurity - RegisteredSecondRankingSecurity - SecondRankingSecurity - SubordinatedSecondRankingSecurity - RegisteredCaveat - Caveat x-enum-order: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 StaffMemberDto: required: - userId - name - roles - isActive type: object properties: userId: type: integer format: int32 name: type: string roles: type: array items: $ref: '#/components/schemas/StaffMemberRole' isActive: type: boolean StaffMemberRole: enum: - 1 - 2 - 3 - 4 type: integer x-enum-varnames: - Adviser - Operations - Credit - Audit x-enum-order: - 0 - 1 - 2 - 3 StandardAddress: required: - streetNumber - streetName - city - postCode - suburb - country type: object properties: buildingName: type: - 'null' - string level: type: - 'null' - string unitNumber: type: - 'null' - string streetNumber: type: string streetName: type: string streetType: type: - 'null' - string streetSuffix: type: - 'null' - string city: type: string postCode: type: string suburb: type: string country: $ref: '#/components/schemas/CountryCode' SubmitAdvancePayment: required: - base - amount - milestoneId type: object properties: base: $ref: '#/components/schemas/SubmitPaymentRequestBase' amount: $ref: '#/components/schemas/CashValue' milestoneId: type: integer format: int32 reason: type: - 'null' - string documentIds: type: - 'null' - array items: type: integer format: int32 SubmitContingencyPayment: required: - base - amount - hasInsufficientFunds type: object properties: base: $ref: '#/components/schemas/SubmitPaymentRequestBase' amount: $ref: '#/components/schemas/CashValue' hasInsufficientFunds: type: boolean reason: type: - 'null' - string insufficientFundsDetails: type: - 'null' - string documentIds: type: - 'null' - array items: type: integer format: int32 SubmitCostToCompletePayment: required: - base - amount type: object properties: base: $ref: '#/components/schemas/SubmitPaymentRequestBase' amount: $ref: '#/components/schemas/CashValue' documentIds: type: - 'null' - array items: type: integer format: int32 SubmitMilestonePayment: required: - base - milestones type: object properties: base: $ref: '#/components/schemas/SubmitPaymentRequestBase' milestones: type: array items: $ref: '#/components/schemas/MilestoneDrawRequest' SubmitPaymentRequestBase: required: - gstRequested - bankAccountId type: object properties: targetPaymentDate: type: - 'null' - string format: date gstRequested: type: boolean transactionReference: type: - 'null' - string bankAccountId: type: integer format: int32 requestNotes: type: - 'null' - string conditionsPrecedentAccepted: type: boolean default: false SubmitProgressPaymentRequest: type: object properties: milestone: oneOf: - type: 'null' - $ref: '#/components/schemas/SubmitMilestonePayment' advance: oneOf: - type: 'null' - $ref: '#/components/schemas/SubmitAdvancePayment' contingency: oneOf: - type: 'null' - $ref: '#/components/schemas/SubmitContingencyPayment' supplementaryCost: oneOf: - type: 'null' - $ref: '#/components/schemas/SubmitSupplementaryCostPayment' costToComplete: oneOf: - type: 'null' - $ref: '#/components/schemas/SubmitCostToCompletePayment' SubmitSupplementaryCostPayment: required: - base - costDraws type: object properties: base: $ref: '#/components/schemas/SubmitPaymentRequestBase' costDraws: type: array items: $ref: '#/components/schemas/SupplementaryCostDrawRequest' SupplementaryCostAmountChange: required: - supplementaryCostId - newAmount type: object properties: supplementaryCostId: type: integer format: int32 newAmount: $ref: '#/components/schemas/CashValue' SupplementaryCostDetailDto: required: - cost - payments type: object properties: cost: $ref: '#/components/schemas/SupplementaryCostDto' payments: type: array items: $ref: '#/components/schemas/SupplementaryCostPaymentDto' SupplementaryCostDrawDetailDto: required: - amount - originalRequestedAmount - cost type: object properties: amount: $ref: '#/components/schemas/CashValue' notes: type: - 'null' - string originalRequestedAmount: oneOf: - type: 'null' - $ref: '#/components/schemas/CashValue' cost: $ref: '#/components/schemas/SupplementaryCostDto' SupplementaryCostDrawRequest: required: - supplementaryCostId - amount type: object properties: supplementaryCostId: type: integer format: int32 amount: oneOf: - type: 'null' - $ref: '#/components/schemas/CashValue' documentIds: type: - 'null' - array items: type: integer format: int32 notes: type: - 'null' - string SupplementaryCostDto: required: - supplementaryCostId - loanId - type - funds - hasOutstandingRequest type: object properties: supplementaryCostId: type: integer format: int32 loanId: type: integer format: int32 type: type: string funds: $ref: '#/components/schemas/AvailableFunds' hasOutstandingRequest: type: boolean fullyPaidAtNzt: type: - 'null' - string format: date-time SupplementaryCostPaymentDto: required: - paidDate - amount - allocations - evidence type: object properties: paidDate: type: string format: date-time amount: $ref: '#/components/schemas/CashValue' allocations: type: array items: $ref: '#/components/schemas/PaymentAllocationDto' evidence: type: array items: $ref: '#/components/schemas/PaymentEvidenceDto' SupplementaryCostRequestDetail: required: - costDraws type: object properties: costDraws: type: array items: $ref: '#/components/schemas/SupplementaryCostDrawDetailDto' TargetPaymentDateType: enum: - 1 - 2 type: integer x-enum-varnames: - OnApproval - OnTargetDate x-enum-order: - 0 - 1 TopupLoanRequest: required: - loanReference type: object properties: loanReference: type: string TransactionType: enum: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 16 - 19 - 20 - 21 - 26 - 27 - 35 - 36 - 37 - 38 - 39 - 40 - 42 - 43 type: integer x-enum-varnames: - Unclassified - Drawdown - Repayment - Interest - EstablishmentFee - DefaultFee - DefaultInterest - ManualLoanTransaction - DischargeFee - DirectDebitDishonorFee - DirectDebitDishonor - Refund - EarlyRepayment - DebtCollectionFees - EstablishmentFeeReversal - DishonourFeeReversal - DefaultInterestReversal - DefaultFeeReversal - Rounding - DrawdownFee - LineFee x-enum-order: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 UnappliedBudgetTransferDto: required: - budgetTransferId - borrowerId - projectId - projectReference - projectName - amount - fromLoanReference - toLoanReference - recoveredInRequestId - proposedAtNzt - reason - approvedBy type: object properties: budgetTransferId: type: integer format: int32 borrowerId: type: integer format: int32 projectId: type: integer format: int32 projectReference: type: string projectName: type: string amount: $ref: '#/components/schemas/CashValue' fromLoanReference: type: string toLoanReference: type: string recoveredInRequestId: type: integer format: int32 proposedAtNzt: type: string format: date-time reason: type: string approvedAtNzt: type: - 'null' - string format: date-time approvedBy: oneOf: - type: 'null' - $ref: '#/components/schemas/ChangeSource' approvedByStaffMemberName: type: - 'null' - string UnverifiedBankAccountDto: required: - bankAccountId - projectId - borrowerId - borrowerName - accountNumber - bank - accountName - loadedAtNzt type: object properties: bankAccountId: type: integer format: int32 projectId: type: integer format: int32 borrowerId: type: integer format: int32 borrowerName: type: string accountNumber: type: string bank: $ref: '#/components/schemas/Bank' accountName: type: string loadedAtNzt: type: string format: date-time loadedByUserId: type: - 'null' - integer format: int32 loadedByUserName: type: - 'null' - string UpdateAddress: type: object properties: standardAddress: oneOf: - type: 'null' - $ref: '#/components/schemas/StandardAddress' nonStandardAddress: oneOf: - type: 'null' - $ref: '#/components/schemas/NonStandardAddress' location: oneOf: - type: 'null' - $ref: '#/components/schemas/GpsLocation' UpdateAppUser: required: - name - email type: object properties: name: type: string email: type: string preferredName: type: - 'null' - string UpdateBankAccount: required: - bank - accountNumber - accountName type: object properties: bank: $ref: '#/components/schemas/Bank' accountNumber: type: string accountName: type: string isCustomerBankAccount: type: boolean default: true UpdateBorrower: required: - name type: object properties: name: type: string UpdateBorrowerAppUser: required: - appUser - roles type: object properties: appUser: $ref: '#/components/schemas/UpdateAppUser' roles: type: array items: $ref: '#/components/schemas/AppUserRole' Updated: required: - id type: object properties: id: type: integer format: int32 UpdateDraftProgressPaymentRequest: type: object properties: milestone: oneOf: - type: 'null' - $ref: '#/components/schemas/DraftMilestoneRequest' advance: oneOf: - type: 'null' - $ref: '#/components/schemas/DraftAdvanceRequest' contingency: oneOf: - type: 'null' - $ref: '#/components/schemas/DraftContingencyRequest' supplementaryCost: oneOf: - type: 'null' - $ref: '#/components/schemas/DraftSupplementaryCostRequest' costToComplete: oneOf: - type: 'null' - $ref: '#/components/schemas/DraftCostToCompleteRequest' UpdateMilestone: required: - limit type: object properties: limit: $ref: '#/components/schemas/CashValue' UpdatePaymentSplit: required: - amount - bankAccountId type: object properties: amount: $ref: '#/components/schemas/CashValue' code: type: - 'null' - string particulars: type: - 'null' - string bankAccountId: type: integer format: int32 UpdateProject: required: - reference - key - name - projectType - addressId - allowPaymentToBorrower - allowAutoApprove - isMasterBuild - adviserId type: object properties: reference: type: string key: type: string format: uuid name: type: string projectType: $ref: '#/components/schemas/ProjectType' addressId: type: integer format: int32 allowPaymentToBorrower: type: boolean allowAutoApprove: type: boolean isMasterBuild: type: boolean adviserId: type: integer format: int32 gstFilingFrequency: oneOf: - type: 'null' - $ref: '#/components/schemas/GstFilingFrequency' UpdateProjectUserFields: required: - name type: object properties: name: type: string gstFilingFrequency: oneOf: - type: 'null' - $ref: '#/components/schemas/GstFilingFrequency' UpdateStaffMember: required: - name - roles type: object properties: name: type: string roles: type: array items: $ref: '#/components/schemas/StaffMemberRole' securitySchemes: smUserToken: type: http description: Squirrel Money User Token scheme: Token bearerFormat: Base64 entraBearer: type: http description: Squirrel AAD scheme: Bearer bearerFormat: JWT tags: - name: Squirrel.Projects.Api - name: DemoData - name: Address description: Manage addresses for borrowers and projects - name: BankAccount description: Manage bank accounts for borrowers - name: BorrowerAppUser - name: Borrower description: Manage borrower information - name: BudgetTransfers - name: Condition - name: Document description: Document management for projects and progress payments - name: DraftProgressPayment description: Create and manage draft progress payment requests - name: DraftProgressPaymentDocuments description: Manage documents attached to draft progress payments - name: InvitationAccept - name: Invitation - name: Loan description: Manage loans associated with projects - name: ManualReview - name: Me - name: Milestone description: Manage project milestones and their completion status - name: MilestoneType - name: Notifications - name: PaymentSplit - name: ProgressPaymentEntity - name: ProgressPaymentRequestChange - name: ProgressPaymentRequest description: Submit and manage progress payment requests - name: ProgressPaymentRequestDocuments - name: Project description: Manage construction projects - name: ProjectTimeline - name: Queues - name: Search - name: StaffMember description: Staff member management - name: AppUser description: Application user management x-policies: AuthenticatedUser: description: Default policy - requires authenticated user (Staff or AppUser) access: - Staff - AppUser BelongsToBorrower: description: 'User''s borrower claim must match the {borrowerId} route parameter' access: - Staff - AppUser BelongsToProject: description: User must have access to the project in the route access: - Staff - AppUser StaffOnly: description: Must be authenticated as a staff member access: - Staff MoneyClient: description: Service-to-service authentication for Squirrel Money integration access: - Squirrel Money Service MmsClient: description: Service-to-service authentication for MMS integration access: - MMS Service StaffOrMmsClient: description: 'Authenticated as a staff member, or the MMS service principal' access: - Staff - MMS Service StaffAdministration: description: Staff member with Operations role access: - Staff (Operations) AppUserAdministration: description: Staff with Operations role OR AppUser with Administration role access: - Staff (Operations) - AppUser (Administration) BorrowerAdministration: description: Staff member with Operations role access: - Staff (Operations) ProjectAdministration: description: Staff member with Operations role access: - Staff (Operations) RequestProgressPayment: description: Project route match AND (Staff with Operations OR AppUser with CreateProgressPaymentRequest) access: - Staff (Operations) - AppUser (CreateProgressPaymentRequest) UpdateExistingAddress: description: Staff member with Operations role access: - Staff (Operations) VerifyBankAccount: description: Staff member with Operations role access: - Staff (Operations) ManuallyApproveDocument: description: Staff member with Operations role access: - Staff (Operations) ManageMilestones: description: Staff member with Operations role access: - Staff (Operations) ManageBankAccounts: description: Staff with Operations role OR AppUser with Administration role access: - Staff (Operations) - AppUser (Administration) ManageProgressPayments: description: Staff with Operations or Credit role access: - Staff (Operations) - Staff (Credit) ApproveProgressPayment: description: Staff member with Credit role access: - Staff (Credit)