From 30bfb1a7737622b0e1e46f21fa7297f56149abfa Mon Sep 17 00:00:00 2001 From: nala Date: Sun, 29 Nov 2026 16:03:11 +0200 Subject: [PATCH] commit compras3 2911 --- .../Commands/PrepareStandaloneRuntime.php | 4 +- .../CommonFinanceAdministrationController.php | 48 + .../Controllers/GeneralLedgerController.php | 13 +- .../OrganizationConfigurationController.php | 2 + .../SupplierPaymentsController.php | 14 +- app/Http/Middleware/HandleInertiaRequests.php | 22 + app/Providers/AppServiceProvider.php | 20 +- app/Services/CommonFinanceAdministration.php | 145 + app/Services/EquipmentWorkflow.php | 2 +- app/Services/ExternalPaymentWorkflow.php | 2 +- app/Services/GeneralLedger.php | 7 + app/Services/InvoiceWorkflow.php | 2 +- app/Services/OrderPartsWorkflow.php | 2 +- app/Services/PurchaseRevisionWorkflow.php | 2 +- app/Services/PurchaseWorkflow.php | 2 +- app/Services/ReceiptWorkflow.php | 2 +- app/Services/StandaloneComponentSchema.php | 71 + app/Services/StandaloneExtensionSchema.php | 32 +- app/Services/StandaloneInstallation.php | 23 +- app/Services/StandaloneRuntime.php | 42 +- app/Services/StandaloneSchema.php | 5 +- app/Services/StockWorkflow.php | 13 +- app/Services/SupplierPayables.php | 19 + config/standalone-runtime.php | 3 + docs/desenvolvimento.md | 24 + docs/matriz-sgc-reconciliada.md | 12 + docs/orientacoes-continuidade.md | 12 + .../proofs/compras-operational-candidate.json | 329 +- ...dalone-pilot-activation-authorization.json | 11 + ...standalone-pilot-activation-preflight.json | 11 + ...-standalone-pilot-activation-proposal.json | 291 + .../compras-standalone-pilot-activation.json | 22 + ...lone-pilot-installation-authorization.json | 12 + ...s-standalone-pilot-installation-check.json | 15 + ...tandalone-pilot-installation-proposal.json | 43 + ...compras-standalone-pilot-installation.json | 45 + ...andalone-pilot-recovery-authorization.json | 10 + ...as-standalone-pilot-recovery-proposal.json | 56 + .../compras-standalone-pilot-recovery.json | 29 + docs/proofs/issued-order-cancellation.json | 38 + docs/proofs/product-review-20261122.json | 55 +- .../standalone-pilot-schema-inventory.json | 6767 +++++++++++++++++ .../js/components/sgc-workspace-shell.tsx | 6 + resources/js/lib/journey-help.ts | 19 + resources/js/lib/procurement-navigation.ts | 38 + resources/js/pages/company/finance.tsx | 871 +++ resources/js/pages/company/parameters.tsx | 13 + resources/js/pages/invoices/index.tsx | 2 +- resources/js/pages/purchases/show.tsx | 12 +- resources/js/types/purchase.ts | 1 + resources/views/purchases/print.blade.php | 2 +- routes/web.php | 5 +- scripts/activate-standalone-pilot.php | 169 + scripts/check-standalone-pilot-activation.php | 62 + .../check-standalone-pilot-installation.php | 70 + scripts/check-standalone-pilot-profiles.php | 103 + scripts/check-standalone-private-recovery.php | 215 + scripts/inspect-standalone-pilot-schema.php | 53 + scripts/requisition-ledger-qa-check.mjs | 68 +- scripts/standalone-configuration-race.mjs | 50 + scripts/standalone-finance-preview.mjs | 69 + .../StandaloneBusinessCompositionTest.php | 222 +- .../StandaloneComponentUpgradeTest.php | 138 + tests/Support/StandaloneConfigurationRace.php | 86 + tests/Support/financial-preparation.test.mjs | 113 + .../standalone-pilot-recovery-worker.php | 114 + tests/Support/standalone-qa-http-router.php | 33 + tests/Support/standalone-runtime-worker.php | 79 +- tests/Unit/StandaloneRuntimeTest.php | 8 + tests/frontend/company-finance.test.tsx | 129 + .../purchase-document-compatibility.test.tsx | 53 + tools/phpstan/optional-packages.stub | 14 + 72 files changed, 10998 insertions(+), 98 deletions(-) create mode 100644 app/Http/Controllers/CommonFinanceAdministrationController.php create mode 100644 app/Services/CommonFinanceAdministration.php create mode 100644 app/Services/StandaloneComponentSchema.php create mode 100644 docs/proofs/compras-standalone-pilot-activation-authorization.json create mode 100644 docs/proofs/compras-standalone-pilot-activation-preflight.json create mode 100644 docs/proofs/compras-standalone-pilot-activation-proposal.json create mode 100644 docs/proofs/compras-standalone-pilot-activation.json create mode 100644 docs/proofs/compras-standalone-pilot-installation-authorization.json create mode 100644 docs/proofs/compras-standalone-pilot-installation-check.json create mode 100644 docs/proofs/compras-standalone-pilot-installation-proposal.json create mode 100644 docs/proofs/compras-standalone-pilot-installation.json create mode 100644 docs/proofs/compras-standalone-pilot-recovery-authorization.json create mode 100644 docs/proofs/compras-standalone-pilot-recovery-proposal.json create mode 100644 docs/proofs/compras-standalone-pilot-recovery.json create mode 100644 docs/proofs/standalone-pilot-schema-inventory.json create mode 100644 resources/js/pages/company/finance.tsx create mode 100644 scripts/activate-standalone-pilot.php create mode 100644 scripts/check-standalone-pilot-activation.php create mode 100644 scripts/check-standalone-pilot-installation.php create mode 100644 scripts/check-standalone-pilot-profiles.php create mode 100644 scripts/check-standalone-private-recovery.php create mode 100644 scripts/inspect-standalone-pilot-schema.php create mode 100644 scripts/standalone-configuration-race.mjs create mode 100644 scripts/standalone-finance-preview.mjs create mode 100644 tests/Feature/StandaloneComponentUpgradeTest.php create mode 100644 tests/Support/StandaloneConfigurationRace.php create mode 100644 tests/Support/financial-preparation.test.mjs create mode 100644 tests/Support/standalone-pilot-recovery-worker.php create mode 100644 tests/Support/standalone-qa-http-router.php create mode 100644 tests/frontend/company-finance.test.tsx diff --git a/app/Console/Commands/PrepareStandaloneRuntime.php b/app/Console/Commands/PrepareStandaloneRuntime.php index 92cf4a9..19797ab 100644 --- a/app/Console/Commands/PrepareStandaloneRuntime.php +++ b/app/Console/Commands/PrepareStandaloneRuntime.php @@ -13,6 +13,7 @@ final class PrepareStandaloneRuntime extends Command {--operator= : Named deployment operator} {--reason= : Recorded installation or recovery reason} {--apply : Apply the explicitly selected installation} + {--reuse-components : Reuse only complete recognised canonical V1 components; reject partial or changed schemas} {--rebind : Preserve restored schema and register a new installation binding}'; protected $description = 'Preparar explicitamente a composição independente; pré-visualizar por defeito'; @@ -20,7 +21,8 @@ final class PrepareStandaloneRuntime extends Command public function handle(StandaloneInstallation $installation): int { $result = $installation->prepare((string) $this->option('expected-database'), (string) $this->option('expected-role'), - (string) $this->option('operator'), (string) $this->option('reason'), $this->option('apply') === true, $this->option('rebind') === true); + (string) $this->option('operator'), (string) $this->option('reason'), $this->option('apply') === true, $this->option('rebind') === true, + $this->option('reuse-components') === true); $this->line(json_encode($result, JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR)); return self::SUCCESS; diff --git a/app/Http/Controllers/CommonFinanceAdministrationController.php b/app/Http/Controllers/CommonFinanceAdministrationController.php new file mode 100644 index 0000000..e598849 --- /dev/null +++ b/app/Http/Controllers/CommonFinanceAdministrationController.php @@ -0,0 +1,48 @@ +user('web'); + abort_unless($actor instanceof User, 403); + $data = $request->validate(['user' => 'nullable|integer|min:1', 'q' => 'nullable|string|max:100', + 'users_page' => 'nullable|integer|min:1|max:1000000', 'history_page' => 'nullable|integer|min:1|max:1000000']); + Inertia::encryptHistory(); + $response = Inertia::render('company/finance', $service->workspace($actor, isset($data['user']) ? (int) $data['user'] : null, $data['q'] ?? ''))->toResponse($request); + $response->headers->set('Cache-Control', 'private, no-store, max-age=0'); + + return $response; + } + + public function store(Request $request, string $kind, CommonFinanceAdministration $service): RedirectResponse + { + $actor = $request->user('web'); + abort_unless($actor instanceof User, 403); + try { + $service->save($actor, $kind, $request->all()); + } catch (\DomainException $error) { + if ($request->header('X-Inertia')) { + throw ValidationException::withMessages(['configuration' => $error->getMessage()]); + } + abort(409, $error->getMessage()); + } catch (\InvalidArgumentException $error) { + if ($request->header('X-Inertia')) { + throw ValidationException::withMessages(['configuration' => $error->getMessage()]); + } + abort(422, $error->getMessage()); + } + + return back()->with('success', 'Configuração financeira registada com histórico.'); + } +} diff --git a/app/Http/Controllers/GeneralLedgerController.php b/app/Http/Controllers/GeneralLedgerController.php index d19f5df..509a23a 100644 --- a/app/Http/Controllers/GeneralLedgerController.php +++ b/app/Http/Controllers/GeneralLedgerController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers; use App\Models\User; use App\Services\GeneralLedger; +use App\Services\StandaloneRuntime; use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use Illuminate\Http\Response; @@ -12,6 +13,14 @@ use Tempo\Finance\GeneralLedger\ReportsWorkspace; final class GeneralLedgerController extends Controller { + /** @return array */ + private function presentation(): array + { + return app(StandaloneRuntime::class)->enabled() ? ['host_journal_policy' => true, + 'synthetic_only' => app(StandaloneRuntime::class)->syntheticOnly(), + 'reports_from' => today()->startOfYear()->toDateString(), 'reports_to' => today()->toDateString()] : []; + } + public function report(Request $r, string $kind, GeneralLedger $ledger): Response|JsonResponse { $d = $r->validate(['from_on' => 'required|date_format:Y-m-d', 'to_on' => 'required|date_format:Y-m-d|after_or_equal:from_on', 'account_id' => 'sometimes|required|integer|min:1', 'page' => 'sometimes|integer|min:1|max:100000', 'per_page' => 'sometimes|integer|in:25,100']); @@ -27,7 +36,7 @@ final class GeneralLedgerController extends Controller return response()->json($data)->header('Cache-Control', 'no-store'); } - return response(ReportsWorkspace::render($data, ['host' => 'SGC autónomo', 'return_url' => '/general-ledger/cycle']))->header('Cache-Control', 'no-store'); + return response(ReportsWorkspace::render($data, ['host' => 'SGC autónomo', 'return_url' => '/general-ledger/cycle'] + $this->presentation()))->header('Cache-Control', 'no-store'); } private function actor(Request $r): User @@ -44,7 +53,7 @@ final class GeneralLedgerController extends Controller abort_if(array_diff(array_keys($r->query()), ['page']) !== [], 422); $data = $ledger->workspace($this->actor($r), (int) ($d['page'] ?? 1)); - return response(CycleWorkspace::render($data, ['host' => 'SGC autónomo', 'csrf' => csrf_token(), 'financial_url' => '/supplier-payments', 'return_url' => '/obrigacoes-fornecedores', 'page_url' => '/general-ledger/cycle']))->header('Cache-Control', 'no-store'); + return response(CycleWorkspace::render($data, ['host' => 'SGC autónomo', 'csrf' => csrf_token(), 'financial_url' => '/supplier-payments', 'return_url' => '/obrigacoes-fornecedores', 'page_url' => '/general-ledger/cycle'] + $this->presentation()))->header('Cache-Control', 'no-store'); } public function command(Request $r, string $action, GeneralLedger $ledger): JsonResponse diff --git a/app/Http/Controllers/OrganizationConfigurationController.php b/app/Http/Controllers/OrganizationConfigurationController.php index f46a551..8f12a8d 100644 --- a/app/Http/Controllers/OrganizationConfigurationController.php +++ b/app/Http/Controllers/OrganizationConfigurationController.php @@ -6,6 +6,7 @@ use App\Models\Tenant; use App\Models\User; use App\Services\AdministrativeGeography; use App\Services\AiPreparationPlan; +use App\Services\CommonFinanceAdministration; use App\Services\CompanyDetails; use App\Services\ComparisonPolicy; use App\Services\IntelligencePolicy; @@ -49,6 +50,7 @@ class OrganizationConfigurationController extends Controller 'companyDetailsReady' => Schema::hasColumn('tenants', 'company_details'), 'approvalLevelsReady' => app(RequisitionApprovalLevels::class)->ready(), 'expiryReady' => app(RequisitionExpiry::class)->ready(), + 'financeConfigurationReady' => app(CommonFinanceAdministration::class)->ready(), 'urgentReviewsReady' => app(UrgentRequisitionReviews::class)->ready(), 'requisitionCategoryOptions' => app(RequisitionCategories::class)->available() ? RequisitionCategories::LABELS : [], 'approvalLevels' => Tenant::query()->findOrFail($actor->tenant_id)->requisition_approval_policy, diff --git a/app/Http/Controllers/SupplierPaymentsController.php b/app/Http/Controllers/SupplierPaymentsController.php index 57afb5b..ca3539f 100644 --- a/app/Http/Controllers/SupplierPaymentsController.php +++ b/app/Http/Controllers/SupplierPaymentsController.php @@ -11,6 +11,7 @@ use App\Services\SupplierPayables; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use Tempo\Finance\Payables\SettlementHttp; +use Tempo\Finance\Payables\SupplierSettlements; final class SupplierPaymentsController extends SettlementHttp { @@ -18,6 +19,14 @@ final class SupplierPaymentsController extends SettlementHttp protected const SERVICE = SupplierPayables::class; + protected function settlementEngine(Request $request): SupplierSettlements + { + $user = $request->user(); + abort_unless($user instanceof User, 403); + + return app(SupplierPayables::class)->settlements($user); + } + protected function guard(): void { if (! app(StandaloneRuntime::class)->enabled()) { @@ -34,7 +43,10 @@ final class SupplierPaymentsController extends SettlementHttp { $user = $request->user(); abort_unless($user instanceof User, 403); - $settings = []; + $settings = app(StandaloneRuntime::class)->enabled() ? [ + 'host_settlement_policy' => true, 'synthetic_only' => app(StandaloneRuntime::class)->syntheticOnly(), + 'return_url' => '/dashboard', + ] : []; if (app(StandaloneRuntime::class)->enabled() && app(ExpenseAllocations::class)->ready() && $user->hasFunctions(['admin', 'finance'])) { $settings['expense_allocation_base_url'] = '/afectacoes-fornecedores/'; } diff --git a/app/Http/Middleware/HandleInertiaRequests.php b/app/Http/Middleware/HandleInertiaRequests.php index 7c1efcc..e0a5fbd 100644 --- a/app/Http/Middleware/HandleInertiaRequests.php +++ b/app/Http/Middleware/HandleInertiaRequests.php @@ -4,12 +4,16 @@ namespace App\Http\Middleware; use App\Models\User; use App\Services\CapitalRegister; +use App\Services\CommonFinanceAdministration; +use App\Services\GeneralLedger; use App\Services\OperationalOrders; use App\Services\OrganizationAccess; use App\Services\PrivateAuditAccess; +use App\Services\StandaloneRuntime; use App\Services\SupplierPayables; use App\Services\WorkContext; use Illuminate\Http\Request; +use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; use Inertia\Middleware; @@ -66,6 +70,7 @@ class HandleInertiaRequests extends Middleware 'profileLabel' => app(OrganizationAccess::class)->profileLabel($actor), ], 'payablesAvailable' => $actor !== null && app(SupplierPayables::class)->can($actor, 'view'), + 'commonFinanceNavigation' => $this->financeNavigation($actor), 'orderCancellationAvailable' => $actor !== null && (bool) config('order_cancellation.enabled') && Schema::hasTable('order_cancellations'), 'operationalOrdersAvailable' => $actor !== null && app(OperationalOrders::class)->ready(), 'privateAuditAvailable' => $actor !== null && app(PrivateAuditAccess::class)->ready(), @@ -73,4 +78,21 @@ class HandleInertiaRequests extends Middleware 'sidebarOpen' => ! $request->hasCookie('sidebar_state') || $request->cookie('sidebar_state') === 'true', ]; } + + /** @return array{payments:bool,ledger:bool,configuration:bool} */ + private function financeNavigation(?User $actor): array + { + $hidden = ['payments' => false, 'ledger' => false, 'configuration' => false]; + if ($actor === null || ! app(StandaloneRuntime::class)->enabled() + || ! $actor->hasFunctions(['admin', 'finance']) || app(OrganizationAccess::class)->maintenanceOnly($actor)) { + return $hidden; + } + + return [ + 'payments' => app(StandaloneRuntime::class)->feature('supplier-settlements', DB::connection()) + && app(SupplierPayables::class)->can($actor, 'view') && app(SupplierPayables::class)->can($actor, 'payments_view'), + 'ledger' => app(GeneralLedger::class)->cycleEnabled() && app(GeneralLedger::class)->can($actor, 'view'), + 'configuration' => $actor->hasFunctions(['admin']) && app(CommonFinanceAdministration::class)->ready(), + ]; + } } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 613095b..4808d9a 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -27,13 +27,25 @@ class AppServiceProvider extends ServiceProvider $this->app->scoped(AdministrativeGeography::class); $this->app->scoped(StandaloneRuntime::class, fn () => new StandaloneRuntime(config('standalone-runtime'), new StandaloneArtifact)); $runtime = $this->app->make(StandaloneRuntime::class); + $loader = $runtime; $paths = null; - if ($runtime->enabled()) { + $preparing = config('standalone-runtime.prepare_only') === true; + if ($preparing && (! $this->app->runningInConsole() || $runtime->enabled())) { + throw new \LogicException('COMPRAS_RUNTIME_PREPARATION_CONSOLE_ONLY'); + } + if ($runtime->enabled() || $preparing) { if (config('common-finance-bundle.root') !== null || config('budget-distributions.enabled') === true) { throw new \LogicException('COMPRAS_RUNTIME_MIXED_COMPOSITION'); } - $paths = $runtime->configure(DB::connection()); - $runtime->assertLoadedPackages(allowMissing: true); + if ($preparing) { + $settings = config('standalone-runtime'); + $settings['enabled'] = true; + $loader = new StandaloneRuntime($settings, new StandaloneArtifact); + $paths = $loader->artifact()['paths']; + } else { + $paths = $runtime->configure(DB::connection()); + } + $loader->assertLoadedPackages(allowMissing: true); config(['common-budget.path' => $paths['budget-control'], 'common-payables.path' => $paths['payables'], 'general-ledger.path' => $paths['general-ledger']]); } @@ -49,7 +61,7 @@ class AppServiceProvider extends ServiceProvider require_once $payables.'/bootstrap.php'; if ($paths !== null) { require_once $paths['general-ledger'].'/bootstrap.php'; - $runtime->assertLoadedPackages(); + $loader->assertLoadedPackages(); } } diff --git a/app/Services/CommonFinanceAdministration.php b/app/Services/CommonFinanceAdministration.php new file mode 100644 index 0000000..57611ce --- /dev/null +++ b/app/Services/CommonFinanceAdministration.php @@ -0,0 +1,145 @@ + 'Consultar obrigações a fornecedores', 'prepare' => 'Preparar reconhecimento de obrigações', + 'validate' => 'Validar reconhecimento de forma independente', 'payments_view' => 'Consultar pagamentos e afectações', + 'payment_prepare' => 'Registar um facto de pagamento', 'payment_confirm' => 'Confirmar um facto de pagamento', + 'allocation_prepare' => 'Propor afectações a facturas', 'allocation_confirm' => 'Confirmar afectações', + 'reversal_prepare' => 'Propor reversão de uma afectação', 'reversal_confirm' => 'Confirmar reversão de forma independente', + 'general_ledger.view' => 'Consultar o diário, balancete e razão', 'general_ledger.prepare' => 'Preparar lançamento contabilístico', + 'general_ledger.validate' => 'Rever lançamento de forma independente', 'general_ledger.post' => 'Aplicar o lançamento revisto', + 'general_ledger.correct_prepare' => 'Preparar estorno e substituição', 'general_ledger.correct_validate' => 'Rever o par de correcção', + 'general_ledger.correct_post' => 'Aplicar o par revisto', 'general_ledger.period_prepare' => 'Preparar conferência do período', + 'general_ledger.period_validate' => 'Rever conferência de forma independente', 'general_ledger.period_close' => 'Aplicar o fecho revisto', + ]; + + public const EFFECT_LABELS = [ + 'supplier_payable.recognised' => 'Reconhecimento da obrigação', 'allocation.confirmed' => 'Afectação confirmada', + 'allocation.reversed' => 'Reversão confirmada', 'journal.reversal' => 'Estorno exacto do original', 'journal.replacement' => 'Substituição do lançamento', + ]; + + public function ready(): bool + { + return app(StandaloneRuntime::class)->enabled() + && app(StandaloneRuntime::class)->feature('finance-configuration', DB::connection()) + && class_exists(LedgerConfiguration::class, false) + && (new \ReflectionClass(LedgerConfiguration::class))->getConstant('VERSION') === 'COMMON-FINANCE-CONFIGURATION-v1'; + } + + private function actor(User $actor): User + { + abort_unless($this->ready(), 503); + app(ConflictGuard::class)->lockCompany($actor); + $actor = app(CurrentActor::class)->lock($actor, [PurchasingRole::Admin]); + abort_if(app(OrganizationAccess::class)->maintenanceOnly($actor), 403); + + return $actor; + } + + private function eligible(User $target): bool + { + $access = app(OrganizationAccess::class); + $permissions = $access->active($target->tenant_id) ? $access->configuredPermissions($target, 'procurement.internal') : $access->permissions($target); + + return ! $access->maintenanceOnly($target) && array_intersect($permissions, ['admin', 'finance']) !== []; + } + + private function writer(User $actor): LedgerConfiguration + { + return new LedgerConfiguration(DB::connection(), ['tenant_id' => (int) $actor->tenant_id, 'company_id' => 0, 'unit_id' => 0], $actor->id, + function (string $action, array $data) use ($actor) { + $fresh = $this->actor($actor); + if (isset($data['user_id'])) { + if (! is_int($data['user_id']) || $data['user_id'] < 1) { + throw new \InvalidArgumentException('Identificador nominativo inválido.'); + } + $target = User::query()->where('tenant_id', $fresh->tenant_id)->whereKey($data['user_id'])->lockForUpdate()->firstOrFail(); + if ($action === 'access' && ($data['actions'] ?? []) !== [] && ! $this->eligible($target)) { + throw ValidationException::withMessages(['user_id' => 'Atribua primeiro uma função de Finanças ou Administração no contexto de Compras internas. A manutenção temporária não recebe estes acessos.']); + } + } + }, + fn (string $action, array $before, array $after, array $result) => app(RequisitionWorkflow::class)->audit($actor, + 'company.finance_configuration_changed', null, $before, ['configuration_action' => $action, 'result' => $result, 'configuration' => $after])); + } + + /** @return array */ + public function workspace(User $actor, ?int $selected = null, string $term = ''): array + { + return DB::transaction(function () use ($actor, $selected, $term) { + $actor = $this->actor($actor); + $writer = $this->writer($actor); + $target = $selected === null ? null : User::query()->where('tenant_id', $actor->tenant_id)->findOrFail($selected); + $access = $target === null ? null : $writer->basis('access', $target->id); + if ($access !== null) { + $identities = array_values(array_unique(array_column($access['rows'], 'person'))); + $access += ['user' => $target->only(['id', 'name', 'email']), 'eligible' => $this->eligible($target), + 'person' => collect($access['rows'])->firstWhere('action', 'view')['person'] ?? ($identities[0] ?? ''), + 'identity_inconsistent' => count($identities) > 1, + 'actions' => array_values(array_intersect(array_column($access['rows'], 'action'), LedgerConfiguration::ACTIONS)), + 'other_actions' => array_values(array_diff(array_column($access['rows'], 'action'), LedgerConfiguration::ACTIONS))]; + } + $needle = str_replace(['!', '%', '_'], ['!!', '!%', '!_'], trim($term)); + $people = User::query()->where('tenant_id', $actor->tenant_id) + ->when($needle !== '', fn ($query) => $query->where(fn ($filter) => $filter->whereRaw("LOWER(name) LIKE LOWER(?) ESCAPE '!'", ['%'.$needle.'%']) + ->orWhereRaw("LOWER(email) LIKE LOWER(?) ESCAPE '!'", ['%'.$needle.'%']))) + ->orderBy('name')->orderBy('id')->paginate(25, ['id', 'name', 'email'], 'users_page')->withQueryString(); + $scope = ['tenant_id' => $actor->tenant_id, 'company_id' => 0, 'unit_id' => 0]; + $history = DB::table('gl_events')->where($scope)->where('kind', 'like', 'configuration.%')->orderByDesc('id') + ->paginate(15, ['id', 'actor_id', 'kind', 'reason', 'previous', 'subsequent', 'created_at'], 'history_page')->withQueryString() + ->through(fn ($row) => ['id' => (int) $row->id, 'actor_id' => (int) $row->actor_id, 'kind' => $row->kind, + 'reason' => $row->reason, 'before' => json_decode($row->previous, true, 64, JSON_THROW_ON_ERROR), + 'after' => json_decode($row->subsequent, true, 64, JSON_THROW_ON_ERROR), 'created_at' => $row->created_at]); + + return ['actorId' => $actor->id, 'tenantId' => $actor->tenant_id, 'users' => $people, 'selectedAccess' => $access, + 'accounts' => $writer->basis('account'), 'periods' => $writer->basis('period'), 'rules' => $writer->basis('rule'), + 'actions' => self::LABELS, 'effects' => self::EFFECT_LABELS, 'q' => $term, 'history' => $history]; + }); + } + + /** @param array $input + * @return array */ + public function save(User $actor, string $kind, array $input): array + { + abort_unless($this->ready(), 503); + $rules = ['operation_key' => 'required|uuid', 'basis_hash' => ['required', 'regex:/^[a-f0-9]{64}$/D'], 'reason' => 'required|string|min:10|max:2000']; + $rules += match ($kind) { + 'access' => ['user_id' => 'required|integer|min:1', 'person' => 'present|nullable|string|max:160', + 'actions' => 'present|array|list|max:20', 'actions.*' => ['required', 'string', 'distinct:strict', Rule::in(LedgerConfiguration::ACTIONS)]], + 'account' => ['code' => 'required|string|max:80', 'label' => 'required|string|max:200', 'currency' => 'required|in:MZN', 'is_movement' => 'required|boolean'], + 'period' => ['period_key' => 'required|string|max:80', 'starts_on' => 'required|date_format:Y-m-d', 'ends_on' => 'required|date_format:Y-m-d|after_or_equal:starts_on'], + 'rule' => ['rule_key' => 'required|string|max:80', 'effect_type' => ['required', Rule::in(LedgerConfiguration::EFFECTS)], + 'valid_from' => 'required|date_format:Y-m-d', 'valid_to' => 'required|date_format:Y-m-d|after_or_equal:valid_from', + 'debit_account_id' => 'required|integer|min:1', 'credit_account_id' => 'required|integer|min:1|different:debit_account_id'], + default => throw new \InvalidArgumentException('Unknown financial configuration action.'), + }; + $data = Validator::make($input, $rules)->validate(); + $operation = strtolower($data['operation_key']); + unset($data['operation_key']); + if ($kind === 'access') { + $data['user_id'] = (int) $data['user_id']; + $data['person'] = $data['person'] ?? ''; + sort($data['actions'], SORT_STRING); + } elseif ($kind === 'account') { + $data['is_movement'] = (bool) $data['is_movement']; + } elseif ($kind === 'rule') { + $data['debit_account_id'] = (int) $data['debit_account_id']; + $data['credit_account_id'] = (int) $data['credit_account_id']; + } + + return $this->writer($actor)->command($kind, $data, $operation); + } +} diff --git a/app/Services/EquipmentWorkflow.php b/app/Services/EquipmentWorkflow.php index e21e3ea..fb85c7c 100644 --- a/app/Services/EquipmentWorkflow.php +++ b/app/Services/EquipmentWorkflow.php @@ -86,7 +86,7 @@ class EquipmentWorkflow if (TechnicalReview::query()->where('requisition_id', $requisition->id)->where('basis_hash', $basis)->exists()) { throw ValidationException::withMessages(['technical' => 'Esta versão já tem uma decisão técnica. A decisão anterior permanece no histórico.']); } - $review = TechnicalReview::query()->create(['tenant_id' => $user->tenant_id, 'requisition_id' => $requisition->id, 'reviewed_by' => $user->id, 'basis_hash' => $basis, 'decision' => $decision, 'reason' => $reason, 'reviewed_at' => now(), 'snapshot' => ['reviewer' => $user->only(['id', 'name', 'department_id']), 'items' => $requisition->items()->get()->toArray(), 'development_only' => true, 'budget_checked' => false]]); + $review = TechnicalReview::query()->create(['tenant_id' => $user->tenant_id, 'requisition_id' => $requisition->id, 'reviewed_by' => $user->id, 'basis_hash' => $basis, 'decision' => $decision, 'reason' => $reason, 'reviewed_at' => now(), 'snapshot' => ['reviewer' => $user->only(['id', 'name', 'department_id']), 'items' => $requisition->items()->get()->toArray(), 'development_only' => app(StandaloneRuntime::class)->syntheticOnly(), 'budget_checked' => false]]); app(RequisitionWorkflow::class)->audit($user, 'equipment.technical_'.$decision, $requisition, null, $review->toArray()); return $review; diff --git a/app/Services/ExternalPaymentWorkflow.php b/app/Services/ExternalPaymentWorkflow.php index d9b7844..c1f22c8 100644 --- a/app/Services/ExternalPaymentWorkflow.php +++ b/app/Services/ExternalPaymentWorkflow.php @@ -127,7 +127,7 @@ class ExternalPaymentWorkflow $this->invalid('Referência, evidência e data válida do exercício actual são obrigatórias.'); } $bank = $this->bank($user, $invoice, (int) $data['supplier_bank_detail_id'], $amount); - $payment = ExternalPayment::query()->create(['tenant_id' => $user->tenant_id, 'invoice_id' => $invoice->id, 'supplier_bank_detail_id' => $bank->id, 'created_by' => $user->id, 'amount_minor' => $amount, 'currency' => $bank->currency, 'paid_on' => $data['paid_on'], 'external_reference' => $reference, 'reference_hash' => $referenceHash, 'payload_hash' => $hash, 'evidence_reference' => trim($data['evidence_reference']), 'bank_snapshot' => ['bank_id' => $bank->id, 'revision' => $bank->revision, 'bank_name' => $bank->bank_name, 'country' => $bank->country, 'currency' => $bank->currency, 'beneficiary' => $bank->beneficiary, 'account_identifier' => $bank->account_identifier, 'reviewer_ids' => SupplierBankReview::query()->where('supplier_bank_detail_id', $bank->id)->pluck('reviewed_by')->all(), 'development_only' => true, 'bank_transfer_executed' => false]]); + $payment = ExternalPayment::query()->create(['tenant_id' => $user->tenant_id, 'invoice_id' => $invoice->id, 'supplier_bank_detail_id' => $bank->id, 'created_by' => $user->id, 'amount_minor' => $amount, 'currency' => $bank->currency, 'paid_on' => $data['paid_on'], 'external_reference' => $reference, 'reference_hash' => $referenceHash, 'payload_hash' => $hash, 'evidence_reference' => trim($data['evidence_reference']), 'bank_snapshot' => ['bank_id' => $bank->id, 'revision' => $bank->revision, 'bank_name' => $bank->bank_name, 'country' => $bank->country, 'currency' => $bank->currency, 'beneficiary' => $bank->beneficiary, 'account_identifier' => $bank->account_identifier, 'reviewer_ids' => SupplierBankReview::query()->where('supplier_bank_detail_id', $bank->id)->pluck('reviewed_by')->all(), 'development_only' => app(StandaloneRuntime::class)->syntheticOnly(), 'bank_transfer_executed' => false]]); $this->audit($user, $invoice, $payment, 'payment.registered'); return $payment; diff --git a/app/Services/GeneralLedger.php b/app/Services/GeneralLedger.php index c715510..28cae96 100644 --- a/app/Services/GeneralLedger.php +++ b/app/Services/GeneralLedger.php @@ -128,6 +128,13 @@ final class GeneralLedger $engine = $this->engine($user); $data = $engine->cycleListing($page); $data['book'] = $engine->listing(['page' => $page]); + if (app(StandaloneRuntime::class)->enabled()) { + $context = app(SupplierPayables::class)->readContext($user); + $rules = DB::table('gl_rules')->where($context['scope'])->orderByDesc('version')->get() + ->unique('rule_key')->values()->map(fn ($rule) => (array) $rule)->all(); + $data['configuration'] = ['rules' => $rules]; + $data['synthetic_only'] = app(StandaloneRuntime::class)->syntheticOnly(); + } $actions = ['prepare', 'validate', 'post', 'correct_prepare', 'correct_validate', 'correct_post', 'period_prepare', 'period_validate', 'period_close']; $data['permissions'] = array_combine($actions, array_map(fn ($a) => $this->can($user, $a), $actions)); diff --git a/app/Services/InvoiceWorkflow.php b/app/Services/InvoiceWorkflow.php index 4665817..ae4ba4f 100644 --- a/app/Services/InvoiceWorkflow.php +++ b/app/Services/InvoiceWorkflow.php @@ -127,7 +127,7 @@ class InvoiceWorkflow $invoice = new Invoice(['tenant_id' => $user->tenant_id, 'purchase_order_id' => $order->id, 'supplier_id' => $order->supplier_id, 'created_by' => $user->id, 'number' => $number, 'issued_on' => $data['issued_on'], 'subtotal_minor' => $subtotal, 'tax_minor' => $tax, 'total_minor' => $subtotal + $tax, 'snapshot' => ['supplier' => $order->snapshot['supplier'], 'order_number' => $order->number, 'author' => $user->only(['id', 'name']), 'currency' => $order->currency, ...($order->currency === 'MZN' ? [] : ['exchange_basis' => $order->snapshot['exchange_basis'], ...(OrderPartsAccess::applies($order) ? ['exchange_sources' => $order->snapshot['exchange_sources']] : [])]), - 'development_only' => true, 'matching_tolerance' => 'zero', 'rounding' => 'cumulative_half_up']]); + 'development_only' => app(StandaloneRuntime::class)->syntheticOnly(), 'matching_tolerance' => 'zero', 'rounding' => 'cumulative_half_up']]); if (app(RequisitionBudgetDistributions::class)->applies($request)) { $distribution = app(InvoiceBudgetDistributions::class)->prepare($user, $invoice, $order, $data, $lines); $invoice->snapshot = [...$invoice->snapshot, 'budget_distribution' => $distribution]; diff --git a/app/Services/OrderPartsWorkflow.php b/app/Services/OrderPartsWorkflow.php index 50d41f9..b5f06dd 100644 --- a/app/Services/OrderPartsWorkflow.php +++ b/app/Services/OrderPartsWorkflow.php @@ -249,7 +249,7 @@ final class OrderPartsWorkflow ...($operational === [] ? [] : ['operational_orders' => $operational]), 'supplier' => $firstQuote->supplier?->only(['id', 'name', 'nuit', 'contact', 'email', 'phone', 'address']), 'issuer' => $actor->only(['id', 'name']), 'items' => $lines, 'catalogue_sources' => $catalogue, - 'budget_control' => $commit, 'development_only' => true, 'budget_checked' => true, + 'budget_control' => $commit, 'development_only' => app(StandaloneRuntime::class)->syntheticOnly(), 'budget_checked' => true, 'order_parts' => ['version' => 1, 'order_key' => $orderKey, 'preparation_fingerprint' => $prepared['fingerprint'], 'sources' => $prepared['sources'], 'frames' => $frames, 'budget_sources' => $budgetSources]]; $order = new PurchaseOrder(['tenant_id' => $actor->tenant_id, 'requisition_id' => $first['requisition_id'], diff --git a/app/Services/PurchaseRevisionWorkflow.php b/app/Services/PurchaseRevisionWorkflow.php index 90c2008..15b1728 100644 --- a/app/Services/PurchaseRevisionWorkflow.php +++ b/app/Services/PurchaseRevisionWorkflow.php @@ -57,7 +57,7 @@ class PurchaseRevisionWorkflow if (! in_array($award->status, ['pending', 'approved', 'rejected']) || trim($reason) === '') { $this->invalid('Estado ou fundamento inválido para cancelamento.'); } - $cancellation = AwardCancellation::query()->create(['tenant_id' => $actor->tenant_id, 'purchase_award_id' => $award->id, 'purchase_control_policy_id' => $policy->id, 'created_by' => $actor->id, 'reason' => trim($reason), 'basis_hash' => $this->basis($award), 'snapshot' => ['policy' => $policy->only(['id', 'revision', 'mode', 'enabled', 'valid_from', 'valid_until']), 'award' => $award->toArray(), 'requisition_id' => $request->id, 'development_only' => true]]); + $cancellation = AwardCancellation::query()->create(['tenant_id' => $actor->tenant_id, 'purchase_award_id' => $award->id, 'purchase_control_policy_id' => $policy->id, 'created_by' => $actor->id, 'reason' => trim($reason), 'basis_hash' => $this->basis($award), 'snapshot' => ['policy' => $policy->only(['id', 'revision', 'mode', 'enabled', 'valid_from', 'valid_until']), 'award' => $award->toArray(), 'requisition_id' => $request->id, 'development_only' => app(StandaloneRuntime::class)->syntheticOnly()]]); app(RequisitionWorkflow::class)->audit($actor, 'cancellation.requested', $request, null, ['cancellation_id' => $cancellation->id, 'award_id' => $award->id, 'policy_id' => $policy->id]); return $cancellation; diff --git a/app/Services/PurchaseWorkflow.php b/app/Services/PurchaseWorkflow.php index 49479a2..606c3d7 100644 --- a/app/Services/PurchaseWorkflow.php +++ b/app/Services/PurchaseWorkflow.php @@ -184,7 +184,7 @@ class PurchaseWorkflow ...app(AgreementOrderLimits::class)->freeze($user, $quote, $requisition, $lines, $agreementBindings), ...($quote->exchange_basis === null ? [] : ['exchange_basis' => $quote->exchange_basis, 'reference_amounts' => app(QuotationExchange::class)->amounts($quote)]), ...($catalogueSources === [] ? [] : ['catalogue_sources' => $catalogueSources]), - 'development_only' => true, + 'development_only' => app(StandaloneRuntime::class)->syntheticOnly(), 'budget_control' => app(BudgetWorkflow::class)->record($user, $requisition, 'commit', $award->total_minor, $award->subtotal_minor, $quote), 'investment_rules' => $award->investment_snapshot, 'equipment_requests' => $requisition->items()->where('purchase_type', 'equipment')->get()->map(fn ($line) => $line->only(['id', 'description', 'production_area']))->all(), diff --git a/app/Services/ReceiptWorkflow.php b/app/Services/ReceiptWorkflow.php index 9777ea6..6d640cf 100644 --- a/app/Services/ReceiptWorkflow.php +++ b/app/Services/ReceiptWorkflow.php @@ -244,7 +244,7 @@ class ReceiptWorkflow 'tenant_id' => $user->tenant_id, 'purchase_order_id' => $order->id, 'received_by' => $user->id, 'warehouse_id' => $warehouse?->id, 'idempotency_key' => $data['idempotency_key'], 'payload_hash' => $hash, 'delivery_note' => $deliveryNote, 'received_on' => $data['received_on'], 'status' => 'partial', 'confirmed_at' => now(), - 'snapshot' => ['order' => $order->only(['id', 'number']), 'supplier' => $order->snapshot['supplier'], 'receiver' => $user->only(['id', 'name']), 'warehouse' => $warehouse?->only(['id', 'code', 'name']), 'development_only' => true, 'budget_checked' => false], + 'snapshot' => ['order' => $order->only(['id', 'number']), 'supplier' => $order->snapshot['supplier'], 'receiver' => $user->only(['id', 'name']), 'warehouse' => $warehouse?->only(['id', 'code', 'name']), 'development_only' => app(StandaloneRuntime::class)->syntheticOnly(), 'budget_checked' => false], ]); foreach ($lines as $line) { $item = $receipt->items()->create($line); diff --git a/app/Services/StandaloneComponentSchema.php b/app/Services/StandaloneComponentSchema.php new file mode 100644 index 0000000..82d360a --- /dev/null +++ b/app/Services/StandaloneComponentSchema.php @@ -0,0 +1,71 @@ + ['budget_distributions', 'budget_distribution_events', 'budget_distribution_entries', 'budget_distribution_consumptions'], + 'supplier-settlements-v1' => ['ps_payments', 'ps_payment_decisions', 'ps_proposals', 'ps_allocation_aliases', 'ps_allocation_decisions', 'ps_allocations', 'ps_commands', 'ps_events', 'ps_outbox'], + 'supplier-payables-v1' => ['pa_access', 'pa_sources', 'pa_proposals', 'pa_obligations', 'pa_commands', 'pa_events', 'pa_outbox'], + ]; + + // Measured from the canonical definitions in an owned synthetic PostgreSQL17 composition. + // Pilot metadata was compared separately; it was not used as the authority for these identities. + public const SUPPORTED = [ + 'budget-distributions-v1' => '4239f48f64e2beb0cf34d3dc8730aca3a0c54aef9cb0dff2c69d03c0e8b1c2e1', + 'supplier-settlements-v1' => '11b1522f8b62c32944cf53a6180046d28d51c5c295e6e390633ac809d72bf05a', + 'supplier-payables-v1' => 'cda146acf4e674c72b7676fc02cf9b8c5e89208d1dd099193950d785c4dd8452', + ]; + + /** @return list */ + public static function reusable(Connection $db): array + { + $groups = []; + foreach (self::SUPPORTED as $group => $expected) { + $actual = self::inspect($db, $group); + if ($actual['present'] === []) { + continue; + } + if ($actual['sha256'] === null || ! hash_equals($expected, $actual['sha256'])) { + throw new LogicException('COMPRAS_RUNTIME_COMPONENT_SCHEMA_UNSUPPORTED:'.$group); + } + $groups[] = $group; + } + + return $groups; + } + + /** @return array{present:array,sha256:?string} */ + public static function inspect(Connection $db, string $group): array + { + if ($db->getDriverName() !== 'pgsql' || ! isset(self::GROUPS[$group])) { + throw new LogicException('COMPRAS_RUNTIME_COMPONENT_PROFILE'); + } + $tables = self::GROUPS[$group]; + $present = array_values(array_filter($tables, fn ($table) => $db->getSchemaBuilder()->hasTable($table))); + if (count($present) !== count($tables)) { + return ['present' => $present, 'sha256' => null]; + } + $frames = []; + sort($tables, SORT_STRING); + foreach ($tables as $table) { + $oid = $db->selectOne('SELECT to_regclass(?)::oid AS id', ['public.'.$table])->id; + $frames[$table] = [ + 'columns' => $db->select('SELECT a.attname AS name,format_type(a.atttypid,a.atttypmod) AS type,a.attnotnull AS required,pg_get_expr(d.adbin,d.adrelid) AS default_value FROM pg_attribute a LEFT JOIN pg_attrdef d ON d.adrelid=a.attrelid AND d.adnum=a.attnum WHERE a.attrelid=? AND a.attnum>0 AND NOT a.attisdropped ORDER BY a.attnum', [$oid]), + 'constraints' => $db->select('SELECT conname AS name,contype AS kind,condeferrable AS deferrable,condeferred AS deferred,convalidated AS validated,pg_get_constraintdef(oid,true) AS definition FROM pg_constraint WHERE conrelid=? ORDER BY conname', [$oid]), + 'indexes' => $db->select('SELECT ci.relname AS name,pg_get_indexdef(i.indexrelid) AS definition,i.indisvalid AS valid FROM pg_index i JOIN pg_class ci ON ci.oid=i.indexrelid WHERE i.indrelid=? ORDER BY ci.relname', [$oid]), + 'triggers' => $db->select('SELECT t.tgname AS name,t.tgenabled AS enabled,pg_get_triggerdef(t.oid,true) AS definition,pg_get_functiondef(t.tgfoid) AS function_definition FROM pg_trigger t WHERE t.tgrelid=? AND NOT t.tgisinternal ORDER BY t.tgname', [$oid]), + ]; + } + if ($group === 'budget-distributions-v1') { + $frames['anchors'] = $db->select("SELECT a.attname AS name,format_type(a.atttypid,a.atttypmod) AS type,a.attnotnull AS required FROM pg_attribute a WHERE a.attrelid='public.requisitions'::regclass AND a.attname='budget_distribution_preparation' AND NOT a.attisdropped"); + } + + return ['present' => $present, 'sha256' => hash('sha256', json_encode($frames, JSON_THROW_ON_ERROR))]; + } +} diff --git a/app/Services/StandaloneExtensionSchema.php b/app/Services/StandaloneExtensionSchema.php index 07e24fd..2e5de2d 100644 --- a/app/Services/StandaloneExtensionSchema.php +++ b/app/Services/StandaloneExtensionSchema.php @@ -8,7 +8,8 @@ use Tempo\Finance\GeneralLedger\LedgerSchema; /** Explicit additive installation only; never called by application boot or a business request. */ final class StandaloneExtensionSchema { - public static function install(Connection $db): void + /** @param list $expectedComponents */ + public static function install(Connection $db, bool $reuseComponents = false, array $expectedComponents = []): void { $settings = config('standalone-runtime'); $settings['enabled'] = true; @@ -35,23 +36,48 @@ final class StandaloneExtensionSchema } $schemas[] = [$schema, $contract, $connectionArgument]; } - $db->transaction(function () use ($db, $runtime, $settings, $schemas) { + $db->transaction(function () use ($db, $runtime, $settings, $schemas, $reuseComponents, $expectedComponents) { $db->selectOne('SELECT pg_advisory_xact_lock(hashtextextended(?, 0))', [$settings['installation_id']]); $runtime->assertInstallation($db); + $reused = []; + if ($reuseComponents) { + // Same company-first ordering as business writers; no schema adoption in a request. + $db->statement('LOCK TABLE tenants,requisitions,approval_steps,workflow_notices,budget_entries IN SHARE ROW EXCLUSIVE MODE'); + foreach (StandaloneComponentSchema::GROUPS as $tables) { + foreach ($tables as $table) { + if ($db->getSchemaBuilder()->hasTable($table)) { + $db->statement('LOCK TABLE '.$table.' IN SHARE ROW EXCLUSIVE MODE'); + } + } + } + $reused = StandaloneComponentSchema::reusable($db); + if ($reused !== $expectedComponents) { + throw new \LogicException('COMPRAS_RUNTIME_COMPONENT_PLAN_CHANGED'); + } + } foreach (['budget_distributions', 'budget_order_commands', 'purchase_order_sources', 'budget_landed_commands', 'budget_requisition_cycles', 'gl_accounts', 'ps_payments', 'ps_reversals', 'gl_corrections'] as $table) { if ($db->getSchemaBuilder()->hasTable($table)) { + if (($table === 'budget_distributions' && in_array('budget-distributions-v1', $reused, true)) + || ($table === 'ps_payments' && in_array('supplier-settlements-v1', $reused, true))) { + continue; + } throw new \LogicException('COMPRAS_RUNTIME_EXTENSION_SCHEMA_EXISTS'); } } // The normal application migrations already install the common payables schema. StandaloneSchema::verify($db->getSchemaBuilder(), ['supplier-payables' => true]); - BudgetDistributionSchema::install(); + if (! in_array('budget-distributions-v1', $reused, true)) { + BudgetDistributionSchema::install(); + } BudgetOrderPartsSchema::install($db); PurchaseOrderSourcesSchema::install($db); BudgetLandedCostSchema::install($db); RequisitionCycleSchema::install($db); foreach ($schemas as [$schema, $contract, $connectionArgument]) { + if ($contract === 'COMMON-PAYABLE-SETTLEMENT-HOST-SCHEMA-v1' && in_array('supplier-settlements-v1', $reused, true)) { + continue; + } $arguments = [$contract, fn () => $runtime->assertInstallation($db)]; if ($connectionArgument) { array_unshift($arguments, $db); diff --git a/app/Services/StandaloneInstallation.php b/app/Services/StandaloneInstallation.php index 3b9146c..d4fb581 100644 --- a/app/Services/StandaloneInstallation.php +++ b/app/Services/StandaloneInstallation.php @@ -10,15 +10,21 @@ use LogicException; final class StandaloneInstallation { /** @return array */ - public function prepare(string $database, string $role, string $operator, string $reason, bool $apply = false, bool $rebind = false): array + public function prepare(string $database, string $role, string $operator, string $reason, bool $apply = false, bool $rebind = false, bool $reuseComponents = false): array { Validator::make(compact('database', 'role', 'operator', 'reason'), [ 'database' => 'required|string|max:200', 'role' => 'required|string|max:200', 'operator' => 'required|string|min:3|max:200', 'reason' => 'required|string|min:10|max:4000', ])->validate(); + if ($rebind && $reuseComponents) { + throw new LogicException('Recovery binding and initial component reuse are separate operations.'); + } if (config('standalone-runtime.enabled') === true) { throw new LogicException('Disable runtime activation before explicit installation or recovery.'); } + if (config('standalone-runtime.prepare_only') !== true) { + throw new LogicException('Use explicit console preparation mode to verify the pinned packages before loading executable files.'); + } $settings = config('standalone-runtime'); $settings['enabled'] = true; $settings['features'] = array_fill_keys(StandaloneRuntime::FEATURES, true); @@ -35,14 +41,21 @@ final class StandaloneInstallation if ($identity === null || $identity->database_name !== $database || $identity->role_name !== $role) { throw new LogicException('COMPRAS_RUNTIME_EXPECTED_DESTINATION'); } + $already = $db->getSchemaBuilder()->hasTable('compras_runtime_installations') + && $db->table('compras_runtime_installations')->where('id', $settings['installation_id'])->exists(); + if ($already) { + $runtime->assertInstallation($db); + } + $reused = $reuseComponents && ! $already ? StandaloneComponentSchema::reusable($db) : []; $plan = ['contract' => StandaloneArtifact::CONTRACT, 'installation_id' => $settings['installation_id'], 'manifest_sha256' => $settings['manifest_sha256'], 'database' => $database, 'role' => $role, - 'feature_activation' => false, 'actor_grants' => false, 'rebind' => $rebind]; + 'feature_activation' => false, 'actor_grants' => false, 'rebind' => $rebind, + 'reuse_components' => $reuseComponents, 'existing_components' => $reused]; if (! $apply) { return $plan + ['state' => 'preview', 'written' => false]; } - return $db->transaction(function () use ($db, $runtime, $settings, $binding, $operator, $reason, $rebind, $plan) { + return $db->transaction(function () use ($db, $runtime, $settings, $binding, $operator, $reason, $rebind, $plan, $reuseComponents, $reused) { $db->selectOne('SELECT pg_advisory_xact_lock(hashtextextended(?, 0))', ['COMPRAS-STANDALONE-INSTALLATION']); $schema = $db->getSchemaBuilder(); if (! $schema->hasTable('compras_runtime_installations')) { @@ -63,10 +76,10 @@ final class StandaloneInstallation $db->table('compras_runtime_installations')->insert([ 'id' => $settings['installation_id'], 'product' => 'compras', 'contract' => StandaloneArtifact::CONTRACT, 'manifest_sha256' => $settings['manifest_sha256'], 'database_binding_sha256' => $binding, - 'recorded_by' => $operator, 'reason' => $reason, 'installed_at' => now(), + 'recorded_by' => $operator, 'reason' => $reason.($reused === [] ? '' : "\nReused canonical components: ".json_encode(array_intersect_key(StandaloneComponentSchema::SUPPORTED, array_flip($reused)), JSON_THROW_ON_ERROR)), 'installed_at' => now(), ]); if (! $rebind) { - StandaloneExtensionSchema::install($db); + StandaloneExtensionSchema::install($db, $reuseComponents, $reused); } $runtime->assertInstallation($db); StandaloneSchema::verify($schema, $settings['features']); diff --git a/app/Services/StandaloneRuntime.php b/app/Services/StandaloneRuntime.php index 152b897..9cbb8f5 100644 --- a/app/Services/StandaloneRuntime.php +++ b/app/Services/StandaloneRuntime.php @@ -12,7 +12,7 @@ final class StandaloneRuntime 'urgent-reviews', 'urgent-quotations', 'conflict-releases', 'private-audit', 'expense-allocations', 'agreement-order-limits', 'order-parts', 'import-tariffs', 'import-legal', 'import-dossier', 'import-bank-support', 'import-readiness', 'import-estimates', 'import-landed-costs', 'budget-distributions', - 'supplier-payables', 'general-ledger', 'supplier-settlements', 'general-ledger-cycle']; + 'supplier-payables', 'general-ledger', 'supplier-settlements', 'general-ledger-cycle', 'finance-configuration']; /** @var array{root:string,manifest:array,paths:array}|null */ private ?array $artifact = null; @@ -30,6 +30,16 @@ final class StandaloneRuntime return $this->enabled() && ($this->settings['features'][$feature] ?? false) === true; } + public function syntheticOnly(): bool + { + $value = $this->enabled() ? ($this->settings['synthetic_only'] ?? true) : true; + if (! is_bool($value)) { + throw new LogicException('COMPRAS_RUNTIME_DATA_CLASSIFICATION'); + } + + return $value; + } + /** @return array|null */ public function configure(Connection $db): ?array { @@ -46,6 +56,17 @@ final class StandaloneRuntime public function assertLoadedPackages(bool $allowMissing = false): void { $artifact = $this->artifact(); + foreach ([...get_declared_classes(), ...get_declared_interfaces(), ...get_declared_traits()] as $class) { + if (! str_starts_with($class, 'Tempo\\Finance\\Budget\\') && ! str_starts_with($class, 'Tempo\\Purchasing\\') + && ! str_starts_with($class, 'Tempo\\Finance\\Payables\\') && ! str_starts_with($class, 'Tempo\\Finance\\GeneralLedger\\')) { + continue; + } + $loaded = (new \ReflectionClass($class))->getFileName(); + $root = realpath($artifact['root']); + if (! is_string($loaded) || $root === false || ! str_starts_with(realpath($loaded) ?: '', $root.DIRECTORY_SEPARATOR)) { + throw new LogicException('COMPRAS_RUNTIME_CLASS_LOCATION'); + } + } foreach ([ 'Tempo\\Finance\\Budget\\BudgetControl' => 'budget-control/src/BudgetControl.php', 'Tempo\\Purchasing\\Internal\\InternalRequisitions' => 'purchasing/src/InternalRequisitions.php', @@ -64,12 +85,30 @@ final class StandaloneRuntime } } if (! $allowMissing) { + if ($this->requested('finance-configuration')) { + $configuration = 'Tempo\\Finance\\GeneralLedger\\LedgerConfiguration'; + if (! class_exists($configuration, false) || (new \ReflectionClass($configuration))->getConstant('VERSION') !== 'COMMON-FINANCE-CONFIGURATION-v1') { + throw new LogicException('COMPRAS_RUNTIME_FINANCE_CONFIGURATION'); + } + } + if ($this->requested('supplier-settlements')) { + $settlements = new \ReflectionClass('Tempo\\Finance\\Payables\\SupplierSettlements'); + $payables = new \ReflectionClass('Tempo\\Finance\\Payables\\Payables'); + if (! $settlements->hasConstant('HOST_POLICY') || $settlements->getConstant('HOST_POLICY') !== 'COMMON-SUPPLIER-SETTLEMENT-v1' + || ! $payables->hasMethod('hostSettlements')) { + throw new LogicException('COMPRAS_RUNTIME_SETTLEMENT_POLICY'); + } + } if ($this->requested('general-ledger')) { $journal = new \ReflectionClass('Tempo\\Finance\\GeneralLedger\\PayableJournal'); if (! $journal->hasConstant('HOST_POLICY') || $journal->getConstant('HOST_POLICY') !== 'COMMON-PAYABLE-JOURNAL-v1' || ! in_array('hostPolicy', array_map(fn ($parameter) => $parameter->getName(), $journal->getConstructor()?->getParameters() ?? []), true)) { throw new LogicException('COMPRAS_RUNTIME_JOURNAL_POLICY'); } + if ($this->requested('general-ledger-cycle') && (! $journal->hasConstant('CONFIGURED_CORRECTIONS_VERSION') + || $journal->getConstant('CONFIGURED_CORRECTIONS_VERSION') !== 'COMMON-LEDGER-CONFIGURED-CORRECTION-v1')) { + throw new LogicException('COMPRAS_RUNTIME_CORRECTION_POLICY'); + } } $budget = new \ReflectionClass('Tempo\\Finance\\Budget\\BudgetControl'); foreach ([ @@ -114,6 +153,7 @@ final class StandaloneRuntime throw new LogicException('COMPRAS_RUNTIME_CONFIGURATION'); } $artifact = $this->verifier->verify($root, $pin); + $this->syntheticOnly(); $features = $this->settings['features'] ?? []; if (! is_array($features)) { throw new LogicException('COMPRAS_RUNTIME_FEATURES'); diff --git a/app/Services/StandaloneSchema.php b/app/Services/StandaloneSchema.php index aa21abb..751f499 100644 --- a/app/Services/StandaloneSchema.php +++ b/app/Services/StandaloneSchema.php @@ -13,7 +13,8 @@ final class StandaloneSchema { foreach (['import-legal' => ['import-tariffs'], 'import-bank-support' => ['import-dossier'], 'import-readiness' => ['import-dossier'], 'general-ledger' => ['supplier-payables'], - 'supplier-settlements' => ['supplier-payables'], 'general-ledger-cycle' => ['general-ledger', 'supplier-settlements']] as $feature => $dependencies) { + 'supplier-settlements' => ['supplier-payables'], 'general-ledger-cycle' => ['general-ledger', 'supplier-settlements'], + 'finance-configuration' => ['supplier-payables', 'general-ledger']] as $feature => $dependencies) { foreach ($dependencies as $dependency) { if (($features[$feature] ?? false) === true && ($features[$dependency] ?? false) !== true) { throw new LogicException('COMPRAS_RUNTIME_FEATURE_DEPENDENCY:'.$feature.':'.$dependency); @@ -51,6 +52,8 @@ final class StandaloneSchema 'ps_reversal_proposals' => ['id'], 'ps_reversals' => ['id']], 'general-ledger-cycle' => ['gl_corrections' => ['id'], 'gl_correction_results' => ['id'], 'gl_period_checks' => ['id'], 'gl_period_reviews' => ['id'], 'gl_period_closures' => ['id']], + 'finance-configuration' => ['pa_access' => ['id', 'user_id', 'person', 'action'], 'gl_accounts' => ['id'], + 'gl_rules' => ['id'], 'gl_periods' => ['id'], 'gl_commands' => ['id'], 'gl_events' => ['id']], default => [], }; foreach ($required as $table => $columns) { diff --git a/app/Services/StockWorkflow.php b/app/Services/StockWorkflow.php index 1261a06..231fd3c 100644 --- a/app/Services/StockWorkflow.php +++ b/app/Services/StockWorkflow.php @@ -125,7 +125,7 @@ class StockWorkflow 'equipment_id' => $equipment?->id, 'spare_part_id' => $part?->id, 'payload_hash' => $hash, 'destination' => $data['destination'] ?? null, 'reason' => $data['reason'], 'quantity_milli' => $quantity, 'theoretical_milli' => $balance['quantity'], 'ledger_version' => $balance['version'], 'recorded_at' => now(), - 'snapshot' => [...$lotSnapshot, 'actor' => $actor->only(['id', 'name']), 'responsible' => $responsible->only(['id', 'name']), 'stock_item' => $item->only(['id', 'code', 'name', 'unit']), 'warehouse' => $warehouse->only(['id', 'code', 'name']), 'destination_warehouse' => $destination?->only(['id', 'code', 'name']), 'equipment' => $equipment?->toArray(), 'spare_part' => $part?->toArray(), 'difference_milli' => $quantity - $balance['quantity'], 'budget_checked' => false, 'development_only' => true], + 'snapshot' => [...$lotSnapshot, 'actor' => $actor->only(['id', 'name']), 'responsible' => $responsible->only(['id', 'name']), 'stock_item' => $item->only(['id', 'code', 'name', 'unit']), 'warehouse' => $warehouse->only(['id', 'code', 'name']), 'destination_warehouse' => $destination?->only(['id', 'code', 'name']), 'equipment' => $equipment?->toArray(), 'spare_part' => $part?->toArray(), 'difference_milli' => $quantity - $balance['quantity'], 'budget_checked' => false, 'development_only' => app(StandaloneRuntime::class)->syntheticOnly()], ]); if ($adjustment !== null) { foreach ([['decrease_milli', -1, 'adjustment_out'], ['increase_milli', 1, 'adjustment_in']] as [$key, $sign, $type]) { @@ -278,11 +278,16 @@ class StockWorkflow private function movement(User $actor, StockOperation $operation, int $warehouse, int $quantity, string $type): StockMovement { - if($type==='issue'&&$operation->kind==='issue'){ - $writer=app(StockIssueMovement::class)->for($actor);$result=$writer->write($operation->id,$writer->preview($operation->id)); - if(!is_int($result['movement_id']??null)||$result['movement_id']<1)throw new \LogicException('Referência de movimento devolvida pelo escritor incompatível.'); + if ($type === 'issue' && $operation->kind === 'issue') { + $writer = app(StockIssueMovement::class)->for($actor); + $result = $writer->write($operation->id, $writer->preview($operation->id)); + if (! is_int($result['movement_id'] ?? null) || $result['movement_id'] < 1) { + throw new \LogicException('Referência de movimento devolvida pelo escritor incompatível.'); + } + return StockMovement::query()->findOrFail($result['movement_id']); } + return StockMovement::query()->create(['tenant_id' => $actor->tenant_id, 'stock_operation_id' => $operation->id, 'stock_item_id' => $operation->stock_item_id, 'warehouse_id' => $warehouse, 'equipment_id' => $operation->equipment_id, 'spare_part_id' => $operation->spare_part_id, 'moved_by' => $actor->id, 'movement_type' => $type, 'quantity_milli' => $quantity, 'snapshot' => [...$operation->snapshot, 'warehouse' => Warehouse::query()->findOrFail($warehouse)->only(['id', 'code', 'name']), 'reference' => $operation->reference, 'reason' => $operation->reason], 'moved_at' => now()]); } } diff --git a/app/Services/SupplierPayables.php b/app/Services/SupplierPayables.php index 39a0a34..e051099 100644 --- a/app/Services/SupplierPayables.php +++ b/app/Services/SupplierPayables.php @@ -10,9 +10,28 @@ use App\Models\User; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; use Tempo\Finance\Payables\Payables; +use Tempo\Finance\Payables\SupplierSettlements; final class SupplierPayables { + public function settlements(User $actor): SupplierSettlements + { + $runtime = app(StandaloneRuntime::class); + if (! $runtime->enabled()) { + return $this->engine($actor)->settlements(); + } + abort_unless($runtime->feature('supplier-settlements', DB::connection()), 403); + $engine = $this->engine($actor); + $class = new \ReflectionClass($engine); + abort_unless($class->hasMethod('hostSettlements'), 503, 'Contrato financeiro de instalação incompatível.'); + $settlements = $class->getMethod('hostSettlements')->invoke($engine, 'COMMON-SUPPLIER-SETTLEMENT-v1', $runtime->syntheticOnly()); + if (! $settlements instanceof SupplierSettlements) { + throw new \LogicException('COMPRAS_RUNTIME_SETTLEMENT_ENGINE'); + } + + return $settlements; + } + public static function enabled(): bool { if (app(StandaloneRuntime::class)->enabled()) { diff --git a/config/standalone-runtime.php b/config/standalone-runtime.php index ef989fd..f2a2ecd 100644 --- a/config/standalone-runtime.php +++ b/config/standalone-runtime.php @@ -3,14 +3,17 @@ // Deployment settings only. No installation, feature or permission is enabled by default. return [ 'enabled' => env('COMPRAS_RUNTIME_ENABLED', false), + 'prepare_only' => env('COMPRAS_RUNTIME_PREPARE_ONLY', false), 'root' => env('COMPRAS_RUNTIME_ROOT'), 'manifest_sha256' => env('COMPRAS_RUNTIME_SHA256'), 'installation_id' => env('COMPRAS_RUNTIME_INSTALLATION_ID'), + 'synthetic_only' => env('COMPRAS_RUNTIME_SYNTHETIC_ONLY', true), 'features' => [ 'supplier-payables' => env('COMPRAS_SUPPLIER_PAYABLES_ENABLED', false), 'general-ledger' => env('COMPRAS_GENERAL_LEDGER_ENABLED', false), 'general-ledger-cycle' => env('COMPRAS_GENERAL_LEDGER_CYCLE_ENABLED', false), 'supplier-settlements' => env('COMPRAS_SUPPLIER_SETTLEMENTS_ENABLED', false), + 'finance-configuration' => env('COMPRAS_FINANCE_CONFIGURATION_ENABLED', false), 'budget-distributions' => env('COMPRAS_BUDGET_DISTRIBUTIONS_ENABLED', false), 'capital-register' => env('COMPRAS_CAPITAL_REGISTER_ENABLED', false), 'operational-orders' => env('COMPRAS_OPERATIONAL_ORDERS_ENABLED', false), diff --git a/docs/desenvolvimento.md b/docs/desenvolvimento.md index f046232..bbeb5c1 100644 --- a/docs/desenvolvimento.md +++ b/docs/desenvolvimento.md @@ -1,5 +1,29 @@ # Desenvolvimento do SGC +29/11/2026 — instalação no piloto expressamente autorizada e executada: runtime `80483320` em pasta privada própria, cinco migrações delimitadas e um recibo da instalação. Nova salvaguarda/restauro119tabelas,118tabelas de negócio e todas as colunas anteriores conservadas; histórico de migrações preservado. Transacção única ensaiada na cópia, bloqueio das escritas e recusa se houver diferença face à salvaguarda antes da alteração; repetição sem duplicação. Base/role temporárias removidas. Configuração activa, .env, manifesto e acessos preservados. Conferência readonly independente validou recibo/identidade não elevada, recusou UUID errado e conferiu24schemas; HTTP /avaliar200 e/login302. Novas capacidades continuam desligadas. Pré-conferência da activação passou em processo separado com PostgreSQL forçado a só leitura:24capacidades e185assets conferidos, sem publicação ou alteração activa. Activação e publicação da interface partilhada estão delimitadas em `compras-standalone-pilot-activation-proposal.json`, ainda por autorizar. Não repetir a instalação. Provas `compras-standalone-pilot-installation.json`, `compras-standalone-pilot-installation-check.json` e `compras-standalone-pilot-activation-preflight.json`; aplicação integral não declarada concluída. + +29/11/2026 — actualização privada autorizada: `php scripts/check-standalone-private-recovery.php --run-authorized-private-copy`. Confere hash da proposta/autorização, destino e runtime; snapshot readonly, salvaguarda fora do repositório, restauro sob identidade própria, comparação integral das colunas anteriores, cinco migrações delimitadas e preparação/repetição sem escrita adicional. Não serve a cópia por HTTP nem envia correio/jobs.119tabelas inicialmente idênticas e118tabelas de negócio conservadas; histórico de migrações preservado,24capacidades conferidas, base/role temporárias removidas. Prova `proofs/compras-standalone-pilot-recovery.json`; não equivale a instalação/activação do piloto. + +Candidata actual `80483320a54af6f1`: balancete e razão conservam o intervalo e a página na impressão, escondem controlos e distinguem linhas da página de totais do filtro. Dez testes integrados/218 asserções passaram; impressão real pré-visualizada numa folha e apresentação móvel390×526/100% conferida, sem impressão física. Configuração e menu móveis conferidos; aviso nativo de preparação pendente preservou texto ao cancelar a navegação. Limites restantes constam da prova operacional. + +### Reutilização explícita dos componentes existentes — QA + +`compras:runtime:prepare --reuse-components` pré-visualiza a reutilização dos perfis completos `budget-distributions-v1`, `supplier-settlements-v1` e `supplier-payables-v1`, pelas assinaturas de `StandaloneComponentSchema::SUPPORTED`. Acrescentar `--apply` executa a alteração aditiva. Colunas, constraints, índices, triggers e funções são conferidos novamente sob bloqueio. Sem a opção, componentes existentes continuam recusados; estruturas desconhecidas não são reparadas. O recibo conserva a selecção e os hashes. `--rebind` é uma operação separada. + +`node scripts/requisition-ledger-qa-check.mjs --standalone-upgrade-only`: três testes/169 asserções passaram, com pré-visualização sem escrita, aplicação única, repetição, conservação de todas as colunas anteriores e do pagamento parcial confirmado, reversão integral de falha intermédia e repetição segura. Base sintética e role removidos. Inventário estrutural readonly do piloto em `proofs/standalone-pilot-schema-inventory.json`; sem valores de negócio ou instalação. Tabelas preexistentes não autorizam marcar migrações antigas como executadas. Uma instalação real exige autorização própria e selecção exacta dos caminhos aplicáveis; não executar migração genérica sobre essas tabelas. + +## Candidata independente autorizada — 29/11/2026 + +Configuração financeira disponível em `/administracao/financeiro`, sob a capacidade opt-in `finance-configuration` e Administração da própria empresa. Cadastro explícito de identidades/competências, contasMZN, períodos e regras versionadas pelo writer comum; não concede funções por consulta nem cria operações financeiras. O menu Administração e a parametrização ligam ao cadastro; Finanças apresenta pagamentos/afectações e diário/balancete/razão apenas com capacidades e direitos próprios, com navegação integral para as páginas dos pacotes. Provas: PostgreSQL10/209, frontend473/93ficheiros e revisão real do cadastro/recarga/menu, com oito conjuntos financeiros/stock preservados. `--standalone-runtime-only --standalone-finance-preview` prepara exclusivamente uma revisão local sintética de20minutos, após arranque/restauro da candidata, com verificação final de conservação e remoção dos recursos próprios. Não usar esse runner no activo. + +Autorização e evidência em `proofs/compras-operational-candidate-authorization.json` e `proofs/compras-operational-candidate.json`. O empacotador `scripts/standalone-runtime-artifact.php` recebe `--financial-source` e `--output`, cria uma pasta/ZIP novos por hash e confere cada byte; nunca substitui pacotes instalados ou bundles congelados. A execução instalada permanece independente da pasta de desenvolvimento SGF. + +Procedimento preparado e exercitado exclusivamente em QA: extrair o ZIP conferido para uma pasta própria e definir `COMPRAS_RUNTIME_ROOT`, `COMPRAS_RUNTIME_SHA256` e `COMPRAS_RUNTIME_INSTALLATION_ID`. Durante a preparação de consola, usar `COMPRAS_RUNTIME_PREPARE_ONLY=true` e `COMPRAS_RUNTIME_ENABLED=false`: o carregador verifica o manifesto e todos os ficheiros antes de executar os quatro pacotes; a aplicação de negócio permanece desligada. Não seleccionar pacotes por caminhos avulsos para preparar a candidata. Conservar o bundle QA e a activação antiga de distribuições desligados. A base própria tem de possuir as migrações normais, com role PostgreSQL sem privilégios elevados. `PAYABLE_SOURCE_INSTANCE` identifica explicitamente as origens da instalação. Terminar o modo de preparação antes de qualquer arranque de negócio; a activação exige a autorização e configuração correspondentes. + +`compras:runtime:prepare --expected-database= --expected-role= --operator= --reason=` apresenta a pré-visualização. `--apply` executa a preparação explícita numa transacção; uma repetição válida não escreve outro recibo nem reinstala o schema. Não cria contas empresariais, permissões ou activação de módulos. A configuração opt-in de cada capacidade continua separada. Após restauro para outra base/role, a identidade antiga é recusada; com UUID novo, `--rebind --apply` verifica o schema e acrescenta um recibo, preservando dados e o recibo anterior. Nunca eliminar histórico para ultrapassar uma recusa de downgrade ou composição parcial. + +Estes comandos não foram executados no piloto/produção. Uma instalação real continua a exigir o destino exacto e a autorização própria com backup/restauro e validação. A candidata ainda conserva limites de referências/apresentação sintéticas a concluir, além dos percursos visuais já registados. As provas técnicas não encerram a aplicação. + 29/11/2026 — continuação para candidata operacional: interface integral466testes/92ficheiros aprovada. Conferidos por bytes68ficheiros dos dois runtimes congelados e184entradas da compilação99b07243. Inventariados27adaptadores e5migraçõesQA na proposta compras-operational-candidate-proposal.json, sem promoção, instalação ou activação executadas. Pedida decisão específica de promoção de contratos/artefactos porque a autorização anterior exclui publicação/instalação operacional. C2: confirmação antiga cancelada e preparação descartada com original preservado; nova tentativa, já comURL/identidade conferidos e observação conjunta, voltou a ser interrompida pela ferramenta no diálogo nativo. Não confirmar a decisão por outra interface nem declarar aprovação; frente visual parada, bases/roles removidos. Corrigidas24notas próprias e4rótulos documentais com acentos corrompidos, escritaUTF-8 e round-trip conferidos. A promoção aguarda resposta; aplicação integral não declarada concluída. 29/11/2026 — cancelamento C2 legado: a revisão nativa encontrou o ramo de documento incompleto sem estado/formulário operacional, apesar da autorização existente. Reposto o componente comum apenas com o DTO autorizado, preservando desconhecidos. Frontend18/2ficheiros, tipos/análise/build aprovados, manifesto99b07243/184entradas. Edge demonstrou pedido com fundamento/suporte, autor sem decisão e origem suspensa; Finanças independente recusou fundamento vazio e seleccionou Aprovar. Ao preencher motivo/accionar decisão, a ferramenta interrompeu o turno por não conseguir confirmar o URL; confirmação/aprovação final não observadas. Não repetir uma acção incerta. A conferência final não passou por faltar cancelamento aprovado. Base/roleQA removidos; separador/possível diálogo não puderam ser fechados. Retomar em nova composição isolada e confirmar decisão/conservação/móvel/impressão. Provas issued-order-cancellation.json/product-review-20261122.json; aplicação integral continua aberta. diff --git a/docs/matriz-sgc-reconciliada.md b/docs/matriz-sgc-reconciliada.md index b50153f..768e9da 100644 --- a/docs/matriz-sgc-reconciliada.md +++ b/docs/matriz-sgc-reconciliada.md @@ -1,5 +1,17 @@ # Matriz reconciliada do SGC — 03/11/2026 +29/11/2026 — instalação no piloto expressamente autorizada e executada: runtime `80483320` em pasta privada própria, cinco migrações delimitadas e um recibo da instalação. Nova salvaguarda/restauro119tabelas,118tabelas de negócio e todas as colunas anteriores conservadas; histórico de migrações preservado. Transacção única ensaiada na cópia, bloqueio das escritas e recusa se houver diferença face à salvaguarda antes da alteração; repetição sem duplicação. Base/role temporárias removidas. Configuração activa, .env, manifesto e acessos preservados. Conferência readonly independente validou recibo/identidade não elevada, recusou UUID errado e conferiu24schemas; HTTP /avaliar200 e/login302. Novas capacidades continuam desligadas. Pré-conferência da activação passou em processo separado com PostgreSQL forçado a só leitura:24capacidades e185assets conferidos, sem publicação ou alteração activa. Activação e publicação da interface partilhada estão delimitadas em `compras-standalone-pilot-activation-proposal.json`, ainda por autorizar. Não repetir a instalação. Provas `compras-standalone-pilot-installation.json`, `compras-standalone-pilot-installation-check.json` e `compras-standalone-pilot-activation-preflight.json`; aplicação integral não declarada concluída. + +29/11/2026 — candidata actual `80483320`, 67 ficheiros/68 entradas. Balancete/razão com impressão compacta, intervalo e paginação explícitos; Edge confirmou uma folha sem controlos de pesquisa e apresentação a390×526/100%. Configuração financeira móvel legível, atalhos em linhas e salto ao plano abaixo do cabeçalho; ligação visível do menu abriu o diário. Comando AX anterior atingiu rodapé porque a ligação estava fora da área visível; sessão e destino correcto conferidos, sem alterar código por inferência. Aviso nativo de saída conservou o fundamento ao cancelar e deixou de aparecer após limpar o rascunho. Dez testes integrados/218 asserções, Pint e PHPStan passaram. Ensaio privado expressamente autorizado: restauro idêntico de119tabelas,118tabelas de negócio conservadas após cinco migrações delimitadas, histórico das migrações preservado,24capacidades verificadas e um recibo/repetição sem escrita. Bases/roles temporárias removidas, salvaguarda privada preservada; origem, permissões, configuração e assets activos intactos. Provas `compras-operational-candidate.json` e `compras-standalone-pilot-recovery.json`. Instalação/activação do piloto e aceitação integral continuam por autorizar/verificar. + +29/11/2026 — continuidade financeira da candidata: corrigida a recarga automática dos ecrãs comuns de pagamentos/diário que podia apagar a preparação de outro formulário. No modo autónomo, operação concluída conserva as outras preparações e oferece actualização explícita; saída avisa apenas quando há alterações, falha de rede conserva valores/UUID e submissão pendente não cria outra chamada. Sem armazenamento persistente novo no navegador. Dez testes executam os scripts do ZIP realmente extraído; comportamento QA anterior preservado. Novo manifesto `106ab6bd9d0e4cb9721ba02200dd4207100d7c4845653f920faa866dcbbcc07b`,67ficheiros/68entradas. Arranque/restauro/recusas passaram; duas rondas com dois processos PHP independentes confirmam uma conta/comando/evento/auditoria, repetição segura ou recusa da preparação desactualizada, oito conjuntos financeiros/stock intactos e nenhuma concessão automática. Negócio PostgreSQL10/209 e PHPStan aprovados; bases/roles removidos. Revisão nativa deste delta continua separada. Prova `proofs/compras-operational-candidate.json`. + +29/11/2026 — C2 confirmado após acção manual do proprietário («ja feito»): estado Aprovado visível com Finanças independente; worker em transacção somente leitura passou, conservando a ordem emitida integral, os valores/relações de15conjuntos, uma solicitação/uma decisão e respectivas auditorias. Estado operacional cancelado e apenas a requisição de origem cancelada; sem reversão financeira fictícia no original legado não controlado. Base/roleQA removidos. A confirmação final deixou de estar pendente; móvel/impressão e fecho do separador continuam sem nova prova, porque o controlo da janela devolveu geometria indisponível em duas tentativas. Prova `proofs/product-review-20261122.json`, secção `native_cancellation_manual_review_pending_20261129`, agora verificada. + +29/11/2026 — delta verificado da candidata autorizada: 24 capacidades, quatro pacotes, 67 ficheiros/68 entradas ZIP, manifesto `c6e458cb9d8b5eb6db9e5729706b1d32cd12291dd4a733e3ab893e95cd33252f`. Preparação exclusiva de consola verifica os bytes antes do carregamento; arranque/restauro/recusas e preservação aprovados. Configuração financeira pela empresa e menus condicionados aos direitos explícitos: PostgreSQL10/209, frontend integral473/93ficheiros, tipos/PHPStan/Pint aprovados. O ciclo real de reconhecimento/diário utiliza o cadastro de acessos, contas, período e regra pelo serviço da empresa. Navegador: conta fictícia registada, formulário limpo, recarga persistente e entrada Administração conferidos; oito conjuntos financeiros/stock intactos e bases/roles removidos. Ajuda específica acrescentada após a observação. Prova `proofs/compras-operational-candidate.json`. C2 continua sem decisão nativa confirmada; interrupção da ferramenta não foi contornada. Instalação/activação no piloto e aceitação integral permanecem separadas. + +29/11/2026 — delta da promoção expressamente autorizada: candidata independente com 23 capacidades opt-in e quatro pacotes comuns verificados, ZIP de 67 entradas, sem instalação/activação no piloto. Registo próprio da instalação, contratos/schema/dependências, recusa de runtime antigo e classe estrangeira, migrações aditivas com definição única e CLI nominativa com pré-visualização/repetição/restauro. Negócio na candidata: PostgreSQL 7 testes/102 asserções, incluindo conta por linha, reserva revista, expiração nativa, recusa de escrita sem direitos, diário equilibrado com contas configuradas, imputação explícita de 40 MZN em 15+25 e pagamento único de 70 MZN repartido por duas facturas em 30+40. Auditoria/expense SQLite19/653 e frontend4 aprovados; PostgreSQL de auditoria e nova conferência do ZIP em curso. Referência: `proofs/compras-operational-candidate.json`. Preservar os limites históricos; a promoção não encerra as referências sintéticas, revisão visual restante, C2 nem a aplicação integral. + 29/11/2026 — continuação para candidata operacional: interface integral466testes/92ficheiros aprovada. Conferidos por bytes68ficheiros dos dois runtimes congelados e184entradas da compilação99b07243. Inventariados27adaptadores e5migraçõesQA na proposta compras-operational-candidate-proposal.json, sem promoção, instalação ou activação executadas. Pedida decisão específica de promoção de contratos/artefactos porque a autorização anterior exclui publicação/instalação operacional. C2: confirmação antiga cancelada e preparação descartada com original preservado; nova tentativa, já comURL/identidade conferidos e observação conjunta, voltou a ser interrompida pela ferramenta no diálogo nativo. Não confirmar a decisão por outra interface nem declarar aprovação; frente visual parada, bases/roles removidos. Corrigidas24notas próprias e4rótulos documentais com acentos corrompidos, escritaUTF-8 e round-trip conferidos. A promoção aguarda resposta; aplicação integral não declarada concluída. 29/11/2026 — cancelamento C2 legado: a revisão nativa encontrou o ramo de documento incompleto sem estado/formulário operacional, apesar da autorização existente. Reposto o componente comum apenas com o DTO autorizado, preservando desconhecidos. Frontend18/2ficheiros, tipos/análise/build aprovados, manifesto99b07243/184entradas. Edge demonstrou pedido com fundamento/suporte, autor sem decisão e origem suspensa; Finanças independente recusou fundamento vazio e seleccionou Aprovar. Ao preencher motivo/accionar decisão, a ferramenta interrompeu o turno por não conseguir confirmar o URL; confirmação/aprovação final não observadas. Não repetir uma acção incerta. A conferência final não passou por faltar cancelamento aprovado. Base/roleQA removidos; separador/possível diálogo não puderam ser fechados. Retomar em nova composição isolada e confirmar decisão/conservação/móvel/impressão. Provas issued-order-cancellation.json/product-review-20261122.json; aplicação integral continua aberta. diff --git a/docs/orientacoes-continuidade.md b/docs/orientacoes-continuidade.md index 79b64a9..e904636 100644 --- a/docs/orientacoes-continuidade.md +++ b/docs/orientacoes-continuidade.md @@ -1,5 +1,17 @@ # Continuidade do desenvolvimento do SGC +29/11/2026 — instalação no piloto expressamente autorizada e executada: runtime `80483320` em pasta privada própria, cinco migrações delimitadas e um recibo da instalação. Nova salvaguarda/restauro119tabelas,118tabelas de negócio e todas as colunas anteriores conservadas; histórico de migrações preservado. Transacção única ensaiada na cópia, bloqueio das escritas e recusa se houver diferença face à salvaguarda antes da alteração; repetição sem duplicação. Base/role temporárias removidas. Configuração activa, .env, manifesto e acessos preservados. Conferência readonly independente validou recibo/identidade não elevada, recusou UUID errado e conferiu24schemas; HTTP /avaliar200 e/login302. Novas capacidades continuam desligadas. Pré-conferência da activação passou em processo separado com PostgreSQL forçado a só leitura:24capacidades e185assets conferidos, sem publicação ou alteração activa. Activação e publicação da interface partilhada estão delimitadas em `compras-standalone-pilot-activation-proposal.json`, ainda por autorizar. Não repetir a instalação. Provas `compras-standalone-pilot-installation.json`, `compras-standalone-pilot-installation-check.json` e `compras-standalone-pilot-activation-preflight.json`; aplicação integral não declarada concluída. + +29/11/2026 — candidata actual `80483320`, 67 ficheiros/68 entradas. Balancete/razão com impressão compacta, intervalo e paginação explícitos; Edge confirmou uma folha sem controlos de pesquisa e apresentação a390×526/100%. Configuração financeira móvel legível, atalhos em linhas e salto ao plano abaixo do cabeçalho; ligação visível do menu abriu o diário. Comando AX anterior atingiu rodapé porque a ligação estava fora da área visível; sessão e destino correcto conferidos, sem alterar código por inferência. Aviso nativo de saída conservou o fundamento ao cancelar e deixou de aparecer após limpar o rascunho. Dez testes integrados/218 asserções, Pint e PHPStan passaram. Ensaio privado expressamente autorizado: restauro idêntico de119tabelas,118tabelas de negócio conservadas após cinco migrações delimitadas, histórico das migrações preservado,24capacidades verificadas e um recibo/repetição sem escrita. Bases/roles temporárias removidas, salvaguarda privada preservada; origem, permissões, configuração e assets activos intactos. Provas `compras-operational-candidate.json` e `compras-standalone-pilot-recovery.json`. Instalação/activação do piloto e aceitação integral continuam por autorizar/verificar. + +29/11/2026 — candidata actual `106ab6bd`,67ficheiros/68entradas, substitui apenas a selecção de testes, sem sobrescrever pacotes anteriores. Corrigida perda das outras preparações por recarga após sucesso nos ecrãs comuns de pagamentos/diário. Protecção de saída por alterações, conservação do UUID após resultado desconhecido, bloqueio de submissão simultânea e botão de actualização explícita quando há outro rascunho; sem localStorage/sessionStorage novos. Dez testes dos scripts do ZIP extraído passaram. Arranque/restauro/recusas passaram com24capacidades; duas corridas reais com dois processos: mesma chave guarda uma vez/repetição, chaves diferentes sobre a mesma base guardam uma vez/recusam a segunda preparação. Uma conta/comando/evento/auditoria por ronda, oito conjuntos protegidos conservados e zero concessões. PostgreSQL10/209 e PHPStan passaram; recursosQA removidos. Confirmar visualmente este delta quando a geometria do Edge estiver recuperada; pedida apenas restauração/maximização da janela, não nova decisãoC2. A resposta «ja feito» já encerrou a confirmaçãoC2 e não deve ser pedida outra vez. + +29/11/2026 — proprietário executou a confirmação nativa C2 e respondeu «ja feito». Aprovado observado emQAa14258b549a5 com Finanças independente; conferência final passou: ordem emitida original imutável, estado operacional cancelado, apenas requisição de origem cancelada,15conjuntos protegidos intactos e uma auditoria de pedido/uma de aprovação. Sem criar reversão fictícia para a origem legada explicitamente não controlada. Base/role removidos; não pedir nem executar novamente esta confirmação. A ligação de origem não pôde ser accionada: duas respostas de geometria indisponível após recuperação da janela; parar essa frente. Móvel/impressão e fecho do separador ainda não demonstrados. Prova `product-review-20261122.json`; os parágrafos abaixo sobre a confirmação pendente são históricos, não reabrem a validação já recebida. + +29/11/2026 — estado seguinte verificado: a promoção autorizada já tem 24 capacidades e ZIP de 68 entradas, manifesto `c6e458cb9d8b5eb6db9e5729706b1d32cd12291dd4a733e3ab893e95cd33252f`. A referência anterior a21capacidades é histórica. Modo `COMPRAS_RUNTIME_PREPARE_ONLY` exclusivo da consola confere todo o pacote antes de o executar, mantendo negócio desligado; arranque/restauro/recusas aprovados. Configuração financeira própria: Admin escolhe pessoa/competências, contas, períodos sem sobreposição e versões de regras; preserva competências de outros contratos e não lança valores. Menus novos de pagamentos/afectações, diário/balancete/razão e configuração dependem das capacidades e direitos; páginas comuns usam navegação integral. PostgreSQL10/209 inclui configuração pelo serviço no ciclo financeiro, HTTP, âmbito estrangeiro, repetição, preparação desactualizada e revogação. Frontend integral473/93, tipos e PHPStan aprovados. Revisão real Edge sobre candidata extraída: cadastro da conta sintéticaQA-FIN-320, limpeza após sucesso, persistência após recarga e menu Administração; oito conjuntos financeiros/stock preservados, base/role original e restaurados removidos. Ajuda financeira específica acrescentada após detectar uma remissão indevida para auditoria. Nenhuma concessão ou instalação real. + +Última tentativa C2: composiçãoQA3f41b9c4c6e6 criou pedido por autor e preparou Aprovar/fundamento com Finanças independente; ferramenta voltou a interromper no diálogo por não confirmar oURL. A conferência final recusou a ausência de decisão aprovada; não é perda do original nem prova de aprovação. Base/role removidos. O diálogo foi depois cancelado e o separadorQA fechado sem submissão; separador original conservado. Não repetir automaticamente a mesma frente nem executar a decisão por outra interface. A confirmação nativa final precisa de intervenção manual numa composição nova. Formalização de Pessoas continua adiada por decisão expressa; revisão visual/impressão restante e autorização própria de instalação/activação mantêm-se abertas. + 29/11/2026 — promoção autorizada por «autorizo», conforme `compras-operational-candidate-authorization.json`; a proposta anterior já não aguarda essa decisão. Candidata independente `afe98e1e`, 66 ficheiros, 21 capacidades opt-in, hashes verificados antes do carregamento, identidade própria da instalação/base/role e schema conferidos. Arranque e restauro em PostgreSQL fora de `testing`, com nomes próprios: projecto criado/repetido/arquivado, plano de contas próprio, consulta contabilística com direitos sintéticos explícitos, seis conjuntos financeiros/stock preservados, três recusas de mutação do recibo e cinco recusas de composição inválida. Restauro conserva 14 conjuntos de dados/relações e o recibo antigo; requer vínculo novo explícito. Bases/roles originais e restaurados removidos. Definições de schema únicas entre QA e instalação; guardas e bundles congelados preservados. Fundamentos45/159, regressão inicial87/1466; ordens13/497 após repor a indicação de controlo das parcelas na impressão. A promoção continua em execução: regressões de negócio, composição financeira restante, procedimento distribuível e percursos nativos pendentes. Não equivale a instalação/activação no piloto, alteração operacional SGF ou conclusão integral. Prova `compras-operational-candidate.json`. 29/11/2026 — continuação para candidata operacional: interface integral466testes/92ficheiros aprovada. Conferidos por bytes68ficheiros dos dois runtimes congelados e184entradas da compilação99b07243. Inventariados27adaptadores e5migraçõesQA na proposta compras-operational-candidate-proposal.json, sem promoção, instalação ou activação executadas. Pedida decisão específica de promoção de contratos/artefactos porque a autorização anterior exclui publicação/instalação operacional. C2: confirmação antiga cancelada e preparação descartada com original preservado; nova tentativa, já comURL/identidade conferidos e observação conjunta, voltou a ser interrompida pela ferramenta no diálogo nativo. Não confirmar a decisão por outra interface nem declarar aprovação; frente visual parada, bases/roles removidos. Corrigidas24notas próprias e4rótulos documentais com acentos corrompidos, escritaUTF-8 e round-trip conferidos. A promoção aguarda resposta; aplicação integral não declarada concluída. diff --git a/docs/proofs/compras-operational-candidate.json b/docs/proofs/compras-operational-candidate.json index b14c63e..fe0161b 100644 --- a/docs/proofs/compras-operational-candidate.json +++ b/docs/proofs/compras-operational-candidate.json @@ -1,30 +1,73 @@ { "date": "2026-11-29", - "state": "in_progress_not_installed_or_activated", + "state": "pilot_schema_and_runtime_installed_new_capabilities_not_activated", "authorization": "compras-operational-candidate-authorization.json", "artifact": { - "root": "storage/framework/testing/compras-standalone-afe98e1ede5b9b4b", + "root": "storage/framework/testing/compras-standalone-80483320a54af6f1", "contract": "COMPRAS-STANDALONE-v1", - "manifest_sha256": "afe98e1ede5b9b4b184fb99f613d264a471d6b2eb4d29566377db7f824dd58a4", - "files": 66, - "packages": ["budget-control", "purchasing", "payables", "general-ledger"] + "manifest_sha256": "80483320a54af6f123498e43c1435a20922455f65860be88bd259e90efcbc0b7", + "files": 67, + "packages": [ + "budget-control", + "purchasing", + "payables", + "general-ledger" + ], + "archive": "storage/framework/testing/compras-standalone-80483320a54af6f1.zip", + "archive_sha256": "bbc1d953061d5a297d4336a3cb746a11af5d6930c6fc7d0b5d64b5bff3046e76", + "archive_entries": 68 }, "implemented": [ "Pinned complete inventory before executable loading; explicit own installation identity and non-elevated PostgreSQL role", "Opt-in features disabled by default; schema, dependency, loaded package and financial contract checks", "Immutable installation receipts; single schema definitions reused by guarded QA and explicit standalone migration path", "Canonical ledger host-verified schema installer retains the original guarded QA entry point", - "21 module adapters retain current permissions, history and single financial writer; account submission fails closed" + "24 opt-in module adapters retain current permissions, history and single financial writer; explicit account submission fails closed", + "Named installation CLI previews by default, refuses a wrong database/role, applies atomically and repeats without new writes; explicit rebind preserves old receipts", + "Versioned host journal policy uses explicitly configured own chart accounts, preserving the old QA policy and all balance/source/independence constraints", + "Common original confirmed payment allocations connect to explicit Finance category attribution, without copying native payments; same numeric identifiers remain separated by source kind", + "One common payment allocated across invoices is counted once while documentary monetary portions are summed exactly; pending or reversed allocations remain visibly indeterminate", + "Private audit includes common settlement and ledger-cycle datasets with own tenant/company/unit scope; bank reference fields and full snapshots remain outside the settlement payment projection", + "Explicit host settlement reference policy keeps legacy SIM behaviour and synthetic provenance as independent concerns", + "Ledger host forms select configured periods and rules without fixed demo dates or values; configured correction reverses original accounts and amounts exactly", + "Fresh native document snapshots use declared data classification, defaulting to synthetic; historical snapshots are never rewritten", + "Console-only explicit preparation mode validates every candidate byte before loading executable code while keeping business capabilities disabled", + "Own company administrator UI for explicit financial person/access assignments, append-only chart and periods, versioned rules and bounded configuration history; no posting or automatic grant from reading", + "Permission-aware main menu links for common payments and ledger workspace, with full navigation for package HTML; administrator configuration link and specific journey guide", + "Host financial forms preserve other pending preparations after success, warn before leaving edited forms, retain command identity after unknown results and reject concurrent duplicate submits; no browser storage introduced" ], "verification": { - "foundation_and_actual_payables_schema": {"tests": 45, "assertions": 159, "result": "passed"}, - "initial_module_regression_sqlite": {"tests": 87, "assertions": 1466, "result": "passed"}, - "import_expense_regression_sqlite": {"tests": 78, "passed": 39, "skipped_optional_runtime": 39, "assertions": 395}, - "frozen_integrated_before_print_fix": {"tests": 50, "passed": 49, "assertions": 1600, "failed": 1, "cause": "Missing consolidated-order budget confirmation text; fixed without weakening its assertion"}, - "frozen_orders_after_print_fix": {"tests": 13, "assertions": 497, "result": "passed"}, + "foundation_and_actual_payables_schema": { + "tests": 46, + "assertions": 164, + "result": "passed" + }, + "initial_module_regression_sqlite": { + "tests": 87, + "assertions": 1466, + "result": "passed" + }, + "import_expense_regression_sqlite": { + "tests": 78, + "passed": 39, + "skipped_optional_runtime": 39, + "assertions": 395 + }, + "frozen_integrated_before_print_fix": { + "tests": 50, + "passed": 49, + "assertions": 1600, + "failed": 1, + "cause": "Missing consolidated-order budget confirmation text; fixed without weakening its assertion" + }, + "frozen_orders_after_print_fix": { + "tests": 13, + "assertions": 497, + "result": "passed" + }, "standalone_postgresql_startup_and_recovery": { "result": "passed", - "available_modules": 21, + "available_modules": 24, "environment": "standalone-qa; outside testing/payable-testing", "own_disposable_database_and_role_names": true, "project_create_replay_archive_history": true, @@ -32,22 +75,264 @@ "private_audit_authority_not_inherited": true, "financial_and_stock_frames_preserved": 6, "immutable_installation_checks": 3, - "rejected": ["foreign loaded package", "wrong pin", "missing dependency", "older incomplete package", "restored database with old binding"], + "rejected": [ + "foreign loaded package", + "wrong pin", + "missing dependency", + "older incomplete package", + "restored database with old binding", + "wrong preparation pin before package loading" + ], "restored_originals_and_relations": "14 table frames verified before new synthetic operations", "explicit_new_binding_preserves_old_receipt": true, - "original_and_restored_databases_roles_removed": true + "original_and_restored_databases_roles_removed": true, + "cli": "preview, wrong destination refusal, atomic prepare, repeated prepare without new writes, explicit recovery rebind", + "unverified_ledger_host_checks": 2, + "note": "Latest extracted 106ab6bd archive passed startup/recovery and invalid composition refusals, after host financial preparation changes" }, - "static_analysis": "focused PHPStan and Pint passed", - "counts_overlap_do_not_sum": true + "static_analysis": "Full PHPStan passed; focused Pint passed", + "counts_overlap_do_not_sum": true, + "standalone_business_postgresql": { + "tests": 10, + "assertions": 209, + "result": "passed", + "cases": [ + "explicit line accounts and replay", + "revised budget cycle without rewriting history", + "native expiry returns same request and preserves prior decisions before fresh submission", + "HTTP financial reads, write denial and disabled module denial", + "one balanced independently reviewed journal with configured accounts and immediate PostgreSQL constraint validation", + "40 MZN partial payment with 15+25 category attribution and preserved reversal history", + "one 70 MZN payment across two invoices with 30+40 documentary portions and no duplicate count", + "Explicit configured correction rules; incorrect inverse mapping refused without proposals", + "Injected interruption after first correction journal rolls back the pair; retry applies exactly once", + "Original source journal retained and unchanged principal; independent period review and idempotent closure", + "Ordinary documentary payment references accepted by host contract while legacy SIM contract still rejects them; QA source remains marked synthetic", + "Administrator-only explicit financial access, stale basis refusal, idempotence and revocation after role removal", + "Own chart unique codes, non-overlapping periods and rule versioning; no journals/payments/stock from configuration; real configuration page DTO", + "Configuration HTTP foreign target and identity contract refusals; unknown grants preserved; stale Inertia preparation has inline errors", + "Server shared menu capabilities distinguish no grant, explicit reader, administrator setup and disabled module; full financial cycle consumes company setup writer" + ], + "runtime_manifest_sha256": "106ab6bd9d0e4cb9721ba02200dd4207100d7c4845653f920faa866dcbbcc07b" + }, + "audit_and_expense_regression_sqlite": { + "tests": 19, + "assertions": 653, + "result": "passed" + }, + "expense_frontend": { + "files": 1, + "tests": 4, + "result": "passed", + "types": "passed" + }, + "installed_runtime_integrity": { + "files": 18, + "result": "passed", + "sgf_folder_dependency": false + }, + "private_audit_postgresql": { + "tests": 19, + "assertions": 584, + "result": "passed", + "scope": "Own company/unit; common settlement outbox; bank reference omission" + }, + "expense_and_purchase_frontend": { + "files": 2, + "tests": 17, + "result": "passed", + "types": "passed" + }, + "frontend_private_build": { + "root": "storage/framework/testing/sgc-standalone-finance-help-qa-20261129", + "state": "passed", + "modules": 2482, + "manifest_sha256": "8653c147ab863447b523ddc03111265e3e6510bdddc31341777d6a3bdc46ce5b" + }, + "finance_configuration_frontend": { + "tests": 3, + "result": "passed", + "types": "passed", + "lint": "passed", + "format": "passed" + }, + "frontend_complete_regression": { + "tests": 473, + "files": 93, + "result": "passed", + "types": "passed" + }, + "finance_configuration_native": { + "build_manifest_sha256": "d9787e59a8eeb53a1b92a3ecfd862720966751098d1b8165920a5b0c134cb35d", + "runtime_manifest_sha256": "c6e458cb9d8b5eb6db9e5729706b1d32cd12291dd4a733e3ab893e95cd33252f", + "environment": "own loopback standalone-qa installation; extracted ZIP", + "account_created": "QA-FIN-320; entirely synthetic", + "form_cleared_after_success": true, + "reload_preserves_original": true, + "administration_menu_entry_observed": true, + "protected_financial_stock_frames": 8, + "no_initial_financial_grants": true, + "original_and_restored_database_roles_removed": true, + "own_browser_tab_closed": true, + "original_browser_tab_preserved": true, + "limitation": "Desktop account/menu delta only; help correction subsequently covered by the full frontend suite, not re-observed in this build" + }, + "native_cancellation_manual_followup": { + "result": "passed", + "owner_response": "ja feito", + "visible_approved_status": true, + "protected_frames_preserved": 15, + "original_order_preserved": true, + "one_request_one_decision": true, + "synthetic_only": true, + "database_role_removed": true, + "reference": "product-review-20261122.json#native_cancellation_manual_review_pending_20261129" + }, + "standalone_configuration_concurrency": { + "result": "passed", + "runtime_manifest_sha256": "106ab6bd9d0e4cb9721ba02200dd4207100d7c4845653f920faa866dcbbcc07b", + "actual_independent_php_processes": 2, + "rounds": 2, + "same_operation": "one saved, one replayed", + "different_operations_same_basis": "one saved, one stale refusal", + "per_round": "one own account, command, common event and native audit", + "protected_financial_stock_frames": 8, + "no_automatic_grants": true, + "original_and_restored_database_roles_removed": true + }, + "host_financial_preparation_scripts": { + "tests": 10, + "result": "passed from the verified extracted 106ab6bd ZIP", + "cases": [ + "clean/edit/revert departure", + "successful one-form command preserves the other draft", + "network failure retains values and exact command identity", + "pending submit does not start second request", + "legacy mode retains refresh behaviour" + ], + "does_not_imply_native_visual_acceptance": true + }, + "canonical_component_upgrade_postgresql": { + "result": "passed", + "tests": 3, + "assertions": 169, + "command": "node scripts/requisition-ledger-qa-check.mjs --standalone-upgrade-only", + "cli_preview_apply_replay": true, + "original_columns_preserved": true, + "synthetic_invoice_minor": 6000, + "confirmed_payment_minor": 4000, + "remaining_balance_minor": 2000, + "currency": "MZN", + "partial_or_modified_components_refused": true, + "mid_upgrade_failure_rolled_back": true, + "isolated_database_and_role_removed": true, + "pilot_writes": false, + "metadata_inventory": "standalone-pilot-schema-inventory.json" + }, + "native_finance_desktop_20261129": { + "result": "observed", + "runtime_manifest": "106ab6bd9d0e4cb9721ba02200dd4207100d7c4845653f920faa866dcbbcc07b", + "build_manifest": "8653c147ab863447b523ddc03111265e3e6510bdddc31341777d6a3bdc46ce5b", + "observed": [ + "Own disposable QA administrator explicitly saved synthetic financial identity and selected rights", + "Finan?as menu displayed payment and ledger destinations", + "Ledger workspace loaded with empty own configured periods and sources", + "Trial balance displayed inclusive dates, zero accounts and explicit no-postings message" + ], + "protected_frames_preserved": 8, + "isolated_original_and_restored_resources_removed": true, + "owned_qa_tab_closed": true, + "original_public_tab_preserved": true, + "limits": [ + "Desktop only", + "No native financial posting performed", + "Dirty-form guard not exercised natively in this pass" + ] + }, + "native_finance_preparation_guard_20261129": { + "runtime_manifest": "106ab6bd9d0e4cb9721ba02200dd4207100d7c4845653f920faa866dcbbcc07b", + "edited_reason_triggered_native_beforeunload": true, + "escape_cancelled_navigation_and_preserved_exact_text": true, + "cleared_reason_allowed_report_navigation_without_warning": true, + "protected_frames_preserved": 8, + "original_and_restored_resources_removed": true, + "qa_tab_closed_original_preserved": true, + "limits": [ + "Success retaining another preparation remains verified by executable script tests only" + ] + }, + "native_report_print_review_20261129": { + "before_change": "Native preview loaded and exposed excessive spacing and interactive search controls across two sheets; cancelled without printing", + "change": "Compact print style hides controls and navigation, retains date interval, page count, row count, full-filter totals distinction and basis; narrower screen spacing and contained tables", + "candidate_manifest": "80483320a54af6f123498e43c1435a20922455f65860be88bd259e90efcbc0b7", + "new_native_review": "Verified after window state changed: one sheet, interval and page context, readable totals and basis; no search controls. Cancelled without physical printing.", + "startup_recovery_and_concurrency": "passed on new candidate", + "protected_frames": 8, + "temporary_resources_removed": true, + "physical_printing": false, + "mobile_review": "390x526 at 100 percent: report title, date filters, totals and empty state fit; table horizontal movement remains within its region. Own financial configuration links wrap, account form uses one column, anchor lands below the header. Visible mobile finance link opens ledger by full-page navigation.", + "input_diagnostic": "An initial AX click on an offscreen mobile link reached the footer home link. Session was preserved; scrolling the menu and clicking the visible ledger link confirmed the correct destination. No product defect inferred.", + "owned_tools_tab_closed_original_dashboard_preserved": true + }, + "standalone_business_latest": { + "tests": 10, + "assertions": 218, + "result": "passed", + "runtime_manifest": "80483320a54af6f123498e43c1435a20922455f65860be88bd259e90efcbc0b7", + "includes_applied_journal_trial_balance_and_account_ledger_print_context": true, + "owned_database_role_removed": true + }, + "private_pilot_restored_copy": { + "authorization": "compras-standalone-pilot-recovery-authorization.json", + "proof": "compras-standalone-pilot-recovery.json", + "result": "passed", + "source_tables_restored_identically": 119, + "original_business_tables_preserved": 118, + "historical_migrations_preserved": true, + "selected_additive_migrations": 5, + "available_modules": 24, + "one_receipt_and_safe_replay": true, + "source_writes": false, + "temporary_resources_removed": true + }, + "pilot_installation": { + "authorization": "compras-standalone-pilot-installation-authorization.json", + "proof": "compras-standalone-pilot-installation.json", + "read_only_check": "compras-standalone-pilot-installation-check.json", + "result": "passed", + "original_business_tables_preserved": 118, + "selected_migrations": 5, + "one_receipt_safe_replay": true, + "active_settings_env_and_asset_manifest_preserved": true, + "temporary_resources_removed": true, + "http": { + "/avaliar": 200, + "/login": 302 + }, + "new_capability_activation": false + }, + "pilot_activation_preflight": { + "reference": "compras-standalone-pilot-activation-preflight.json", + "database_enforced_read_only": true, + "capabilities_started": 24, + "frontend_files_verified": 185, + "active_changes": false, + "activation_authorized": false + } }, "remaining": [ - "Complete standalone business regressions and remaining financial composition paths", - "Distributable installation procedure", - "Remaining native visual/print journeys in the existing matrix; C2 final confirmation remains unconfirmed" + "Remaining native visual/print journeys and whole application acceptance; final C2 decision and conservation already verified", + "New capability activation in the pilot requires its own concrete authorization; schema/runtime installation is now authorized, executed and verified", + "Production publication/installation not authorized" ], - "frozen_manifests_preserved": ["182e10ceec556e120ecb14b57d17f0132ce0b555041cb054cdf9d17bcc1d51df", "fe1dec59a6d619670e887fd2f972a6de176b858a90f03cf43a017c681606816a"], - "pilot_or_production_installation": false, + "frozen_manifests_preserved": [ + "182e10ceec556e120ecb14b57d17f0132ce0b555041cb054cdf9d17bcc1d51df", + "fe1dec59a6d619670e887fd2f972a6de176b858a90f03cf43a017c681606816a" + ], + "pilot_or_production_installation": true, "pilot_or_production_activation": false, "sgf_operational_changes": false, - "application_complete": false + "application_complete": false, + "pilot_installation": true, + "production_installation": false } diff --git a/docs/proofs/compras-standalone-pilot-activation-authorization.json b/docs/proofs/compras-standalone-pilot-activation-authorization.json new file mode 100644 index 0000000..2c9ecd8 --- /dev/null +++ b/docs/proofs/compras-standalone-pilot-activation-authorization.json @@ -0,0 +1,11 @@ +{ + "date": "2026-11-29", + "state": "approved", + "decision": "aautorizo", + "proposal": "compras-standalone-pilot-activation-proposal.json", + "proposal_sha256": "cefcc1bcde848e13831404c114aec98e1a167a1ca3614e19e38a60761bdb1709", + "scope": "pilot_24_module_activation_and_shared_frontend_assets", + "new_grants_or_users": false, + "new_business_operations": false, + "public_domain_runtime_activation": false +} diff --git a/docs/proofs/compras-standalone-pilot-activation-preflight.json b/docs/proofs/compras-standalone-pilot-activation-preflight.json new file mode 100644 index 0000000..8f39061 --- /dev/null +++ b/docs/proofs/compras-standalone-pilot-activation-preflight.json @@ -0,0 +1,11 @@ +{ + "date": "2026-11-29T13:58:13+00:00", + "state": "passed", + "database_enforced_read_only": true, + "all_24_capabilities_start_with_pinned_installed_packages": true, + "source_instance_preserved": true, + "frontend_assets_verified": 185, + "active_settings_changed": false, + "assets_published": false, + "new_grants_or_business_commands": false +} diff --git a/docs/proofs/compras-standalone-pilot-activation-proposal.json b/docs/proofs/compras-standalone-pilot-activation-proposal.json new file mode 100644 index 0000000..a2ee473 --- /dev/null +++ b/docs/proofs/compras-standalone-pilot-activation-proposal.json @@ -0,0 +1,291 @@ +{ + "date": "2026-11-29", + "state": "prepared_not_authorized_or_executed", + "scope": "pilot_24_module_activation_and_shared_frontend_assets", + "decision": "Autorizar activar as 24 capacidades já instaladas no piloto e publicar a compilação de interface conferida. Não conceder competências, configurar políticas empresariais ou executar operações de negócio.", + "important_shared_frontend_impact": "O manifesto public/build é partilhado com o domínio público da aplicação. A nova compilação também será entregue nesse domínio, mantendo os acessos e flags próprios do respectivo ambiente. Não activar aí o runtime nem novas capacidades. Esta publicação da interface requer autorização expressa; não está incluída na autorização de instalação anterior.", + "origin_of_required_decision": "A autorização anterior exclui expressamente activação, configuração activa e substituição de assets; AGENTS.md secção 6.", + "pilot_data_classification": "Conservar o âmbito de ensaio do piloto para novas operações, declaradas sintéticas. Não reescrever a classificação, snapshots ou história dos documentos anteriores.", + "procedure": [ + "Conferir novamente o recibo, a identidade da base, o schema, o runtime e os hashes dos ficheiros/configuração indicados; recusar deriva.", + "Preservar configuração e manifesto anteriores em pasta privada. Conferir os 185 assets da candidata; acrescentar apenas ficheiros novos ou já idênticos, sem sobrescrever chunks divergentes. Trocar o manifesto apenas após a conferência integral.", + "Alterar apenas as chaves proposed_runtime_settings na configuração privada do piloto, preservando a origem financeira PAYABLE_SOURCE_INSTANCE e todas as demais chaves. Não alterar .env ou configuração do domínio público.", + "Conferir arranque, menus por perfil, recusas de acesso, ausência de concessões automáticas e conservação dos dados; sem novas operações empresariais." + ], + "recovery": "Se o arranque/compatibilidade falhar, repor apenas as chaves de configuração e o manifesto anteriores a partir das cópias privadas, após conferir que não houve edição concorrente. Manter o schema aditivo e o histórico; não efectuar downgrade ou sobrescrever a base. Conservar os chunks anteriores para o restauro do manifesto.", + "excluded": [ + "Activar o runtime ou novas capacidades no domínio público/produção", + "Conceder acessos, criar pessoas, contas, regras, políticas fiscais ou parâmetros empresariais", + "MFA, geografia operacional G3, envio SGF, fiscalidade/bancos/JUE e formalização de Pessoas", + "Novas migrações, operações empresariais ou alterações operacionais ao SGF" + ], + "target": "http://127.0.0.1:8005", + "installation_proof": "compras-standalone-pilot-installation.json", + "installation_id": "0602a856-0413-480f-9ef3-1a1f3238bb90", + "runtime_manifest": "80483320a54af6f123498e43c1435a20922455f65860be88bd259e90efcbc0b7", + "runtime_directory": "C:/laragon/data/compras/runtime/80483320a54af6f1", + "proposed_runtime_settings": { + "COMPRAS_RUNTIME_ENABLED": "true", + "COMPRAS_RUNTIME_PREPARE_ONLY": "false", + "COMPRAS_RUNTIME_ROOT": "C:/laragon/data/compras/runtime/80483320a54af6f1", + "COMPRAS_RUNTIME_SHA256": "80483320a54af6f123498e43c1435a20922455f65860be88bd259e90efcbc0b7", + "COMPRAS_RUNTIME_INSTALLATION_ID": "0602a856-0413-480f-9ef3-1a1f3238bb90", + "COMPRAS_RUNTIME_SYNTHETIC_ONLY": "true", + "SGC_BUDGET_DISTRIBUTIONS_ENABLED": "false", + "SGC_BUDGET_DISTRIBUTIONS_QA_ENABLED": "false", + "COMMON_FINANCE_BUNDLE_ROOT": "(null)", + "COMMON_FINANCE_BUNDLE_SHA256": "(null)", + "COMMON_PAYABLES_PATH": "C:/laragon/data/compras/runtime/80483320a54af6f1/payables", + "COMMON_BUDGET_PATH": "C:/laragon/data/compras/runtime/80483320a54af6f1/budget-control", + "COMMON_PURCHASING_PATH": "C:/laragon/data/compras/runtime/80483320a54af6f1/purchasing", + "COMPRAS_SUPPLIER_PAYABLES_ENABLED": "true", + "COMPRAS_GENERAL_LEDGER_ENABLED": "true", + "COMPRAS_GENERAL_LEDGER_CYCLE_ENABLED": "true", + "COMPRAS_SUPPLIER_SETTLEMENTS_ENABLED": "true", + "COMPRAS_FINANCE_CONFIGURATION_ENABLED": "true", + "COMPRAS_BUDGET_DISTRIBUTIONS_ENABLED": "true", + "COMPRAS_CAPITAL_REGISTER_ENABLED": "true", + "COMPRAS_OPERATIONAL_ORDERS_ENABLED": "true", + "COMPRAS_REQUISITION_ACCOUNTS_ENABLED": "true", + "COMPRAS_REQUISITION_EXPIRY_ENABLED": "true", + "COMPRAS_URGENT_REVIEWS_ENABLED": "true", + "COMPRAS_URGENT_QUOTATIONS_ENABLED": "true", + "COMPRAS_CONFLICT_RELEASES_ENABLED": "true", + "COMPRAS_PRIVATE_AUDIT_ENABLED": "true", + "COMPRAS_EXPENSE_ALLOCATIONS_ENABLED": "true", + "COMPRAS_AGREEMENT_LIMITS_ENABLED": "true", + "COMPRAS_ORDER_PARTS_ENABLED": "true", + "COMPRAS_IMPORT_TARIFFS_ENABLED": "true", + "COMPRAS_IMPORT_LEGAL_ENABLED": "true", + "COMPRAS_IMPORT_DOSSIER_ENABLED": "true", + "COMPRAS_IMPORT_BANK_SUPPORT_ENABLED": "true", + "COMPRAS_IMPORT_READINESS_ENABLED": "true", + "COMPRAS_IMPORT_ESTIMATES_ENABLED": "true", + "COMPRAS_IMPORT_LANDED_COSTS_ENABLED": "true" + }, + "feature_names": [ + "supplier-payables", + "general-ledger", + "general-ledger-cycle", + "supplier-settlements", + "finance-configuration", + "budget-distributions", + "capital-register", + "operational-orders", + "requisition-accounts", + "requisition-expiry", + "urgent-reviews", + "urgent-quotations", + "conflict-releases", + "private-audit", + "expense-allocations", + "agreement-order-limits", + "order-parts", + "import-tariffs", + "import-legal", + "import-dossier", + "import-bank-support", + "import-readiness", + "import-estimates", + "import-landed-costs" + ], + "preserve_source_instance": true, + "new_grants_or_users": false, + "new_business_configuration_or_operations": false, + "new_migrations": false, + "frontend": { + "candidate_root": "storage/framework/testing/sgc-standalone-finance-help-qa-20261129", + "manifest_sha256": "8653c147ab863447b523ddc03111265e3e6510bdddc31341777d6a3bdc46ce5b", + "previous_manifest_sha256": "1edb9ab0aa62fcf4e9c9075ce6e405de5435dc8ea4799d1949535a96c718df4e", + "files": { + "assets/Combination-Cf-uZSDM.js": "cb6de0edf2a5bc431766866135d9c8868a5671cd0bcc7894cfd8d425db1ea41d", + "assets/administrative-location-q1YBJn1l.js": "6b6963bba9f363dde629dc9ae8c4275d530cb89da9d55f67feec38be551db0af", + "assets/agreement-order-bindings-CsGilIRe.js": "fb13dc88d5539f655970551007b734735fcd648d3a43086ac0f9ac3f0170dfb6", + "assets/ai-preparation-preview-B5B4Jl8K.js": "8b902935251b5f484f4abeef6dc46e0f4f6475ef58b2ded60c95bf9a4cd99e8b", + "assets/arrow-right-jQM5Ljhm.js": "460657b89c0a22dd8c648c59408ab9b5d89cda0a2f77fdb5aafb5d4cd81ee047", + "assets/budget-distribution-fields-B0szbRQd.js": "6e6798536ce8cf9b483606ea78c9e7e7fd10111637eb61ee933edbb9e5ed04d6", + "assets/button-CSyysFhi.js": "a0c7c2d62ff1c139a6b5e6ff2e4c7cc778682337a935a3eee0e2df5ac36607b9", + "assets/candidate-availability-BBYAjwDY.js": "848c1b093b9016d4dbbc7795f44c281eb3776bfebf82b2a84ca943c70f5df1aa", + "assets/candidate-documents-DzSJVuya.js": "3f5131f76ab32a1477614e2318e09a5fbe736f5b6fc75fe306fdba5802f28482", + "assets/check-B0y1oDcN.js": "2b0f7b1e72a08a1106cae81a5910d88a308d1bc92c729def81b0c38b743c7c59", + "assets/clock-3-Cy_zSYUr.js": "b8bf146f2a287cd2bf356687ab0dfdcb0bef6f0213bfda494985dd98d97d20a0", + "assets/comparison-policy-summary-C80JsjfA.js": "13b64488a4166adec1678d172588b46cf6834382c575b87054c49ba587b69fa8", + "assets/conflict-BelUpYxR.js": "19efa315d126114e8d34439393364583a3fc1b735b3afc41f401c3da8aaf33b4", + "assets/correction-source-search-BlskK11K.js": "6ad55ada5e896411e415d9fa99f34f0d388cc8f54aa88fe05625915253eddf7a", + "assets/createLucideIcon-Bl2ij0Zm.js": "88026a98f925baf2a85f5c6091f3dce5d35689ec432417ba87ac3fba450aa326", + "assets/dist-Bm7wFECT.js": "ec7a8f48099bdb15bd706858c566dff3c664ea77420b2973463f9482c5c66aa0", + "assets/dist-Cxy2kTRX.js": "7884e24de234f6d592ec16f228c0eaba69ee5adf28fcbedb0d59383d184958c8", + "assets/dist-DSfJglKD.js": "7e5239388df8e9e9251bc5d432701c3a1798b8940371f88e42683e6426f0c6f2", + "assets/download-d-ik75sA.js": "ac23d0b10fe748b8664965a4ebb479336cbc75e4d08e570577e5f70519bfde1c", + "assets/eye-BcFYyvf-.js": "eccd97f0bfeab1e54e9d1abdcd96184794449a6b6277d096598489f52f61e9cf", + "assets/file-text-BMumQ0Wt.js": "9af4fdf5c0527694f24719af17256ac1ebb7061ddd738e5135fdd411f5b3a3ac", + "assets/fonts-C9MNnjVw.css": "3846a9bb60bfad92960eadcccaf0b4e129d74b11d48791506c8d1a827a385cc8", + "assets/import-estimate-money-C8In-mMc.js": "a55799be92061737217e27d9d22baf042cd085b35da5c49f64ef8abb819205a5", + "assets/import-tariff-summary-DD1KFUFU.js": "986f9e557a2a243338df9085965d9d61996d128a844fc88028e48237c5df9d4d", + "assets/input-error-B1DjHZT7.js": "00286fd9e30543b59027b37606d63c96944efdf4f58339aba7afd0cd08629ace", + "assets/instrument-sans-400-normal-D1W7dsQl.woff": "797bd3eaa70edbd4757650ab44dad75fbfbfdf18bacedb4b71022c04621d30ad", + "assets/instrument-sans-400-normal-DRC__1Mx.woff2": "9a91efaa3599a6ef01b2f49e9ec670e3a2f39baeef09c73198f1052cf3bb0850", + "assets/instrument-sans-500-normal-Dk9ku72i.woff2": "9d3547da16d950d12a677c772a3ff9b69846e60e7dcd1b5efd540993f7286532", + "assets/instrument-sans-500-normal-Z6ESRlEs.woff": "bd6a8dc8b0dc0cced0c32d3eda93f0e0e82c58ddefea8b53b3307b0c48da3089", + "assets/instrument-sans-600-normal-B7fBEWYG.woff2": "efb770916eda95a0e31d80cccde9651d4e8617010b21220e9f227c4820d675da", + "assets/instrument-sans-600-normal-B9e8oLYv.woff": "9b4ce1f2b26be7cb087fd87d6f99a202136292ec820af75bd38ab9e53895cf28", + "assets/inventory-B5h3Ukug.js": "4e5464e66e4f4436f82f06de10587dbde46c3b7c92d964b09eaa31e6d9f4fb2e", + "assets/inventory-BF2HrsoH.js": "fa3e4a56bae767f93e7f7d0202c4efecc8d08583c0ca6761db8560acda64ddc9", + "assets/inventory-correction-filters-K-RY6cU2.js": "4d7d4b58fd6fcccc19f29e6adf0bd972ccece878a0e6a2051f78fe65505c695e", + "assets/inventory-event-actions-B8W-9A-a.js": "08c93354ccd5c6cb1acec75dd1378cf8f813b10564bda05bc5af53ec87b13285", + "assets/jsx-runtime-Cjjuc_0N.js": "239501f6701a312b0fbef99c9067ea0d62f11aeeb3a8b388ec4c7528b0493500", + "assets/label-Dn4U5SHB.js": "d273f9faf668fc6fc998709fa86dbb3d424a23271725cc48a9b88a8b2d8e399c", + "assets/loader-circle-YS2_4W2r.js": "4648de3680be9df8d38d808bb954b6cee541cf3b376321926a10c3edddb96345", + "assets/order-document-links-CY7gGohw.js": "a94c6e359ec9ab4cb143177522e2822c9aaacc462f636ab5fccfe09c45cdc43c", + "assets/order-parts-CW5t2gcS.js": "4bf1d746291eded17bfeceaedcfbab1f4daf5fe0f384739196110a8f98b5db9b", + "assets/package-check--ZYjz2oi.js": "ce6074fe092e03473ff914cfe088a47acd57852fe4faef54f239fd04ccd6ab83", + "assets/password-DSVT9zkL.js": "e9f8a7ef9b436a3e046d49f9ab56bdb4ca736bc98f69fc89efe36ec0a9bd08aa", + "assets/password-input-CSxNuD3_.js": "f117f12fe3ac3767485754a3650ffedcc2a6c6eebcc6a6eeb88a312e89e92b7b", + "assets/pencil--NTa5x5n.js": "ffc5e9c22501ed8196d21f31e016d351f91796821392ec9942716d7a70b9c022", + "assets/people-hiring-0ebERuf_.js": "443ff16989484ecbb7576eb060a5339fccd2fc720015d72a2af828e91d12461c", + "assets/printer-D0Qc0KdJ.js": "6a29144df3944867ae389bb8e8194205099314ffa04c41f0fb054226f27b3566", + "assets/procurement-8XN9qCAY.js": "e0b77fdaa81057b59fd44d459d3e234a3edb98ebcf1be15e85360c55734d56b8", + "assets/procurement-payable-insights-DfwHG-cE.js": "55a6bfd4d4429d80b6c54ac8a2299e1aa7a0b11ea82183a6d2edeb73c8aa89f6", + "assets/quotation-exchange-panel-Cy3DHM6W.js": "0e3d3b0e557822946420d7ba54900753b03100856a6a2077efbcca62273c3fd9", + "assets/receipt-conversion-C5-TjG0i.js": "5abdc73cb84a05fc1d4f9a7a1072d4d56bad3a449487cacb819cfba41b9d9f75", + "assets/requisition-category-fields-DKZso-VO.js": "3ccb225b1afb3080e80165f14e40624b077020d818771b29583b70d3a839ef30", + "assets/requisition-history-Dsahm4kA.js": "cd35dcf01ae95f608899009f3795ba78255ef294566e97ca24b70204ff2fa033", + "assets/rolldown-runtime-WkwZ5CU-.js": "2629f2ad3cb75a57d98de697127f5af7d777ef572bbcdfa6e3ce8f438cd4527e", + "assets/spinner-CpJAdIKb.js": "9c8f8fb08c631cae61ecdf41cd766fbc3e777fd184fa707b6351c3d460eef059", + "assets/supplier-DbZ754P4.js": "5617827f9283736a34edb62fe4ea4e6c8df48961c617dd66f416fb054dd92ab4", + "assets/supplier-evaluation-fields-CeoZG0uI.js": "fcaf27e8e2bac729bb6038ab8d4d77b913114f072f88b51f1097184d705cceb7", + "assets/supply-pagination-CnzjlbVc.js": "8537e2e4e48a836f41a2b2176f635ced2b1c62734485d1109bc4469168a1cb28", + "assets/territorial-filter-De2XLPLa.js": "fc12d319adb0cfe9cc44e371c1414559e39c8b42ecefebaca642e8ef8eeb2c3e", + "assets/text-link-CydDNIng.js": "9ddf76c1a4d33cb5d25315e38395f2893250091a23c156adc582bbb2bcad85b9", + "assets/use-inventory-preparation-identity-DcCfUMXu.js": "43e5cb96c4ef1bd19574442166c972db05be7d25e5f5ba76a8a0086646eaa0f8", + "assets/use-preparation-dirty-MDWP6eOW.js": "e4eff3b06a4127a38321af9cd542069423a99bdc14649d12acac4a0330070611", + "assets/use-procurement-preparation-identity-NZ7gcqOB.js": "09315e79db9d28ab8e584c1e6978ee3da38a849f1be28c0499301e1b3f98d115", + "assets/utils-DJPu_GY6.js": "7b162681baff9e9a115823fd6070404fcaddf53d058b311edbe98be7f2662ef4", + "assets/wayfinder-Dp7PqxvV.js": "3d4c90228fda731e37f541f3087fdf5387d9d59433e35b267b64a97196f70781", + "assets/app-gFUcHXMG.css": "1e5f6e98f7165bf48430bde976c4c7839ced8e5c5db30ab897108149770a020f", + "assets/app-BRwRZlcU.js": "740764296a25f44aa94fd86b479ed0cb3b81bef06a761f6aff81577df54cfa78", + "assets/metadata-DNESZTTn.js": "67dc1a25793e11f1192c67725c0dee4b1b2d2640a43b89d95c71263e3790b165", + "assets/private-mRjYV8Eo.js": "661f54187f8c129e833bc62205b811b3cac788aae0bf43bce841bbf7faa8f8be", + "assets/confirm-password-BQfnWvvZ.js": "8fc566ec082b1c7ff725743865357c17614c209e6ef491b02c38bda288143a50", + "assets/forgot-password-C5VEt_1O.js": "84f8e1b90922a36b7f17860c50009cebc142483afa8ab7c1d5673a8539c098bf", + "assets/login-DAfDfzpC.js": "3eaa5b674de183641916a4d2c682f7c8ceffeef668e985054ae776da33a32510", + "assets/register-DiO46XTg.js": "216f207333555ce56e0a5e88689bad68c19a6e029094ca4a9a6c91b7744d27a4", + "assets/reset-password-D5jxdIKB.js": "1dfd528b22f0e85853b48081d1a7722f10c9c9c838d091ae9bd3eabd6870fef9", + "assets/two-factor-challenge-B0m3AXbn.js": "94fb5d0c3d8ade83121f5676b78013b0d203262c2545b7cc918585498e1f214a", + "assets/budgets-CRhm1x9a.js": "8a47db0dbba77e1238654a9d5ce69d662599f78921c28fe01e8a4fa435aded2e", + "assets/access-DX0p-ALd.js": "47a2476846ee63ce459197c02878f8ae12b688a6e1b628f1be59efedf66ceed9", + "assets/entry-DhIghaCT.js": "eab7d47dc01e43fcbd14adb2fb8194522392b18f05aba13850b63aa8fd81f77b", + "assets/opportunity-Cfl4ItuR.js": "ed2b4cc034627b211c4672e5b69e807e86148099044835b46ba79b7234ebdb46", + "assets/profile-CUfa_SGH.js": "24c858e016ac8c607bc0c87e5bc9fad09830afd31b956780f69616db80b9181d", + "assets/receipt-CX6COlya.js": "a20578c41e007f6000ff25baf9e53e7c39312d6541432b98edaa66d2355461d8", + "assets/candidate-portal-rcW6aAtc.js": "54b069ded082be6743c4a667a8f09adeb5b2eb10d315eda4fae139defc250739", + "assets/finance-DVUt4zPS.js": "1596b2fd3128b555b1d6e104d1b051ab410ee10af8904dbeae056b8cc599be73", + "assets/geography-review-inSJC1uH.js": "bb3344fc24c43623c16824dfc04bf61b38d514ea7772aab9440a9e3f0ed0cd96", + "assets/company-uuDr3Lkh.js": "835c39bb5d6d4ad9bd0a98e3201a3d4803ea8d4f6c89606995f24176577f16a9", + "assets/parameters-Bn2f0Lwp.js": "39ce8d90b87da592fde07810a2daaabf0e0439c75fd360f077045e32dc1ae8a7", + "assets/setup-Cf1u8DlQ.js": "1fc837a2077768a9d132ce5e54a5ea5a9566fd1a6eedf0d11e2ae8b36b073a4f", + "assets/submission-forms-Brn8SVMi.js": "d93f2f3bc362b662190097a1911ed7294ee750053956aba37ffed6f13615a1c1", + "assets/conflicts-DULjQj60.js": "b4ced9106803dcb5d94ba7396f42d5b676182da6ef8c839a0fedce58ea9014f7", + "assets/show-CXUxrvsc.js": "ee5f42d70c94e53b8a1b2348dbc2c193e4e082871c023ccf98681477ea0bd7c4", + "assets/dashboard-Bmch_aF3.js": "ce62a3b21812d4877dd96609eeb3f6c890f438aa35a129da59c343004a374bd0", + "assets/capital-register-3rPxBO08.js": "605667112b8f553cfaab58dbd68198fb797fbbb7dacf45a89253fa7e6fa6447b", + "assets/equipment-D3gDCksW.js": "8311c9df7935248582612877b1faa15b2e006868fbd5239e0f644369491968a1", + "assets/show-BDM1VNm0.js": "e53a5b3172ab78908cced37331aee4764788470960252618e107a8289d02c169", + "assets/home-DMxsrrQu.js": "474dc7396c1c78abb261af1b3586c35897c7d3e82ad35fb56715cc1b6f0bdaa6", + "assets/investment-4rM40ZqR.js": "e090786efc535abf2e06a4076efa433082ba99f46bfce0304333852ce1f8c3a6", + "assets/invoices-xVbn64mb.js": "f97711eb0f466c7cec3e1ae51ddc852cfba1e0d08427e0251e210645d920d0e7", + "assets/approval-timeouts-gpIkUgKf.js": "2f53712d7f5df65ca1d51def1f8074f0ae0be0fc5e16912742803c7137334318", + "assets/urgent-review-policy-saBWEW4K.js": "0169a815e2866d0bf9ab0fe47edfa32ea1f2c9824808fae73b9f83e4d144f14a", + "assets/expense-allocation-dy8GmT6Z.js": "023a3d30e53a02cb14ca01a7af5d33f4f831ef49a64ef9e61c3227de937a8169", + "assets/payments-DYJyIzFd.js": "79dc922c04b7329d7b2207e8e08d725b72471c0412541bb09b2d9b59d02cc1d5", + "assets/access-C50xmS7f.js": "9634b1f3a97ea32ef4bf7931a83854f5040cfce6ff87f02311c66db334ab4426", + "assets/people-BFLmm0Bb.js": "3a7d10a58f105aabd91d4fba36471e466c3c4486ffe2770cf6a668042ae0f16a", + "assets/registry-Cii3MIJf.js": "305d5da40fdcc22c13395cd874b5d85ec09003d2cb3a4ddc15495f4c6d2748a5", + "assets/reports-SqRwBlij.js": "80119f7c66eaa3bf4fb1811839c1166b2eed81ad7df29ab5c0dfedfd8784792b", + "assets/show-C2qF15oG.js": "d27b328d33f171277e9bf349b0f90a2817a3ade65a51b755b27b0b1ab3ef3d49", + "assets/submissions-8aMZoWGn.js": "01772b8c3ce56609269ed55f9fc0715b3cb5f5fb12e721dd7cc0214eb192dc95", + "assets/planning-BPSSc6GP.js": "af4081de94d339147b11ce4cc953b86b7c696c866c11bf6a12b35c126df3f735", + "assets/admission-ivkTJEz-.js": "37eb8f30383e8c07b91d58e72d470654b72bb251da8c8e5ffb839753d67c3d8f", + "assets/preview-DV4Cduza.js": "47efa257617f1da79297ca63f5c960e64c71400e15036d723170434120d7b9b0", + "assets/inventory-demo-BQHwsz5E.js": "9d75dbc858a3773a5eab3ba3f968670541a18d53396957619bf6e347f404f362", + "assets/principal-B8ISfUJG.js": "a15a047299a131e419afe09904412a695d7b67dae7eef98a4d2c1151afeacb0b", + "assets/qualification-Dakz_jSp.js": "73c910bac82c660967a6e1f5b57f54b03f32fd4532d4c2522d0a4ec6e70d3e10", + "assets/recommendation-CmXhWQb0.js": "bd94e5819d677d31e7a346cef3c38c6edde3d525d912ff3bdbaba91d7bd0ac79", + "assets/purchase-controls-h4XNByZA.js": "0ffb85c63602c5770010b7bae1448489ada9d41ec6bbd08013b19e3b6716a7de", + "assets/orders-D1xyxniL.js": "90ace9693b47ae4124b4ee640e8236b622bc6968bbfd377a6d689a24a92c7a8f", + "assets/admission-policy-Bxl9q7Ze.js": "804c979b05198f62edc3290f6e16b0dd0bf74aea5abcadf736ccf13aaca92327", + "assets/admission-BNHy6k1Q.js": "0701f16cc80fa99f57b1401383d2d5656ca44b7058365bb87b47e96a9d1acfd8", + "assets/award-bocVxC5W.js": "31accaef4b58573549bedaa6bf21e04318a3267637571e21600144b44b32f38d", + "assets/distribution-amendment-DysAGRsZ.js": "fbba801ba75693729b95226074051a27b45b7a1c097900fa0fb3ece03d9a269a", + "assets/purchases-D8K6y_yO.js": "6abef5a6023a841eae1edc18ab0567e261a5d000207cf5271836f146eb3db9da", + "assets/opening-Bv3scXa4.js": "27f49fa9a09b7e43a281fde77efedc57f294793cbb40cc49f7e30bc878e0b8e3", + "assets/order-parts-amendment-T2lDSXKh.js": "323540acb12b25242e81e189c75922db0d968fde708c49bdd68715416827a538", + "assets/parts-C10oKRBw.js": "9675e418ead6bf42c4aa2e316c40d20096c2f2a3a4d6440e5e4b5dd4edbedbd1", + "assets/process-Djvt8rha.js": "f52e1c19c2ab9a972a941672d55834752dabc5e97535a6467a52b4b34855bb9a", + "assets/qualification-CIRpe48K.js": "14d05519ff649a79a16850f6986f02ac09f9c2529c2f346b2a6b83c8ad1667b6", + "assets/recommendation-policy-DHa_RO5T.js": "913a0c94fd948a87f90aa54bda9d14e94db8d87447e3f8bb6d54d37d4fc7dfcf", + "assets/recommendation-7jZxHHI2.js": "f309415b27d575f8ed54d586f58fcf0e620c82cafe5a51748fd7f6eb5238b391", + "assets/review-report-DJEzGNwj.js": "12c055ea08c71d67e390c123e4c875856da753665dd859a33856f3d6be93781b", + "assets/show-7RCwnMHY.js": "153c28e30d45e32ecfd811152265a5c6db039ae1906e03e043e82017dcf3e97c", + "assets/quotations-DP49MVx6.js": "d0662d0c91a9f27b4a6ff0a530c363f9888bc9b09fa54dbc7c65f908fe7322d4", + "assets/show-0VhmR9II.js": "93f71542b303548b071f26271bb66d1f8109fee2a9e28b3ec69126006d33453a", + "assets/receipts-BCX0N8MC.js": "ad95665f532e70aa499eb8624799a7542a0655be9efa144bd249dc09d84ddfa6", + "assets/order-2hWRc75B.js": "9c25145cd0765f32c9109b26321f47f3c70cd8bbeae1ec9e9213934d35d13e97", + "assets/show-CBNwrwQj.js": "f762a503e2cfbfc15c5ca589c5b9eeb39038695ab0fdc8f80347ec658f2abbb7", + "assets/procurement-DVyUQgY4.js": "bf24f89fe28db2fe18f352baaad4061db84412828afa9a5bc42da9e7cd15148b", + "assets/supplier-improvements-H_pHn-cg.js": "e8f601462f5dbbb82eebf6c47eccd728077e17b5795adcb832f85a1a6dc5c07f", + "assets/accounts-r4LlW9r8.js": "1c199e2ca96b809a41adc603a407f30f0285247b8e3d425acea605b49be831ed", + "assets/capital-assignments-j69vqlUT.js": "2cde54c863dc7bc8a07cb9aee4f3de0a5aecd0a3595be5d70aaae437e52cc613", + "assets/distributions-Dnozjk5P.js": "ff15954e4b4e5b3bb841a7fc37b9b66dd886ea5a7f66ed91e1edc334e7d7a77b", + "assets/expiry-DH4pava_.js": "1c94dbe747c7d35bc475779ddd4acb7416b8a4714d5621a02ae0763bdd11d9f6", + "assets/form-Dr9FHncJ.js": "35821a0a3e874ae27489dea2d5e407f92bb2be83d3c16a90156c6fff9f4f6550", + "assets/requisitions-B89ydqrJ.js": "d4f4ca2c19f996fdd9ccaff3c1034aee2696afd7f0de4d88a3600b45aa094076", + "assets/operational-orders-BC6e8svZ.js": "414ac55b221dfc957ac8e77586909b6a6e5d31bfd2f44dd37a6a2313ad4432ab", + "assets/show-DAW4Xkgt.js": "9fd82a91d7b25110bc1f25ba3e4828a074803bf226dd9a1bcb7fb6b7b05008c3", + "assets/urgent-review-CR1NjmkK.js": "5ecaf558d81af4261a7c34688898b67610a370cadc03b1dd3e70f2003d8bae65", + "assets/urgent-reviews-BFFw2b7z.js": "d6f02a28141baa66ba122a300967d17c84e576dca9b3df6974a8be6d8a5bd8a5", + "assets/urgent-stock-CGVLVL-u.js": "ac3a0de26754b0e47fddbb0998618422d64a62d6e7407f01f0bfca64ff231bb3", + "assets/procurement-BS7xH9pD.js": "d722d909b48db18bc30b60ede455a4727191d1ab8612f15ca4f4f1572bc8bb7b", + "assets/appearance-DTLkICZ0.js": "dcf74e881903f09c418212245ee70a999dd3ab86fc4c1c68ad9bcd3d70c795da", + "assets/profile-Cc9DSa-j.js": "4e01859f23a4a9690d2ad2d649816995b985de366132a87446df3de27b011594", + "assets/security-DQoiFFcJ.js": "ca3866044dfbda0a1e0cf06902b3a13842f35539e7d8c16bb33170da6a46c733", + "assets/availability-DXUlX6Ah.js": "9dc054ae9af3fcda6269ca149a9056fa1be53531e4aec8764476c7477d59e2d5", + "assets/catalogue-DVR9ftZR.js": "451d2742659a2cf7f0686d9f9e765d8f0a8c3744e4683d6c2f285a1c4d7708e9", + "assets/dispositions-C1oAb9Zn.js": "d0dd5669270b26d2f04c216298ee2ae22a2162b4444d78a5976c48c82db943f2", + "assets/stock-lXsySti4.js": "fc3af4c76c0786bc8b107f14048aacbb719975fe1cfbe92a17ccd0b8ff4594f3", + "assets/lots-DFg5vqya.js": "928ae98ff325557afa7bc286bc5864e78ff7db971b599a4e14dedcc7438ba687", + "assets/operations-B4qhyY85.js": "b140f28368d5c5ae40d61d9e0c81bee0798167225728e549079a13ee457404b1", + "assets/pilot-CS10xOhC.js": "a3aea682593c9bb101544d7f4e0b21b2224fb34269c719bf4f5fd961abd21d25", + "assets/replenishment-CPd5Jus0.js": "bef9632d2b3dce693529c8f8d4d1383907cdd278746c6b058f039a3584a0742e", + "assets/request-DAMxCEAW.js": "e8b86fa82f815d01bb27994d1864e81695ae81bd23430e4e7afdd368f799ea16", + "assets/requests-B511eeSz.js": "dab4fc5048fd0cf99b5e13490a0a6cc5e225ccea65c300066dfdca1bfe4f7c8f", + "assets/returns-BIwxpXom.js": "d4104f823d5cda6ece4a3590a08ecde7ae32ca2b0fbeb2e7f63f36bcb72add56", + "assets/reversals-BP1xMk2u.js": "3ecc0a7e5870d175d2cc5d738116ce1232e9e00f29bdbe7870158e600817813a", + "assets/bank-lC6lGLBX.js": "2bb2906b8d81edf206a0fb7fde8e2496525973ebce71260b986e97a477121c8b", + "assets/edit-CLtNr60H.js": "fb9acf8d87a85a2988d1b521046f71f680919ba0540eb5649e96e81da9545d74", + "assets/evaluation-D6Q_8mDA.js": "2aadc5208bed11b06dc5adfe8ae226c25c07bf49aeaad115cc0105a5e7ab3685", + "assets/evaluations-D-xOv-2P.js": "13e96b44260bf03d7784dc960598a6a7f117d2b2f8065465aae27b2e871c3244", + "assets/suppliers-CKTQMlS_.js": "ca3a61f48bf8089109fcf2215c9adcafd90f67b7c14a470ca3d0bff5311d0a80", + "assets/show-D2l_JDTd.js": "56e2914ad5967717d78931b5d7e1df4cf9a9750a9586ec38bb2d882f017a4729", + "assets/agreement-followup-DKmKswG8.js": "7eb103928d73d1e46e80e3e34f7820db0a76b4090f70948dfe995fe6be728c77", + "assets/coordination-C4CfgzMQ.js": "455e0fdd3f939ee5d8a8e8aebc4bdd9a26f38386a7a336c8ac359da878ce0928", + "assets/history-B4HKgGRn.js": "e14def2d6f09950419bf3c3770319841d8c58d3aaf52e335d5d675a94907a639", + "assets/import-bank-support-BakXSWY2.js": "6f4f1759b498193fd5c8de154d833c5c0c13d7738bd1e4f892866b5139d46cf6", + "assets/import-costs-B8aNNhIA.js": "62caebe9df8cd374802c3785691058d965ca371e11cd5484142ba0ad74a9968c", + "assets/import-dossier-zGo_X6s7.js": "da762e34f0a13b9cd8a72d715b4333f550f9204e3d29d45b6c1c90680d00ffcf", + "assets/import-estimate-Xzmh8niR.js": "00d88681b91ce7a23963b583910993147abc5c9154944ac67f73adb90c8cc0c1", + "assets/import-legal-B1JQHCrs.js": "b4ad6595627afd4c53aa9026037cad019c87223e058d9611da0aeb4c1d4319b3", + "assets/import-readiness-D3ea7cE1.js": "8a98fe5e985f4acfb7cd0b5eae6005622b0b5dfa07dda5bf77fa91a299d16595", + "assets/import-tariffs-BrZctl0c.js": "c25fa35aa7d338d8dd3bc5c4b6c2499364176f168de94f430b9de30b19c8dbe6", + "assets/supply-uD7BTenT.js": "6ae7304176acec13b2a4930723049e52256a72b4b28a84567e75b203901b0736", + "assets/suggestions-FRi50_51.js": "95d82dfbe16a2947f2d9f90ce5c1e163d678c835081fa4c91bdb1abbe1af8b3a", + "assets/welcome-CRjlUHIF.js": "8755772cba7a83237cb6acbae5cfae38d8ee5564f60cc5396529c4e7bff6e1f6", + "assets/work-context-Dv3-1YAs.js": "ebf09eb4c2391814456fd52f928040b64ed028f83ff768893a15505fc3996851", + "assets/notices-DeGfoWRy.js": "bee56aacec93994728d4b5057e3f46c0580818b041011fb5777eee80a4513a07", + "assets/tasks-CYqFoxtM.js": "d560cdac3c41fa7030317e8a4aa80bb3e3576b8fd1c576bf987259e25bc86288" + }, + "shared_public_root": true + }, + "active_settings_sha256": "9b3f235153404a616b7783ab4cb1f35fc1d47d50b0c5b66cddbe871dff0e7c5b", + "application_complete": false +} diff --git a/docs/proofs/compras-standalone-pilot-activation.json b/docs/proofs/compras-standalone-pilot-activation.json new file mode 100644 index 0000000..fa55541 --- /dev/null +++ b/docs/proofs/compras-standalone-pilot-activation.json @@ -0,0 +1,22 @@ +{ + "date": "2026-11-29T13:59:22+00:00", + "state": "passed", + "authorization": "compras-standalone-pilot-activation-authorization.json", + "target": "http:\/\/127.0.0.1:8005", + "backup_directory": "C:\/laragon\/data\/compras\/backups\/activation-20261129-135921-e4e3ef971526", + "runtime_manifest": "80483320a54af6f123498e43c1435a20922455f65860be88bd259e90efcbc0b7", + "frontend_manifest": "8653c147ab863447b523ddc03111265e3e6510bdddc31341777d6a3bdc46ce5b", + "new_grants_or_users": false, + "business_commands": false, + "capabilities_enabled": 24, + "assets_verified": 185, + "all_database_tables_preserved": 150, + "unrelated_settings_preserved": true, + "source_instance_preserved": true, + "public_env_preserved": true, + "http": { + "\/avaliar": 200, + "\/login": 302 + }, + "public_domain_runtime_activated": false +} diff --git a/docs/proofs/compras-standalone-pilot-installation-authorization.json b/docs/proofs/compras-standalone-pilot-installation-authorization.json new file mode 100644 index 0000000..cf68eea --- /dev/null +++ b/docs/proofs/compras-standalone-pilot-installation-authorization.json @@ -0,0 +1,12 @@ +{ + "date": "2026-11-29", + "state": "approved", + "decision": "autorizo", + "proposal": "compras-standalone-pilot-installation-proposal.json", + "proposal_sha256": "fb2b6311560a26934c55ada8e6fb31b64d41494d6123c315baec238564d8f87a", + "scope": "pilot_schema_and_pinned_runtime_only", + "new_capability_activation": false, + "active_configuration_changes": false, + "asset_changes": false, + "permission_changes": false +} diff --git a/docs/proofs/compras-standalone-pilot-installation-check.json b/docs/proofs/compras-standalone-pilot-installation-check.json new file mode 100644 index 0000000..b837698 --- /dev/null +++ b/docs/proofs/compras-standalone-pilot-installation-check.json @@ -0,0 +1,15 @@ +{ + "date": "2026-11-29T13:52:54+00:00", + "state": "passed", + "read_only_database_transaction": true, + "receipt_and_non_elevated_binding_verified": true, + "wrong_installation_id_refused": true, + "all_24_module_schemas_verified": true, + "runtime_activation_stays_disabled": true, + "http": { + "\/avaliar": 200, + "\/login": 302 + }, + "business_commands": false, + "permission_changes": false +} diff --git a/docs/proofs/compras-standalone-pilot-installation-proposal.json b/docs/proofs/compras-standalone-pilot-installation-proposal.json new file mode 100644 index 0000000..ba23b09 --- /dev/null +++ b/docs/proofs/compras-standalone-pilot-installation-proposal.json @@ -0,0 +1,43 @@ +{ + "date": "2026-11-29", + "state": "proposed_not_authorized_or_executed", + "decision": "Autorizar a instalação aditiva do schema e do runtime conferido exclusivamente no piloto Compras de http://127.0.0.1:8005, mantendo a activação actual e sem activar as novas capacidades.", + "source_of_required_authorization": "A autorização da promoção exclui instalação no piloto; a autorização posterior de salvaguarda/ensaio permite apenas a cópia privada restaurada. AGENTS.md, secção 6, exige autorização concreta para migrações no destino activo.", + "runtime": { + "manifest_sha256": "80483320a54af6f123498e43c1435a20922455f65860be88bd259e90efcbc0b7", + "archive_sha256": "bbc1d953061d5a297d4336a3cb746a11af5d6930c6fc7d0b5d64b5bff3046e76", + "private_installation_directory": "C:/laragon/data/compras/runtime/80483320a54af6f1", + "old_artifacts": "Preservar integralmente; não sobrescrever pacotes instalados ou congelados" + }, + "exact_schema_selection": { + "normal_migrations": "Exactamente os cinco caminhos/hashes de compras-standalone-pilot-recovery-proposal.json:selected_normal_migrations_in_restored_copy_only; conferir novamente antes de executar", + "extensions": "StandaloneInstallation e StandaloneExtensionSchema já ensaiados, com --reuse-components e os três perfis canónicos completos", + "not_selected": "Migrações históricas de pa_sources/pa_obligations, importação financeira, decisões legadas de pagamentos, geografia operacional e envio SGF; não marcar migrações anteriores como executadas por inferência", + "receipt": "UUID próprio novo da instalação, nome/role exactos conferidos no servidor, operador/motivo e hashes registados; repetição sem outra escrita" + }, + "procedure": [ + "Pré-visualizar identidade e selecção, confirmar que o schema e o runtime não mudaram desde as provas; recusar deriva ou recibo incompatível.", + "Obter nova salvaguarda consistente privada e confirmar restauro/conservação antes da escrita no piloto; preservar configurações e manifestos anteriores.", + "Preparar o pacote numa nova pasta privada, conferir todos os bytes e aplicar apenas as cinco migrações e a instalação aditiva já ensaiada. Não executar migrate genérico.", + "Comparar todas as colunas anteriores e os registos históricos das migrações, permitindo apenas os cinco registos novos e o recibo técnico previsto.", + "Conferir recusas e repetição, disponibilidade anterior e configuração inalterada. Relatar a instalação sem a confundir com activação ou aceitação integral." + ], + "acceptance": [ + "118 tabelas anteriores de negócio preservadas, com todas as colunas e valores anteriores; migrações anteriores preservadas.", + "Cinco migrações delimitadas, schema das 24 capacidades disponível e um recibo imutável; repetição sem duplicação.", + "Configuração, concessões, MFA, dados bancários, parâmetros fiscais, assets e activação dos módulos permanecem como estavam.", + "Nenhum documento, aprovação, pagamento, movimento de stock ou lançamento criado para demonstrar a instalação." + ], + "recovery": "Falha de transacção reverte a sua alteração. Preservar salvaguarda e diagnóstico. Não apagar história nem efectuar downgrade sobre dados novos. Se for necessária reposição da base inteira, interromper e apresentar o impacto concreto antes de sobrescrever a origem.", + "excluded": [ + "Activar as novas capacidades, substituir assets ou alterar configurações da aplicação activa", + "Conceder acessos, criar utilizadores, contas, regras ou decisões empresariais", + "Instalação em produção ou alteração do domínio público", + "Operações ou alterações ao SGF" + ], + "evidence": [ + "compras-standalone-pilot-recovery.json:119 tabelas restauradas idênticas,118 tabelas de negócio e histórico de migrações conservados,24 capacidades verificadas e repetição sem escrita", + "compras-operational-candidate.json: testes integrados10/218, actualização sintética3/169, arranque/restauro/recusas e concorrência real; menus móveis e impressão observados" + ], + "application_complete": false +} diff --git a/docs/proofs/compras-standalone-pilot-installation.json b/docs/proofs/compras-standalone-pilot-installation.json new file mode 100644 index 0000000..8cbec97 --- /dev/null +++ b/docs/proofs/compras-standalone-pilot-installation.json @@ -0,0 +1,45 @@ +{ + "date": "2026-11-29T13:51:56+00:00", + "state": "passed", + "source_read_only": false, + "source_writes": "five_selected_migrations_and_runtime_schema_receipt_only", + "private_backup_directory": "C:\/laragon\/data\/sgf-tempo\/backups\/compras-standalone-recovery-20261129-135155-902f3bf53999", + "temporary_database": "compras_private_restore_902f3bf53999", + "temporary_role": "compras_private_app_902f3bf53999", + "runtime_manifest": "80483320a54af6f123498e43c1435a20922455f65860be88bd259e90efcbc0b7", + "pilot_installation_or_activation": "installation_only", + "backup_sha256": "86fc60039377cbb80706801b7536e4a1e0e08b1a18e6e3df9f0bb6fce62dfcfd", + "initial_tables_preserved": 119, + "upgrade": { + "verified": true, + "selected_migrations": 5, + "available_modules": 24, + "one_receipt_replay_without_write": true, + "configuration_stays_disabled": true, + "existing_components": [ + "budget-distributions-v1", + "supplier-settlements-v1", + "supplier-payables-v1" + ] + }, + "historical_migration_records_preserved": true, + "original_business_tables_preserved": 118, + "pilot_upgrade": { + "verified": true, + "selected_migrations": 5, + "available_modules": 24, + "one_receipt_replay_without_write": true, + "configuration_stays_disabled": true, + "existing_components": [ + "budget-distributions-v1", + "supplier-settlements-v1", + "supplier-payables-v1" + ] + }, + "pilot_activation": false, + "runtime_directory": "C:\/laragon\/data\/compras\/runtime\/80483320a54af6f1", + "installation_id": "0602a856-0413-480f-9ef3-1a1f3238bb90", + "active_settings_env_and_asset_manifest_preserved": true, + "temporary_database_removed": true, + "temporary_role_removed": true +} diff --git a/docs/proofs/compras-standalone-pilot-recovery-authorization.json b/docs/proofs/compras-standalone-pilot-recovery-authorization.json new file mode 100644 index 0000000..16f40da --- /dev/null +++ b/docs/proofs/compras-standalone-pilot-recovery-authorization.json @@ -0,0 +1,10 @@ +{ + "date": "2026-11-29", + "state": "approved", + "decision": "Autorizar salvaguarda e ensaio na cópia privada", + "proposal": "compras-standalone-pilot-recovery-proposal.json", + "proposal_sha256": "81a9fb3a7aee43c0bed63f900e8b3e53d76f944b0143a3a0288bd054dc079292", + "source_writes": false, + "pilot_installation_or_activation": false, + "private_local_restore_only": true +} diff --git a/docs/proofs/compras-standalone-pilot-recovery-proposal.json b/docs/proofs/compras-standalone-pilot-recovery-proposal.json new file mode 100644 index 0000000..d292a3f --- /dev/null +++ b/docs/proofs/compras-standalone-pilot-recovery-proposal.json @@ -0,0 +1,56 @@ +{ + "date": "2026-11-29", + "state": "proposed_not_authorized_or_executed", + "decision": "Autorizar exclusivamente a salvaguarda e o ensaio privado de actualização numa cópia restaurada do piloto de Compras; sem escrita, instalação ou activação na base original.", + "target": { + "source": "Piloto de Compras http://127.0.0.1:8005, identidade exacta conferida pela configuração privada e pelo servidor", + "metadata_inventory": "standalone-pilot-schema-inventory.json", + "restored_destination": "Nova base local própria, nome e role únicos registados antes da criação; sem servidor HTTP, jobs, correio ou integrações", + "runtime_manifest_sha256": "80483320a54af6f123498e43c1435a20922455f65860be88bd259e90efcbc0b7", + "runtime_archive_sha256": "bbc1d953061d5a297d4336a3cb746a11af5d6930c6fc7d0b5d64b5bff3046e76" + }, + "reason": "Os ensaios sintéticos passaram, mas não demonstram a compatibilidade com todos os registos anteriores do piloto. A autorização existente limita os ensaios a dados sintéticos; uma cópia dos dados anteriores exige esta decisão específica.", + "operations": [ + "Conferir identidade, configuração e manifesto de origem sem os alterar; obter snapshot consistente readonly e salvaguarda privada local.", + "Restaurar para base e role novas e próprias; comparar todas as tabelas e todas as colunas anteriores com o snapshot, sem expor os seus valores em provas.", + "Na cópia exclusivamente, aplicar apenas as migrações normais necessárias à composição seleccionada e a preparação do runtime conferido com --reuse-components. Conferir cada ficheiro/hash no plano antes da alteração; não executar migrate genérico nem marcar migrações históricas como executadas por inferência.", + "Verificar os três perfis canónicos completos antes da reutilização, recibo da nova instalação, recusas, repetição e conservação de todos os valores anteriores; não criar utilizadores, permissões, contas, regras, documentos ou operações financeiras.", + "Remover apenas a base/role temporárias próprias após a conferência; preservar a salvaguarda privada com hash e relatório agregado para revisão." + ], + "acceptance": [ + "Origem sem alterações de schema, dados, configurações, permissões, assets ou disponibilidade.", + "Cópia inicial idêntica ao snapshot; colunas anteriores conservadas após a actualização, salvo tabelas exclusivamente técnicas cuja alteração esteja expressamente prevista no plano.", + "Um recibo de instalação; repetição sem duplicação; módulos desligados e nenhuma operação de negócio.", + "Falha não permite avanço ao piloto; diagnóstico delimitado e recursos próprios identificados para recuperação." + ], + "excluded": [ + "Instalação, migração, activação ou substituição de assets no piloto, domínio público ou produção", + "Concessões de acesso, MFA, novos actores, decisões de negócio ou operações financeiras", + "Envio de dados a serviços externos, abertura da cópia por HTTP ou utilização dos seus contactos para mensagens", + "Alterações operacionais ao SGF ou activação fiscal/bancária/JUE" + ], + "recovery": "A origem é apenas lida. Interromper o ensaio, preservar diagnóstico sem valores privados e remover somente recursos temporários comprovadamente criados por este ensaio. A salvaguarda não será restaurada sobre a origem por esta autorização.", + "evidence_already_available": { + "synthetic_upgrade_tests": 3, + "synthetic_upgrade_assertions": 169, + "latest_business_tests": 10, + "latest_business_assertions": 218, + "startup_recovery_and_real_process_concurrency": "passed", + "previous_canonical_artifacts_preserved": true + }, + "application_complete": false, + "selected_normal_migrations_in_restored_copy_only": { + "database/migrations/2026_11_03_000003_create_order_cancellations.php": "c60bf9123b9c9e2ef56687779f1e90b063a34a22d957df5c045dc4d2230f17d3", + "database/migrations/2026_11_22_000005_add_requisition_category_context.php": "1fb94b43d7754ecc254ccd4f671dd5ca684fbc3384831a464a70a6b1087364aa", + "database/migrations/2026_11_22_000006_create_procurement_saved_searches.php": "03aa7b18f59fe9d65da94b96545919277cafe17588975c6ae4cca9cba3c10a6c", + "database/migrations/2026_11_28_000001_create_conflict_releases.php": "a0f24ccc5961de00a3ed0ec9ddb9c6f45db022b2638c0c81c1507306b3f10af4", + "database/migrations/2026_11_28_000002_create_private_audit_exports.php": "df843191283851fbc2fd0f4bb33ad1f3c1e945c8c87feaf4bce71e55900a84d5" + }, + "normal_migrations_explicitly_not_selected": [ + "2026_10_29_000021_create_supplier_payables: existing canonical schema must match; preserve historical migration records", + "2026_10_29_000022_create_payable_history_imports", + "2026_10_29_000023_create_payable_payment_decisions", + "2026_11_03_000005_add_operational_geography_references", + "2026_11_10_000001_create_sgf_invoice_dispatches" + ] +} diff --git a/docs/proofs/compras-standalone-pilot-recovery.json b/docs/proofs/compras-standalone-pilot-recovery.json new file mode 100644 index 0000000..4d80507 --- /dev/null +++ b/docs/proofs/compras-standalone-pilot-recovery.json @@ -0,0 +1,29 @@ +{ + "date": "2026-11-29T13:51:41+00:00", + "state": "passed", + "source_read_only": true, + "source_writes": false, + "private_backup_directory": "C:\/laragon\/data\/sgf-tempo\/backups\/compras-standalone-recovery-20261129-135141-e0767c75981d", + "temporary_database": "compras_private_restore_e0767c75981d", + "temporary_role": "compras_private_app_e0767c75981d", + "runtime_manifest": "80483320a54af6f123498e43c1435a20922455f65860be88bd259e90efcbc0b7", + "pilot_installation_or_activation": false, + "backup_sha256": "f22ef85aa81cc15ea83f3f90efce027eb99d785db0f8d97f9502d143716601b4", + "initial_tables_preserved": 119, + "upgrade": { + "verified": true, + "selected_migrations": 5, + "available_modules": 24, + "one_receipt_replay_without_write": true, + "configuration_stays_disabled": true, + "existing_components": [ + "budget-distributions-v1", + "supplier-settlements-v1", + "supplier-payables-v1" + ] + }, + "historical_migration_records_preserved": true, + "original_business_tables_preserved": 118, + "temporary_database_removed": true, + "temporary_role_removed": true +} diff --git a/docs/proofs/issued-order-cancellation.json b/docs/proofs/issued-order-cancellation.json index 068f4d7..28b0540 100644 --- a/docs/proofs/issued-order-cancellation.json +++ b/docs/proofs/issued-order-cancellation.json @@ -160,5 +160,43 @@ }, "final_worker": "Refused because native approved cancellation absent. Not a passing complete-cycle conservation proof.", "operational_changes": false + }, + "native_manual_final_verified_20261129": { + "state": "manual_decision_and_conservation_verified", + "private_root": "storage/framework/testing/rq01-ledger-qa-a14258b549a5", + "url": "http://localhost:64010/ordens/cancelamentos", + "runner_session": 81503, + "stop_file": "storage/framework/testing/rq01-ledger-qa-a14258b549a5/stop-review", + "synthetic_only": true, + "source_order": "OC-TEST-pRGeu1s5nE", + "request_submitted_by_author": true, + "independent_finance_identity": "qa-finance@example.invalid", + "approval_option_and_reason_prepared": true, + "decision_not_submitted": false, + "manual_step": "User clicks Registar decisao and confirms the native dialog in the own QA tab; return control for conservation checks", + "native_final_approval_confirmed": true, + "duration_minutes": 60, + "cleanup": { + "isolated_database_removed": true, + "isolated_role_removed": true, + "operational_changes": false, + "owned_tab_closure_not_verified_geometry_unavailable": true + }, + "original_browser_tab_preserved": true, + "owner_response": "ja feito", + "verification": { + "visible_status": "Aprovado", + "independent_finance_decision": true, + "original_order_preserved": true, + "original_status": "issued", + "operational_status": "cancelled", + "source_request_cancelled_only": true, + "protected_frames_preserved": 15, + "no_fabricated_legacy_reversal": true, + "one_request_one_decision": true, + "readonly_transaction": true, + "synthetic_only": true + }, + "remaining": "Native mobile/print delta not verified; source-link input stopped after two geometry-unavailable attempts. No failed confirmation repeated." } } diff --git a/docs/proofs/product-review-20261122.json b/docs/proofs/product-review-20261122.json index efe381f..e5df017 100644 --- a/docs/proofs/product-review-20261122.json +++ b/docs/proofs/product-review-20261122.json @@ -699,7 +699,7 @@ "adapted_drawer_closes_after_navigation": true, "agreements_to_contracts_link_followed": true, "header_links_separated_and_wrapped": true, - "new_label": "Novo contrato com vários artigos", + "new_label": "Novo contrato com v\u00e1rios artigos", "document_title": "Contrato QA-VISUAL-CONTRACT", "readable_without_horizontal_page_overflow": true }, @@ -863,5 +863,58 @@ "result": "passed", "duration_seconds": 55.18, "does_not_imply_application_acceptance": true + }, + "native_cancellation_followup_20261129": { + "private_root": "storage/framework/testing/rq01-ledger-qa-3f41b9c4c6e6", + "state": "native final approval still unconfirmed", + "observation": "Author submitted synthetic request; separate Finance identity selected approval and entered reason; Computer Use stopped at native confirmation because URL could not be established", + "mandatory_final_conservation_worker": "failed because approved cancellation absent; not a passing full-cycle proof", + "cleanup": { + "database_removed": true, + "role_removed": true, + "native_confirmation_cancelled_later": true, + "own_tab_closed_later": true, + "original_browser_tab_preserved": true + }, + "no_alternative_interface_execution": true, + "next": "Manual final native confirmation in a fresh isolated QA composition; do not repeat blocked automation" + }, + "native_cancellation_manual_review_pending_20261129": { + "state": "manual_decision_and_conservation_verified", + "private_root": "storage/framework/testing/rq01-ledger-qa-a14258b549a5", + "url": "http://localhost:64010/ordens/cancelamentos", + "runner_session": 81503, + "stop_file": "storage/framework/testing/rq01-ledger-qa-a14258b549a5/stop-review", + "synthetic_only": true, + "source_order": "OC-TEST-pRGeu1s5nE", + "request_submitted_by_author": true, + "independent_finance_identity": "qa-finance@example.invalid", + "approval_option_and_reason_prepared": true, + "decision_not_submitted": false, + "manual_step": "User clicks Registar decisao and confirms the native dialog in the own QA tab; return control for conservation checks", + "native_final_approval_confirmed": true, + "duration_minutes": 60, + "cleanup": { + "isolated_database_removed": true, + "isolated_role_removed": true, + "operational_changes": false, + "owned_tab_closure_not_verified_geometry_unavailable": true + }, + "original_browser_tab_preserved": true, + "owner_response": "ja feito", + "verification": { + "visible_status": "Aprovado", + "independent_finance_decision": true, + "original_order_preserved": true, + "original_status": "issued", + "operational_status": "cancelled", + "source_request_cancelled_only": true, + "protected_frames_preserved": 15, + "no_fabricated_legacy_reversal": true, + "one_request_one_decision": true, + "readonly_transaction": true, + "synthetic_only": true + }, + "remaining": "Native mobile/print delta not verified; source-link input stopped after two geometry-unavailable attempts. No failed confirmation repeated." } } diff --git a/docs/proofs/standalone-pilot-schema-inventory.json b/docs/proofs/standalone-pilot-schema-inventory.json new file mode 100644 index 0000000..8a8fdeb --- /dev/null +++ b/docs/proofs/standalone-pilot-schema-inventory.json @@ -0,0 +1,6767 @@ +{ + "checked_at": "2026-11-29T12:57:45+00:00", + "environment": "http:\/\/127.0.0.1:8005", + "inspection_only": true, + "consistent_read_only": true, + "business_values_read": false, + "configuration_or_permission_changes": false, + "tables": { + "admission_adoptions": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "requisition_id", + "type": "bigint", + "nullable": false + }, + { + "name": "admission_policy_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "revision", + "type": "integer", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "admission_decisions": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "admission_adoption_id", + "type": "bigint", + "nullable": false + }, + { + "name": "qualification_set_id", + "type": "bigint", + "nullable": false + }, + { + "name": "quotation_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "revision", + "type": "integer", + "nullable": false + }, + { + "name": "outcome", + "type": "character varying", + "nullable": false + }, + { + "name": "basis_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "admission_policies": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "revision", + "type": "integer", + "nullable": false + }, + { + "name": "enabled", + "type": "boolean", + "nullable": false + }, + { + "name": "roles", + "type": "json", + "nullable": false + }, + { + "name": "required_count", + "type": "integer", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "admission_reviews": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "admission_decision_id", + "type": "bigint", + "nullable": false + }, + { + "name": "reviewed_by", + "type": "bigint", + "nullable": false + }, + { + "name": "verdict", + "type": "character varying", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "approval_steps": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "requisition_id", + "type": "bigint", + "nullable": false + }, + { + "name": "position", + "type": "smallint", + "nullable": false + }, + { + "name": "role", + "type": "character varying", + "nullable": false + }, + { + "name": "decision", + "type": "character varying", + "nullable": false + }, + { + "name": "approver_id", + "type": "bigint", + "nullable": true + }, + { + "name": "comment", + "type": "text", + "nullable": true + }, + { + "name": "decided_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "routing", + "type": "json", + "nullable": true + } + ], + "audit_logs": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "user_id", + "type": "bigint", + "nullable": false + }, + { + "name": "action", + "type": "character varying", + "nullable": false + }, + { + "name": "requisition_id", + "type": "bigint", + "nullable": true + }, + { + "name": "ip_address", + "type": "character varying", + "nullable": true + }, + { + "name": "before", + "type": "json", + "nullable": true + }, + { + "name": "after", + "type": "json", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "award_cancellations": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "purchase_award_id", + "type": "bigint", + "nullable": false + }, + { + "name": "purchase_control_policy_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "reviewed_by", + "type": "bigint", + "nullable": true + }, + { + "name": "status", + "type": "character varying", + "nullable": false + }, + { + "name": "basis_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "review_reason", + "type": "text", + "nullable": true + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "reviewed_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "budget_consumptions": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "budget_id", + "type": "bigint", + "nullable": false + }, + { + "name": "invoice_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "amount_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "budget_distribution_consumptions": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "distribution_id", + "type": "bigint", + "nullable": false + }, + { + "name": "allocation_key", + "type": "character varying", + "nullable": false + }, + { + "name": "budget_id", + "type": "bigint", + "nullable": false + }, + { + "name": "invoice_id", + "type": "bigint", + "nullable": false + }, + { + "name": "amount_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "subtotal_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "total_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "budget_distribution_entries": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "distribution_id", + "type": "bigint", + "nullable": false + }, + { + "name": "allocation_key", + "type": "character varying", + "nullable": false + }, + { + "name": "budget_id", + "type": "bigint", + "nullable": false + }, + { + "name": "kind", + "type": "character varying", + "nullable": false + }, + { + "name": "reserved_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "committed_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "budget_distribution_events": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "distribution_id", + "type": "bigint", + "nullable": false + }, + { + "name": "kind", + "type": "character varying", + "nullable": false + }, + { + "name": "operation_key", + "type": "uuid", + "nullable": false + }, + { + "name": "payload_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "result", + "type": "json", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "budget_distributions": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "requisition_id", + "type": "bigint", + "nullable": false + }, + { + "name": "phase", + "type": "character varying", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "budget_entries": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "budget_id", + "type": "bigint", + "nullable": false + }, + { + "name": "requisition_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "kind", + "type": "character varying", + "nullable": false + }, + { + "name": "reserved_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "committed_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "budget_reinforcements": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "budget_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "reviewed_by", + "type": "bigint", + "nullable": true + }, + { + "name": "reference", + "type": "character varying", + "nullable": false + }, + { + "name": "payload_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "amount_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "status", + "type": "character varying", + "nullable": false + }, + { + "name": "review_reason", + "type": "text", + "nullable": true + }, + { + "name": "reviewed_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "budgets": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "cost_center_id", + "type": "bigint", + "nullable": false + }, + { + "name": "year", + "type": "smallint", + "nullable": false + }, + { + "name": "amount_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "includes_tax", + "type": "boolean", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "approved_by", + "type": "bigint", + "nullable": true + }, + { + "name": "approved_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "kind", + "type": "character varying", + "nullable": false + } + ], + "cache": [ + { + "name": "key", + "type": "character varying", + "nullable": false + }, + { + "name": "value", + "type": "text", + "nullable": false + }, + { + "name": "expiration", + "type": "bigint", + "nullable": false + } + ], + "cache_locks": [ + { + "name": "key", + "type": "character varying", + "nullable": false + }, + { + "name": "owner", + "type": "character varying", + "nullable": false + }, + { + "name": "expiration", + "type": "bigint", + "nullable": false + } + ], + "candidate_access_tokens": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "candidate_account_id", + "type": "bigint", + "nullable": false + }, + { + "name": "purpose", + "type": "character varying", + "nullable": false + }, + { + "name": "token_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "expires_at", + "type": "timestamp without time zone", + "nullable": false + }, + { + "name": "consumed_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "candidate_accounts": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "email", + "type": "character varying", + "nullable": false + }, + { + "name": "password", + "type": "character varying", + "nullable": false + }, + { + "name": "portal_version_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "email_verified_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "session_version", + "type": "integer", + "nullable": false + } + ], + "candidate_events": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "candidate_account_id", + "type": "bigint", + "nullable": false + }, + { + "name": "action", + "type": "character varying", + "nullable": false + }, + { + "name": "metadata", + "type": "json", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "candidate_opportunity_publications": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "people_process_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "active", + "type": "boolean", + "nullable": false + }, + { + "name": "description", + "type": "text", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "candidate_portal_versions": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "registration_open", + "type": "boolean", + "nullable": false + }, + { + "name": "notice", + "type": "text", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "candidate_profile_versions": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "candidate_account_id", + "type": "bigint", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "data", + "type": "json", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "candidate_submission_documents": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "people_process_id", + "type": "bigint", + "nullable": false + }, + { + "name": "candidate_submission_id", + "type": "bigint", + "nullable": false + }, + { + "name": "document_key", + "type": "character varying", + "nullable": false + }, + { + "name": "path", + "type": "character varying", + "nullable": false + }, + { + "name": "original_name", + "type": "character varying", + "nullable": false + }, + { + "name": "mime_type", + "type": "character varying", + "nullable": false + }, + { + "name": "size", + "type": "bigint", + "nullable": false + }, + { + "name": "sha256", + "type": "character varying", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "candidate_submissions": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "people_process_id", + "type": "bigint", + "nullable": false + }, + { + "name": "candidate_account_id", + "type": "bigint", + "nullable": false + }, + { + "name": "operation_key", + "type": "uuid", + "nullable": false + }, + { + "name": "reference", + "type": "character varying", + "nullable": false + }, + { + "name": "input_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "candidate_triage": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "people_process_id", + "type": "bigint", + "nullable": false + }, + { + "name": "candidate_submission_id", + "type": "bigint", + "nullable": false + }, + { + "name": "people_application_id", + "type": "bigint", + "nullable": true + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "operation_key", + "type": "uuid", + "nullable": false + }, + { + "name": "input_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "outcome", + "type": "character varying", + "nullable": false + }, + { + "name": "profile_version", + "type": "integer", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "public_message", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "conflict_declarations": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "user_id", + "type": "bigint", + "nullable": false + }, + { + "name": "supplier_id", + "type": "bigint", + "nullable": true + }, + { + "name": "requisition_id", + "type": "bigint", + "nullable": true + }, + { + "name": "has_conflict", + "type": "boolean", + "nullable": false + }, + { + "name": "known_since", + "type": "date", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "declared_at", + "type": "timestamp without time zone", + "nullable": false + }, + { + "name": "root_id", + "type": "bigint", + "nullable": true + }, + { + "name": "previous_id", + "type": "bigint", + "nullable": true + } + ], + "cost_centers": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "department_id", + "type": "bigint", + "nullable": false + }, + { + "name": "code", + "type": "character varying", + "nullable": false + }, + { + "name": "name", + "type": "character varying", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "criticality_levels": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "code", + "type": "character varying", + "nullable": false + }, + { + "name": "name", + "type": "character varying", + "nullable": false + }, + { + "name": "criteria", + "type": "text", + "nullable": false + }, + { + "name": "is_critical", + "type": "boolean", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "departments": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "name", + "type": "character varying", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "equipment": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "department_id", + "type": "bigint", + "nullable": false + }, + { + "name": "stock_item_id", + "type": "bigint", + "nullable": true + }, + { + "name": "criticality_level_id", + "type": "bigint", + "nullable": false + }, + { + "name": "code", + "type": "character varying", + "nullable": false + }, + { + "name": "description", + "type": "character varying", + "nullable": false + }, + { + "name": "area", + "type": "character varying", + "nullable": false + }, + { + "name": "serial_number", + "type": "character varying", + "nullable": true + }, + { + "name": "status", + "type": "character varying", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "equipment_spare_parts": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "equipment_id", + "type": "bigint", + "nullable": false + }, + { + "name": "spare_part_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "external_payments": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "invoice_id", + "type": "bigint", + "nullable": false + }, + { + "name": "supplier_bank_detail_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "reviewed_by", + "type": "bigint", + "nullable": true + }, + { + "name": "status", + "type": "character varying", + "nullable": false + }, + { + "name": "amount_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "currency", + "type": "character varying", + "nullable": false + }, + { + "name": "paid_on", + "type": "date", + "nullable": false + }, + { + "name": "external_reference", + "type": "text", + "nullable": false + }, + { + "name": "reference_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "payload_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "evidence_reference", + "type": "text", + "nullable": false + }, + { + "name": "bank_snapshot", + "type": "text", + "nullable": false + }, + { + "name": "review_reason", + "type": "text", + "nullable": true + }, + { + "name": "reviewed_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "failed_jobs": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "uuid", + "type": "character varying", + "nullable": false + }, + { + "name": "connection", + "type": "character varying", + "nullable": false + }, + { + "name": "queue", + "type": "character varying", + "nullable": false + }, + { + "name": "payload", + "type": "text", + "nullable": false + }, + { + "name": "exception", + "type": "text", + "nullable": false + }, + { + "name": "failed_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "goods_receipt_items": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "goods_receipt_id", + "type": "bigint", + "nullable": false + }, + { + "name": "purchase_order_item_id", + "type": "bigint", + "nullable": false + }, + { + "name": "stock_item_id", + "type": "bigint", + "nullable": true + }, + { + "name": "received_milli", + "type": "bigint", + "nullable": false + }, + { + "name": "accepted_milli", + "type": "bigint", + "nullable": false + }, + { + "name": "rejected_milli", + "type": "bigint", + "nullable": false + }, + { + "name": "quality_status", + "type": "character varying", + "nullable": false + }, + { + "name": "notes", + "type": "text", + "nullable": true + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + } + ], + "goods_receipts": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "purchase_order_id", + "type": "bigint", + "nullable": false + }, + { + "name": "received_by", + "type": "bigint", + "nullable": false + }, + { + "name": "warehouse_id", + "type": "bigint", + "nullable": true + }, + { + "name": "number", + "type": "character varying", + "nullable": true + }, + { + "name": "idempotency_key", + "type": "uuid", + "nullable": false + }, + { + "name": "payload_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "delivery_note", + "type": "character varying", + "nullable": false + }, + { + "name": "received_on", + "type": "date", + "nullable": false + }, + { + "name": "status", + "type": "character varying", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "confirmed_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "inventory_lot_allocations": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "stock_item_id", + "type": "bigint", + "nullable": false + }, + { + "name": "warehouse_id", + "type": "bigint", + "nullable": false + }, + { + "name": "lot_id", + "type": "bigint", + "nullable": false + }, + { + "name": "stock_movement_id", + "type": "bigint", + "nullable": true + }, + { + "name": "setup_record_id", + "type": "bigint", + "nullable": true + }, + { + "name": "quantity_milli", + "type": "bigint", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "investment_policies": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "revision", + "type": "integer", + "nullable": false + }, + { + "name": "status", + "type": "character varying", + "nullable": false + }, + { + "name": "mode", + "type": "character varying", + "nullable": false + }, + { + "name": "scope", + "type": "character varying", + "nullable": false + }, + { + "name": "currency", + "type": "character varying", + "nullable": false + }, + { + "name": "ceiling_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "includes_tax", + "type": "boolean", + "nullable": false + }, + { + "name": "valid_from", + "type": "date", + "nullable": false + }, + { + "name": "valid_until", + "type": "date", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "decided_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "investment_policy_reviews": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "investment_policy_id", + "type": "bigint", + "nullable": false + }, + { + "name": "reviewed_by", + "type": "bigint", + "nullable": false + }, + { + "name": "decision", + "type": "character varying", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "invoice_items": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "invoice_id", + "type": "bigint", + "nullable": false + }, + { + "name": "purchase_order_item_id", + "type": "bigint", + "nullable": false + }, + { + "name": "quantity_milli", + "type": "bigint", + "nullable": false + }, + { + "name": "subtotal_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "tax_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + } + ], + "invoices": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "purchase_order_id", + "type": "bigint", + "nullable": false + }, + { + "name": "supplier_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "validated_by", + "type": "bigint", + "nullable": true + }, + { + "name": "number", + "type": "character varying", + "nullable": false + }, + { + "name": "issued_on", + "type": "date", + "nullable": false + }, + { + "name": "status", + "type": "character varying", + "nullable": false + }, + { + "name": "subtotal_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "tax_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "total_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "validated_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "job_batches": [ + { + "name": "id", + "type": "character varying", + "nullable": false + }, + { + "name": "name", + "type": "character varying", + "nullable": false + }, + { + "name": "total_jobs", + "type": "integer", + "nullable": false + }, + { + "name": "pending_jobs", + "type": "integer", + "nullable": false + }, + { + "name": "failed_jobs", + "type": "integer", + "nullable": false + }, + { + "name": "failed_job_ids", + "type": "text", + "nullable": false + }, + { + "name": "options", + "type": "text", + "nullable": true + }, + { + "name": "cancelled_at", + "type": "integer", + "nullable": true + }, + { + "name": "created_at", + "type": "integer", + "nullable": false + }, + { + "name": "finished_at", + "type": "integer", + "nullable": true + } + ], + "jobs": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "queue", + "type": "character varying", + "nullable": false + }, + { + "name": "payload", + "type": "text", + "nullable": false + }, + { + "name": "attempts", + "type": "smallint", + "nullable": false + }, + { + "name": "reserved_at", + "type": "integer", + "nullable": true + }, + { + "name": "available_at", + "type": "integer", + "nullable": false + }, + { + "name": "created_at", + "type": "integer", + "nullable": false + } + ], + "migrations": [ + { + "name": "id", + "type": "integer", + "nullable": false + }, + { + "name": "migration", + "type": "character varying", + "nullable": false + }, + { + "name": "batch", + "type": "integer", + "nullable": false + } + ], + "organization_access": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "active", + "type": "boolean", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "organization_memberships": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "user_id", + "type": "bigint", + "nullable": false + }, + { + "name": "profile_id", + "type": "bigint", + "nullable": false + }, + { + "name": "maintenance", + "type": "boolean", + "nullable": false + }, + { + "name": "expires_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "reason", + "type": "text", + "nullable": true + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "organization_profiles": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "name", + "type": "character varying", + "nullable": false + }, + { + "name": "permissions", + "type": "json", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "work_contexts", + "type": "json", + "nullable": true + } + ], + "pa_access": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "company_id", + "type": "bigint", + "nullable": false + }, + { + "name": "unit_id", + "type": "bigint", + "nullable": false + }, + { + "name": "user_id", + "type": "bigint", + "nullable": false + }, + { + "name": "person", + "type": "character varying", + "nullable": false + }, + { + "name": "action", + "type": "character varying", + "nullable": false + } + ], + "pa_commands": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "company_id", + "type": "bigint", + "nullable": false + }, + { + "name": "unit_id", + "type": "bigint", + "nullable": false + }, + { + "name": "actor_id", + "type": "bigint", + "nullable": false + }, + { + "name": "command_key", + "type": "uuid", + "nullable": false + }, + { + "name": "request_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "result", + "type": "jsonb", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "pa_events": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "company_id", + "type": "bigint", + "nullable": false + }, + { + "name": "unit_id", + "type": "bigint", + "nullable": false + }, + { + "name": "source_id", + "type": "bigint", + "nullable": false + }, + { + "name": "actor_id", + "type": "bigint", + "nullable": false + }, + { + "name": "kind", + "type": "character varying", + "nullable": false + }, + { + "name": "payload", + "type": "jsonb", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "pa_obligations": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "company_id", + "type": "bigint", + "nullable": false + }, + { + "name": "unit_id", + "type": "bigint", + "nullable": false + }, + { + "name": "source_id", + "type": "bigint", + "nullable": false + }, + { + "name": "proposal_id", + "type": "bigint", + "nullable": false + }, + { + "name": "source_revision", + "type": "character varying", + "nullable": false + }, + { + "name": "principal_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "currency", + "type": "character varying", + "nullable": false + }, + { + "name": "due_on", + "type": "date", + "nullable": true + }, + { + "name": "recognised_by", + "type": "bigint", + "nullable": false + }, + { + "name": "recognised_person", + "type": "character varying", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "pa_outbox": [ + { + "name": "event_id", + "type": "bigint", + "nullable": false + }, + { + "name": "state", + "type": "character varying", + "nullable": false + } + ], + "pa_proposals": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "company_id", + "type": "bigint", + "nullable": false + }, + { + "name": "unit_id", + "type": "bigint", + "nullable": false + }, + { + "name": "source_id", + "type": "bigint", + "nullable": false + }, + { + "name": "source_revision", + "type": "character varying", + "nullable": false + }, + { + "name": "capture_version", + "type": "integer", + "nullable": false + }, + { + "name": "snapshot", + "type": "jsonb", + "nullable": false + }, + { + "name": "missing", + "type": "jsonb", + "nullable": false + }, + { + "name": "prepared_by", + "type": "bigint", + "nullable": false + }, + { + "name": "prepared_person", + "type": "character varying", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "pa_sources": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "company_id", + "type": "bigint", + "nullable": false + }, + { + "name": "unit_id", + "type": "bigint", + "nullable": false + }, + { + "name": "source_key", + "type": "character varying", + "nullable": false + }, + { + "name": "local_source_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "password_reset_tokens": [ + { + "name": "email", + "type": "character varying", + "nullable": false + }, + { + "name": "token", + "type": "character varying", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "people_access_states": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "people_process_id", + "type": "bigint", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + } + ], + "people_applications": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "people_process_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "operation_key", + "type": "uuid", + "nullable": false + }, + { + "name": "name", + "type": "character varying", + "nullable": false + }, + { + "name": "reference", + "type": "character varying", + "nullable": false + }, + { + "name": "summary", + "type": "text", + "nullable": false + }, + { + "name": "received_on", + "type": "date", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "person_id", + "type": "bigint", + "nullable": true + }, + { + "name": "person_snapshot", + "type": "json", + "nullable": true + } + ], + "people_clarifications": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "people_process_id", + "type": "bigint", + "nullable": false + }, + { + "name": "people_application_id", + "type": "bigint", + "nullable": false + }, + { + "name": "people_review_id", + "type": "bigint", + "nullable": false + }, + { + "name": "criterion_index", + "type": "integer", + "nullable": false + }, + { + "name": "question", + "type": "text", + "nullable": false + }, + { + "name": "raised_by", + "type": "bigint", + "nullable": false + }, + { + "name": "responsible_id", + "type": "bigint", + "nullable": false + }, + { + "name": "due_on", + "type": "date", + "nullable": false + }, + { + "name": "operation_key", + "type": "uuid", + "nullable": false + }, + { + "name": "creation_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "status", + "type": "character varying", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "responses", + "type": "json", + "nullable": false + }, + { + "name": "decisions", + "type": "json", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "people_process_access": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "people_process_id", + "type": "bigint", + "nullable": false + }, + { + "name": "user_id", + "type": "bigint", + "nullable": false + }, + { + "name": "scopes", + "type": "json", + "nullable": false + }, + { + "name": "expires_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "people_processes": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "operation_key", + "type": "uuid", + "nullable": false + }, + { + "name": "creation_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "kind", + "type": "character varying", + "nullable": false + }, + { + "name": "title", + "type": "character varying", + "nullable": false + }, + { + "name": "purpose", + "type": "text", + "nullable": false + }, + { + "name": "closes_on", + "type": "date", + "nullable": false + }, + { + "name": "rules", + "type": "json", + "nullable": false + }, + { + "name": "status", + "type": "character varying", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "opened_by", + "type": "bigint", + "nullable": true + }, + { + "name": "selected_application_id", + "type": "bigint", + "nullable": true + }, + { + "name": "selection", + "type": "json", + "nullable": true + }, + { + "name": "confirmed_by", + "type": "bigint", + "nullable": true + }, + { + "name": "contract", + "type": "json", + "nullable": true + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "work_context_key", + "type": "character varying", + "nullable": false + } + ], + "people_registry": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "operation_key", + "type": "uuid", + "nullable": false + }, + { + "name": "creation_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "name", + "type": "character varying", + "nullable": false + }, + { + "name": "reference", + "type": "character varying", + "nullable": false + }, + { + "name": "reference_key", + "type": "character varying", + "nullable": false + }, + { + "name": "profile_summary", + "type": "text", + "nullable": false + }, + { + "name": "active", + "type": "boolean", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "people_reviews": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "people_application_id", + "type": "bigint", + "nullable": false + }, + { + "name": "reviewed_by", + "type": "bigint", + "nullable": false + }, + { + "name": "answers", + "type": "json", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "score_minor", + "type": "integer", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "proposal_evaluations": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "quotation_id", + "type": "bigint", + "nullable": false + }, + { + "name": "evaluator_id", + "type": "bigint", + "nullable": false + }, + { + "name": "quality", + "type": "numeric", + "nullable": false + }, + { + "name": "history", + "type": "numeric", + "nullable": false + }, + { + "name": "payment", + "type": "numeric", + "nullable": false + }, + { + "name": "comment", + "type": "text", + "nullable": false + }, + { + "name": "no_conflict", + "type": "boolean", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "proposal_openings": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "requisition_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "revision", + "type": "integer", + "nullable": false + }, + { + "name": "opened_at", + "type": "timestamp without time zone", + "nullable": false + }, + { + "name": "timezone", + "type": "character varying", + "nullable": false + }, + { + "name": "submission_deadline", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "reference", + "type": "character varying", + "nullable": false + }, + { + "name": "location", + "type": "character varying", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "notes", + "type": "text", + "nullable": true + }, + { + "name": "participants", + "type": "json", + "nullable": false + }, + { + "name": "annexes", + "type": "json", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "basis_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "ps_allocation_aliases": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "company_id", + "type": "bigint", + "nullable": false + }, + { + "name": "unit_id", + "type": "bigint", + "nullable": false + }, + { + "name": "reference_key", + "type": "character varying", + "nullable": false + }, + { + "name": "reference", + "type": "character varying", + "nullable": false + }, + { + "name": "proposal_id", + "type": "bigint", + "nullable": false + }, + { + "name": "actor_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "ps_allocation_decisions": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "company_id", + "type": "bigint", + "nullable": false + }, + { + "name": "unit_id", + "type": "bigint", + "nullable": false + }, + { + "name": "proposal_id", + "type": "bigint", + "nullable": false + }, + { + "name": "decision", + "type": "character varying", + "nullable": false + }, + { + "name": "actor_id", + "type": "bigint", + "nullable": false + }, + { + "name": "person", + "type": "character varying", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "ps_allocations": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "company_id", + "type": "bigint", + "nullable": false + }, + { + "name": "unit_id", + "type": "bigint", + "nullable": false + }, + { + "name": "payment_id", + "type": "bigint", + "nullable": false + }, + { + "name": "obligation_id", + "type": "bigint", + "nullable": false + }, + { + "name": "decision_id", + "type": "bigint", + "nullable": false + }, + { + "name": "amount_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "source_revision", + "type": "character varying", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "ps_commands": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "company_id", + "type": "bigint", + "nullable": false + }, + { + "name": "unit_id", + "type": "bigint", + "nullable": false + }, + { + "name": "actor_id", + "type": "bigint", + "nullable": false + }, + { + "name": "command_key", + "type": "uuid", + "nullable": false + }, + { + "name": "request_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "result", + "type": "jsonb", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "ps_events": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "company_id", + "type": "bigint", + "nullable": false + }, + { + "name": "unit_id", + "type": "bigint", + "nullable": false + }, + { + "name": "payment_id", + "type": "bigint", + "nullable": false + }, + { + "name": "actor_id", + "type": "bigint", + "nullable": false + }, + { + "name": "person", + "type": "character varying", + "nullable": false + }, + { + "name": "kind", + "type": "character varying", + "nullable": false + }, + { + "name": "payload", + "type": "jsonb", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "ps_outbox": [ + { + "name": "event_id", + "type": "bigint", + "nullable": false + }, + { + "name": "state", + "type": "character varying", + "nullable": false + } + ], + "ps_payment_decisions": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "company_id", + "type": "bigint", + "nullable": false + }, + { + "name": "unit_id", + "type": "bigint", + "nullable": false + }, + { + "name": "payment_id", + "type": "bigint", + "nullable": false + }, + { + "name": "decision", + "type": "character varying", + "nullable": false + }, + { + "name": "actor_id", + "type": "bigint", + "nullable": false + }, + { + "name": "person", + "type": "character varying", + "nullable": false + }, + { + "name": "evidence_reference", + "type": "character varying", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "ps_payments": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "company_id", + "type": "bigint", + "nullable": false + }, + { + "name": "unit_id", + "type": "bigint", + "nullable": false + }, + { + "name": "obligation_id", + "type": "bigint", + "nullable": false + }, + { + "name": "fact_key", + "type": "character varying", + "nullable": false + }, + { + "name": "evidence_key", + "type": "character varying", + "nullable": false + }, + { + "name": "supplier_key", + "type": "character varying", + "nullable": false + }, + { + "name": "currency", + "type": "character varying", + "nullable": false + }, + { + "name": "amount_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "paid_on", + "type": "date", + "nullable": false + }, + { + "name": "fact_reference", + "type": "character varying", + "nullable": false + }, + { + "name": "evidence_reference", + "type": "character varying", + "nullable": false + }, + { + "name": "payload_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "snapshot", + "type": "jsonb", + "nullable": false + }, + { + "name": "prepared_by", + "type": "bigint", + "nullable": false + }, + { + "name": "prepared_person", + "type": "character varying", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "ps_proposals": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "company_id", + "type": "bigint", + "nullable": false + }, + { + "name": "unit_id", + "type": "bigint", + "nullable": false + }, + { + "name": "payment_id", + "type": "bigint", + "nullable": false + }, + { + "name": "reference_key", + "type": "character varying", + "nullable": false + }, + { + "name": "reference", + "type": "character varying", + "nullable": false + }, + { + "name": "plan_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "plan", + "type": "jsonb", + "nullable": false + }, + { + "name": "prepared_by", + "type": "bigint", + "nullable": false + }, + { + "name": "prepared_person", + "type": "character varying", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "purchase_award_approvals": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "purchase_award_id", + "type": "bigint", + "nullable": false + }, + { + "name": "position", + "type": "smallint", + "nullable": false + }, + { + "name": "role", + "type": "character varying", + "nullable": false + }, + { + "name": "decision", + "type": "character varying", + "nullable": false + }, + { + "name": "approver_id", + "type": "bigint", + "nullable": true + }, + { + "name": "comment", + "type": "text", + "nullable": true + }, + { + "name": "decided_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "purchase_awards": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "requisition_id", + "type": "bigint", + "nullable": false + }, + { + "name": "quotation_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "justification", + "type": "text", + "nullable": false + }, + { + "name": "delivery_date", + "type": "date", + "nullable": false + }, + { + "name": "delivery_location", + "type": "character varying", + "nullable": false + }, + { + "name": "status", + "type": "character varying", + "nullable": false + }, + { + "name": "subtotal_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "tax_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "total_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "approval_snapshot", + "type": "json", + "nullable": false + }, + { + "name": "decision_matrix", + "type": "json", + "nullable": false + }, + { + "name": "comparison_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "investment_snapshot", + "type": "json", + "nullable": true + }, + { + "name": "admission_snapshot", + "type": "json", + "nullable": true + }, + { + "name": "recommendation_snapshot", + "type": "json", + "nullable": true + } + ], + "purchase_control_policies": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "revision", + "type": "integer", + "nullable": false + }, + { + "name": "status", + "type": "character varying", + "nullable": false + }, + { + "name": "mode", + "type": "character varying", + "nullable": false + }, + { + "name": "enabled", + "type": "boolean", + "nullable": false + }, + { + "name": "valid_from", + "type": "date", + "nullable": false + }, + { + "name": "valid_until", + "type": "date", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "decided_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "purchase_control_reviews": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "purchase_control_policy_id", + "type": "bigint", + "nullable": false + }, + { + "name": "reviewed_by", + "type": "bigint", + "nullable": false + }, + { + "name": "decision", + "type": "character varying", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "purchase_order_items": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "purchase_order_id", + "type": "bigint", + "nullable": false + }, + { + "name": "requisition_item_id", + "type": "bigint", + "nullable": false + }, + { + "name": "description", + "type": "character varying", + "nullable": false + }, + { + "name": "category", + "type": "character varying", + "nullable": false + }, + { + "name": "purchase_type", + "type": "character varying", + "nullable": false + }, + { + "name": "unit", + "type": "character varying", + "nullable": false + }, + { + "name": "quantity", + "type": "numeric", + "nullable": false + }, + { + "name": "unit_price_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "tax_rate", + "type": "numeric", + "nullable": false + }, + { + "name": "subtotal_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "tax_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "total_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "equipment_id", + "type": "bigint", + "nullable": true + }, + { + "name": "spare_part_id", + "type": "bigint", + "nullable": true + } + ], + "purchase_orders": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "requisition_id", + "type": "bigint", + "nullable": false + }, + { + "name": "purchase_award_id", + "type": "bigint", + "nullable": false + }, + { + "name": "supplier_id", + "type": "bigint", + "nullable": false + }, + { + "name": "issued_by", + "type": "bigint", + "nullable": false + }, + { + "name": "number", + "type": "character varying", + "nullable": true + }, + { + "name": "status", + "type": "character varying", + "nullable": false + }, + { + "name": "currency", + "type": "character varying", + "nullable": false + }, + { + "name": "subtotal_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "tax_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "total_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "issued_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "purchase_plan_items": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "department_id", + "type": "bigint", + "nullable": false + }, + { + "name": "requisition_id", + "type": "bigint", + "nullable": true + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "responsible_id", + "type": "bigint", + "nullable": false + }, + { + "name": "title", + "type": "character varying", + "nullable": false + }, + { + "name": "nature", + "type": "character varying", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "purchase_plan_milestones": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "purchase_plan_item_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "label", + "type": "character varying", + "nullable": false + }, + { + "name": "planned_on", + "type": "date", + "nullable": false + }, + { + "name": "actual_on", + "type": "date", + "nullable": true + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "purchase_revisions": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "award_cancellation_id", + "type": "bigint", + "nullable": false + }, + { + "name": "source_requisition_id", + "type": "bigint", + "nullable": false + }, + { + "name": "requisition_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "qualification_assessments": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "qualification_set_id", + "type": "bigint", + "nullable": false + }, + { + "name": "quotation_id", + "type": "bigint", + "nullable": false + }, + { + "name": "analyst_id", + "type": "bigint", + "nullable": false + }, + { + "name": "revision", + "type": "integer", + "nullable": false + }, + { + "name": "answers", + "type": "json", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "qualification_sets": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "requisition_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "revision", + "type": "integer", + "nullable": false + }, + { + "name": "criteria", + "type": "json", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "basis_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "quotation_exchange_rates": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "requisition_id", + "type": "bigint", + "nullable": false + }, + { + "name": "recorded_by", + "type": "bigint", + "nullable": false + }, + { + "name": "currency", + "type": "character varying", + "nullable": false + }, + { + "name": "rate", + "type": "character varying", + "nullable": false + }, + { + "name": "quoted_on", + "type": "date", + "nullable": false + }, + { + "name": "source", + "type": "character varying", + "nullable": false + }, + { + "name": "operation_id", + "type": "uuid", + "nullable": false + }, + { + "name": "payload_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "quotation_items": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "quotation_id", + "type": "bigint", + "nullable": false + }, + { + "name": "requisition_item_id", + "type": "bigint", + "nullable": false + }, + { + "name": "description", + "type": "character varying", + "nullable": false + }, + { + "name": "quantity", + "type": "numeric", + "nullable": false + }, + { + "name": "unit_price_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "tax_rate", + "type": "numeric", + "nullable": false + }, + { + "name": "subtotal_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "tax_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "total_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "quotations": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "requisition_id", + "type": "bigint", + "nullable": false + }, + { + "name": "supplier_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "reference", + "type": "character varying", + "nullable": false + }, + { + "name": "delivery_days", + "type": "integer", + "nullable": false + }, + { + "name": "valid_until", + "type": "date", + "nullable": false + }, + { + "name": "payment_terms", + "type": "character varying", + "nullable": false + }, + { + "name": "subtotal_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "tax_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "total_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "currency", + "type": "character varying", + "nullable": false + }, + { + "name": "weights", + "type": "json", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "commercial_terms", + "type": "json", + "nullable": true + }, + { + "name": "exchange_basis", + "type": "json", + "nullable": true + } + ], + "receipt_documents": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "goods_receipt_id", + "type": "bigint", + "nullable": false + }, + { + "name": "uploaded_by", + "type": "bigint", + "nullable": false + }, + { + "name": "document_type", + "type": "character varying", + "nullable": false + }, + { + "name": "original_name", + "type": "character varying", + "nullable": false + }, + { + "name": "path", + "type": "character varying", + "nullable": false + }, + { + "name": "mime_type", + "type": "character varying", + "nullable": false + }, + { + "name": "size", + "type": "integer", + "nullable": false + }, + { + "name": "sha256", + "type": "character varying", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "recommendation_adoptions": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "requisition_id", + "type": "bigint", + "nullable": false + }, + { + "name": "recommendation_policy_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "revision", + "type": "integer", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "recommendation_attempts": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "recommendation_adoption_id", + "type": "bigint", + "nullable": false + }, + { + "name": "quotation_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "revision", + "type": "integer", + "nullable": false + }, + { + "name": "basis_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "recommendation_policies": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "revision", + "type": "integer", + "nullable": false + }, + { + "name": "enabled", + "type": "boolean", + "nullable": false + }, + { + "name": "roles", + "type": "json", + "nullable": false + }, + { + "name": "required_count", + "type": "integer", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "recommendation_reviews": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "recommendation_attempt_id", + "type": "bigint", + "nullable": false + }, + { + "name": "reviewed_by", + "type": "bigint", + "nullable": false + }, + { + "name": "verdict", + "type": "character varying", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "replenishment_work": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "stock_item_id", + "type": "bigint", + "nullable": false + }, + { + "name": "warehouse_id", + "type": "bigint", + "nullable": false + }, + { + "name": "responsible_id", + "type": "bigint", + "nullable": false + }, + { + "name": "generation", + "type": "bigint", + "nullable": false + }, + { + "name": "processed_generation", + "type": "bigint", + "nullable": false + }, + { + "name": "attempts", + "type": "integer", + "nullable": false + }, + { + "name": "failures", + "type": "integer", + "nullable": false + }, + { + "name": "last_outcome", + "type": "character varying", + "nullable": true + }, + { + "name": "last_error", + "type": "text", + "nullable": true + }, + { + "name": "due_at", + "type": "timestamp with time zone", + "nullable": false + }, + { + "name": "last_run_at", + "type": "timestamp with time zone", + "nullable": true + }, + { + "name": "created_at", + "type": "timestamp with time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp with time zone", + "nullable": true + } + ], + "requisition_catalogue": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "stock_item_id", + "type": "bigint", + "nullable": false + }, + { + "name": "category", + "type": "character varying", + "nullable": false + }, + { + "name": "purchase_type", + "type": "character varying", + "nullable": false + }, + { + "name": "source_snapshot", + "type": "json", + "nullable": false + }, + { + "name": "published", + "type": "boolean", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "requisition_commands": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "actor_id", + "type": "bigint", + "nullable": false + }, + { + "name": "operation_key", + "type": "uuid", + "nullable": false + }, + { + "name": "request_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "result", + "type": "json", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "requisition_items": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "requisition_id", + "type": "bigint", + "nullable": false + }, + { + "name": "description", + "type": "character varying", + "nullable": false + }, + { + "name": "category", + "type": "character varying", + "nullable": false + }, + { + "name": "purchase_type", + "type": "character varying", + "nullable": false + }, + { + "name": "quantity", + "type": "numeric", + "nullable": false + }, + { + "name": "unit", + "type": "character varying", + "nullable": false + }, + { + "name": "unit_price_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "tax_rate", + "type": "numeric", + "nullable": false + }, + { + "name": "subtotal_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "tax_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "total_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "equipment_id", + "type": "bigint", + "nullable": true + }, + { + "name": "spare_part_id", + "type": "bigint", + "nullable": true + }, + { + "name": "production_area", + "type": "character varying", + "nullable": true + }, + { + "name": "downtime_started_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "catalogue_entry_id", + "type": "bigint", + "nullable": true + }, + { + "name": "catalogue_snapshot", + "type": "json", + "nullable": true + } + ], + "requisitions": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "number", + "type": "character varying", + "nullable": true + }, + { + "name": "requester_id", + "type": "bigint", + "nullable": false + }, + { + "name": "department_id", + "type": "bigint", + "nullable": false + }, + { + "name": "cost_center_id", + "type": "bigint", + "nullable": true + }, + { + "name": "priority", + "type": "character varying", + "nullable": false + }, + { + "name": "needed_by", + "type": "date", + "nullable": true + }, + { + "name": "justification", + "type": "text", + "nullable": true + }, + { + "name": "status", + "type": "character varying", + "nullable": false + }, + { + "name": "currency", + "type": "character varying", + "nullable": false + }, + { + "name": "subtotal_minor", + "type": "bigint", + "nullable": true + }, + { + "name": "tax_minor", + "type": "bigint", + "nullable": true + }, + { + "name": "total_minor", + "type": "bigint", + "nullable": true + }, + { + "name": "approval_snapshot", + "type": "json", + "nullable": true + }, + { + "name": "submitted_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "comparison_policy", + "type": "json", + "nullable": true + }, + { + "name": "work_context_key", + "type": "character varying", + "nullable": false + }, + { + "name": "process_version", + "type": "integer", + "nullable": false + }, + { + "name": "draft_input", + "type": "json", + "nullable": true + }, + { + "name": "budget_distribution_preparation", + "type": "json", + "nullable": true + } + ], + "sessions": [ + { + "name": "id", + "type": "character varying", + "nullable": false + }, + { + "name": "user_id", + "type": "bigint", + "nullable": true + }, + { + "name": "ip_address", + "type": "character varying", + "nullable": true + }, + { + "name": "user_agent", + "type": "text", + "nullable": true + }, + { + "name": "payload", + "type": "text", + "nullable": false + }, + { + "name": "last_activity", + "type": "integer", + "nullable": false + } + ], + "spare_parts": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "stock_item_id", + "type": "bigint", + "nullable": false + }, + { + "name": "criticality_level_id", + "type": "bigint", + "nullable": false + }, + { + "name": "minimum_milli", + "type": "bigint", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "stock_items": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "code", + "type": "character varying", + "nullable": false + }, + { + "name": "name", + "type": "character varying", + "nullable": false + }, + { + "name": "unit", + "type": "character varying", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "stock_movements": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "goods_receipt_item_id", + "type": "bigint", + "nullable": true + }, + { + "name": "stock_item_id", + "type": "bigint", + "nullable": false + }, + { + "name": "warehouse_id", + "type": "bigint", + "nullable": false + }, + { + "name": "moved_by", + "type": "bigint", + "nullable": false + }, + { + "name": "movement_type", + "type": "character varying", + "nullable": false + }, + { + "name": "quantity_milli", + "type": "bigint", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "moved_at", + "type": "timestamp without time zone", + "nullable": false + }, + { + "name": "stock_operation_id", + "type": "bigint", + "nullable": true + }, + { + "name": "equipment_id", + "type": "bigint", + "nullable": true + }, + { + "name": "spare_part_id", + "type": "bigint", + "nullable": true + } + ], + "stock_operations": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "responsible_id", + "type": "bigint", + "nullable": false + }, + { + "name": "warehouse_id", + "type": "bigint", + "nullable": false + }, + { + "name": "destination_warehouse_id", + "type": "bigint", + "nullable": true + }, + { + "name": "stock_item_id", + "type": "bigint", + "nullable": false + }, + { + "name": "count_id", + "type": "bigint", + "nullable": true + }, + { + "name": "kind", + "type": "character varying", + "nullable": false + }, + { + "name": "reference", + "type": "character varying", + "nullable": false + }, + { + "name": "idempotency_key", + "type": "uuid", + "nullable": false + }, + { + "name": "payload_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "destination", + "type": "character varying", + "nullable": true + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "quantity_milli", + "type": "bigint", + "nullable": false + }, + { + "name": "theoretical_milli", + "type": "bigint", + "nullable": true + }, + { + "name": "ledger_version", + "type": "bigint", + "nullable": true + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "recorded_at", + "type": "timestamp without time zone", + "nullable": false + }, + { + "name": "equipment_id", + "type": "bigint", + "nullable": true + }, + { + "name": "spare_part_id", + "type": "bigint", + "nullable": true + } + ], + "submission_forms": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "audience", + "type": "character varying", + "nullable": false + }, + { + "name": "modality", + "type": "character varying", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "definition", + "type": "json", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "supplier_bank_details": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "supplier_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "revision", + "type": "integer", + "nullable": false + }, + { + "name": "bank_name", + "type": "character varying", + "nullable": false + }, + { + "name": "country", + "type": "character varying", + "nullable": false + }, + { + "name": "currency", + "type": "character varying", + "nullable": false + }, + { + "name": "beneficiary", + "type": "text", + "nullable": false + }, + { + "name": "account_identifier", + "type": "text", + "nullable": false + }, + { + "name": "evidence_reference", + "type": "text", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + }, + { + "name": "account_key", + "type": "uuid", + "nullable": true + } + ], + "supplier_bank_reviews": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "supplier_bank_detail_id", + "type": "bigint", + "nullable": false + }, + { + "name": "reviewed_by", + "type": "bigint", + "nullable": false + }, + { + "name": "decision", + "type": "character varying", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "supplier_documents": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "supplier_id", + "type": "bigint", + "nullable": false + }, + { + "name": "uploaded_by", + "type": "bigint", + "nullable": false + }, + { + "name": "document_type", + "type": "character varying", + "nullable": false + }, + { + "name": "original_name", + "type": "character varying", + "nullable": false + }, + { + "name": "path", + "type": "character varying", + "nullable": false + }, + { + "name": "mime_type", + "type": "character varying", + "nullable": false + }, + { + "name": "size", + "type": "bigint", + "nullable": false + }, + { + "name": "sha256", + "type": "character varying", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "supplier_evaluations": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "supplier_id", + "type": "bigint", + "nullable": false + }, + { + "name": "department_id", + "type": "bigint", + "nullable": true + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "submitted_by", + "type": "bigint", + "nullable": true + }, + { + "name": "reviewed_by", + "type": "bigint", + "nullable": true + }, + { + "name": "previous_id", + "type": "bigint", + "nullable": true + }, + { + "name": "operation_key", + "type": "uuid", + "nullable": false + }, + { + "name": "creation_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "revision", + "type": "integer", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "status", + "type": "character varying", + "nullable": false + }, + { + "name": "contributors", + "type": "json", + "nullable": false + }, + { + "name": "supplier_snapshot", + "type": "json", + "nullable": false + }, + { + "name": "payload", + "type": "json", + "nullable": false + }, + { + "name": "review_reason", + "type": "text", + "nullable": true + }, + { + "name": "reviewed_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "supplier_improvements": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "supplier_evaluation_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "responsible_id", + "type": "bigint", + "nullable": false + }, + { + "name": "operation_key", + "type": "uuid", + "nullable": false + }, + { + "name": "creation_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "title", + "type": "character varying", + "nullable": false + }, + { + "name": "description", + "type": "text", + "nullable": false + }, + { + "name": "due_on", + "type": "date", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "status", + "type": "character varying", + "nullable": false + }, + { + "name": "contributors", + "type": "json", + "nullable": false + }, + { + "name": "result", + "type": "text", + "nullable": true + }, + { + "name": "evidence", + "type": "text", + "nullable": true + }, + { + "name": "reviewed_by", + "type": "bigint", + "nullable": true + }, + { + "name": "review_reason", + "type": "text", + "nullable": true + }, + { + "name": "reviewed_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "supplier_responses": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "supplier_evaluation_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "operation_key", + "type": "uuid", + "nullable": false + }, + { + "name": "creation_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "status", + "type": "character varying", + "nullable": false + }, + { + "name": "payload", + "type": "json", + "nullable": false + }, + { + "name": "contributors", + "type": "json", + "nullable": false + }, + { + "name": "decision", + "type": "json", + "nullable": true + }, + { + "name": "reviewed_by", + "type": "bigint", + "nullable": true + }, + { + "name": "review_reason", + "type": "text", + "nullable": true + }, + { + "name": "reviewed_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "suppliers": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "name", + "type": "character varying", + "nullable": false + }, + { + "name": "nuit", + "type": "character varying", + "nullable": false + }, + { + "name": "contact", + "type": "character varying", + "nullable": false + }, + { + "name": "email", + "type": "character varying", + "nullable": false + }, + { + "name": "phone", + "type": "character varying", + "nullable": false + }, + { + "name": "address", + "type": "character varying", + "nullable": false + }, + { + "name": "category", + "type": "character varying", + "nullable": false + }, + { + "name": "beneficiaries", + "type": "text", + "nullable": false + }, + { + "name": "document_references", + "type": "text", + "nullable": false + }, + { + "name": "diligence_notes", + "type": "text", + "nullable": false + }, + { + "name": "blocked", + "type": "boolean", + "nullable": false + }, + { + "name": "status", + "type": "character varying", + "nullable": false + }, + { + "name": "next_review", + "type": "date", + "nullable": false + }, + { + "name": "reviewed_by", + "type": "bigint", + "nullable": true + }, + { + "name": "review_comment", + "type": "text", + "nullable": true + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "last_changed_by", + "type": "bigint", + "nullable": true + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "geography_reference", + "type": "json", + "nullable": true + } + ], + "supply_records": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "kind", + "type": "character varying", + "nullable": false + }, + { + "name": "record_key", + "type": "uuid", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "state", + "type": "character varying", + "nullable": false + }, + { + "name": "stock_item_id", + "type": "bigint", + "nullable": true + }, + { + "name": "warehouse_id", + "type": "bigint", + "nullable": true + }, + { + "name": "supplier_id", + "type": "bigint", + "nullable": true + }, + { + "name": "purchase_order_id", + "type": "bigint", + "nullable": true + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "data", + "type": "json", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "operation_key", + "type": "uuid", + "nullable": false + }, + { + "name": "input_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "technical_reviews": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "requisition_id", + "type": "bigint", + "nullable": false + }, + { + "name": "reviewed_by", + "type": "bigint", + "nullable": false + }, + { + "name": "basis_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "decision", + "type": "character varying", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "reviewed_at", + "type": "timestamp without time zone", + "nullable": false + } + ], + "tenants": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "name", + "type": "character varying", + "nullable": false + }, + { + "name": "currency", + "type": "character varying", + "nullable": false + }, + { + "name": "first_limit_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "second_limit_minor", + "type": "bigint", + "nullable": false + }, + { + "name": "approval_includes_tax", + "type": "boolean", + "nullable": false + }, + { + "name": "rules_provisional", + "type": "boolean", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "default_tax_rate", + "type": "numeric", + "nullable": false + }, + { + "name": "comparison_policy", + "type": "json", + "nullable": true + }, + { + "name": "intelligence_policy", + "type": "json", + "nullable": true + }, + { + "name": "work_context_policy", + "type": "json", + "nullable": true + }, + { + "name": "geography_reference", + "type": "json", + "nullable": true + }, + { + "name": "company_details", + "type": "json", + "nullable": true + }, + { + "name": "requisition_approval_policy", + "type": "json", + "nullable": true + } + ], + "users": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "name", + "type": "character varying", + "nullable": false + }, + { + "name": "email", + "type": "character varying", + "nullable": false + }, + { + "name": "email_verified_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "password", + "type": "character varying", + "nullable": false + }, + { + "name": "remember_token", + "type": "character varying", + "nullable": true + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": true + }, + { + "name": "department_id", + "type": "bigint", + "nullable": true + }, + { + "name": "purchasing_role", + "type": "character varying", + "nullable": false + }, + { + "name": "two_factor_secret", + "type": "text", + "nullable": true + }, + { + "name": "two_factor_recovery_codes", + "type": "text", + "nullable": true + }, + { + "name": "two_factor_confirmed_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "warehouse_request_events": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "warehouse_request_id", + "type": "bigint", + "nullable": false + }, + { + "name": "actor_id", + "type": "bigint", + "nullable": false + }, + { + "name": "version", + "type": "integer", + "nullable": false + }, + { + "name": "operation_key", + "type": "uuid", + "nullable": false + }, + { + "name": "input_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "action", + "type": "character varying", + "nullable": false + }, + { + "name": "data", + "type": "json", + "nullable": false + }, + { + "name": "reason", + "type": "text", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp with time zone", + "nullable": false + } + ], + "warehouse_requests": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "warehouse_id", + "type": "bigint", + "nullable": false + }, + { + "name": "cost_center_id", + "type": "bigint", + "nullable": false + }, + { + "name": "work_context_key", + "type": "character varying", + "nullable": false + }, + { + "name": "operation_key", + "type": "uuid", + "nullable": false + }, + { + "name": "input_hash", + "type": "character varying", + "nullable": false + }, + { + "name": "status", + "type": "character varying", + "nullable": false + }, + { + "name": "snapshot", + "type": "json", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp with time zone", + "nullable": false + } + ], + "warehouse_reservations": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "warehouse_request_id", + "type": "bigint", + "nullable": false + }, + { + "name": "line_index", + "type": "integer", + "nullable": false + }, + { + "name": "stock_item_id", + "type": "bigint", + "nullable": false + }, + { + "name": "warehouse_id", + "type": "bigint", + "nullable": false + }, + { + "name": "authorization_event_id", + "type": "bigint", + "nullable": false + }, + { + "name": "actor_id", + "type": "bigint", + "nullable": false + }, + { + "name": "command_key", + "type": "uuid", + "nullable": false + }, + { + "name": "kind", + "type": "character varying", + "nullable": false + }, + { + "name": "quantity_milli", + "type": "bigint", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp with time zone", + "nullable": false + } + ], + "warehouses": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "created_by", + "type": "bigint", + "nullable": false + }, + { + "name": "code", + "type": "character varying", + "nullable": false + }, + { + "name": "name", + "type": "character varying", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp without time zone", + "nullable": true + }, + { + "name": "updated_at", + "type": "timestamp without time zone", + "nullable": true + } + ], + "workflow_notices": [ + { + "name": "id", + "type": "bigint", + "nullable": false + }, + { + "name": "tenant_id", + "type": "bigint", + "nullable": false + }, + { + "name": "requisition_id", + "type": "bigint", + "nullable": false + }, + { + "name": "approval_step_id", + "type": "bigint", + "nullable": false + }, + { + "name": "recipient_id", + "type": "bigint", + "nullable": false + }, + { + "name": "reference", + "type": "character varying", + "nullable": false + }, + { + "name": "role", + "type": "character varying", + "nullable": false + }, + { + "name": "created_at", + "type": "timestamp with time zone", + "nullable": false + }, + { + "name": "read_at", + "type": "timestamp with time zone", + "nullable": true + } + ] + }, + "applied_migrations": [ + "0001_01_01_000000_create_users_table", + "0001_01_01_000001_create_cache_table", + "0001_01_01_000002_create_jobs_table", + "2026_10_28_000001_create_procurement_foundation", + "2026_10_28_000002_create_suppliers_and_quotations", + "2026_10_28_000003_add_supplier_maintenance_and_documents", + "2026_10_28_000004_create_conflict_declarations", + "2026_10_28_000005_create_purchase_awards_and_orders", + "2026_10_28_000006_create_receipts_and_stock", + "2026_10_28_000007_create_stock_operations", + "2026_10_28_000008_create_equipment_and_spare_parts", + "2026_10_28_000009_create_budgets", + "2026_10_28_000010_create_invoices", + "2026_10_28_000011_create_supplier_bank_details", + "2026_10_28_000012_create_external_payments", + "2026_10_28_000013_create_budget_reinforcements", + "2026_10_28_000014_create_investment_policies", + "2026_10_28_000015_create_purchase_controls", + "2026_10_28_000016_create_purchase_planning", + "2026_10_28_000017_create_proposal_openings", + "2026_10_28_000018_create_documentary_qualification", + "2026_10_28_000019_create_formal_admission", + "2026_10_28_000020_create_formal_recommendations", + "2026_10_30_000024_create_supplier_evaluations", + "2026_10_30_000025_create_supplier_improvements", + "2026_10_30_000026_create_supplier_responses", + "2026_10_30_000027_create_organization_access", + "2026_10_30_000028_add_economic_comparison_terms", + "2026_10_30_000029_add_comparison_policy_snapshots", + "2026_10_30_000030_create_people_hiring", + "2026_10_30_000031_create_people_process_access", + "2026_10_30_000032_create_people_clarifications", + "2026_10_30_000033_add_intelligence_policy", + "2026_10_30_000034_create_people_registry", + "2026_10_30_000035_create_requisition_catalogue", + "2026_10_30_000036_create_submission_forms", + "2026_10_30_000037_create_candidate_profiles", + "2026_10_30_000038_create_candidate_access_tokens", + "2026_10_30_000039_create_candidate_submissions", + "2026_10_30_000040_create_candidate_triage", + "2026_10_30_000041_create_candidate_submission_documents", + "2026_11_01_000042_create_supply_records", + "2026_11_01_000043_create_inventory_lot_allocations", + "2026_11_01_000044_allow_signed_lot_adjustments", + "2026_11_01_000045_add_work_context_configuration", + "2026_11_01_000046_add_requisition_command_versions", + "2026_11_01_000046_create_workflow_notices", + "2026_11_01_000047_create_warehouse_requests", + "2026_11_01_000048_create_warehouse_request_events", + "2026_11_02_000049_create_warehouse_reservations", + "2026_11_02_000050_create_replenishment_work", + "2026_11_03_000001_add_two_factor_columns_to_users", + "2026_11_03_000002_create_receipt_documents", + "2026_11_03_000004_add_administrative_geography_references", + "2026_11_21_000001_create_quotation_exchange_rates", + "2026_11_21_000002_add_supplier_bank_account_keys", + "2026_11_22_000001_add_company_details_to_tenants", + "2026_11_22_000002_allow_incomplete_requisition_drafts", + "2026_11_22_000003_add_configured_requisition_levels", + "2026_11_22_000004_create_budget_distributions" + ], + "component_profiles": { + "budget-distributions-v1": { + "present": [ + "budget_distributions", + "budget_distribution_events", + "budget_distribution_entries", + "budget_distribution_consumptions" + ], + "sha256": "4239f48f64e2beb0cf34d3dc8730aca3a0c54aef9cb0dff2c69d03c0e8b1c2e1" + }, + "supplier-settlements-v1": { + "present": [ + "ps_payments", + "ps_payment_decisions", + "ps_proposals", + "ps_allocation_aliases", + "ps_allocation_decisions", + "ps_allocations", + "ps_commands", + "ps_events", + "ps_outbox" + ], + "sha256": "11b1522f8b62c32944cf53a6180046d28d51c5c295e6e390633ac809d72bf05a" + }, + "supplier-payables-v1": { + "present": [ + "pa_access", + "pa_sources", + "pa_proposals", + "pa_obligations", + "pa_commands", + "pa_events", + "pa_outbox" + ], + "sha256": "cda146acf4e674c72b7676fc02cf9b8c5e89208d1dd099193950d785c4dd8452" + } + } +} diff --git a/resources/js/components/sgc-workspace-shell.tsx b/resources/js/components/sgc-workspace-shell.tsx index 9617e0e..cc9df53 100644 --- a/resources/js/components/sgc-workspace-shell.tsx +++ b/resources/js/components/sgc-workspace-shell.tsx @@ -29,6 +29,7 @@ import { activeProcurementEntry, procurementNavigation, } from '@/lib/procurement-navigation'; +import type { CommonFinanceNavigation } from '@/lib/procurement-navigation'; import { roleLabels } from '@/types/procurement'; import type { WorkContextState } from '@/types/work-context'; import { WorkContextChange } from '@/components/work-context-change'; @@ -54,6 +55,9 @@ export function SgcWorkspaceShell({ children }: { children: ReactNode }) { permissions: string[]; } | null; const context = page.props.workContext as WorkContextState | null; + const commonFinance = page.props.commonFinanceNavigation as + | CommonFinanceNavigation + | undefined; const scopedEntries = new Set( procurementNavigation( context?.permissions ?? [], @@ -63,6 +67,7 @@ export function SgcWorkspaceShell({ children }: { children: ReactNode }) { page.props.operationalOrdersAvailable === true, page.props.privateAuditAvailable === true, page.props.capitalRegisterAvailable === true, + commonFinance, ).flatMap((group) => group.entries.map((entry) => entry.id)), ); const groups = procurementNavigation( @@ -73,6 +78,7 @@ export function SgcWorkspaceShell({ children }: { children: ReactNode }) { page.props.operationalOrdersAvailable === true, page.props.privateAuditAvailable === true, page.props.capitalRegisterAvailable === true, + commonFinance, ) .map((group) => ({ ...group, diff --git a/resources/js/lib/journey-help.ts b/resources/js/lib/journey-help.ts index 4342a7f..9c73dff 100644 --- a/resources/js/lib/journey-help.ts +++ b/resources/js/lib/journey-help.ts @@ -37,6 +37,25 @@ function topic( } export const journeyHelp: JourneyHelp[] = [ + topic( + 'company-finance', + 'Configurar o livro financeiro da empresa', + ['company/finance'], + 'Registar as pessoas, competências, contas, períodos e regras utilizados no núcleo financeiro da própria empresa.', + [ + 'Seleccione expressamente o utilizador e as competências pretendidas. Utilize a mesma referência de pessoa para contas que pertencem à mesma pessoa.', + 'Registe os códigos e designações do plano de contas. Assinale as contas de movimento que podem ser usadas nas regras.', + 'Defina períodos sem sobreposição e regras com efeito, duas contas distintas e vigência explícitos. Fundamente cada alteração.', + 'Confira o histórico. Uma nova versão da regra preserva os lançamentos e as decisões anteriores.', + ], + [ + 'A administração configura; as competências de preparação, revisão e aplicação financeira são escolhidas separadamente. Consultar a página não concede acessos.', + 'O cadastro não cria dívidas, pagamentos, lançamentos ou movimentos de stock. O fecho de período exige o circuito de conferência independente.', + 'Revogar competências deste contrato conserva acessos de outros contratos e o histórico. Uma pessoa não pode rever o seu próprio trabalho por usar outra conta.', + ], + 'Se a configuração mudou, actualize a preparação e confira novamente os valores antes de guardar. Se não sabe se a operação foi registada, consulte o histórico antes de repetir.', + 'Os intervenientes com competência explícita podem prosseguir para as obrigações, pagamentos e diário no menu Finanças.', + ), topic( 'private-audit', 'Preparar uma exportação privada de auditoria', diff --git a/resources/js/lib/procurement-navigation.ts b/resources/js/lib/procurement-navigation.ts index 7dd8cd6..e52e3dd 100644 --- a/resources/js/lib/procurement-navigation.ts +++ b/resources/js/lib/procurement-navigation.ts @@ -24,6 +24,11 @@ export type ProcurementGroup = { icon: LucideIcon; entries: ProcurementEntry[]; }; +export type CommonFinanceNavigation = { + payments?: boolean; + ledger?: boolean; + configuration?: boolean; +}; const readers = ['admin', 'procurement', 'finance', 'department_head']; const finance = ['admin', 'finance']; const inventory = [...readers, 'warehouse']; @@ -36,6 +41,7 @@ export function procurementNavigation( operationalOrders = false, privateAudit = false, capitalRegister = false, + commonFinance: CommonFinanceNavigation = {}, ): ProcurementGroup[] { const groups: ProcurementGroup[] = [ { @@ -455,6 +461,28 @@ export function procurementNavigation( }, ] : []), + ...(commonFinance.payments === true + ? [ + { + id: 'supplier_settlements', + label: 'Pagamentos e afectações a facturas', + path: '/supplier-payments', + roles: finance, + fullPage: true, + }, + ] + : []), + ...(commonFinance.ledger === true + ? [ + { + id: 'general_ledger', + label: 'Diário, balancete e razão', + path: '/general-ledger/cycle', + roles: finance, + fullPage: true, + }, + ] + : []), { id: 'payments', label: 'Pagamentos externos', @@ -480,6 +508,16 @@ export function procurementNavigation( label: 'Administração e controlo', icon: ShieldCheck, entries: [ + ...(commonFinance.configuration === true + ? [ + { + id: 'finance_configuration', + label: 'Configuração financeira', + path: '/administracao/financeiro', + roles: ['admin'], + }, + ] + : []), { id: 'company', label: 'Empresa, equipa e centros', diff --git a/resources/js/pages/company/finance.tsx b/resources/js/pages/company/finance.tsx new file mode 100644 index 0000000..409b6b9 --- /dev/null +++ b/resources/js/pages/company/finance.tsx @@ -0,0 +1,871 @@ +import { Head, Link, router, useForm } from '@inertiajs/react'; +import { useState } from 'react'; +import type { FormEvent, ReactNode } from 'react'; +import { + PageTitle, + Panel, + FormErrors, + TableViewport, + controlClass, +} from '@/components/procurement'; +import { Button } from '@/components/ui/button'; +import { usePreparationDirty } from '@/hooks/use-preparation-dirty'; +import { useProcurementPreparationIdentity } from '@/hooks/use-procurement-preparation-identity'; + +type Row = Record; +type Basis = { hash: string; rows: T[] }; +type Account = { + id: number; + code: string; + label: string; + currency: string; + is_movement: boolean; +}; +type Person = { id: number; name: string; email: string }; +type Page = { + data: T[]; + prev_page_url: string | null; + next_page_url: string | null; +}; +type Access = Basis & { + user: Person; + eligible: boolean; + person: string; + actions: string[]; + other_actions: string[]; + identity_inconsistent: boolean; +}; +type Props = { + actorId: number; + tenantId: number; + q: string; + users: Page; + selectedAccess: Access | null; + accounts: Basis; + periods: Basis; + rules: Basis; + actions: Record; + effects: Record; + history: Page<{ + id: number; + actor_id: number; + kind: string; + reason: string; + before: Basis; + after: Basis; + created_at: string; + }>; +}; +type Kind = 'access' | 'account' | 'period' | 'rule'; +type Data = { + operation_key: string; + basis_hash: string; + reason: string; + user_id?: number; + person?: string; + actions?: string[]; + code?: string; + label?: string; + currency?: string; + is_movement?: boolean; + period_key?: string; + starts_on?: string; + ends_on?: string; + rule_key?: string; + effect_type?: string; + valid_from?: string; + valid_to?: string; + debit_account_id?: string; + credit_account_id?: string; +}; +const base = '/administracao/financeiro'; + +function useConfigurationForm( + kind: Kind, + hash: string, + identity: string, + fields: Partial, + clearAfterSave = true, +) { + const initial: Data = { + ...fields, + operation_key: '', + basis_hash: hash, + reason: '', + }; + const form = useForm(identity, initial); + const ref = usePreparationDirty(form.isDirty); + const current = form.data.basis_hash === hash; + const review = () => { + form.setData({ ...form.data, operation_key: '', basis_hash: hash }); + form.clearErrors(); + }; + const submit = (event: FormEvent) => { + event.preventDefault(); + if (!current || form.processing) return; + const operation = form.data.operation_key || crypto.randomUUID(); + form.setData('operation_key', operation); + form.transform((data) => ({ ...data, operation_key: operation })); + form.post(`${base}/${kind}`, { + preserveScroll: true, + onSuccess: (page) => { + const source = + page.props[ + kind === 'access' + ? 'selectedAccess' + : kind === 'account' + ? 'accounts' + : kind === 'period' + ? 'periods' + : 'rules' + ]; + if ( + !source || + typeof source !== 'object' || + !('hash' in source) || + typeof source.hash !== 'string' + ) + return; + const next = { + ...(clearAfterSave ? initial : form.data), + operation_key: '', + basis_hash: source.hash, + reason: '', + }; + form.setData(next); + form.setDefaults(next); + form.clearErrors(); + }, + }); + }; + return { form, ref, current, review, submit }; +} + +function Reason({ + value, + change, + id, +}: { + value: string; + change: (value: string) => void; + id: string; +}) { + return ( +