Compare commits
14
Commits
fase5-producao
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b150f8fdea | ||
|
|
0dc441b6e4 | ||
|
|
db5664c84c | ||
|
|
822fb2ffcc | ||
|
|
0d58e2fda1 | ||
|
|
df851dafa1 | ||
|
|
2c24032ec3 | ||
|
|
c574df4d39 | ||
|
|
ebbf0d2bec | ||
|
|
e0ec95e90f | ||
|
|
8df759de33 | ||
|
|
f590a29e55 | ||
|
|
95f80a10d7 | ||
|
|
c9bd6db90b |
@@ -56,9 +56,9 @@ final class CommonStockReadController extends Controller
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return response()->json(['status' => 'unavailable', 'message' => 'A fonte de stock está indisponível ou incompatível. Actualize a consulta mais tarde.'], 503)->header('Cache-Control','no-store');
|
||||
return response()->json(['status' => 'unavailable', 'message' => 'A fonte de stock está indisponível ou incompatível. Actualize a consulta mais tarde.'], 503)->header('Cache-Control', 'no-store');
|
||||
}
|
||||
|
||||
return response()->json($result)->header('Cache-Control','no-store');
|
||||
return response()->json($result)->header('Cache-Control', 'no-store');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class OrderCancellationController extends Controller
|
||||
{
|
||||
$actor = $this->actor($request);
|
||||
$focus = $request->validate(['cancellation_id' => 'nullable|integer|min:1'])['cancellation_id'] ?? null;
|
||||
abort_unless($actor->hasFunctions(['admin', 'procurement', 'finance', 'requester', 'department_head']), 403);
|
||||
abort_unless($workflow->canView($actor), 403);
|
||||
|
||||
return DB::transaction(function () use ($request, $actor, $workflow, $focus) {
|
||||
if (DB::getDriverName() === 'pgsql' && DB::transactionLevel() === 1) {
|
||||
|
||||
@@ -51,7 +51,7 @@ final class WarehouseReturnController extends Controller
|
||||
DB::statement('SET TRANSACTION ISOLATION LEVEL REPEATABLE READ READ ONLY');
|
||||
}
|
||||
|
||||
return $run();
|
||||
return $run();
|
||||
}) : $run();
|
||||
|
||||
return response()->json($result)->header('Cache-Control', 'no-store');
|
||||
|
||||
@@ -4,10 +4,12 @@ namespace App\Services;
|
||||
|
||||
use App\Models\ConflictDeclaration;
|
||||
use App\Models\ConflictRelease;
|
||||
use App\Models\Supplier;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Tempo\Purchasing\Composition\ExecutionContext;
|
||||
|
||||
/** Explicit direction authority; no legacy Admin/Finance fallback or automatic expiry. */
|
||||
final class ConflictReleases
|
||||
@@ -16,6 +18,10 @@ final class ConflictReleases
|
||||
{
|
||||
$db = DB::connection();
|
||||
|
||||
if (app()->bound(ExecutionContext::class)) {
|
||||
return app(ExecutionContext::class)->allows('conflict-release', $db) && Schema::hasTable('conflict_releases');
|
||||
}
|
||||
|
||||
if (app(StandaloneRuntime::class)->enabled()) {
|
||||
return app(StandaloneRuntime::class)->feature('conflict-releases', $db) && Schema::hasTable('conflict_releases');
|
||||
}
|
||||
@@ -42,6 +48,13 @@ final class ConflictReleases
|
||||
public function authorise(User $actor, ConflictDeclaration $declaration, array $input): ConflictRelease
|
||||
{
|
||||
abort_unless($this->ready(), 503);
|
||||
if (app()->bound(ExecutionContext::class)) {
|
||||
abort_unless(app(ExecutionContext::class)->permits('purchasing_conflicts.authorise', DB::connection()), 403);
|
||||
if ($declaration->requisition_id === null) {
|
||||
abort_unless(app(ExecutionContext::class)->component('conflict-release', DB::connection())['company_authorise'] ?? false, 403);
|
||||
abort_unless($declaration->supplier_id !== null && Supplier::query()->where('tenant_id', $actor->tenant_id)->whereKey($declaration->supplier_id)->exists(), 403);
|
||||
}
|
||||
}
|
||||
$data = Validator::make($input, ['operation_key' => 'required|uuid', 'reason' => 'required|string|min:10|max:5000'])->validate();
|
||||
$data['operation_key'] = strtolower($data['operation_key']);
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ class OrderCancellationPolicyWorkflow extends PurchaseControlPolicyWorkflow
|
||||
public function propose(User $user, array $data): PurchaseControlPolicy
|
||||
{
|
||||
$this->enabled();
|
||||
app(OrderCancellationRuntime::class)->assertAction('prepare');
|
||||
abort_if(app(OrganizationAccess::class)->maintenanceOnly($user), 403);
|
||||
validator($data, ['previous_id' => 'required|integer|min:0', 'mode' => 'required|in:issued_order', 'enabled' => 'required|boolean',
|
||||
'valid_from' => 'required|date_format:Y-m-d', 'valid_until' => 'required|date_format:Y-m-d|after_or_equal:valid_from', 'reason' => 'required|string|min:10|max:4000'])->validate();
|
||||
@@ -59,6 +60,7 @@ class OrderCancellationPolicyWorkflow extends PurchaseControlPolicyWorkflow
|
||||
public function review(User $user, PurchaseControlPolicy $policy, string $decision, string $reason): void
|
||||
{
|
||||
$this->enabled();
|
||||
app(OrderCancellationRuntime::class)->assertAction('approve');
|
||||
abort_if(app(OrganizationAccess::class)->maintenanceOnly($user), 403);
|
||||
parent::review($user, $policy, $decision, $reason);
|
||||
}
|
||||
|
||||
@@ -6,14 +6,30 @@ use Illuminate\Support\Facades\DB;
|
||||
use LogicException;
|
||||
use Tempo\Finance\Budget\BudgetContext;
|
||||
use Tempo\Finance\OrderCancellation\CommitmentReversal;
|
||||
use Tempo\Purchasing\Composition\ExecutionContext;
|
||||
|
||||
/** Version selection for the existing additive reversal writer, never another budget ledger. */
|
||||
final class OrderCancellationRuntime
|
||||
{
|
||||
public const MANIFEST_SHA256 = '52df7927aa2689598ce1be92de1483694347a696245704abb9e3925db7abfc0f';
|
||||
|
||||
public function assertAction(string $action): void
|
||||
{
|
||||
if (! in_array($action, ['prepare', 'approve', 'revise'], true)) {
|
||||
throw new LogicException('COMPRAS_CANCELLATION_ACTION');
|
||||
}
|
||||
if (app()->bound(ExecutionContext::class)) {
|
||||
abort_unless(app(ExecutionContext::class)->permits('purchasing_order_cancellations.'.$action, DB::connection()), 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function assertReady(): void
|
||||
{
|
||||
if (app()->bound(ExecutionContext::class)) {
|
||||
$this->compositionRoot();
|
||||
|
||||
return;
|
||||
}
|
||||
$runtime = app(StandaloneRuntime::class);
|
||||
if (! $runtime->enabled()) {
|
||||
return;
|
||||
@@ -56,8 +72,11 @@ final class OrderCancellationRuntime
|
||||
/** Returns whether the writer requires the explicit cycle map in its financial context. */
|
||||
public function load(int $origin): bool
|
||||
{
|
||||
$operational = app(StandaloneRuntime::class)->enabled();
|
||||
if ($operational) {
|
||||
$composed = app()->bound(ExecutionContext::class);
|
||||
$operational = $composed || app(StandaloneRuntime::class)->enabled();
|
||||
if ($composed) {
|
||||
$path = $this->compositionRoot().'/src/CommitmentReversal.php';
|
||||
} elseif ($operational) {
|
||||
$this->assertReady();
|
||||
$path = config('order_cancellation.root').'/src/CommitmentReversal.php';
|
||||
} else {
|
||||
@@ -75,4 +94,23 @@ final class OrderCancellationRuntime
|
||||
|
||||
return $operational;
|
||||
}
|
||||
|
||||
private function compositionRoot(): string
|
||||
{
|
||||
$db = DB::connection();
|
||||
$component = app(ExecutionContext::class)->component('order-cancellation-cycles', $db);
|
||||
if (! hash_equals(self::MANIFEST_SHA256, $component['manifest_sha256']) || ! property_exists(BudgetContext::class, 'requisitionCycles')) {
|
||||
throw new LogicException('COMPRAS_CANCELLATION_COMPOSITION');
|
||||
}
|
||||
foreach (['order_cancellations' => ['operation_key', 'basis_hash', 'status'],
|
||||
'order_cancellation_policies' => ['revision', 'status'], 'order_cancellation_policy_reviews' => ['reviewed_by'],
|
||||
'budget_entries' => ['requisition_cycle'], 'budget_requisition_cycles' => ['cycle', 'state']] as $table => $columns) {
|
||||
if (! $db->getSchemaBuilder()->hasColumns($table, $columns)) {
|
||||
throw new LogicException('COMPRAS_CANCELLATION_SCHEMA');
|
||||
}
|
||||
}
|
||||
self::verifyArtifact($component['root']);
|
||||
|
||||
return $component['root'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,11 @@ use Tempo\Finance\OrderCancellation\CommitmentReversal;
|
||||
|
||||
class OrderCancellationWorkflow
|
||||
{
|
||||
public function canView(User $actor): bool
|
||||
{
|
||||
return $actor->tenant_id !== null && $actor->hasFunctions(['admin', 'procurement', 'finance', 'requester', 'department_head']);
|
||||
}
|
||||
|
||||
public function canRevise(User $actor, OrderCancellation $record): bool
|
||||
{
|
||||
if (! config('order_cancellation.enabled') || $record->tenant_id !== $actor->tenant_id || $record->status !== 'approved' || $record->revised_requisition_id
|
||||
@@ -124,6 +129,7 @@ class OrderCancellationWorkflow
|
||||
public function request(User $actor, PurchaseOrder $order, array $input): OrderCancellation
|
||||
{
|
||||
$this->enabled();
|
||||
app(OrderCancellationRuntime::class)->assertAction('prepare');
|
||||
$data = validator($input, ['operation_key' => 'required|uuid', 'reason' => 'required|string|min:10|max:4000', 'evidence' => 'required|string|min:10|max:4000'])->validate();
|
||||
$data['operation_key'] = strtolower($data['operation_key']);
|
||||
$hash = hash('sha256', json_encode([$order->id, $data], JSON_THROW_ON_ERROR));
|
||||
@@ -161,6 +167,7 @@ class OrderCancellationWorkflow
|
||||
public function decide(User $actor, OrderCancellation $record, string $decision, string $reason): void
|
||||
{
|
||||
$this->enabled();
|
||||
app(OrderCancellationRuntime::class)->assertAction('approve');
|
||||
validator(['decision' => $decision, 'reason' => $reason], ['decision' => 'required|in:approved,rejected', 'reason' => 'required|string|min:10|max:4000'])->validate();
|
||||
DB::transaction(function () use ($actor, $record, $decision, $reason) {
|
||||
app(ConflictGuard::class)->lockCompany($actor);
|
||||
@@ -250,6 +257,7 @@ class OrderCancellationWorkflow
|
||||
public function revise(User $actor, OrderCancellation $record, string $neededBy, string $reason): Requisition
|
||||
{
|
||||
$this->enabled();
|
||||
app(OrderCancellationRuntime::class)->assertAction('revise');
|
||||
validator(['needed_by' => $neededBy, 'reason' => $reason], ['needed_by' => 'required|date_format:Y-m-d|after_or_equal:today', 'reason' => 'required|string|min:10|max:4000'])->validate();
|
||||
|
||||
return DB::transaction(function () use ($actor, $record, $neededBy, $reason) {
|
||||
|
||||
+169
-167
@@ -53,7 +53,7 @@
|
||||
"app/Http/Controllers/CandidatePortalController.php": "1f826616776b1ea9d7b19998bf0556521196fcc36e7decebf50825c874beeca6",
|
||||
"app/Http/Controllers/CapitalRegisterController.php": "1e6b156c394085965929601f9f4b942a38817124426b6fff832a6467ffc7d1fc",
|
||||
"app/Http/Controllers/CommonFinanceAdministrationController.php": "b5d93248cc3692c4b6b2ad079b1cff3721e538405e84e8407d9dbf385fcc502e",
|
||||
"app/Http/Controllers/CommonStockReadController.php": "893654aa9b123822c8af79c57dba79997b5c3dff3af3ff544c6ed22be87dbaf4",
|
||||
"app/Http/Controllers/CommonStockReadController.php": "af7ca6c8728e50a1ae27fcdcc5c32e8d26691365c4109aa5be900bd9c32198ab",
|
||||
"app/Http/Controllers/CompanyController.php": "a441a7041390fa0ac84ff920e68d6e15e3342ba94e51eebdc7e7085ef695f00f",
|
||||
"app/Http/Controllers/ConflictDeclarationController.php": "073d17c96f0455aa62feb7c4d77e563fd85b368862cb81db96a3a06c43704d40",
|
||||
"app/Http/Controllers/Controller.php": "1728f0a5c43342cb03669d217104de085abba81d88a1d75cbe9dc0c976690e1b",
|
||||
@@ -78,7 +78,7 @@
|
||||
"app/Http/Controllers/InvestmentPolicyController.php": "ea2026b3020ada821cc549d39439cd1a9b35d51d7137a2f4c41aa1e0ed425d54",
|
||||
"app/Http/Controllers/InvoiceController.php": "d28714c1301a81b9fe8fcede12c68221e87bf27e7603af3da205879b95119703",
|
||||
"app/Http/Controllers/OperationalOrdersController.php": "8a7e6bc08cbacabf70f55ae6fbe34e71e2ddfd9f45b4733814842446c95dd230",
|
||||
"app/Http/Controllers/OrderCancellationController.php": "fe9c8ac161edcbd28cd23c9ef49ebb305fc2893c917d66f1039c663c1230f11a",
|
||||
"app/Http/Controllers/OrderCancellationController.php": "ffe1044ba5196561afa761e4ad8f3bb004f593522555886ba1f8827480437e8d",
|
||||
"app/Http/Controllers/OrderPartsController.php": "c4e3c0df8b736fd4ca4512455379d06073d882c5afac5da73eee58c75d84ef98",
|
||||
"app/Http/Controllers/OrganizationConfigurationController.php": "0b6b360b01a7945b83741af2055196a99a2fd677f4ed479a0120936e7552a85b",
|
||||
"app/Http/Controllers/PeopleHiringController.php": "d12f2bba36ded2c076e6ea3462e0bce03fe776c5aa9932dcaf0e91ee32b062fd",
|
||||
@@ -124,7 +124,7 @@
|
||||
"app/Http/Controllers/WarehouseExchangeController.php": "f6ee16be5eb7ef8f0ecb9cf25024399047f81b3de70bdc332d5efe5945e99a24",
|
||||
"app/Http/Controllers/WarehousePilotController.php": "5d8b701bd24f4dd85790e588b8aa1e71e5fc165ae7cdaf9ad03ec83a94f66388",
|
||||
"app/Http/Controllers/WarehouseRequestController.php": "0d4765df747943c94db22b7d45524cebd3504ce76611c24a499d03bbcbfddaef",
|
||||
"app/Http/Controllers/WarehouseReturnController.php": "7ddf3818696b719e4bb0ba6169ad2c1c8a7463fe2162638023b186018108f3f7",
|
||||
"app/Http/Controllers/WarehouseReturnController.php": "753732ced509cacad37aee91339f734055a006fb7b9ff86a30a12f9401e4d27a",
|
||||
"app/Http/Controllers/WorkContextController.php": "6e96ca95150a5200666516dcac707b5feb05a88ab29fc4c08658781894ffbf2f",
|
||||
"app/Http/Controllers/WorkflowNoticeController.php": "4005a2bbce18ab21caabee7e4a5cd050f001240ca87d7729646598b50ad845e1",
|
||||
"app/Http/Controllers/WorkflowTaskInboxController.php": "ee950c89d6201882b0c82db9f4f2bc8481ed26a23ba71fdf6d8b40fc65b7ce99",
|
||||
@@ -256,7 +256,7 @@
|
||||
"app/Services/CompanyDetails.php": "03bdc3eb0281d9b27dc325c17661265dbe819ca9cec46ffe311dfc9c377dfa89",
|
||||
"app/Services/ComparisonPolicy.php": "53829f5798e31583d59c49c29440cfd8c7f83f4728c4fb2915075ead8d8ee8f3",
|
||||
"app/Services/ConflictGuard.php": "b5b7e28a96741e31d99e02a0865d5938ff4345fc88f3a66907b5a0832979f60f",
|
||||
"app/Services/ConflictReleases.php": "2fbe67958d4772d6f7c580456679f3d27385c8780775ed672b9b26d46fd65566",
|
||||
"app/Services/ConflictReleases.php": "afa8038beb5137578fbe2502b1c16c91017e175aef21103e5098be5c8479d2d2",
|
||||
"app/Services/CurrentActor.php": "ae88aa7313e7a499fb38be9297a5b605cd0949022807f23a91a9e364170a017f",
|
||||
"app/Services/CustomerDeliveries.php": "c30231e92e58e9beb63afc89559c23d10c664d722fdbc561e6fb48dcf016859d",
|
||||
"app/Services/CustomerDeliverySchema.php": "827e5290fdac8b11c2c0c93d5c751f1e1521022a231ac1626f5fa21d7dd82c06",
|
||||
@@ -301,9 +301,9 @@
|
||||
"app/Services/InvoiceWorkflow.php": "d9e0aff66f94e8928b19b9cc213b6a274aa307e08494b98643d112ad61a81e85",
|
||||
"app/Services/OperationalHealth.php": "b19f8a366c9f05848e8e4b4173ef0c9cac19fdcd36eff4c0d5e21dd21083f5f3",
|
||||
"app/Services/OperationalOrders.php": "dd90278b6682423ddeb3a86378e671a97df253f772e2c9a31a23678b26139b51",
|
||||
"app/Services/OrderCancellationPolicyWorkflow.php": "41bec84a737cbbd6936241bdad06618973d8771d2b90b8f9e364bd7456bce381",
|
||||
"app/Services/OrderCancellationRuntime.php": "5a98bb958c0bf5652d986dbdb63604feb4c46b9ee49f0364cde00473a40c20f0",
|
||||
"app/Services/OrderCancellationWorkflow.php": "1f45c710e45e577d79c164d14254697c604af626ac56612ab44ab78d2a917da7",
|
||||
"app/Services/OrderCancellationPolicyWorkflow.php": "8de7e79b558409bb06ef6ed21da2baf7abc8e1a8f49e034e9fe94589c39ee39c",
|
||||
"app/Services/OrderCancellationRuntime.php": "d3dc355f419bda0ebb434750b7851e9249000c3429b3df30064d94260a3c3fef",
|
||||
"app/Services/OrderCancellationWorkflow.php": "19fdee39b17677e06ccd54e8de99580a4f7ce90fdcd7cb3ff69c34705808bc8a",
|
||||
"app/Services/OrderPartsAccess.php": "78c036d267bf740fd6d95f2f7cfe5c3f5b35279e624da0d338c793e50963df23",
|
||||
"app/Services/OrderPartsAmendments.php": "d3c1f90d5f6577c37046b46dd700991efb4fad20c672ce847dd3ab6ed330ea12",
|
||||
"app/Services/OrderPartsExchange.php": "4a7d16a91b45bd5be52b834c9fa7359215041059925e242ac9e45656f4ef53e1",
|
||||
@@ -569,24 +569,25 @@
|
||||
"database/standalone-migrations/2026_11_29_000001_create_runtime_installations.php": "31dccd12e54221a16db88165eb21ca7c466771fef60957510a52b4cc0a8415bb",
|
||||
"database/standalone-migrations/2026_11_29_000002_install_standalone_extensions.php": "18b809eb173c38615d237c940b19541ea36b089ba8cd7534144899b29b3b44e0",
|
||||
"integrations/contracts/warehouse-fulfilment-v1.json": "f6f4913f9bdb8be44b26fb10c600300e3d6b37756e34639d555e59e916e924fc",
|
||||
"integrations/sgf/access/AccessOverlay.php": "7b027792ffbc35758161aac79bc9bb762c0449bfde291fad2bd16075323812c5",
|
||||
"integrations/sgf/access/AccessOverlay.php": "2f209880d649c162cdff496ed7af0e81438827ba7611c9c21b768fb8d5f0306d",
|
||||
"integrations/sgf/access/InitialAuthority.php": "133f7546b35786e382398e6e781d91c7db0ebf0c2a0ac375c6e102f805319763",
|
||||
"integrations/sgf/access/NativeAccessCatalogue.php": "56bfd4c664ac577d950a6367615526e5db1a80ca878851db0bfb6b87ec0f5e57",
|
||||
"integrations/sgf/access/routes.php": "297b80a4729c563d09fb4f1828197ede3531d05b30f554c3f91b8bda082bf756",
|
||||
"integrations/sgf/access/screen.php": "b53639ff8440fbc5777ec436282bdac41d3a65661000b07af9b04640cdbf35b8",
|
||||
"integrations/sgf/internal-requisitions/Controller.php": "293f2356a56004999feed930714147fc657b804b787c95cf44e8cf1487745634",
|
||||
"integrations/sgf/internal-requisitions/Port.php": "700362c2da9728632985975f7ff5147fc41bc6b29b166adbe72d1ebaa3023c1e",
|
||||
"integrations/sgf/internal-requisitions/Schema.php": "af3cfeb011dafc5d9dc5486ab1b5e29c87f29436f8e07e8ba1f63c5f4a2deec6",
|
||||
"integrations/sgf/internal-requisitions/bootstrap.php": "2f40340d53406bd0b7beeb1a25cf2c32d94c80463df6dbe6e17640a5d77630fc",
|
||||
"integrations/sgf/internal-requisitions/bootstrap.php": "77a45efb04e74c572255561a6b0f9839cb3eb6c704f48911ea6593a0b08f215e",
|
||||
"integrations/sgf/internal-requisitions/routes.php": "26fd9d26cb0338cbeeb17c7a71303b3cc2c2976a7930622453a6d4f43b0fe257",
|
||||
"integrations/sgf/internal-requisitions/screen.mjs": "04a0c0e1f96c9f54fedfc7e8394a7fb908a4971c3e84020da1627466abea0074",
|
||||
"integrations/sgf/internal-requisitions/screen.php": "02485900f52cab568ccba9b018cd32efa1387bac54e0ca9503e145a954288109",
|
||||
"integrations/sgf/operational/AdminUiOverlay.php": "ab488ff8a6984477ef480bac27d9357a9fb24dadf9a286cae7624983167aefdb",
|
||||
"integrations/sgf/operational/AdminUiOverlay.php": "dac3b71e3fa8111e0638bfff8bd5452ea66a227961dee30ef607fb156de0c3e9",
|
||||
"integrations/sgf/operational/BootOverlay.php": "c7ee415915adfd0317b3bb48429bb9c5d1dfc151f57737e37a2c5cdd48a173cd",
|
||||
"integrations/sgf/operational/BudgetOverlay.php": "07b27057395ccf58b43b43debb305579077572f2293a6a2c5e0e50938408a8e3",
|
||||
"integrations/sgf/operational/BudgetSchema.php": "2ce1fd319c667b1cb417c552f4ec903076a476c3d69327691661d61a77bc23da",
|
||||
"integrations/sgf/operational/BudgetSetup.php": "04a08e0bc2130055052e36d64ce0cc7ba0bf905359666c2b954dc96361c062c2",
|
||||
"integrations/sgf/operational/BudgetUiSchema.php": "60a2b27db5ad78567b473f2afdbbf9c00bb7ed60b2ec2b8f1f6fe7380ed330b8",
|
||||
"integrations/sgf/operational/CodeDeployment.php": "da43f8c7c8d72d7edacd6e8569ac64340bbbf89419b4179d95bcb667f28b674b",
|
||||
"integrations/sgf/operational/CodeDeployment.php": "ca173831ba2232b664cf4afd558e6b6df699a78a24e0410f0f762f81a726fedf",
|
||||
"integrations/sgf/operational/Composition.php": "5aef5ae326e30f662f37281e914e26777be84c0e5ca7f390ee03ed1700ad4830",
|
||||
"integrations/sgf/operational/Installation.php": "516b90cc92c3eeab1e4ce300bb3e57c43c72fe3601b76a43d78ac550d195f275",
|
||||
"integrations/sgf/operational/RuntimeContext.php": "5576804beb286e3ed26b026a2c2610f7cfb4b2a3c599fd70ed61b158189dc4ae",
|
||||
@@ -594,7 +595,7 @@
|
||||
"integrations/sgf/operational/bootstrap.php": "15b8ed26b8e26907e46fcecf6f6f2bbe3ba36c58ba1176207cee799c98c57869",
|
||||
"integrations/sgf/operational/budget-contract.json": "8607a0c36781a549a36428608b0ccabd4b65c3e22ab401e7830753c756384dbf",
|
||||
"integrations/sgf/operational/budget-setup.php": "9146aab31f898d2ce950b3c98cb77a6e5a032622fb694d76135ce6737379395e",
|
||||
"integrations/sgf/operational/entry.php": "0e86193900882389bc6dadc1fb8864c278df30a112dabadcd5f7b8bebcd5c66c",
|
||||
"integrations/sgf/operational/entry.php": "19d4a5970259dba72d7e956b59ab180788fa3a60fcc24bd4bf94a38d09f67587",
|
||||
"integrations/sgf/operational/frontend-routes.php": "aadf52eb2eba1c5f078994ab012697af466aa654c197da88ff44845b026b29e1",
|
||||
"integrations/sgf/operational/routes.php": "27b58b88b4d7706c4ac185db2f31ac9f3041508e9c817319e560644e9a18e342",
|
||||
"integrations/sgf/operational/setup-routes.php": "bd98c9324e45091cd0b7be6f22dbbe2d038fbecf94876cb99ff3d037d95456ba",
|
||||
@@ -662,8 +663,9 @@
|
||||
"packages/payables/ui/page.php": "209c6a8b6e52f5ddefbb0e203bd5a8b21c021ff2039dc7bb91b561f4b03bcc04",
|
||||
"packages/payables/ui/settlements.php": "c820eebeb9fd4e99560f94f05db9358af5168c93c281733db0d94d20ae95057a",
|
||||
"packages/purchasing/README.md": "0c012f253f69236f0170c2a37010d7c07d3f9a2bc2f9dc94d0d6813b011ee9fd",
|
||||
"packages/purchasing/bootstrap.php": "f3efddf8977a326fb90fce386c23fd21976ba4fb1096ffb8a41f83790c739af6",
|
||||
"packages/purchasing/bootstrap.php": "70a8f772165776ca5c25ff67bdfeae36596202b405df171bb9651644ac3f6b0d",
|
||||
"packages/purchasing/module.json": "33c0c854be9ec41d64165f8d92275cb0c141caf952988128e8fdbcb816c0b0e3",
|
||||
"packages/purchasing/src/ExecutionContext.php": "6dd61be5bfe1fc7615e4aac625dbf22ab627f41c82ed337036c8e31c32f82db8",
|
||||
"packages/purchasing/src/ExpiryRequisitionPort.php": "647cbe5cc1a0fde5ba2cae2537e51ebb45e0271f2f0c45536c4236000148fd91",
|
||||
"packages/purchasing/src/InternalRequisitions.php": "925f67d4d31c1a865d4a25a72385aae7ec398fbac10e72804791548c07d9a7a2",
|
||||
"packages/purchasing/src/ProposalScoring.php": "e6bba763e63d96e51f55b6653a5b3a9079f90e8ddb7d3ff414ea27f93284f9a8",
|
||||
@@ -672,7 +674,7 @@
|
||||
"packages/purchasing/src/RequisitionFailure.php": "72d199f2d2d42a5a40ea9b6afc9fb15f5a7c9f1253adca5d00e9037565ed54d3",
|
||||
"packages/purchasing/src/RequisitionPort.php": "46aa5f793a3f6abf7ed3561e337f3bbe7b6a63b1c25a37e230ad4e76a3492814",
|
||||
"packages/purchasing/src/Sourcing.php": "c2153a301fa20c72d2e8e285cd6e2bcc38618cade0aab9845e8d8cba8aecc55f",
|
||||
"packages/purchasing/src/StockCosting.php": "0a59333ca4247b2335ef5999f6d5e8370959c519db63921d361a309ad3b2245b",
|
||||
"packages/purchasing/src/StockCosting.php": "3877245df5976671fbe4e2552d71fa7d70c701afa18c5a56b5f4f9191cf6a6f7",
|
||||
"packages/runtime-manifest.json": "2e08bdc32fdf9cdc33e9387c4eb47c8a0e5decebb458c185bbd030094e46d8a2",
|
||||
"public/.htaccess": "b7e379c77639fd56144947dbae84c84eb466d9c686ea81f2f013ae85421da923",
|
||||
"public/apple-touch-icon.png": "4001aa032ff113e1a268a9bbf1ab0fd9949439f9f54a85895956eb323aba977d",
|
||||
@@ -680,7 +682,7 @@
|
||||
"public/favicon.svg": "242f4f8f93f5fbc6c8aeec500c9bac02dcfe68daba166d484c5cdc986c88d8ee",
|
||||
"public/index.php": "eba77cba39695b6bd091fe5211d481f7ebb2ce2d8d26230b5a609465d0a4aff9",
|
||||
"public/robots.txt": "e5c4b84484ee4216e9373be99380320c25dd94805f99f0a805846f087636553f",
|
||||
"resources/css/app.css": "73bdaa547064cf238c8fc3bfcc8de65bb27e312a41fd65066e341f0c6730df7d",
|
||||
"resources/css/app.css": "99e89c708513769ec40d06711ac6f3d61a16566d3fa12ec8e8caa0723c0dfffe",
|
||||
"resources/data/geography/README.md": "67357700c56957e48020216c928e0a57d8601a670f6f87baf2d65035be8b9e43",
|
||||
"resources/data/geography/cartografia-moz.json": "28530f11f528e6f715396991e1294872c7e6a8b260d08a84e7d8fe17e5920457",
|
||||
"resources/js/app.tsx": "366544590847f45c927928d7a157a304b5ad05f39385a6d40b77cacba236e13b",
|
||||
@@ -696,7 +698,7 @@
|
||||
"resources/js/components/app-shell.tsx": "e290b18e92dec75b60b0ef4ff69aa78e398fe6e2f98a9ae13e1df18616253348",
|
||||
"resources/js/components/app-sidebar-header.tsx": "3d179335d0bbd2cbd6907d7adba0c58a3db0cb758acc544f6516850641652c5a",
|
||||
"resources/js/components/app-sidebar.tsx": "d1b0c9bb3101dd333f6015e19b9360a77252275e06ab8572296855ce20584ca9",
|
||||
"resources/js/components/appearance-tabs.tsx": "77f8e26a951dd669d7b7dbdc2e53afbdcb4b503645f83a2d8b4770299602ab92",
|
||||
"resources/js/components/appearance-tabs.tsx": "d53f48b0883713bf786fdf4b7877e03638bcf2e707b64ea6b8559501bfc8c4c7",
|
||||
"resources/js/components/breadcrumbs.tsx": "b6968897d551e98eaf73a87ae7cede9d53b4f88d6757cad0008404a6990555e3",
|
||||
"resources/js/components/budget-distribution-fields.tsx": "2403120078814d857391f5aaeee8cfd54bdf1fdc55da5ff419b9830146d25831",
|
||||
"resources/js/components/budget-reinforcements.tsx": "4a9df0016d6cc79ad5ce14489a4d128cc14099d44c5d9ebbdeb654386734c63b",
|
||||
@@ -708,7 +710,7 @@
|
||||
"resources/js/components/comparison-policy-summary.tsx": "80535e2723e9b896d84b23a598f11b390d7fb94ebc2cf58c7cb3a5b1b4241684",
|
||||
"resources/js/components/coordination-record-filters.tsx": "1b3ba3f0aee6ec9df86ba19b09ff8a2dcb41725ea40c1df608d2008e543aaae7",
|
||||
"resources/js/components/correction-source-search.tsx": "187beb417209961be9b56b875ce4fdb3d118f3758aca667acf3ba3b5bf15a047",
|
||||
"resources/js/components/delete-user.tsx": "32e58456a6268f423b2ab1d4405497833584a52d72e210c29435b1d1aef50a43",
|
||||
"resources/js/components/delete-user.tsx": "c478c5455f23d95866bac3c0728a6c3e3c2d8dd45dfb09472ae9ede1b7838a3f",
|
||||
"resources/js/components/evidence-brief.tsx": "3b4630e44fdc02191d1e8ecebcd451c20b9e5a35b49ded9f5d78044bd1e24932",
|
||||
"resources/js/components/heading.tsx": "9ced8fa490d485c06c1ff87051b4bfe051b922cf9c58370e8d542d957f4f6394",
|
||||
"resources/js/components/import-estimate-reconciliation.tsx": "3558f4f175fee91b36216ede80abf0634cc76de4ec1b4e747044c1422af495fb",
|
||||
@@ -730,7 +732,7 @@
|
||||
"resources/js/components/order-document-links.tsx": "e74896d278b7fa10a3e1ab19fc91b6411e283c874d6ed4767ec9f864fefd0acb",
|
||||
"resources/js/components/order-parts-summary.tsx": "39ba610885d2b94fa5a85ba931b4dbfc95e26998260084e551d76f93b01f51dc",
|
||||
"resources/js/components/organization-activation-preview.tsx": "32eeea4456ab90c57e4ee3c5b2ec68320e2ae55c423ced735de418c9a6d55fd1",
|
||||
"resources/js/components/password-input.tsx": "1d88ede1286014f78d98ec33f834f48a953ae8b17011da605adc29bfd67da282",
|
||||
"resources/js/components/password-input.tsx": "55bf38d42d166a3ea9fb85174d7fec23588a38c6d0cd5fce6760aa9eac9f82f7",
|
||||
"resources/js/components/people-clarifications.tsx": "a378159cf383d8cfa78c2ffaaf151d311a3e2c6f58ae3d72f21ebe9f9852e95b",
|
||||
"resources/js/components/people-contract-formalization.tsx": "daed8faa04f79393c44d952154a0d79061fda6650cc9c480e9547814db1aa07c",
|
||||
"resources/js/components/people-operational-insights.tsx": "55ce0f42e7d574e7c8832ec869aceaecd41d70a2ba8117b9397ce30528aab82f",
|
||||
@@ -755,14 +757,14 @@
|
||||
"resources/js/components/requisition-submission-confirmation.tsx": "edda59cc40f9f900747f64a85c3ac7b01d43edb345ca67d59d3c4eb99a7a91fc",
|
||||
"resources/js/components/saved-procurement-searches.tsx": "d6002cf6a92871586fefda3d8d938f3c346e7fadd05ab5dfb388b5f36e1a333c",
|
||||
"resources/js/components/sgc-shell.tsx": "76e8059c5b5a9ae1e4351ee8efaa0e376394dc7133bc7524b5ee653009836687",
|
||||
"resources/js/components/sgc-workspace-shell.tsx": "f574c6f897b5063e074c9e47c10e108e467b4fbe994cb1994664886224c58541",
|
||||
"resources/js/components/sgc-workspace-shell.tsx": "87ce329b54ec4a4ddad4475cd08da653e88c6aeed7c3c35962521080183df334",
|
||||
"resources/js/components/supplier-evaluation-fields.tsx": "949b24c0aa3477d37696badfef0c7d6b0ea7002ecb806f8a7936e4a7fca72344",
|
||||
"resources/js/components/supplier-improvements.tsx": "eeebed3614a2822a791e3c1d8ac79b90b85b90f5e969c485e7181c1540e14743",
|
||||
"resources/js/components/supplier-responses.tsx": "4ca28fb346d91df2ef70c1151f2677e59ee4583ff70c794d3da99245140ff5bd",
|
||||
"resources/js/components/supply-pagination.tsx": "d94fbcaa804b51c8566edfd7d7df2acae075317ad69693ab2c6c660d38eaaaac",
|
||||
"resources/js/components/territorial-filter.tsx": "7e58718726444216c9c2d9719794dc13aa6365df3bda8a17ca982b8d8293a8fc",
|
||||
"resources/js/components/text-link.tsx": "d0b1698349e777ed052f0292f44536280d9bb7559b9d5e4c5284d1d1b6565309",
|
||||
"resources/js/components/two-factor-management.tsx": "4a36f393e5ae44d7578bf9f12ce9f4115334864c5b041161dee829cade30aa8a",
|
||||
"resources/js/components/two-factor-management.tsx": "fd1042d207efff2a66bbe67dd4bd9eda876a1a8b74b7a201fa49ea4681fb2d08",
|
||||
"resources/js/components/ui/alert.tsx": "ce9841beb06b4b3a2c88dbfb46f9635d198827870becdfd3e2619181e28fdf61",
|
||||
"resources/js/components/ui/avatar.tsx": "1e8837e409f4ede09137c6a01d290047ac2c0c306991d4872cf499c77b9aff2a",
|
||||
"resources/js/components/ui/badge.tsx": "da6d8f237f7fd88fd9dd0e83863d9cf65a473f3affaccb5547b1b6503bc815ac",
|
||||
@@ -814,7 +816,7 @@
|
||||
"resources/js/layouts/auth/auth-split-layout.tsx": "f8b096eaad8ca3c66c23fc077689ee18df8148c12f92541064108e5543cb87e9",
|
||||
"resources/js/layouts/journey-help-layout.tsx": "a4115578b63e260b3ca2f682110764c52419ff19bb91ffe7c062c1a0041b970e",
|
||||
"resources/js/layouts/preview-layout.tsx": "dd8db768d6f50f0342cc5620aa427d91616fd501b6a50fdf8b7cc624fb3273cf",
|
||||
"resources/js/layouts/settings/layout.tsx": "8189ceafbe93d5b7e268be3f5470956864c23b3b37a5a4a3f2d0883770b77387",
|
||||
"resources/js/layouts/settings/layout.tsx": "04647467b9fce06dfb7a5122f0fab77859b5a46773da047242686c5d4e6f1fac",
|
||||
"resources/js/lib/form-error-focus.ts": "d248e6f984a92ab741a88c53cfe3436edbccfbac58b2f567dc911ecdf85e7bbb",
|
||||
"resources/js/lib/import-estimate-money.ts": "4579f4bdb9a873bf4d4c99b3a614a0e176cbe6f340dc04418d8662324b00a2f3",
|
||||
"resources/js/lib/import-legal-specific-rate.ts": "efe2af92c5c2c8794b84c12610389f9a9cc1f1196065761176c055bfa031b982",
|
||||
@@ -824,7 +826,7 @@
|
||||
"resources/js/lib/preparation-forms.ts": "8fe813f03ad386a089bf7917a57c10d6423d5c03021eec784006a77426490f8d",
|
||||
"resources/js/lib/preview-navigation.ts": "806e6545068b4861f015d7860b02d95ef24712c50f0bf9ae5c949ae134e2d140",
|
||||
"resources/js/lib/procurement-menu-search.ts": "c70f023cc50448799b2cbd9841d6f4c41f9f76eb0fcbda7b883286fd8b044d3a",
|
||||
"resources/js/lib/procurement-navigation.ts": "63a75e9c1cf531a91dbfe2641bf3478206e12ff399bc8e2ff3d64d02058b573c",
|
||||
"resources/js/lib/procurement-navigation.ts": "48528a9d16f6d6db7fecc8b304685a3fd7b136a74c44cb8ea110d215e00aa85f",
|
||||
"resources/js/lib/receipt-preparation.ts": "681f19a985c229e8b97d4f216384d1f3f4b3527d167385fb1b292ae31d70102c",
|
||||
"resources/js/lib/requisition-estimate.ts": "881c648f2faa13664faf9b73fd78230d672f5d165dc3f292c35734804943aa9f",
|
||||
"resources/js/lib/requisition-history.ts": "1340a40dd2271eba6d68ed2ab6fd9b4b0c07ac7544be40662990d82949093f10",
|
||||
@@ -913,9 +915,9 @@
|
||||
"resources/js/pages/requisitions/urgent-reviews.tsx": "f5bfdc0a4bc6c67ffec99975ee19f809cb4008c70e46529fc8417f8f2cdfb032",
|
||||
"resources/js/pages/requisitions/urgent-stock.tsx": "93a16c049e68220a11e08e9d2de406feb4a34ae4f110795e44744691857dbf01",
|
||||
"resources/js/pages/search/procurement.tsx": "aed2d770b436dbfe2f4911030caf2926ebd02e0655fea0cf24aad4574e343291",
|
||||
"resources/js/pages/settings/appearance.tsx": "915a7ca2faa1d7213c9cfbe1fb574d3b8674bd32a20bd11ed9d3e5cee18797ed",
|
||||
"resources/js/pages/settings/profile.tsx": "204385f546de1f4841d76f6d98f6c48e8af99ed310ffd9a9491b2b7ab90a6a3c",
|
||||
"resources/js/pages/settings/security.tsx": "f49d466936f6cc208d87854cf89c91df92fdb19538ace80b4d0e0f01cd876fab",
|
||||
"resources/js/pages/settings/appearance.tsx": "02e07cd5f8c4d10711655c81ab83d0c924bf336628ef69319cbd40603b2c511a",
|
||||
"resources/js/pages/settings/profile.tsx": "78b42aeda0e89d8e749a7833d8b453ce66aa3f41f035f864c42b41fbc4da4384",
|
||||
"resources/js/pages/settings/security.tsx": "3df9ce93d92453516229c23a67fd5a1abe95a9613fd4d08f311c72190e16fc8a",
|
||||
"resources/js/pages/stock/availability.tsx": "612031daa39547433e447c0ba504830720ecf5840b106edb6f59ad8623c883ff",
|
||||
"resources/js/pages/stock/catalogue.tsx": "3bfa271c4fe59908be08c060f157500165986ac0b04aa7affbc1aff6de3ecfdf",
|
||||
"resources/js/pages/stock/dispositions.tsx": "ac39d99c8759979fdacddd4319023463344cbbb886db1bbc23093473c5553720",
|
||||
@@ -987,86 +989,86 @@
|
||||
"routes/web.php": "93689bb8b453db1559eb1063b2ffc3c25d24d39ac8b9b4e811bc3e50131ba2d4",
|
||||
"scripts/archive-compras-release.py": "fcc753b0186ec2b73e28bf27665bbe335f7367a335f8facf7e7077abc217872d",
|
||||
"scripts/build-compras-release.mjs": "00c83ed3b9446255360660a650d1f142ea029243b342ed1afdb7382ddf804328",
|
||||
"scripts/deployment/compras-tempo-deploy.sh": "1d100affd6601a4a2a68bc9ae0ba642220e015651b03c3c9776b5c892d9c46f1",
|
||||
"scripts/deployment/compras-tempo-deploy.sh": "d49a4071325c576bf41628adf38eeda4df5e2d99554846dd0f48fda2a49f3920",
|
||||
"scripts/verify-compras-release.php": "a88d9f66c0542c6685c252c37ad27069b39278445db0e0bb407353a1f8ea9c94"
|
||||
},
|
||||
"frontend": {
|
||||
"manifest_sha256": "a4684810560202502dbc009c03f7047ceaa719f52da8b11bb2d9e99b56c78619",
|
||||
"entry": "assets/app-CqiAeQsa.js",
|
||||
"manifest_sha256": "bacf3aa57a8aca31bc203b5648598318ef431bcfe76dd54cd38e65d964018dc8",
|
||||
"entry": "assets/app-FRa9q82K.js",
|
||||
"fonts_manifest_sha256": "66edf17c93351fe01158be7414a441a762f106417c74351881876b405b8b10ca",
|
||||
"files": {
|
||||
"assets/access-CncEXMnH.js": "be3ae35ba2438ae9df268aec7ffa38a4a079d9944496b9c11dad5d28582c2922",
|
||||
"assets/access-DeUKXTrZ.js": "ee8ab9d4520248dfe554a3b9c414784e9e4c252c5375b4c1d31abeec85eb113f",
|
||||
"assets/accounts-BZu1pQu3.js": "135401d69730b6bc2989151d5e4810053e791ec7fbaa859d5f40211dff20e1e1",
|
||||
"assets/administrative-location-BtKEZFbb.js": "f492b85af45cbb7d88680e8a1666e14bf9fa4f32f8a7aa31bf5b618520ee2ead",
|
||||
"assets/admission-CGe0JXkt.js": "796768cc7597a3e0044d218df8c3bf148a9f299e0049412c6e35c24b7606e2bb",
|
||||
"assets/admission-DtPrWRu8.js": "8806c6fd5203cb272bc31b5f2309acbf1c4118ca0a6fadc36f6a0ccec16e2b13",
|
||||
"assets/admission-policy-kqBWTzfp.js": "adb23dcd394c2f556c3328145be2a1280daa24959664f1593d68ca2a492c3b18",
|
||||
"assets/agreement-followup-I3vRsreE.js": "3aa8a96115cc0788b9bc101ac8ddf6c7d2bba64e9bbaea195ae9c9477338c25e",
|
||||
"assets/agreement-order-bindings-C8vMwQ29.js": "4548d824e5c946275f9d53820eae73de73a4380986c9b59f754ad3851352c954",
|
||||
"assets/ai-preparation-preview-DGlDQ8by.js": "99fec256bad6465ee8f7bbba3a7073a489e01d2838ee2017e55defd647544a6d",
|
||||
"assets/app-41PlYeB7.css": "ffd500937f094aa90f948dc10d86bf07ce38a1991dc0f68e9cd9397dabfbaed7",
|
||||
"assets/app-CqiAeQsa.js": "6ad4b986a040f1e15c1431a7ec64266a3bc83843c5cc7c0fd11acba71bf2ec25",
|
||||
"assets/appearance-BcQdqaQq.js": "967db0ccc50646bdf4589305f4001d8adb357adc4c401efbe75a668c7d9c887e",
|
||||
"assets/approval-timeouts-Di6ywppI.js": "fa54b79f9229d6dcccbe6e4a72552d1bda1f74dd96d07db23a2ce1d6f244279b",
|
||||
"assets/access-6RIzCj4G.js": "750ee367a5615e163e04220a54cb2f907722c723624d7823ff660788f2380b54",
|
||||
"assets/access-DbMFIgPJ.js": "d493b0589c68bb100a0553c731e37d4b9857bc5838fe2c9dfed08b71c1d7853c",
|
||||
"assets/accounts-CN5bTxeQ.js": "32911622ee25a63cd897302e13afcf6469c6f03a6d26d0ca4bb135e16938e612",
|
||||
"assets/administrative-location-e0kWp_pN.js": "cb724482a81aa9290df5f2469fcc419f099a4ecaf5e39cfbcfb3723abfaabf2b",
|
||||
"assets/admission--RSoPSUp.js": "2a88f20ba78167bd43a6aac694bbc11fbc48c8e952a2944a664ea42d17ef3575",
|
||||
"assets/admission-BamYFrpI.js": "c9a9ccee8d7ec031d9a18f254f7a2ac14ae7c7bdf90000d1d587523d4e860204",
|
||||
"assets/admission-policy-BIboDoxM.js": "1f66ed87069fff207f962cb282d5a63159857cd6b99b61a2dc2c8c23d0c808c7",
|
||||
"assets/agreement-followup-CKqcTqxA.js": "6960d0c2a109d872d4a044c68b9a92e6a5df353b18d2f5b16d95e06da76f0df8",
|
||||
"assets/agreement-order-bindings-z6E1chJj.js": "732faa0d191bb5542a8cd9194be79f3a55f8406ff58b5e564642065a4d6a1d43",
|
||||
"assets/ai-preparation-preview-DkyRla-s.js": "75f4d34f4baea2dde1dffa35eb6e6bcc82a85b9307c6acdcaebde5909d833f4a",
|
||||
"assets/app-9vLPq3tu.css": "30a747d594e1e54234a50632e70c65fdb7bbfe200d5d490c64d9329c14994576",
|
||||
"assets/app-FRa9q82K.js": "e84d69233cac024936af11257258eaa767d7c8d091f9b328900acceaa526846d",
|
||||
"assets/appearance-C_id8L89.js": "63bc812385685034eeb65f4062c4b2b2db62b0ec7922bb9891bbcc63ca35dc24",
|
||||
"assets/approval-timeouts-CcIYODQY.js": "0c1d7e5eb66e314f54f1e009d1e90092bb6f2a02b3f4423d4dd1b72e12355608",
|
||||
"assets/arrow-right-jQM5Ljhm.js": "460657b89c0a22dd8c648c59408ab9b5d89cda0a2f77fdb5aafb5d4cd81ee047",
|
||||
"assets/availability-DlG9m44U.js": "1e380a3e0538713b28c87f477bee6f157a9e41fa40b7cd25af88bfc05b88df7e",
|
||||
"assets/award-xyfajmRb.js": "06c5df6a112ddbf8e9c3853d85ded1b64a7ee771bcf67dd57d63428cb81652cc",
|
||||
"assets/bank-BF845tIT.js": "9aa6733b38fbc2480faffab3faf1dd7406c2361a1f3b5c32756f7befe8a0a725",
|
||||
"assets/budget-distribution-fields-CBqqlRZ-.js": "9a6370a75d53340b7feea6d46754e9470af32eaed8d68846afee6eec57b3ecf9",
|
||||
"assets/budgets-CZ76NULL.js": "1247383e18b6db6fc8085be26415b9dd1ca91d1a847470dfc8cd594916a95419",
|
||||
"assets/availability-re-qUwlL.js": "4cfa8e418dca2b481bcfb792da39b5254e8c033ca68d8019940f97020ae6e874",
|
||||
"assets/award-BODPKmtn.js": "34a888051b5e06d6e5677335e9fe1a0209d32d822a51ab725fe53128738463ac",
|
||||
"assets/bank-DCDvLp7S.js": "1ebe400758f9f955c1cda3dfbe964eabcb3e1ee29c3eccb792fda8037a30f46f",
|
||||
"assets/budget-distribution-fields-Df3ghWtn.js": "407c955afc0a44f81777872b8be23dc20240105ce2d9b67ca042256cf0c7eb81",
|
||||
"assets/budgets-NENY5WEE.js": "43164ec1ea7b8f6dc9181df0fc9adad77f211c619b407895f51d772d09d770e7",
|
||||
"assets/button-CSyysFhi.js": "a0c7c2d62ff1c139a6b5e6ff2e4c7cc778682337a935a3eee0e2df5ac36607b9",
|
||||
"assets/candidate-availability-BBYAjwDY.js": "848c1b093b9016d4dbbc7795f44c281eb3776bfebf82b2a84ca943c70f5df1aa",
|
||||
"assets/candidate-documents-DzSJVuya.js": "3f5131f76ab32a1477614e2318e09a5fbe736f5b6fc75fe306fdba5802f28482",
|
||||
"assets/candidate-portal-ByeF-HzY.js": "1fda7e8791c3a5de8fb4d0c162b82806c5331dac2047d03d26a21a6ba2977330",
|
||||
"assets/capital-assignments-LLO7N5cZ.js": "2fefc7f78d26c014f84eb51c656592edd8c89c53b307379fc9c177965d56f898",
|
||||
"assets/capital-register-DckK7uVJ.js": "1c4407f11997977e4a835a09f9265192722b5626d939a739c99c2a2feb83d520",
|
||||
"assets/catalogue-PVpVhU3u.js": "8aee54ba507bc1a48a8f496aae36ce1833f6a4e551c56af3905b0076a2e1fbfd",
|
||||
"assets/candidate-portal-BT-UAb4h.js": "27f589d80c2f98ef685eb1b22d9ab6a479cce9e3794e96f85b90bd4a2dc7f6a9",
|
||||
"assets/capital-assignments-D9iqQmWC.js": "6cdea49568b7a2cc0497fc240a649c432759cf5f3c8bff3b47876c902d8c6e06",
|
||||
"assets/capital-register-BzQZK4QA.js": "83e5c32c48da1f41df9e0e92584102371c6b736b603126c2a06bf1239f2c52f0",
|
||||
"assets/catalogue-BFuFaZP5.js": "8a3c3b6b4a2384ec3ea3e4993ee235c230ea4cafe0c4e525f9ee296b7cdfca84",
|
||||
"assets/check-B0y1oDcN.js": "2b0f7b1e72a08a1106cae81a5910d88a308d1bc92c729def81b0c38b743c7c59",
|
||||
"assets/clients-DgOXK3SD.js": "f83844f179f6e948c9ca3c833648e0fc4683bdc061fcb03cb25150fbd37a846d",
|
||||
"assets/clients-DfzbULV9.js": "0360f28c44602fa538c92197a1382de14395fcdb026e417a09f8871bd5d22398",
|
||||
"assets/clock-3-Cy_zSYUr.js": "b8bf146f2a287cd2bf356687ab0dfdcb0bef6f0213bfda494985dd98d97d20a0",
|
||||
"assets/Combination-Cf-uZSDM.js": "cb6de0edf2a5bc431766866135d9c8868a5671cd0bcc7894cfd8d425db1ea41d",
|
||||
"assets/company-D4HtOp9W.js": "1bed80387269c3de626971cc411bf44171ad7bf32328eee8f2fb3a27963140af",
|
||||
"assets/company-DTrnEocS.js": "bace3efa22bdefc6fb1872aaf888a9da66f44c7a0aa047acbd04e9a9177351ec",
|
||||
"assets/comparison-policy-summary-C80JsjfA.js": "13b64488a4166adec1678d172588b46cf6834382c575b87054c49ba587b69fa8",
|
||||
"assets/confirm-password-Bt9AghUU.js": "59df2ddef1373ae5893721532cafa5b167750deb92f6a697174028ecd607b9be",
|
||||
"assets/confirm-password-Bo_I6kPZ.js": "c3f95f5b8db2f41a6e7abf24ec777e321c6db3975e9173e74ad6f145483df713",
|
||||
"assets/conflict-BelUpYxR.js": "19efa315d126114e8d34439393364583a3fc1b735b3afc41f401c3da8aaf33b4",
|
||||
"assets/conflicts-Bb-FP3VW.js": "8b47e8a21d5dad6fe0729cb0ad4e92a5ffaa4d7e4729a19ddf872a7a99ad3c60",
|
||||
"assets/coordination-Cb--Qf4B.js": "070f022e7ac671612d549f22178ffb0c71078b9d0cc83e12112b5ccad70e8e96",
|
||||
"assets/correction-source-search-6bu99vM4.js": "432fcf11267706aaec2a7741e5e17b7816af8dae2efed97c94b9f435b44a4eea",
|
||||
"assets/conflicts-CzeF9BNI.js": "f97a7f22d7c80b8af9625d80f54884b3245b1f1a6ea29807147393eeb08fa562",
|
||||
"assets/coordination-3b1xHxCP.js": "c82afc7c3d9f855e146d497e1826ea58cdbc4895f42ea6379232c5d2a29259dd",
|
||||
"assets/correction-source-search-BhOqg0Pm.js": "2f020744bed54a5cd9b7d129cbedcddafcfc80081be22a4942a606c3f9900d68",
|
||||
"assets/createLucideIcon-Bl2ij0Zm.js": "88026a98f925baf2a85f5c6091f3dce5d35689ec432417ba87ac3fba450aa326",
|
||||
"assets/dashboard-B-qyi0_U.js": "dd5cf8200a4e5bd1426e887c31875acfc1fea8ece35984fe5fe17315d4174a2d",
|
||||
"assets/dispositions-B-HzNki9.js": "5c2fe8e4a622a4d5514e3340eca5c59c9f491ab2127fbfa750d87090f0376b02",
|
||||
"assets/dashboard-C3Su6Dl5.js": "624f9f3967394cf217bd9dca7029638230965b7c51e54d254d5bebe09da2ee57",
|
||||
"assets/dispositions-BLMv8_e3.js": "a23b531bd1b688b8d9cb2a42b66e9f2467113a74d42a5eda10af135ea5346b55",
|
||||
"assets/dist-Bm7wFECT.js": "ec7a8f48099bdb15bd706858c566dff3c664ea77420b2973463f9482c5c66aa0",
|
||||
"assets/dist-Cxy2kTRX.js": "7884e24de234f6d592ec16f228c0eaba69ee5adf28fcbedb0d59383d184958c8",
|
||||
"assets/dist-DSfJglKD.js": "7e5239388df8e9e9251bc5d432701c3a1798b8940371f88e42683e6426f0c6f2",
|
||||
"assets/distribution-amendment-Dh5zrz7_.js": "f83349a132ce255998ac604809ba6bbd5057e0be042fcb716ad8f7911a63494f",
|
||||
"assets/distributions-CRiUmPM4.js": "879f03978832678242752a2546386033eed771502fa3aa1af520ec69d2c10f5a",
|
||||
"assets/distribution-amendment-D6wI-lNC.js": "db833a0579c3a7b675bfe8dee770b02f58b3d2baa685e380ff217504361ff1fc",
|
||||
"assets/distributions-CntIbU6Y.js": "9c7f235ce9920f25a11b06384200ba825903ae8baf51d6c181565fdf6f076497",
|
||||
"assets/download-d-ik75sA.js": "ac23d0b10fe748b8664965a4ebb479336cbc75e4d08e570577e5f70519bfde1c",
|
||||
"assets/edit-B16FV96b.js": "5944dc90b59e3a97dd1b7643f3ce918fbb4ba1d12b2ce1ad677a29c653eee6ad",
|
||||
"assets/entry-3Ab7sNRI.js": "e6ec3f3c4998b4b96a88aec4abe53c1346434d8063bc104e45ddfd371ed0bca6",
|
||||
"assets/equipment-CR-oneTX.js": "d76b843b95a88da43b6106f73e7721d106f44059e73dab63dccfad48b011a094",
|
||||
"assets/evaluation-Biwcip0o.js": "adac4abc14281862c8bf00c86c142cdfc4797ac8f46c5dfe5ab8d3ad18418319",
|
||||
"assets/evaluations-BexJNXqb.js": "6798a0a21892efb8dcee383eadbe3cfb39615cb3dcafd8915ca8a04406102592",
|
||||
"assets/expense-allocation-CiQmkPcQ.js": "c4b1b5cb21eb5c1460813e606dfc13e68eb755b2d0103d63e9283f365f1fc4c5",
|
||||
"assets/expiry-CPWkdYmu.js": "93926df3cfe38c1c976be8ee3a44fc4e77611be1c4b630316481f9537b54d07b",
|
||||
"assets/edit-oeT4U_UI.js": "c947a743db019689ed115a39e7df479bdf11591638adf676a7c228ee963f4ee2",
|
||||
"assets/entry-CZv0LTbl.js": "69b87ed3e3c5794c649e068f7b636da35417278b7fdf6d0dc866675abcc25420",
|
||||
"assets/equipment-DQv6FDIF.js": "0f9d0bbdae82f90009b41d177b0686991ba5eacd2a11cf5fdd28a05084e07e5d",
|
||||
"assets/evaluation-Di2VFYJh.js": "aaa932f99adbde680c6eea1275b3edaf3b1591f6d38c3a64918ce6a6f6df2083",
|
||||
"assets/evaluations-BiQs7WTD.js": "de7624db9c5bab8c39e8eff76dd74b92bc736c3a5bf78d5dd89f3997e47d9111",
|
||||
"assets/expense-allocation-C0n1Kqvz.js": "4081dbc6aa47c845a01328629202e999a68ce7b5dafa614809e6534964bd36ab",
|
||||
"assets/expiry-J0LG8YbJ.js": "19ef0917357f15df1b9605a3d3b08d1b435fd6d44e7eeaaff5623c8b5a95e9c9",
|
||||
"assets/eye-BcFYyvf-.js": "eccd97f0bfeab1e54e9d1abdcd96184794449a6b6277d096598489f52f61e9cf",
|
||||
"assets/file-text-BMumQ0Wt.js": "9af4fdf5c0527694f24719af17256ac1ebb7061ddd738e5135fdd411f5b3a3ac",
|
||||
"assets/finance-BAbwUbvO.js": "f42eb4d4f8574e1e1c3e78a72907ad4ce195fec26491e18563ceae21ce2ac326",
|
||||
"assets/finance-Dh6SqBh8.js": "bcc9a3dc3014819f3d61602d4b2870f8f70b724bfb4b5a0f42bc06578aebd5b4",
|
||||
"assets/fonts-C9MNnjVw.css": "3846a9bb60bfad92960eadcccaf0b4e129d74b11d48791506c8d1a827a385cc8",
|
||||
"assets/forgot-password-CStW1VeO.js": "8d759bce216f41502133cb20423414caabdcd680941bb0ade55e7814a8a75024",
|
||||
"assets/form-gyoBHHzt.js": "2aa8459c6ea89eae0dedd4c2532d9d9a0152024bf9090f7abe958e32573a6e65",
|
||||
"assets/geography-review-0MQRBHFz.js": "ea34457046deabbc9e76a212a6bd3711691799f2534f5b336a1d4cdec770937a",
|
||||
"assets/history-C2-WcI-m.js": "c25a2b8ac93d8cad86c063dbc5e392e8e4edb2b461c8f74a3d3b7f96e1841464",
|
||||
"assets/home-CbYx0aqR.js": "0669454febce401fa89be9ff01b9473c9251d97bf6058b4cbf51cdd492b60fe6",
|
||||
"assets/import-bank-support-CuA6XGMr.js": "93f556852eb3ced9f925a2ca4aa436784f594526794765ee907dcb94aacfd21c",
|
||||
"assets/import-costs-JYijH6OJ.js": "f01eec1a2b72920d60a35bf96eada6c5c5b3dfe202376df3229f0e5164d7f45f",
|
||||
"assets/import-dossier-qRPwGHgU.js": "da2f107af60bd179b206479543715d822342f833da219ec812ed06709161783d",
|
||||
"assets/import-estimate-CdH-hcf-.js": "767218202efa41c168321de400114fb4fe65ad9da2db142c7caf341942a82826",
|
||||
"assets/forgot-password-Ce2HDxzv.js": "f6a5df2a3606d67901cc82600465795593ee31fe37e7f895e88a4647674ad1f4",
|
||||
"assets/form-o7domDg_.js": "7c004e0525823d0c2ec7b0b28a4100638bbea231434005d1d1f86d788e802398",
|
||||
"assets/geography-review-CvhwePKZ.js": "3b4766544f85224ddf357697625b3716f77fb6472481f5d1ff1c6e5a9625748b",
|
||||
"assets/history-C6PRJ9fC.js": "537f805861a1bfb509ef731ecd4063690451d2a943886649d7c958b118e1b8de",
|
||||
"assets/home-CTsWjgmC.js": "5578189fca1b6cfabc9bf6bfc6967f96fdb259de2776794e311617b59df4bd51",
|
||||
"assets/import-bank-support-CywYLfdM.js": "308612145a1d5d08be55aab6727ecf5cdd388319c08522082c30be01ba75e93a",
|
||||
"assets/import-costs-DMCUYAT8.js": "33499d90c4054ed4d1a2b13d52d00af2b48535c7ed3cf34d905449d177cd3001",
|
||||
"assets/import-dossier-u_RgERgb.js": "ccd34ea25dad0bde4353a78481a3720557e14588ebb7b4975afea38df15a5aff",
|
||||
"assets/import-estimate-gKteDzNE.js": "29a776d956c958d8aea8e28c14cfe54bdc65045d295c307440af33e5fa8eef5f",
|
||||
"assets/import-estimate-money-C8In-mMc.js": "a55799be92061737217e27d9d22baf042cd085b35da5c49f64ef8abb819205a5",
|
||||
"assets/import-legal-C4-d0Wu9.js": "dea93a1ba37a6592037f9edefbae284c9413cdc59c85be68789d42302dd551ca",
|
||||
"assets/import-readiness-sL2sUwgH.js": "3b6a0bb5d8784b775a2dac0f6b6469c6bfceccdd0738a78a50d9e9610a202264",
|
||||
"assets/import-tariff-summary-CP39sSz8.js": "830d13b37efa4220b40842e9c32eb69aef2eab76ac51d726b32aefe4899c7098",
|
||||
"assets/import-tariffs-CBu8w5bx.js": "43659cf19bd4b63bdffd5e103c38578907b5214564189e3ee265995cc5a8c87b",
|
||||
"assets/import-legal-IXV0gKJ5.js": "b4164ab75166c6f5e649d2e1120fec84e46f8461fdff842c6714f1e9f6910faf",
|
||||
"assets/import-readiness-CUZz4b5u.js": "ff99300bbfcb37d41dcd49270b7df48ee71497c433183a8481c28a740a373d1d",
|
||||
"assets/import-tariff-summary-DQqpqvQn.js": "0e8412cb4377402675e9d7459857fd6e04b46e5ca0813c99b7437b2f3ab68480",
|
||||
"assets/import-tariffs-C0Jrk60Y.js": "50c7f2daa6ead14d298262b74e4d4fbf5170354e83d33529353c033f70c452b0",
|
||||
"assets/input-error-B1DjHZT7.js": "00286fd9e30543b59027b37606d63c96944efdf4f58339aba7afd0cd08629ace",
|
||||
"assets/instrument-sans-400-normal-D1W7dsQl.woff": "797bd3eaa70edbd4757650ab44dad75fbfbfdf18bacedb4b71022c04621d30ad",
|
||||
"assets/instrument-sans-400-normal-DRC__1Mx.woff2": "9a91efaa3599a6ef01b2f49e9ec670e3a2f39baeef09c73198f1052cf3bb0850",
|
||||
@@ -1076,111 +1078,111 @@
|
||||
"assets/instrument-sans-600-normal-B9e8oLYv.woff": "9b4ce1f2b26be7cb087fd87d6f99a202136292ec820af75bd38ab9e53895cf28",
|
||||
"assets/inventory-B5h3Ukug.js": "4e5464e66e4f4436f82f06de10587dbde46c3b7c92d964b09eaa31e6d9f4fb2e",
|
||||
"assets/inventory-BF2HrsoH.js": "fa3e4a56bae767f93e7f7d0202c4efecc8d08583c0ca6761db8560acda64ddc9",
|
||||
"assets/inventory-correction-filters-wQLXbtvv.js": "74b9c4cfbe54b86e4703afc3242bb145d2e0544dbc9bb4d8485b8665c3b61083",
|
||||
"assets/inventory-demo-BPmaHY-Z.js": "279be4b5fafe2e7d48e77e9242d7d7baeed098809671513295b8202b2eac6320",
|
||||
"assets/inventory-event-actions-DsG7_JfC.js": "32e0bfb9b60bfca1f1950b44d4de0852e20148a776afe1156784c8723d7add5d",
|
||||
"assets/investment-SOuc1oYr.js": "d76411dd2ef35afa360034db6ffce4c0860effd991f27e2de6984230fb6121e8",
|
||||
"assets/invoices-BYALUkwU.js": "1aba6bcd898e118b8bee785d73327a0a66fc8f7a96f20bf38d7d4cec6e381f0d",
|
||||
"assets/inventory-correction-filters-BTau_Bm_.js": "d86c15b1a6e7bb0efa06b32d7333e50ecbb4e8d264ee100feb10f93184329504",
|
||||
"assets/inventory-demo-BWxtMAiX.js": "fab543ea168ba0e9cb27fc05fc9d8202b36394fbcb66ba739ee43e9b267b30b3",
|
||||
"assets/inventory-event-actions-B76kgu-T.js": "6bbc0266d9b98111e0d90b84b3e158601018cb64af4c801063c9a1eb7f036ab6",
|
||||
"assets/investment-B-lhJbxc.js": "262c01ea9c4238ab5a352e5f096a584818869ee474f841f43c98fcbc4737c85f",
|
||||
"assets/invoices-CoQKVSHr.js": "84547e69b00d5188d961da40c0ece0d02f05547e7c3bfaa46a2724f0c2be0644",
|
||||
"assets/jsx-runtime-Cjjuc_0N.js": "239501f6701a312b0fbef99c9067ea0d62f11aeeb3a8b388ec4c7528b0493500",
|
||||
"assets/label-Dn4U5SHB.js": "d273f9faf668fc6fc998709fa86dbb3d424a23271725cc48a9b88a8b2d8e399c",
|
||||
"assets/loader-circle-YS2_4W2r.js": "4648de3680be9df8d38d808bb954b6cee541cf3b376321926a10c3edddb96345",
|
||||
"assets/login-CM_bbI5J.js": "e8aa6be35efc123225926ac96b06c770982001932aecc62cdea797e1fb48425a",
|
||||
"assets/lots-C5oyQ0Dn.js": "4df019a914324faa14e99c5a9de08ac242e2561fc582fe1a7e110dae33bec6c4",
|
||||
"assets/metadata-6dlV5ADO.js": "892c9dd1b056a2476701fff701936edb423b19b6be5912a8feff6015394d3ac3",
|
||||
"assets/notices-C0A6aCfv.js": "c3a14beceb01e8f56acdf62bab8847e251a63db13a8ea96ebac7ecd0364176ad",
|
||||
"assets/opening-Cuk1bfJV.js": "0d51e9fd66f794bb7b3c23561e3ae1727e8af9ffc48265805398e5fd0ee01d12",
|
||||
"assets/operational-orders-DIYSD3r2.js": "11b575ac5470e51961dc3fe25be4280962ab6e02ebcc6e89db56b2e31613c8d3",
|
||||
"assets/operations-_f2UvgDX.js": "f2105875b31acee1c2ccca98040f48408da3458302203cd9b1c3dd027e01bba3",
|
||||
"assets/opportunity-BmVuvPKL.js": "dba41d36d304746ba9ac7efd47d339d2552b9a8f3458c5e39c99efa33dae023f",
|
||||
"assets/order-CHImQrID.js": "db1c0bc23457ace0a936cdc41f4c31df98b28cdbcc12657eafe1fca42bf72e51",
|
||||
"assets/login-CKkzK9N3.js": "ae58a62dac0a2b91f56a78a0670bf94cd17879eccfff7f8e889136c360acfb24",
|
||||
"assets/lots-DLkS_9dB.js": "31244e0591d3e7b00994503875001e415a1caa7470ba4bc66de6c31ed3d7905a",
|
||||
"assets/metadata-D7NEtUJo.js": "d3de356a0c015fca373331594e059644822e0c33ae17fef4e0d63a32ccbfedf6",
|
||||
"assets/notices-D4vesv_i.js": "af21be3a9a997712a33bddedf71a6b9f04dd3077129e36b610be61b5ea68351b",
|
||||
"assets/opening-MySRzkCA.js": "a5f82cc166dd8c04443019c83d00fd494c04702015d3226163a82336d5f3fb59",
|
||||
"assets/operational-orders-Db1a3_d2.js": "560d8aee0ac0f318872c1aa17b45893aaf86deaf2a5ffed03e0069e888727e25",
|
||||
"assets/operations-BTjhBAX4.js": "a292d564f4b2c0fdcc7defa237130aa90d500eab4df5eb97d822ea402161321f",
|
||||
"assets/opportunity-DhyZc2j0.js": "c4439c2cb899a3dd4009df93e7d43653ac72b710dea260d1a117619f1b7e9612",
|
||||
"assets/order-1R6jL5U2.js": "d4d3da0e460f337a12ae7cb48b0e5b86d5769b99f8e731e4d0291a81b032ba4a",
|
||||
"assets/order-document-links-CY7gGohw.js": "a94c6e359ec9ab4cb143177522e2822c9aaacc462f636ab5fccfe09c45cdc43c",
|
||||
"assets/order-parts-amendment-BY8qmhCg.js": "bcab01a57ebe8a46e4efc241f15b4d76474bf8b510705a75e4f5e002be7a3dc1",
|
||||
"assets/order-parts-amendment-7FVr3_Hc.js": "2d718bba4c7c0691bb35c2f0c5b5ce658f5fa08d37deb85fd458bf146d1e4093",
|
||||
"assets/order-parts-CW5t2gcS.js": "4bf1d746291eded17bfeceaedcfbab1f4daf5fe0f384739196110a8f98b5db9b",
|
||||
"assets/orders-BMegvixt.js": "8c82a5f2ebdcc866cff5c30e6f91d0355a25dd4911a6cc3daadc591003713ec8",
|
||||
"assets/orders-DktTA0RQ.js": "1f76571f7fe716a9f18bd7aee4e0b0a92c08a4c124877859befbf8d4ef2e2e05",
|
||||
"assets/package-check--ZYjz2oi.js": "ce6074fe092e03473ff914cfe088a47acd57852fe4faef54f239fd04ccd6ab83",
|
||||
"assets/parameters-Bhh1tlIO.js": "62905ad490e55ffbbf1fbdfc0a06fa239658d6cd25ee3813a5ddb0c1992a318b",
|
||||
"assets/parts-BexD01RR.js": "7f41a76c841b030b53b4795251b2a60192c6df30a73bc2b423c74a881888a90d",
|
||||
"assets/parameters-wuvJV9Px.js": "f9d5348276425da558770ca37102a0307aa4d4849382c6689f12a1d91c073f70",
|
||||
"assets/parts-DOtDARmz.js": "31aaeb9a7de10a7360fb030e426eaa3d33ce833f02d5e76b3bc3d3f5b463668d",
|
||||
"assets/password-DSVT9zkL.js": "e9f8a7ef9b436a3e046d49f9ab56bdb4ca736bc98f69fc89efe36ec0a9bd08aa",
|
||||
"assets/password-input-R852OODD.js": "96be8fdba10dfa7065df7b5dd87fc20c254dba201d9d2a2cae429590b2fb379c",
|
||||
"assets/payments-COyDnUYM.js": "e7d1e35fdf672e4ddf75198663f0a43aeeb7fbcb885c2ac6fb358d4c397e2943",
|
||||
"assets/password-input-B_ydX-2T.js": "abc7698708ee781c47d28a8256a9f4c91830d2104b5adc1e0c2f4043687d385c",
|
||||
"assets/payments-CsYlYIwS.js": "795d2c900fdf7db19ffd73621437915761c6c7fee5e432938d5a082e44471dad",
|
||||
"assets/pencil--NTa5x5n.js": "ffc5e9c22501ed8196d21f31e016d351f91796821392ec9942716d7a70b9c022",
|
||||
"assets/people-Cu-e1LWq.js": "d82e494e20f670d579180db6612c29f3aabeae82fe6ac765c6f0d68a966b9ae8",
|
||||
"assets/people-hiring-0ebERuf_.js": "443ff16989484ecbb7576eb060a5339fccd2fc720015d72a2af828e91d12461c",
|
||||
"assets/pilot-DsEpX6bo.js": "a3e36b51e344d7c355e479679a6381394e94e152a36baae54150b8cba0a6bfd9",
|
||||
"assets/planning-Bn-UexmL.js": "a4951fbf907f84b55717947ee345cd7868acb9c440c88ab513805c2663ce912d",
|
||||
"assets/preview-Cs2lwk_F.js": "ea91d060605c4bea5ec1503da38ca260e1cc34c83fa11dafd3fc350827d00ff1",
|
||||
"assets/principal-C9-2XKsF.js": "1f042e737944f334a6595b8a5acd6fbbf17048d558212c3c9086c24618a5bc1a",
|
||||
"assets/people-WolDmi5B.js": "9dcf87a1163c34cc4372d4b9917772fd2ed40f3ecbec266e6ff569cc3942ec9a",
|
||||
"assets/pilot-D-unccL7.js": "d19261e169ef77da5c59085d757150ed04418f48922ec41205036c7d625a8145",
|
||||
"assets/planning-CBwEM0r_.js": "fddf628fcf1cd35546be9982cf417c3090983a7f5992ca157171ac9cc3d92a13",
|
||||
"assets/preview-C92oU48r.js": "5b6e2f4bbcad7a784dce935cf1f7c54c9eea31ddc1f41e36915842ac71cc21b0",
|
||||
"assets/principal-DhGV8u_B.js": "8ef4380fb447a6fc7d9ce126935fdf6160fb2c556b3843575c6ee4276b8d96de",
|
||||
"assets/printer-D0Qc0KdJ.js": "6a29144df3944867ae389bb8e8194205099314ffa04c41f0fb054226f27b3566",
|
||||
"assets/private-Df-WvbBB.js": "65ae459f438e1fe1dbad166fecd7d40910bddde1c691fdd813b2461c50c50ec9",
|
||||
"assets/process-BKe5B7Z1.js": "41a1d28d51aa68c3a1eb44a9fa9b233bd4efdff9adc89fb27489fe2c44430340",
|
||||
"assets/procurement-B9d2r3T0.js": "4879822e9c750e7ae97920e5f5925c7fe99e9a63cf43dcfff157c34908970246",
|
||||
"assets/procurement-B9wLf0G1.js": "91a33dc218b12176c0ab080309f58a7e638aeabbaddd1d0365da2a6d39a7cf96",
|
||||
"assets/procurement-BJPj7Ddi.js": "1cc46b1747c7756e0cb06d8f3a437018f01ff07cbad9c42a66845315e44431fd",
|
||||
"assets/procurement-payable-insights-DhqZD3xg.js": "4c01b6aa200eaebe6c45e6f56397287acceac2f5117ff1b3860e271e3834c723",
|
||||
"assets/profile-5D8G2fNK.js": "8d5905fcb1c888ced636ac5732661fd8d217702edbcccdf43b0a340b1f14d4e8",
|
||||
"assets/profile-gM8TSc1s.js": "ff8d00ff80d31820244e855794b24763f00f366ae5c43a2267b7f2ee6746df8f",
|
||||
"assets/purchase-controls-D56IuuV9.js": "fb327547fa49dee3df44a957f811f7d09b8b0529a7f9b52ae3997296284c9413",
|
||||
"assets/purchases-BvkQUPdA.js": "29405ed00b28d91cfd0a9bc06e8c66dc9de434f3f609aee62eab9ffd4cd23390",
|
||||
"assets/qualification-CrGXaAf4.js": "5e116e604084ac663bdfa347cbb9523514cee2831207a714f2692f18e539ecb8",
|
||||
"assets/qualification-kq9sXNGF.js": "140e3b83cf379cfd3578ee0d5a83e369ed619323c74fb751fc8fe210b3a2627e",
|
||||
"assets/quotation-exchange-panel-BEleRmjG.js": "64b7d399174cd3f8f9135e98bb0b3f37e70c48d1424220b3b8a5f0ee60b5db35",
|
||||
"assets/quotations-D_6FrDjS.js": "0f888c68d1b905aeb7fccdbc0033c2df7c5257d80950c56578db7838ac7bb22d",
|
||||
"assets/receipt-conversion-DDvDdGo7.js": "75252f4006f33fb090ceed81814bb832f730ffe40e5347f97fec262c49446368",
|
||||
"assets/private-Uy11QMzl.js": "ca266e399280ce8fb0279093bb27713172bbf4149a060f4ca1c393b1932904ea",
|
||||
"assets/process-B2Org14B.js": "77651fbf041bf28b2ecb5ca2072ca76f38f9dad5d89ed9cdfba4ba0574e90ee4",
|
||||
"assets/procurement-BjFF89UY.js": "cd0460740e0b76af821fdb71665c631e0b1be1f5ab23a296b88764ddd3641f2b",
|
||||
"assets/procurement-CV_qGaWs.js": "dde065f0fa17a1d1da46bb85f6a4c5e5e87604d108ec60f6b94da596184f9fd8",
|
||||
"assets/procurement-CWLoGk-Z.js": "2eba8ebbba4458fc6c99470641f7b075ad3d95e8ae7e083aeaea8370b9f7c1f3",
|
||||
"assets/procurement-payable-insights-BmfFC1lz.js": "64f8915a85860ef8bf4ff763bb242f90eb0050c801ee78afc065f9e1f7c68ad4",
|
||||
"assets/profile-BfJFByaA.js": "7b85ac36ca8beb565f5bdd1e146138f569122593328077674d94b53862fa93d8",
|
||||
"assets/profile-DzWKvDSr.js": "25f1fdb1bb1647dd713075351f224586858a0986643296d6328bdc6d0c9cd742",
|
||||
"assets/purchase-controls-Sskn16mz.js": "98b53a2c132fc0871c48e0b613814788f62f8f4f241d2dc50dd3c676035f1044",
|
||||
"assets/purchases-DhT-lv7U.js": "9a408e89037b847bea482d44b1782009b4f1302c11d73db6598bd4529fad9cb9",
|
||||
"assets/qualification-15ATF1T5.js": "9035fd554258139e8c9d29fa995fa1ae32d03c0da66fd7b44a89d44dfb3d68bb",
|
||||
"assets/qualification-BKgj7Qrn.js": "bcf599ae27c421cfdba7bdf9284cf4a439f0e3b22f8481201180ea574a965970",
|
||||
"assets/quotation-exchange-panel-BG2OBC3_.js": "737cf3946d100f0773d4148d24d2ec4379dcb7a01e358ddde7bc48d7eaa70142",
|
||||
"assets/quotations-aEn618XQ.js": "f606602167a867547e78b0a1ee427a8b57d13cd162f034d1688baa1bfbd0e7a7",
|
||||
"assets/receipt-conversion-Di6YDWEX.js": "70c1158b43f43ee249a7c068f4f5e25f66536bdcf8a9e91fddcf3f5933e79dfe",
|
||||
"assets/receipt-CX6COlya.js": "a20578c41e007f6000ff25baf9e53e7c39312d6541432b98edaa66d2355461d8",
|
||||
"assets/receipts-_PjCmDis.js": "4f9bea12beae6fa94e4e0a0b3e16667efba25f864b8dba46612e541c20fe29ca",
|
||||
"assets/recommendation-CaDRtadg.js": "c0e5208f2c51a4fe7eb9fb3f10f910ba5540a2afb233fa72675d576e109f9092",
|
||||
"assets/recommendation-policy-Bgv2ILQr.js": "cf474b24380fe72d8ac68b48a4b39cc2d43edc57ba8cfa06d575541fd64782ae",
|
||||
"assets/recommendation-S8cEr6gP.js": "e54b0a5cc711c7fda5db33c6391c81a1ea8718c6b6b07b9a3c72730f70f00d70",
|
||||
"assets/register-BOGVH328.js": "cfcfa3cec012901a87ba763c3ea2f10c822be7cb1c92555724f8d6ed99d7f695",
|
||||
"assets/registry-D91n9_UZ.js": "362e5c30bcc441020fa0a5ca39eb64b19e4c99b318b489a20dbda38bb6cedfaf",
|
||||
"assets/replenishment-BH0c8UTU.js": "d1d886ddc237e713d93015aa1be8e567294605cb5c44f2f0cb0351dafce256f6",
|
||||
"assets/reports-ZhsscJl2.js": "17d02b7adb3c0181613db552de359609fb6510ed63ac53156627e505cad4c9f8",
|
||||
"assets/request-hnpNG_ce.js": "52f5347c699358c7c5715d85e21a202674100dfc6ac53641b6801a946e38eae0",
|
||||
"assets/requests-DhIjazwK.js": "433204bce8f0588b2692eeacd8f868432c808bb554a31ee5a5f88e054ffa641c",
|
||||
"assets/requisition-category-fields-BfA1STDY.js": "3a8468317189cb2d04a3776782ba004169509d67c6ebdf39fc1590c8a6470859",
|
||||
"assets/receipts-DMVEKlnH.js": "9a54b33b740ad7dde84f8dda733da6e67014f3da7ac587c74a209c779b9a7ab6",
|
||||
"assets/recommendation-Bigzro8d.js": "51a7b45ce13617f4d0a7271d2d09c0a348f753753b2cfe4f9e3daf9385cd24d2",
|
||||
"assets/recommendation-Ci2DpNvv.js": "e4484f468a5dbe994232f8c5b95db898b394a9be788a33f7a52bc284bdf59825",
|
||||
"assets/recommendation-policy-DnjTs7t-.js": "f49eab2d9e6e0cc03bcfa6c28aee1a4e4dec7a9d7d753f8c74c122a9214d33f7",
|
||||
"assets/register-CBq-kgUx.js": "eb7576902016f866b70bd32d22f38855b5ccca5a88dfedb3e4310a3d912045d9",
|
||||
"assets/registry-mRyrnLTk.js": "930b1bfb2d04b0b6926094b8947adc9e6c26550db64e82be4283bb41101eb45d",
|
||||
"assets/replenishment-BQbeNUOv.js": "136c3f2bcef1a494bc8b9dd41f4c75441947c3f3b608d369e11e7f8a9b4f5ef2",
|
||||
"assets/reports-21-g65zW.js": "78eb285abd070478cbe7ede314c4502214a1f8de468f2ddef420401b8b6047ba",
|
||||
"assets/request-kDrYmjJU.js": "54e6b8b73c3f4f0f72fc46643c868c705e44cee151c1a5cdaa0b7d0b79461b5a",
|
||||
"assets/requests-CqZuLJt2.js": "7c756ba0aaee79c72882c2340231931b16b5be8fa0e562b34ec72eaa774319a8",
|
||||
"assets/requisition-category-fields-BCQvbHQx.js": "13575478bc31cb9973e306079278c3b2c3c216d240753789e4d5ad4cd2523ba9",
|
||||
"assets/requisition-history-Dsahm4kA.js": "cd35dcf01ae95f608899009f3795ba78255ef294566e97ca24b70204ff2fa033",
|
||||
"assets/requisitions-CfSLtwIQ.js": "1cdc8652d9c202dd4ae92843e548b13e01e0cb4e6a2db47f9a592bbbc8c789a2",
|
||||
"assets/reset-password-Cz7lqDku.js": "a6c3d34a2c9b0d2a78f65df6b004cb3586f6f9d80031017728e2dbd88d785562",
|
||||
"assets/returns-BhqW_9as.js": "42c56b23166be4b0f533d43ac088f3e3413bfa90f35975f35647d9a4f50d5103",
|
||||
"assets/reversals-C8uzSXSi.js": "1f0023c32a6ac60619c09e511072cce525f682cd1b8d1878dfbc69f1c8580599",
|
||||
"assets/review-report-BddB_7Uo.js": "a9cdc357aeea90e41ea421458ef2407473ccd3f8619185ab3025eac172373f45",
|
||||
"assets/requisitions-BlZN3vx6.js": "793a0decacc7b9ce9b9203a1ad596f282a6601adbc6ba1abc01b1518a20c4c32",
|
||||
"assets/reset-password-BLisGeTG.js": "99cfa1c249dd699854e58975c384e70549d65a67443875465f319444c1ad3ea5",
|
||||
"assets/returns-CvjDZGdM.js": "30a54a3f75b5a9bbb03393458daf4c8e53b8389b28e55f5a62c15e6f4418e6d3",
|
||||
"assets/reversals-DsfqTViN.js": "16eb4414ff94bce849ab2b455a416cb4a438248a9729757a7e04d9bef7e12782",
|
||||
"assets/review-report-BGeqzANx.js": "97e61f9b081c1fbb5a49ce190d4b1f9f02df036c57f364e40dba1e0f14a12fe4",
|
||||
"assets/rolldown-runtime-WkwZ5CU-.js": "2629f2ad3cb75a57d98de697127f5af7d777ef572bbcdfa6e3ce8f438cd4527e",
|
||||
"assets/security-Db3mWEUi.js": "cf94c9e2b65d265ba0d230a083bd5f087a0199c69a8206b4d912dfff1aa25f87",
|
||||
"assets/setup-38btiZNT.js": "48aa7e7bbe396a0d10137f4ac35ae6e350351eae9adacc49d482be1cce0d2227",
|
||||
"assets/show--VVVcETW.js": "fab7db8230446f87f8c06032b25084aa153e34b903dee693b1485642dd2bcdfb",
|
||||
"assets/show-Bk9BoB1j.js": "ad5b5087f3eb78bd812736c365f57c772c0c306b817d76127cc63ad0c9ecc6ea",
|
||||
"assets/show-CMovsent.js": "90e5909fec1ac626ac52a2c9db542a7c380ab153144ef5ecb861cb8dcda0262b",
|
||||
"assets/show-CuKwkVJl.js": "f3dcf426c103c072fdb75d2a2e2b5c37997ec5b3b97010b9c267a539858434da",
|
||||
"assets/show-CvopPHD4.js": "c020cf1acbe2e62dcd74a224ca65afb910bc522c4d19cbdb02f63e24bcec6e0b",
|
||||
"assets/show-DbPXbMfL.js": "29df6d62c33eebba4bf406b0f11e21486ca9de2cb784dfa17bb0aa566e711162",
|
||||
"assets/show-DHQKA8kl.js": "809dc0bb6d0b05cc9ae9cb5da70242e45f98bccba341a0810ad63b5d6ec4788c",
|
||||
"assets/show-DkvVYZa5.js": "de695610cab274e2ebf2736d2b555eb4e6a3c4d8e7f34fd693030c7dff2c0c14",
|
||||
"assets/security-urIbqDkA.js": "45ee40ceab92ab0b90e2b1075ff74d8b532ee662388324c8fabd7972d02b6c35",
|
||||
"assets/setup-DIxL3oD3.js": "544fd262702b5f0dc301d0a09531689505ab0648b2d1f58f9d85e169f0093891",
|
||||
"assets/show-B2zWoEnz.js": "53120ab4401abbb76eb0b3cae799f6be3d14ebade3b895e4682c41ab7a1176e1",
|
||||
"assets/show-BPIGrBcy.js": "eeaf9c861c37eee59f8cc938855ece553cfe5835d962c6576aa7ca94a933af84",
|
||||
"assets/show-CDCQnmYo.js": "44d89891f49ada3b84664a8f880987d6549f7ff7a75b7e80be408fd30d43cd88",
|
||||
"assets/show-CiLJsQSW.js": "ef395c1f5f63f7d37147146122ef518e3bcf0e32f0d848d4522be702291869ac",
|
||||
"assets/show-CS5M27pQ.js": "116f220cd664b2404b7ed83547dafbd300477674223fd80e969b5ce80d1f2222",
|
||||
"assets/show-DzaxzscB.js": "4e62eb1c21b8dd81a681f04943eb8e18b01230ea5bd619fe19e734aacd5afeeb",
|
||||
"assets/show-itIAs-4v.js": "86e39e4d1a5299e81b7bce32075a239d38b6a8ca8310ffe514361d812c24ac8c",
|
||||
"assets/show-sG29pHFY.js": "c0539106f5193ac78a770f55072533a9104c31c908a2eea6378629875161b995",
|
||||
"assets/spinner-CpJAdIKb.js": "9c8f8fb08c631cae61ecdf41cd766fbc3e777fd184fa707b6351c3d460eef059",
|
||||
"assets/stock-ob-YhrID.js": "05132959c3bfb18dbc4886d621b2f08df7620d798c9e0196b32d3d99f375f563",
|
||||
"assets/submission-forms-DBfKeyTz.js": "a033cc5308b298abd2b66f2971c526ba909d97178078993c20179bdb5e4dd5d0",
|
||||
"assets/submissions-BIqKoX5S.js": "0f376fc990f74ff70da733f696ff293f48107fb7f5d6b0518a2587a84a6a37c6",
|
||||
"assets/suggestions-BYJp21LQ.js": "c945eb2553dea4af682c7b528aa39d335a6bfc729cb9470e09e063217dcae85c",
|
||||
"assets/stock-DhIQhBYe.js": "eb5d751d2229307d2c2614608c84246200b31471991c97a663980ee1de0c1554",
|
||||
"assets/submission-forms-DmmGlgCf.js": "e6e1c1fc2a1d89676288810b4cb63c2a7381d599598b40793e6752972def2501",
|
||||
"assets/submissions-B2gL_M33.js": "e2657aba356a52f9ebc30350c39980780ff38f028dbad3d262751ab6c8aa43c2",
|
||||
"assets/suggestions-DiWOO6_D.js": "a75abbaea0739fe452d35d42f5a46ef89a0d118eede06556205f2024cc41df75",
|
||||
"assets/supplier-DbZ754P4.js": "5617827f9283736a34edb62fe4ea4e6c8df48961c617dd66f416fb054dd92ab4",
|
||||
"assets/supplier-evaluation-fields-Wp0wjDTI.js": "1ad85c1e8cac221e1e3988027f47643a0bb7794c85c2686452cbabf390897d40",
|
||||
"assets/supplier-improvements-CbDFDPwK.js": "cc1b6d045a05bf95c1e59ed7f46767161e303331d48c7ea1b3339c0e7acc6242",
|
||||
"assets/suppliers-DOitEs2H.js": "334714ab39f42174165f0a35ced144552e902fd961c2c773fc088306c9eb033f",
|
||||
"assets/supply-CT7phV_N.js": "f3ff06b05472053edd5c09f446e927259f3d680c442a7ccc1b9eb26235115dc1",
|
||||
"assets/supplier-evaluation-fields-CqyDxSq4.js": "f4abfa45e893b7ccbd3ca0a6b17d287e9449fde79e908c41f46d1ec845e5d105",
|
||||
"assets/supplier-improvements-BJjbYzR-.js": "59bf466ef14222aaeacbebb29a64c6f14402b10aeb06841461cac9cc94444263",
|
||||
"assets/suppliers-DvWsnpz-.js": "63fc9ab54af033d85845cfa00c2837024a26c8f29aa2ec8b6d8deb402c00216b",
|
||||
"assets/supply-MDVtDJ55.js": "7773601e5230ed2ef8f55044f341b9dd6b94b76fb57a27d928049a29a298b838",
|
||||
"assets/supply-pagination-CnzjlbVc.js": "8537e2e4e48a836f41a2b2176f635ced2b1c62734485d1109bc4469168a1cb28",
|
||||
"assets/tasks-B8onhiLE.js": "a854d1f3b65d34087fb994a419a9dcb8d4da0f43c42a6fd83db4cd1a6a8b131e",
|
||||
"assets/territorial-filter-Ctid8p4S.js": "d06cfd0857e46bb1771cf38113d1bfdc1b90e11669900ba6f1955e00b2811649",
|
||||
"assets/tasks-BC5OP9Yp.js": "5c4a1b78ed2915f552c843aff5a3bc498d11a57016b4e7ba5de95ca84ce58d75",
|
||||
"assets/territorial-filter-BSQf0R02.js": "5cf717f7e5bc86f3361f901f92eba171b52d750732d061db0b3a8e79223600a3",
|
||||
"assets/text-link-CydDNIng.js": "9ddf76c1a4d33cb5d25315e38395f2893250091a23c156adc582bbb2bcad85b9",
|
||||
"assets/two-factor-challenge-BuKaxWOm.js": "7f81b5a7db06edafe7188462527f886291acbbb5f828d87f74b745a2fc1d22da",
|
||||
"assets/urgent-review-Dei6LVFI.js": "a06f433f853b5f3507f753854c7d5bfffe34a98398c3bc7b4237a9491f2406c2",
|
||||
"assets/urgent-review-policy-ChVwKIh6.js": "a867bd1b416dc528c374e02742d838612008f713ccd96ecb5241a8e6ad1d78f6",
|
||||
"assets/urgent-reviews-DM4vIxoA.js": "2bc7c56456cb3158f22dc4f2da75d762209d6c58d61d2adddbf76aaa22492c5b",
|
||||
"assets/urgent-stock-C4V_nM2q.js": "5ebe290831b633a5cd63093b0b31884ab8a0cb88af46c719bbf542d0382d20c4",
|
||||
"assets/two-factor-challenge-CbCDi50w.js": "d3a8c25f73695f883acd713770e69d7cf0cb2251db476530e84ef015951b9243",
|
||||
"assets/urgent-review-DrDSrySw.js": "19f92444fa6ae5aeac718e0312d4db2559d3b700adb57204667f7d92df7fa918",
|
||||
"assets/urgent-review-policy-DZrQJAhD.js": "c59660563efad173d6ad8616b15629f6ef4cc9c34c0cda3793b75ffe82663898",
|
||||
"assets/urgent-reviews-Bki3qZVV.js": "49e0be00359c46a67b85e36eeca51dea0ee413b22ee1f4fef0a4df90305bc5fb",
|
||||
"assets/urgent-stock-BewzmU1k.js": "d46d691777b55a1a1b57e63766cb02852514e0114b17d115ff4e5c5f7ca45bce",
|
||||
"assets/use-inventory-preparation-identity-DcCfUMXu.js": "43e5cb96c4ef1bd19574442166c972db05be7d25e5f5ba76a8a0086646eaa0f8",
|
||||
"assets/use-preparation-dirty-BgWtEMn8.js": "40bb918883cfea471bce7294a489978ac71dcd3bcd6383f18e191284796493d8",
|
||||
"assets/use-preparation-dirty-CzJrHUXB.js": "6f5b60681538994be575a4adec321d77330456037fafc94aac0dd56d907f5dfa",
|
||||
"assets/use-procurement-preparation-identity-NZ7gcqOB.js": "09315e79db9d28ab8e584c1e6978ee3da38a849f1be28c0499301e1b3f98d115",
|
||||
"assets/utils-DJPu_GY6.js": "7b162681baff9e9a115823fd6070404fcaddf53d058b311edbe98be7f2662ef4",
|
||||
"assets/wayfinder-Dp7PqxvV.js": "3d4c90228fda731e37f541f3087fdf5387d9d59433e35b267b64a97196f70781",
|
||||
"assets/welcome-ukqAGxCJ.js": "d44149f825b8c75bc74f484e6523940703f058a785c6908d4b28c97b4071f13f",
|
||||
"assets/work-context-IqHxnOTH.js": "0bdf597277e899ef85b71953f7aedaa27047022b32f5d595fc2bc2de44678219"
|
||||
"assets/welcome-BAPZNXy9.js": "99c149c00db9441eecfa10e324e0284011102fb749dd5c9945326104f42ea8a1",
|
||||
"assets/work-context-CaHTAaw0.js": "3d87b7c9b63cd8b56f9e46156a69b8672cd1602b8e71977055a757d92a40e358"
|
||||
}
|
||||
},
|
||||
"components": [
|
||||
@@ -1197,5 +1199,5 @@
|
||||
"manifest_sha256": "52df7927aa2689598ce1be92de1483694347a696245704abb9e3925db7abfc0f"
|
||||
}
|
||||
],
|
||||
"release_id": "compras-2160835ce2ddf346"
|
||||
"release_id": "compras-e7f04f3245abfd46"
|
||||
}
|
||||
|
||||
@@ -8,6 +8,26 @@ Um pagamento externo do exercício anterior pode ainda ser registado e conferido
|
||||
|
||||
Na v1 o cancelamento de ordens emitidas continua desligado. Para ordens sem recepção nem factura que o fornecedor não vai cumprir, aplica-se o procedimento manual de `docs/procedimento-ordens-nao-entregues.md`: despacho escrito da Direcção, mapa de ordens anuladas mantido por Finanças e, se necessário, reforço da dotação `ANUL-<ordem>` com dupla aprovação no sistema. Proibido corrigir por base de dados ou com recepções/facturas fictícias. Antes de ligar `order_cancellation`, decidir o tratamento dos reforços já concedidos para não duplicar o disponível.
|
||||
|
||||
## Declarações globais no SGF — âmbito de empresa autorizado
|
||||
|
||||
Autorização expressa recebida: «Autorizar âmbito de empresa, sem concessões persistentes», conforme decisão adicional em docs/proposta-extensao-composicao-sgf.md. Os dois direitos purchasing_conflicts.view/authorise podem ter âmbito de empresa para declarações globais por fornecedor; direitos de unidade não as abrangem. Preservar a competência nativa própria da Direcção, associação explícita e não ambígua empresa SGF/empresa nativa, dados NULL sem classificação automática e direitos base de criação sem concessões adicionais. Sem contas novas, concessões persistentes, operacionais ou publicação. Não voltar a solicitar autorização deste recorte; implementação/testes ainda em curso.
|
||||
|
||||
## Extensão do contrato SGF autorizada — 30/11/2026
|
||||
|
||||
O proprietário autorizou expressamente implementar e testar em isolamento docs/proposta-extensao-composicao-sgf.md e continuar a integração total. Inclui declaração de capacidades validada pelo runtime existente, versões locais qualificadas, levantamento de impedimentos, cancelamento por ciclos e os seis nomes de catálogo propostos, sem atribuições persistentes. Não voltar a pedir esta autorização; os estados «pendente» abaixo são históricos. Não conceder acessos persistentes, alterar instalações operacionais, publicar ou criar aplicações paralelas. Preservar SGC independente e uma autoridade financeira. Em desenvolvimento: ExecutionContext limitado à ligação/execução, pontes dos serviços originais e WorkflowExecution no ReceiptRuntime; implementação ainda exige qualificação e entrega antes de declarar conclusão.
|
||||
|
||||
## Extensão do contrato de execução SGF — proposta pendente, 30/11/2026
|
||||
|
||||
Continuação da integração identificou uma fronteira concreta: ConflictReleases::ready() admite SGC autónomo/testes restritos, não ReceiptRuntime do SGF; cancelamento actual exige versão qualificada e ciclos. Proposta revista em docs/proposta-extensao-composicao-sgf.md e hashes em docs/proofs/sgf-composition-extension-proposal-20261130.json. Ainda não autorizada, implementada ou activada. A autorização anterior do instalador v2 cobre entrega de ficheiros, não esta alteração de contrato de execução. Não contornar ready() mudando APP_ENV, retirar guardas físicas, copiar outro motor ou atribuir competência de Direcção ao administrador/financeiro. Proposta prevê extensão do runtime existente, seis nomes de direitos no catálogo sem atribuições, versões locais qualificadas, ciclos e testes revertidos; zero GRANT/REVOKE ou operacionais. Candidata3d2e9743ecf621d3 inalterada. Verificar resposta do proprietário antes de implementar a extensão; não voltar a pedir autorização se entretanto concedida para este recorte.
|
||||
|
||||
## Seguimento da integração SGF — catálogo administrativo e matriz,30/11/2026
|
||||
|
||||
Continuação expressa sem novas aplicações/publicação/operacionais: o catálogo dos33direitos nativos de Compras/Stock foi incorporado no MESMO AccessOverlay/AdminUiOverlay, preservando os direitos antigos, criação de unidade apenas com unit.view/unit.edit e delegação apenas de direito possuído no âmbito.54verificações PostgreSQL revertidas no livro existenteb4093c6f6707, sem novas contas/concessões persistentes/GRANT/REVOKE. Candidata3d2e9743ecf621d3,169ficheiros/99sobreposições/27fontes de schema,202verificações de recuperação de código; fonte financeira bd787c45e6f91bf0 reutilizada. Não instalada. Hashes/provas/matriz em docs/integracao-total-sgf-20261130.md e docs/proofs/sgf-purchasing-access-delivery-20261130.json. Verificador de inventário apenas de leitura:25componentes,21fontes divergentes/duas ausentes/duas inalteradas,12testes/25asserções; não é aceitação funcional. ConflictReleases, cancelamento de ordens, diferenças posteriores e portabilidade continuam pendentes. Não declarar integração integral concluída, substituir os pins/bindings físicos nem retirar guardas QA por esta entrega. SGC independente e restantes permissões/configuração reais preservadas.
|
||||
|
||||
## Recibos de custo zero na integração SGF — 30/11/2026
|
||||
|
||||
O proprietário autorizou expressamente implementar recibos de custo zero, com revisão independente e testes isolados, preservando SGC autónomo e instalações operacionais. Implementado no MESMO `PayableJournal`, sem lançamento ou movimento adicional; entradas continuam a exigir custo explícito positivo. Candidata privada `MERCHANDISE-V2-6e1b9710e9094c5a`, não instalada, com 202 verificações de recuperação de código; detalhes e hashes em `docs/integracao-total-sgf-20261130.md` e `docs/proofs/sgf-zero-cost-receipts-20261130.json`. FIFO153/CMP155, dados utilizados/restauro, revisão distinta, versões, revogação, relatórios e guardas concorrentes qualificados na regressão existente `b4093c6f6707`, contexto1/2/2; contagens sobrepostas. Cópias SQL transitórias removidas, sem novas bases/contas/demonstrações/GRANT/REVOKE ou publicação. Não repetir a autorização deste incremento; instalação, activação, parametrização real e aceitação operacional continuam separadas. Não enfraquecer a exigência de montantes positivos no diário nem tratar custo desconhecido como zero.
|
||||
|
||||
## Conclusão e uniformização — decisões expressas do proprietário, 29/11/2026
|
||||
|
||||
Pedido: uniformizar local e público, configurar emails, terminar a validação e o desenvolvimento restante. Remetente e destino autorizado para a mensagem de teste: `nala@tempo.co.mz`; não divulgar credenciais. A configuração SMTP local continua a exigir um ficheiro privado com autenticação ou outro mecanismo aprovado; o endereço de email não constitui uma password.
|
||||
|
||||
@@ -1,5 +1,124 @@
|
||||
# Integração integral de Compras no SGF — execução de 30/11/2026
|
||||
|
||||
## Matriz actual consolidada — conferência das versões
|
||||
|
||||
**Decisão específica pendente:** a [extensão do contrato de execução](proposta-extensao-composicao-sgf.md) concretiza a entrada dos workflows actuais na composição SGF. A análise confirmou que ConflictReleases::ready() não admite hoje o runtime SGF e que o cancelamento requer o componente qualificado por ciclos. A autorização do instalador v2 não altera esses contratos. Não foram removidas guardas, carregadas versões novas, aplicadas migrações ou atribuídos direitos. Fontes/hashes e seis nomes de direitos propostos, sem atribuições: [registo da proposta](proofs/sgf-composition-extension-proposal-20261130.json). A candidata3d2e9743ecf621d3 permanece inalterada. A implementação desta extensão aguarda autorização específica; a análise documental não fecha os percursos funcionais.
|
||||
|
||||
**Candidata corrente deste seguimento:** `MERCHANDISE-V2-3d2e9743ecf621d3`, preparada e não instalada, sucede à6e1b9710e9094c5a acrescentando o catálogo administrativo de direitos nativos. Manifesto SHA-256 `3d2e9743ecf621d3e0113769a5339df7b0a704822d09243ef29a79015034770a`; ZIP `46cfe55141e180565cf7617ec487ca30eacf86494601997bdb466039580a67ac`.169ficheiros/99sobreposições/27fontes de schema; **202 verificações** de aplicação/repetição/recuperação de código. Não introduz schema novo neste incremento. A revisão financeira `bd787c45e6f91bf0` e as suas provas válidas foram reutilizadas.
|
||||
|
||||
O MESMO `AccessOverlay`/`AdminUiOverlay` passou a incluir os33direitos nativos de Compras/Stock e os respectivos rótulos, conservando os nomes do percurso anterior. `select/approve` do adaptador nativo não são renomeados para `propose/confirm`. A interface continua a consumir o catálogo enviado pelo servidor. Criar unidade concede apenas unit.view/unit.edit; gerir acessos exige access.manage, direito delegado no mesmo âmbito e consulta da unidade pelo destinatário. Não se atribuem perfis nativos, correspondências ou capacidades por esta listagem. As guardas de contexto, aprovação independente e flags funcionais permanecem.
|
||||
|
||||
**54 verificações** em PostgreSQL com as identidades sintéticas existentes e rollback:33âmbitos SQL, criação real de unidade sem direitos adicionais, catálogo/rótulos, recusa de nome desconhecido, âmbito empresa indevido, unidade alheia, delegação sem autoridade, destinatário sem consulta, repetição única, revogação imediata, administrador revogado, auditoria e preservação das tabelas. Unidade de ensaio revertida; zero novas contas/concessões persistentes/GRANT/REVOKE. Compilação privada aprovada; revisão visual separada. Os hashes das duas sobreposições ensaiadas e das três fontes de entrega coincidem com a candidata. [Prova de entrega e vínculos](proofs/sgf-purchasing-access-delivery-20261130.json). Recuperação de código: `storage/framework/testing/merchandise-v2-86f3c3a3fbd8/recovery-result.json`.
|
||||
|
||||
Esta matriz prevalece sobre as tabelas históricas seguintes. A candidata de mercadorias `6e1b9710e9094c5a` conserva a qualificação do seu recorte; não certifica automaticamente as versões actuais de todos os processos do SGC.
|
||||
|
||||
Conferência apenas de leitura do pacote nativo da regressão existente: manifesto SHA-256 `7709a3d447d54c17d2fb4be4f9a0f70455c4a38c34e4bb8c643f6b5169071556`, integridade de todos os ficheiros declarados verificada. Na selecção explícita de **25 componentes**, há **21 fontes alteradas**, **duas não transferidas** e **duas sem alteração**. Diferença de hash não prova regressão funcional; exige comparar a alteração e qualificar o percurso afectado. Esta selecção não é um inventário exaustivo de todas as dependências.
|
||||
|
||||
| Percurso/componente | Estado para a integração integral | Fecho necessário |
|
||||
| --- | --- | --- |
|
||||
| Contexto, permissões e identidade actual | Parcialmente transferido; quatro fontes seleccionadas divergentes | Comparar WorkContext, HasWorkContext, CurrentActor e OrganizationAccess, mantendo direitos e isolamento do adaptador SGF |
|
||||
| Requisição → orçamento → aprovação | Percurso anterior aceite; quatro fontes seleccionadas divergentes | Conferir alterações posteriores antes de declarar equivalência com o SGC actual; não recriar os documentos aceites |
|
||||
| Consulta → comparação → adjudicação | Parcialmente transferido; três fontes divergentes | Conferir PurchaseWorkflow, ProposalComparison e ConflictGuard; manter decisão independente |
|
||||
| Levantamento de impedimentos pela Direcção | Pendente: ConflictReleases não consta do pacote conferido | Incorporar serviço, modelo, schema, competência e histórico do circuito existente; nunca eliminar conflitos por adaptação |
|
||||
| Encomenda → recepção | Percurso anterior aceite; ReceiptWorkflow e política de recepção divergentes; ReceiptDocuments sem alteração | Comparar diferenças e adaptar ecrãs/permissões necessários; equipamentos/peças não são uma condição universal do percurso básico, mas os respectivos ramos não ficam aceites por esta conclusão |
|
||||
| Cancelamento de ordens | Pendente: OrderCancellationWorkflow não consta do pacote conferido | Reutilizar cancelamento e reversão orçamental existentes, com versão/política/revisão; não criar outro writer |
|
||||
| Obrigação e dívida a fornecedor | Percurso anterior aceite; duas fontes divergentes | Conferir InvoiceWorkflow e SupplierPayables e preservar autoridade financeira única |
|
||||
| Armazém e reservas internas | Parcialmente transferido; quatro fontes seleccionadas divergentes | Comparar StockWorkflow, WarehouseRequests, WarehouseReservations e WarehouseFulfilment; qualificar alterações efectivamente relevantes |
|
||||
| Reposição e sugestões para revenda | Implementado no recorte ensaiado; duas fontes divergentes e SupplySuggestions sem alteração | Comparar SupplyPlanning/AutomaticPurchases; duas conversões simultâneas continuam sem prova completa, o ensaio de leitor concorrente não as substitui |
|
||||
| Venda, recebimento de cliente e entrega | Implementado no recorte de mercadorias ensaiado | Aceitação das variantes documentais restantes e correspondência transversal com os processos actualizados |
|
||||
| Valorização FIFO/CMP, devolução original, reconciliação, entradas e custo zero | Implementado no recorte qualificado da candidata actual | Preservar provas de custo, arredondamento e recuperação; não voltar a apresentar como decisões pendentes |
|
||||
| Actualização e recuperação de código | Implementado/ensaiado: v2, 202 verificações na candidata actual | Requalificar somente ficheiros alterados pelos próximos incrementos; não activar uma versão |
|
||||
| Recuperação de schema/dados | Ensaiada transaccionalmente, incluindo dados utilizados | Recuperação de servidor, ACL/proprietários e privilégios de instalação não estão demonstrados por rollback na mesma base |
|
||||
| Portabilidade da composição | Pendente | Adaptadores ainda dependem de vínculos, caminhos e guardas físicos do ambiente de regressão. Conservar as guardas; não apresentar a candidata como instalação autónoma pronta para clientes |
|
||||
| Catálogo administrativo de permissões de Compras/Stock | Implementado e ensaiado na preparação da candidata3d2e9743ecf621d3 |54verificações; delegação pelo mecanismo existente, sem concessões persistentes. Instalação/configuração efectiva e restantes catálogos financeiros separados. Três concessões stock.view propostas para a8085 continuam sem aplicação e não são autorizadas por esta tarefa |
|
||||
| Parametrização real, visual, carga e implantação | Etapas separadas, excluídas desta execução | Sem valores empresariais presumidos, novas aplicações, publicação ou alterações operacionais |
|
||||
|
||||
Evidência reproduzível: [inventário das fontes e hashes](proofs/sgf-workflow-inventory-20261130.json). Comando apenas de leitura: `php scripts/sgf-workflow-inventory.php <pasta-do-bundle> 7709a3d447d54c17d2fb4be4f9a0f70455c4a38c34e4bb8c643f6b5169071556`. O verificador não arranca Laravel nem estabelece ligações a bases. Recusa manifesto divergente, ficheiro adulterado, caminhos inseguros e inventários sem hashes de origem. **12 testes/25 asserções** e Pint dirigidos passaram. Nenhuma prova financeira anterior foi repetida.
|
||||
|
||||
Estado global: **parcialmente integrado**. O inventário resolve a ambiguidade documental; os componentes pendentes acima ainda exigem implementação/qualificação e não foram declarados concluídos.
|
||||
|
||||
## Entrega anterior — recibos de custo zero autorizados
|
||||
|
||||
O proprietário autorizou expressamente a [proposta de recibos de custo zero](proposta-custos-zero-sgf.md), com revisão independente e testes isolados. Este incremento está concluído no código e nas provas; não equivale à instalação ou à aceitação operacional da integração integral.
|
||||
|
||||
Candidata privada **MERCHANDISE-V2-6e1b9710e9094c5a**, não instalada: 168 ficheiros/99 sobreposições, 27 fontes de schema sujeitas a recibo separado. Manifesto SHA-256 `6e1b9710e9094c5ab91987a1465e6f2e3e3067af4856e93b0053280bfb380760`; ZIP `6c2bc3501849515ab49db7c5200be7a265f789b3defd1f81bab8a5686fc61037`. Aplicação/repetição/recuperação de código: **202 verificações** na cópia privada, prova `storage/framework/testing/merchandise-v2-957d5d2ef984/recovery-result.json`. Revisão fonte `bd787c45e6f91bf08b2b38a958645c8bfcb5301652452800d10bf6cd6dbd76b8`, ZIP `e4dd24f3450dad3a78ce041c0bf32b004ad52165d822c493c9899b0e7b178a85`; compatibilidade compilada `cab61896c8e4aa47` preservada. Substitui a candidata 815d88bc0f2f7105 neste recorte sem apagar o histórico.
|
||||
|
||||
| Capacidade | Estado actual |
|
||||
| --- | --- |
|
||||
| Custo de saída calculado em 0,00 MZN | Implementado para as saídas tipadas do custo empresarial; só com arredondamento aprovado, origem física e cálculo comum qualificados |
|
||||
| Proposta, revisão e aplicação | Mesmo `PayableJournal`, permissões existentes e outra identidade; confirmação guarda `gl_stock_zero_costs`, sem lançamento, linhas de diário ou novo movimento físico |
|
||||
| Origem e versões | Recibo, revisão, autor/data, motivo e versão conservados; chave repetida recupera o recibo, versão substituída e alteração indevida de custo são recusadas |
|
||||
| Exclusão de duplicações | Um custo por movimento; guarda serializa recibos zero e lançamentos positivos e recusa a segunda inserção |
|
||||
| Custos posteriores e último saldo | Referência de recibo distinta de identificador de lançamento; FIFO/CMP continuam a partir do custo aceite, com acerto exacto na última saída |
|
||||
| Saldo físico sem valor remanescente | Reconciliação independente conserva explicitamente zero, sem inventar recepção gratuita ou custo positivo |
|
||||
| Consulta, relatórios e impressão | Recibos paginados separados dos lançamentos e de custos em falta; totais financeiros continuam a usar apenas linhas reais do diário |
|
||||
| Recuperação | Schema vazio removível; histórico utilizado preservado. Restauro de dados preenchidos e falha parcial ensaiados separadamente da recuperação de código |
|
||||
|
||||
Provas incluídas, sobrepostas e não somáveis como casos únicos: **153** FIFO (`20261130-203737-d83fb894`) e **155** CMP/meio cêntimo (`20261130-203751-65891c96`), com endpoints/controladores reais, Blade, revogação, revisão independente, versão substituída, falsificação zero↔um cêntimo, falha tardia e restauro de dados utilizados. A matemática comum passou **26 testes/83 asserções**; projecção **11/21**; interface simulada **14 testes**. Lint dos ficheiros afectados e formatação das classes novas passaram.
|
||||
|
||||
Regressões preservadas/actualizadas: devolução original com reconciliação/restauro **166** (`20261130-203805-b7652c1e`), entrada positiva/CMP **157** (`20261130-203820-73ca9047`), transferência/reconciliação **163** (`20261130-203835-21f7fea6`), schema/dados **17** (`20261130-203849-194565f3`), serviços **26** (`20261130-203900-041ddf77`). Provas anteriores válidas de revenda **24** e sugestões **43** reutilizadas.
|
||||
|
||||
Concorrência: duas ligações PostgreSQL disputaram a guarda e as restrições reais copiadas para um schema SQL transitório no livro isolado existente. Foram observados bloqueio e recusa da segunda operação nos casos zero/zero, zero/positivo e positivo/zero. A cópia foi removida, sem alterar dados públicos ou privilégios. Este ensaio cobre a exclusão concorrente na BD; cálculo e autorização foram verificados separadamente pelo escritor nativo e pelos controladores. Não é um teste de carga nem de duas sessões HTTP completas.
|
||||
|
||||
Conferência final apenas de leitura: zero schemas SQL transitórios restantes, tabelas novas revertidas, artigo temporário de abertura ausente e perímetro original `2e18acc7c460bd3c1574b13b3bad768e0187941f103f59d41acc3186aee9fcff` preservado. Sem novas bases, demonstrações, contas, GRANT/REVOKE ou publicação. SGC independente e instalações operacionais intactos. A ligação proprietária permanece uma limitação do ensaio; restauro de servidor/ACL/proprietários, revisão visual, carga e parametrização operacional continuam separados. Os estados pendentes abaixo são históricos.
|
||||
|
||||
## Entrega anterior — valorização e recuperação
|
||||
|
||||
Candidata privada **MERCHANDISE-V2-815d88bc0f2f7105**, preparada e não instalada: 166 ficheiros, 97 sobreposições e 26 fontes de schema sujeitas a recibo próprio. Manifesto SHA-256 `815d88bc0f2f7105b0e4783c0b98fff21c0f4fde36f10b717b93da7f10a3c349`; ZIP `d918a6e9908edad20eec86f5f614b1d6e3339d94f91e93a6367f091b7bf84913`. Aplicação, repetição e recuperação de código passaram **198 verificações** na cópia privada, com o instalador e arranque distribuídos. Prova: `storage/framework/testing/merchandise-v2-f4d2b27db9f9/recovery-result.json`. Não equivale a instalação, activação ou aceitação operacional; SGF real permanece em 0.1.1.
|
||||
|
||||
Revisão fonte `723e67e88eff653a9cc7648f3319528276ebd48a4105ff2d94b4b57af815010f`, ZIP `472f8ab3275a93f5e282145a8d1610524afbb468e32b63776764fe42fac18637`; compilação de compatibilidade `cab61896c8e4aa47`, manifesto `ea7bb21a3e3780d84b6f27a4275998b50f8a24f55724cdccffb4bcd39bda972f`, ZIP `6ba573b6241154f8ed73f08d7bd65073036daf7c4b3b373faa9f03ebe1fbde10`. A candidata sucede à `9c182cdaabd8f13f` neste recorte, preservando os pacotes/provas históricos.
|
||||
|
||||
| Capacidade | Estado e prova actual |
|
||||
| --- | --- |
|
||||
| Abertura 4 UN/75 MZN | Ensaio expressamente autorizado concluído e revertido; perímetro original recuperado por hash |
|
||||
| Entradas com custo explícito | Mesmo diário, custo total por movimento, revisão independente; 157 verificações na diferença positiva/CMP |
|
||||
| Devolução pela recepção original | Ligação financeira implementada no mesmo escritor; custo original distinto da taxa antiga, bloqueio de preço livre, replay, falha tardia e revogação conferidos |
|
||||
| Camada original indisponível | Bloqueio até reconciliação independente; nova versão conserva quantidade/valor e identifica a recepção. Prova nativa de camada não identificada e reposição explícita; esgotamento por saídas conferido no cálculo PHP/SQL |
|
||||
| Transferência e venda no destino | Propriedade conferida sem despesa na transferência; reconciliação posterior também ensaiada, 163 verificações |
|
||||
| Schema e dados utilizados | Recuperação dos schemas completos, mais restauro destrutivo revertido das novas tabelas preenchidas, guardas e sequências; falha parcial recuperada sem repetir lançamentos |
|
||||
| Custo de saída arredondado a zero | Bloqueado pelo contrato financeiro actual; decisão específica pendente em [proposta de recibos de custo zero](proposta-custos-zero-sgf.md) |
|
||||
| Instalação/aceitação operacional | Não executadas; configuração real, acessos e revisão visual mantêm etapas próprias |
|
||||
|
||||
Provas financeiras incluídas: FIFO com recuperação de dados utilizados — **166**, execução `20261130-191939-364e83d0`; CMP/devolução/reconciliação — **152**, `20261130-191619-be8771be`; transferência/reconciliação — **163**, `20261130-191632-9a67395b`; diferença positiva/CMP — **157**, `20261130-191645-7156c2af`. Restauro de schemas — **15**, `20261130-191659-85a37153`. Serviços anteriores — 26; políticas de revenda — 24 reutilizadas; sugestões — 43 na execução `20261130-192002-77f00a5f`. São passagens sobrepostas, não um total de casos distintos. Mantêm-se 22 testes/63 asserções do cálculo, 11/21 da projecção e 13 testes focados de interface simulada; não substituem aceitação visual ou testes de carga.
|
||||
|
||||
O restauro das tabelas preenchidas usa exclusivamente a ligação proprietária existente da regressão, incluindo `CREATE/DROP` das estruturas testadas e `ALTER TABLE ... DISABLE/ENABLE TRIGGER USER` durante a reposição dos registos já aceites; as chaves estrangeiras continuam activas. Não se atribuem estes privilégios à aplicação nem se executam GRANT/REVOKE. Esta ligação continua uma limitação conhecida do ensaio, não um modelo de cliente. As provas são transaccionais na mesma base e não cobrem perda do servidor ou restauro de ACL/proprietários.
|
||||
|
||||
A integração integral permanece **parcialmente concluída**. Os estados seguintes são históricos: a ligação financeira de devoluções, os cortes posteriores a transferências e a preparação da candidata entretanto avançaram conforme a matriz acima. Não criar outro motor, juntar bases, publicar ou activar o conector por esta preparação.
|
||||
|
||||
## Seguimento autorizado — variantes e recuperação de schema/dados
|
||||
|
||||
Actualização do seguimento: o ensaio de abertura autorizado está concluído e revertido. A reconciliação de camadas já dispõe de proposta, revisão independente, histórico paginado, ecrã próprio e recibo de recuperação. A distribuição conserva exactamente a quantidade e o valor contabilizados; referências a recepções mantêm o custo original e o restante fica explicitamente identificado como saldo reconciliado. Não cria movimentos ou lançamentos nem altera custos anteriores. As saídas seguintes usam o corte aprovado; versões, política, origem, direitos actuais e identidade são conferidos no servidor e no SQL.
|
||||
|
||||
Provas privadas mais recentes: FIFO com reconciliação `20261130-185630-0e13403c/merchandise-cost-result.json` (160 verificações, incluindo endpoint directo, Blade, consulta sem escrita, recibo privado, colisão de identidade e revogação); CMP `20261130-185245-70c2aa48/merchandise-cost-result.json` (157 verificações, anterior ao último reforço de titularidade do recibo); entrada positiva/CMP `20261130-185506-9e39f6d0/merchandise-cost-result.json` (157 verificações). Não somar passagens sobrepostas. Cálculo comum: 22 testes/63 asserções; projecção: 11 testes/21 asserções; interface de reconciliação: seis testes simulados. Pint e análise estática do cálculo passaram. Revisão visual continua separada.
|
||||
|
||||
Recuperação actualizada: `20261130-185051-7dac1a97/schema-data-recovery.json`, 15 verificações, inclui instalação/remoção de estruturas vazias de custos explícitos e reconciliação, restauro dos dois schemas, linhas e sequências, falhas parciais e rollback final. Não ensaia perda do servidor, restauro de ACL/owners ou instalação operacional.
|
||||
|
||||
Limites ainda abertos: ligação financeira completa de devoluções com preços de recepção diferentes e camadas consumidas; reconciliação após transferências já valorizadas (o corte actual recusa esse histórico); custos financeiros arredondados a zero; preparação da nova candidata e aceitação transversal. Os cálculos PHP/SQL de devolução pela recepção original, incluindo camadas reconciliadas, já têm regressão, mas não equivalem ao percurso financeiro completo. A candidata `9c182cdaabd8f13f` não inclui este seguimento. As descrições «em desenvolvimento» abaixo são estados históricos, não substituem estas limitações actuais.
|
||||
|
||||
O proprietário autorizou expressamente em 30/11 continuar a integração, sem novas demonstrações/publicação, e aprovou duas regras: devoluções a fornecedor pelo custo da recepção original, sem recalcular saídas anteriores, com reconciliação independente de camadas já consumidas; e custo explícito proposto/aprovado por outra identidade para diferenças positivas ou aberturas sem aquisição identificável. Estas decisões não concedem direitos, instalam schema operacional ou parametrizam valores empresariais.
|
||||
|
||||
Autorização adicional expressa: apenas o ensaio revertido do quarto artigo `QA-ABERTURA-20261130`, livro no contexto 1/2/2/armazém12, contagem4UN/custo total75MZN, preparação15/revisão16. Implementado no auxiliar de testes com diário e hashes do perímetro, sem alterar `ComposedMaterialIsolation` nem o perímetro da8085. A prova de abertura passou154verificações em `20261130-181646-80222768/merchandise-cost-result.json`; o perímetro original foi reposto byte a byte (`2e18acc7c460bd3c1574b13b3bad768e0187941f103f59d41acc3186aee9fcff`). Isto não autoriza manter outro artigo/livro, criar contas ou conceder direitos.
|
||||
|
||||
O custo explícito de entradas foi ligado ao MESMO diário: novas propostas/revisões nativas de valor total por movimento, comandos repetíveis no recibo de stock existente, controlos SQL, configuração de contas própria e formulários no razão integrado. O custo não cria recepção fictícia, dívida, pagamento ou novo movimento. Diferença positiva por lotes mantém a quarentena original; não se concedeu poder a um interveniente para libertar o próprio lote. Uma abertura não rastreada usa a contagem/ajuste originais, com aprovação independente do custo; não impõe regras de lotes a artigos sem rastreio. Recuperação de schema vazio ensaiada, remoção de decisões utilizadas recusada. O circuito persistido de reconciliação de camadas ainda está em desenvolvimento; os estados anteriores abaixo são históricos.
|
||||
|
||||
Em desenvolvimento: prefixo de propriedade v2 para transferência interna seguida de venda no destino, sem despesa na expedição/recepção e com dedução única no relatório de propriedade; ajustes negativos previamente conferidos; devoluções valorizadas pela recepção identificada no cálculo comum e na validação SQL. A disponibilidade da camada original é obrigatória; no CMP, sem alocações qualificadas que provem a origem, a disponibilidade incerta após saídas exige reconciliação, sem pressupor uma afectação física. O custo explícito de entradas positivas e a reconciliação persistida ainda estão em implementação. A candidata anterior não inclui este seguimento até nova preparação identificada por hashes.
|
||||
|
||||
Recuperação ensaiada no livro de regressão existente: dumps consistentes de ambos os schemas públicos, reprodução integral dentro de transacções, comparação de todas as linhas/sequências e estruturas, aplicação das migrações novas e falhas parciais. **11 verificações** passaram, prova privada `20261130-174654-1079e69f/schema-data-recovery.json`. A comparação normaliza apenas a conversão equivalente de arrays de literais varchar para text que o PostgreSQL reescreve ao restaurar; não ignora restrições ou valores. As ligações proprietárias existentes, sem CREATEDB/CREATEROLE/superutilizador, foram reutilizadas sem concessões. Não foi criado outro servidor/base/demonstração. Esta prova é restauro transaccional na mesma base isolada, não recuperação após perda do servidor nem restauro de ACL/owners. As bases originais foram repostas por rollback e conferidas.
|
||||
|
||||
## Continuação: sugestões de mercadorias e entrega v2 conferida
|
||||
|
||||
Integrado em desenvolvimento o percurso política de revenda aprovada → sugestão → conferência por outra identidade → requisição em rascunho → submissão/reserva → aprovação. O adaptador reutiliza SupplySuggestions, RequisitionWorkflow e a reserva originais. Estimativas, finalidade e versão aprovada acompanham a origem e o histórico; não se calcula imposto com números de vírgula flutuante na interface. A conversão não submete nem reserva por si mesma.
|
||||
|
||||
O servidor verifica módulo, empresa/unidade, permissões actuais e a origem auditada de cada versão. A mesma referência física não permite consultar outra unidade. O recibo de uma confirmação incerta pode ser recuperado por leitura; só uma resposta explícita de recibo ausente permite repetir o comando original. Revogação bloqueia confirmação e repetição. Alterações por guardar oferecem guardar, descartar ou cancelar; falha mantém a preparação no ecrã.
|
||||
|
||||
Passaram **43 verificações de integração**, **24 de políticas** e **16 testes de interface simulada**. Usaram-se as contas e o livro de regressão existentes, com perfis efémeros revertidos e transportes de mensagens simulados. As linhas anteriores foram conferidas e preservadas; nenhuma concessão persistente, nova instalação ou comunicação externa. Não constitui aceitação visual nem prova de duas conversões simultâneas.
|
||||
|
||||
Candidata actual de código: **MERCHANDISE-V2-9c182cdaabd8f13f**, 155 ficheiros/86 sobreposições; manifesto SHA-256 `9c182cdaabd8f13f17ad94fe891ff41a81ca7e1242135aa53f4af6b9cc1261c0`, ZIP `f428b39507869271cbe220437313ea9ab83f116426d85e282556bcc3b1fd7f47`. Fonte revista `14c43e745471ebef`, compatibilidade compilada `a7cc8cbadcccc00e`. **176 verificações** de aplicação/repetição/recuperação de ficheiros passaram, incluindo o instalador e arranque efectivamente distribuídos. As 22 fontes de schema continuam a exigir prova separada; o recibo do ensaio é sintético. Prova privada: `storage/framework/testing/merchandise-v2-bc812c9c44ba/recovery-result.json`. Substitui a candidata de código 46133eee4f4f5ddb para este recorte, sem apagar as provas históricas.
|
||||
|
||||
Ensaio adicional entre processos: um leitor independente recebeu 503 com espera limitada enquanto o contexto estava bloqueado e 200 após libertação. Não executou comandos de negócio nem demonstra duas conversões simultâneas. Prova do percurso: `suggestion-integration-result.json`, execução privada `20261130-145628-3ece0103`; 43 verificações incluem este ensaio.
|
||||
|
||||
Instalações, configuração e ponteiro operacional preservados. Flags de sugestões e revenda permanecem desligadas por defeito. Continuam pendentes as variantes de valorização de transferências/devoluções/ajustes, recuperação operacional de schema/dados e aceitação transversal; a integração total não é declarada concluída.
|
||||
|
||||
## Continuação: arredondamento aprovado
|
||||
|
||||
O proprietário definiu arredondamento ao cêntimo, metade para cima, com acerto do saldo na última saída. Implementado como opção explícita `half_up_final_balance` na política empresarial, proposta/revisão independente, entrega congelada, cálculo comum e validação SQL do mesmo diário. Políticas anteriores continuam exactas; não se lhes atribui uma regra retroactivamente. A migração preparada, ainda não instalada, valida a regra e impede que a decisão altere o arredondamento proposto. A reversão de schema vazio e a recusa de apagar históricos utilizados foram novamente ensaiadas.
|
||||
@@ -12,6 +131,20 @@ A integração integral **não está concluída**. A conferência encontrou uma
|
||||
|
||||
## Âmbito autorizado e limites
|
||||
|
||||
### Continuação autorizada: entrega v2
|
||||
|
||||
Implementada a extensão aprovada em `docs/proposta-entrega-integracao-sgf-v2.md`, no mesmo `CodeDeployment`. v1 conserva o seu comportamento; v2 exige o predecessor exacto, ampliação declarada, hashes antes/depois e ausência expressa para ficheiros novos. Valida recibos de schema por origem/destino/ficheiros e inclui o hash do recibo no alvo revisto. Recuperação preserva alterações desconhecidas; usa bytes preparados conferidos, sem reler uma origem mutável na aplicação.
|
||||
|
||||
Corrigida a preparação anterior que exigia `sourcing/bootstrap.php` sem incluir a pasta correspondente. A composição v2 já não habilita automaticamente requisições ao carregar código. A composição v1 histórica mantém a sua semântica. O cálculo comum é carregado da própria cópia verificada da candidata, somente quando explicitamente habilitado; uma versão divergente já carregada é recusada. Não cria outro escritor ou dependência de execução da pasta-fonte SGC.
|
||||
|
||||
Candidata de código **MERCHANDISE-V2-46133eee4f4f5ddb**, 147 ficheiros e 78 sobreposições. ZIP SHA-256 `e664273baeef86b0bd96df3df3722acef838932da5d953f52ef6683080d68e1c`; manifesto `46133eee4f4f5ddb789eb3e7d91f1c40960847fe431bacc251f965cad1c87b5d`. Fontes: revisão 336a3885051d0e36 e preparação compilada 1b535581af984ca1. A base de desenvolvimento é Git `fe02d1d5d03c5b02a7aa6602dcfd55c88fb69d96`, com bytes canónicos do Git e manifesto de compilação existente identificado separadamente. Não é uma certificação dos bytes ou do estado da instalação operacional. Uma instalação que já tenha outra entrega exige preparação de transição com o predecessor correspondente; não reutilizar esta candidata inicial como actualização indiscriminada.
|
||||
|
||||
**Verificação:** 24 testes/76 asserções do instalador, quatro/12 do arranque condicionado e 14/38 do cálculo comum passaram. Duas verificações adicionais de links foram ignoradas porque o ambiente não permitiu criar links; nenhum privilégio foi alterado. Falhas em seis etapas duráveis, repetição, reversão em ordem, ficheiros inesperados/adulterados, paths indevidos e recibos divergentes cobertos. Preparação real: **160 verificações** de ficheiros aplicados/restaurados, ausência reposta, repetição, ponteiro preservado e qualificação do próprio instalador/arranque/cálculo distribuídos. Compilação privada e Pint dirigidos aprovados. Sem ligação a base nesta prova de entrega.
|
||||
|
||||
Há 22 fontes de schema que exigem conferência separada. O recibo usado no ensaio é marcado sintético e pertence exclusivamente à cópia privada; não integra o ZIP nem autoriza migrar qualquer base. Não se certificou restauro operacional de dados/schema. Prova: `storage/framework/testing/merchandise-v2-ed79c8ff9bfe/recovery-result.json`. O arquivo 7b67b2a3022b9acd é preliminar e não passou a qualificação posterior do instalador incluído; foi preservado e substituído pela identificação acima, sem instalação.
|
||||
|
||||
**Limites preservados:** nenhum destino instalado, módulo operacional 0.1.1 intacto, sem activação, publicação, GRANT/REVOKE ou concessões persistentes. Continuam necessários os percursos de sugestões/requisições para revenda e a qualificação das variantes de custo; uma entrega de código recuperável não equivale à integração funcional integral concluída.
|
||||
|
||||
### Continuação: políticas de mercadorias para venda
|
||||
|
||||
O adaptador `StockCompletionController` passou a admitir a finalidade original `resale` quando a capacidade separada `merchandise_invoices.resale_planning_enabled` está habilitada. Valor por defeito falso, sem activação de instalações. O ecrã usa as finalidades realmente disponíveis, exige escolha quando existem duas, preserva a finalidade na edição e mostra-a na conferência. A aprovação continua no `SupplyPlanning` original, com identidade independente. Não se criam requisições, movimentos ou lançamentos por guardar/aprovar uma política.
|
||||
@@ -76,18 +209,19 @@ Esta candidata é resultado do preparador anterior reconciliado; a sua existênc
|
||||
|
||||
Este ensaio cobre recuperação de código e ficheiros da candidata; não demonstra recuperação de dados/schema nem aceitação empresarial. Nenhuma alteração de schema integra este incremento.
|
||||
|
||||
## Matriz do restante circuito
|
||||
## Matriz histórica do restante circuito — anterior à conferência das versões
|
||||
|
||||
| Parte | Evidência encontrada | Situação para a integração total |
|
||||
| --- | --- | --- |
|
||||
| Compras até reconhecimento da obrigação | Percurso C01–C10 documentado na instalação 8085 em 04/11 | Reutilizar e conferir diferenças posteriores do SGC; não repetir documentos de prova. |
|
||||
| Actualização e recuperação | Mecanismos existentes; compatibilidade com o host actual corrigida neste incremento | Preparação aprovada no âmbito de ficheiros; instalação excluída. |
|
||||
| Actualização e recuperação | Mesmo instalador com v2 autorizado, predecessor/hash/ausência/recibos; 176 verificações em cópia e arranque incluído | Candidata de código 9c182cdaabd8f13f preparada; compatibilidade/recuperação operacional de schema e dados e instalação excluídas deste ensaio. |
|
||||
| Sugestão e requisição para revenda | Política e estimativas versionadas, decisão independente, conversão/submissão/reserva/aprovação originais; 43 verificações em rollback | Integrado em desenvolvimento, sem activação; duas conversões simultâneas e revisão visual ainda por conferir. |
|
||||
| Venda de mercadorias no SGC | CustomerSales, CustomerDeliveries e SalesStockSource em trabalho paralelo, com livro cr_* comum | Preservar; não copiar o livro nem presumir equivalência com facturas nativas do SGF. |
|
||||
| Facturação existente do SGF | Extensão tipada de mercadorias testada no escritor nativo, com catálogo real | Implementada em desenvolvimento; não activada na demonstração ou instalação operacional. Guardas QA mantidas. |
|
||||
| Dívida e recebimentos de cliente | Recebível, recebimento parcial, afectação e reversão testados no percurso nativo | Integrados em desenvolvimento; sem dinheiro real. Variantes documentais restantes e implantação ainda por aceitar. |
|
||||
| Entrega física da mercadoria | Linha/versionamento/saldo/repetição ligados ao StockWorkflow original | Implementada e ensaiada em rollback; publicação, activação e revisão visual pendentes. |
|
||||
| Contabilidade das mercadorias | Venda e custo pelo mesmo diário; FIFO/CMP, revisão, repetição, recuperação e validação SQL ensaiados | Prefixo qualificado de entradas/saídas. Transferências/devoluções/ajustes e aberturas incompatíveis ficam pendentes; configuração empresarial explícita. |
|
||||
| Equivalência global e entrega | 128 verificações por método, 26 regressões de serviços e pacote privado de revisão | Integração total permanece parcial; sem aceitação global, pacote instalável total ou publicação. Falta a conferência transversal de compras para revenda. |
|
||||
| Equivalência global e entrega | Provas financeiras anteriores válidas preservadas, 24 de políticas, 43 de sugestões e candidata de código v2 recuperável | Integração funcional permanece parcial; variantes de custo e aceitação transversal pendentes, sem publicação. |
|
||||
|
||||
A facturação do SGF ainda tem guardas de conformidade de teste; não foram retiradas. Desenvolver em QA não equivale a habilitar emissão fiscal real. Regras, séries, taxas, contas e correspondências empresariais dependem da parametrização e da autorização da instalação, não de valores de demonstração.
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"format": "tempo.sgf-composition-extension-proposal.v1",
|
||||
"status": "awaiting_specific_contract_authorisation",
|
||||
"implemented": false,
|
||||
"activated": false,
|
||||
"predecessor_manifest_sha256": "3d2e9743ecf621d3e0113769a5339df7b0a704822d09243ef29a79015034770a",
|
||||
"existing_native_bundle_manifest_sha256": "7709a3d447d54c17d2fb4be4f9a0f70455c4a38c34e4bb8c643f6b5169071556",
|
||||
"features": [
|
||||
"conflict-release",
|
||||
"order-cancellation-cycles"
|
||||
],
|
||||
"proposed_unit_rights": [
|
||||
"purchasing_conflicts.view",
|
||||
"purchasing_conflicts.authorise",
|
||||
"purchasing_order_cancellations.view",
|
||||
"purchasing_order_cancellations.prepare",
|
||||
"purchasing_order_cancellations.approve",
|
||||
"purchasing_order_cancellations.revise"
|
||||
],
|
||||
"account_assignments": [],
|
||||
"persistent_grants": 0,
|
||||
"sql_grants": [],
|
||||
"source_pins": {
|
||||
"app/Services/ConflictReleases.php": "2fbe67958d4772d6f7c580456679f3d27385c8780775ed672b9b26d46fd65566",
|
||||
"app/Models/ConflictRelease.php": "bd7fa0ee0a3e901227fb50a7b19d2285a46472842a72b27a3f10aa175e1f52fb",
|
||||
"app/Services/ConflictGuard.php": "b5b7e28a96741e31d99e02a0865d5938ff4345fc88f3a66907b5a0832979f60f",
|
||||
"database/migrations/2026_11_28_000001_create_conflict_releases.php": "a0f24ccc5961de00a3ed0ec9ddb9c6f45db022b2638c0c81c1507306b3f10af4",
|
||||
"app/Services/OrderCancellationWorkflow.php": "1f45c710e45e577d79c164d14254697c604af626ac56612ab44ab78d2a917da7",
|
||||
"app/Services/OrderCancellationRuntime.php": "5a98bb958c0bf5652d986dbdb63604feb4c46b9ee49f0364cde00473a40c20f0",
|
||||
"database/migrations/2026_11_03_000003_create_order_cancellations.php": "c60bf9123b9c9e2ef56687779f1e90b063a34a22d957df5c045dc4d2230f17d3",
|
||||
"packages/order-cancellation/releases/0.2.0-rc.1/manifest.json": "52df7927aa2689598ce1be92de1483694347a696245704abb9e3925db7abfc0f",
|
||||
"packages/order-cancellation/releases/0.2.0-rc.1/src/CommitmentReversal.php": "ecf0028a57b0280cf3a889da29a6e528c7eaa6a876e700b32ff59ac3b3eeb069"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"passed": true,
|
||||
"checks": 176,
|
||||
"candidate": "MERCHANDISE-V2-9c182cdaabd8f13f",
|
||||
"manifest_sha256": "9c182cdaabd8f13f17ad94fe891ff41a81ca7e1242135aa53f4af6b9cc1261c0",
|
||||
"archive_sha256": "f428b39507869271cbe220437313ea9ab83f116426d85e282556bcc3b1fd7f47",
|
||||
"bundled_updater_qualified": true,
|
||||
"bundled_bootstrap_and_cost_qualified": true,
|
||||
"bootstrap_did_not_enable_requisitions": true,
|
||||
"baseline_git_commit": "fe02d1d5d03c5b02a7aa6602dcfd55c88fb69d96",
|
||||
"code_copy": "C:/laragon/www/compras/storage/framework/testing/merchandise-v2-bc812c9c44ba",
|
||||
"schema_or_data_recovery_qualified": false,
|
||||
"synthetic_schema_receipt_only": true,
|
||||
"database_connected": false,
|
||||
"destination_installed": false,
|
||||
"pointer_preserved": "0.1.1",
|
||||
"published": false
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"status": "candidate_prepared_not_installed",
|
||||
"integration_complete": false,
|
||||
"candidate": {
|
||||
"id": "MERCHANDISE-V2-815d88bc0f2f7105",
|
||||
"manifest_sha256": "815d88bc0f2f7105b0e4783c0b98fff21c0f4fde36f10b717b93da7f10a3c349",
|
||||
"archive_sha256": "d918a6e9908edad20eec86f5f614b1d6e3339d94f91e93a6367f091b7bf84913",
|
||||
"source_review_manifest_sha256": "723e67e88eff653a9cc7648f3319528276ebd48a4105ff2d94b4b57af815010f",
|
||||
"source_review_archive_sha256": "472f8ab3275a93f5e282145a8d1610524afbb468e32b63776764fe42fac18637",
|
||||
"compatibility_manifest_sha256": "ea7bb21a3e3780d84b6f27a4275998b50f8a24f55724cdccffb4bcd39bda972f",
|
||||
"baseline_git_commit": "fe02d1d5d03c5b02a7aa6602dcfd55c88fb69d96",
|
||||
"files": 166,
|
||||
"host_overlays": 97,
|
||||
"schema_sources_requiring_separate_receipt": 26,
|
||||
"code_recovery_checks": 198,
|
||||
"code_recovery_proof": "storage/framework/testing/merchandise-v2-f4d2b27db9f9/recovery-result.json"
|
||||
},
|
||||
"isolated_book": {
|
||||
"id": "b4093c6f6707",
|
||||
"scope": [1, 2, 2],
|
||||
"warehouse_id": 12,
|
||||
"temporary_opening_item": "QA-ABERTURA-20261130",
|
||||
"temporary_quantity_milli": 4000,
|
||||
"temporary_amount_minor": 7500,
|
||||
"opening_rehearsal_reverted": true,
|
||||
"material_perimeter_sha256_restored": "2e18acc7c460bd3c1574b13b3bad768e0187941f103f59d41acc3186aee9fcff"
|
||||
},
|
||||
"regression_runs": {
|
||||
"fifo_original_return_reconciliation_used_data_recovery": {"run": "20261130-191939-364e83d0", "checks": 166},
|
||||
"weighted_average_original_return_reconciliation": {"run": "20261130-191619-be8771be", "checks": 152},
|
||||
"transit_and_subsequent_reconciliation": {"run": "20261130-191632-9a67395b", "checks": 163},
|
||||
"positive_input_weighted_average": {"run": "20261130-191645-7156c2af", "checks": 157},
|
||||
"schema_data_restore": {"run": "20261130-191659-85a37153", "checks": 15},
|
||||
"retained_service_finance": {"run": "20261130-191709-afbd6313", "checks": 26},
|
||||
"retained_resale_policy": {"run": "20261130-145429-852ee636", "checks": 24},
|
||||
"suggestion_integration": {"run": "20261130-192002-77f00a5f", "checks": 43}
|
||||
},
|
||||
"counts_overlap_do_not_sum": true,
|
||||
"focused_checks": {"stock_costing_tests": 22, "stock_costing_assertions": 63, "projection_tests": 11, "projection_assertions": 21, "ui_simulated_tests": 13, "stock_costing_static_analysis_errors": 0},
|
||||
"boundaries": {
|
||||
"new_databases": 0,
|
||||
"new_demonstrations": 0,
|
||||
"new_accounts": 0,
|
||||
"persistent_grants": 0,
|
||||
"operational_installation_touched": false,
|
||||
"sgc_operational_data_touched": false,
|
||||
"published": false,
|
||||
"connector_activated": false,
|
||||
"visual_acceptance": false,
|
||||
"new_server_disaster_restore_tested": false,
|
||||
"acl_owner_restore_tested": false
|
||||
},
|
||||
"decision_pending": "docs/proposta-custos-zero-sgf.md",
|
||||
"limitations": [
|
||||
"Zero-rounded outgoing costs remain blocked pending the explicit contract decision.",
|
||||
"The SQL owner connection is an isolated rehearsal limitation, not a client application permission model.",
|
||||
"Used-table recovery and complete-schema restore are transactional rehearsals in the existing isolated databases.",
|
||||
"The native financial return fixture reuses one actual original receipt at a cost different from the legacy rate; multiple-price receipt arithmetic and exhausted-layer refusal are separately qualified in PHP and SQL.",
|
||||
"Operational parametrisation, installation, visual review and load acceptance remain separate."
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
{
|
||||
"format": "tempo.sgf-purchasing-access-delivery.v1",
|
||||
"installed": false,
|
||||
"activated": false,
|
||||
"candidate": "MERCHANDISE-V2-3d2e9743ecf621d3",
|
||||
"manifest_sha256": "3d2e9743ecf621d3e0113769a5339df7b0a704822d09243ef29a79015034770a",
|
||||
"archive_sha256": "46cfe55141e180565cf7617ec487ca30eacf86494601997bdb466039580a67ac",
|
||||
"code_recovery_checks": 202,
|
||||
"code_recovery_proof": "storage/framework/testing/merchandise-v2-86f3c3a3fbd8/recovery-result.json",
|
||||
"financial_review_reused": "bd787c45e6f91bf08b2b38a958645c8bfcb5301652452800d10bf6cd6dbd76b8",
|
||||
"native_access_proof_sha256": "2c146000199edc0538ff69e269bf03f4f22db5481633786ef4a2cd6c21b40f47",
|
||||
"native_access_checks": 54,
|
||||
"native_access_proof": {
|
||||
"passed": true,
|
||||
"checks": [
|
||||
"native SQL scope matches purchasing_requests.view",
|
||||
"native SQL scope matches purchasing_requests.prepare",
|
||||
"native SQL scope matches purchasing_requests.submit",
|
||||
"native SQL scope matches purchasing_requests.approve",
|
||||
"native SQL scope matches purchasing_sourcing.view",
|
||||
"native SQL scope matches purchasing_sourcing.prepare",
|
||||
"native SQL scope matches purchasing_sourcing.evaluate",
|
||||
"native SQL scope matches purchasing_sourcing.select",
|
||||
"native SQL scope matches purchasing_sourcing.approve",
|
||||
"native SQL scope matches purchasing_orders.view",
|
||||
"native SQL scope matches purchasing_orders.issue",
|
||||
"native SQL scope matches purchasing_receipts.view",
|
||||
"native SQL scope matches purchasing_receipts.confirm",
|
||||
"native SQL scope matches purchasing_suppliers.view",
|
||||
"native SQL scope matches purchasing_suppliers.prepare",
|
||||
"native SQL scope matches purchasing_suppliers.review",
|
||||
"native SQL scope matches purchasing_invoices.view",
|
||||
"native SQL scope matches purchasing_invoices.prepare",
|
||||
"native SQL scope matches purchasing_invoices.validate",
|
||||
"native SQL scope matches purchasing_obligations.view",
|
||||
"native SQL scope matches stock.view",
|
||||
"native SQL scope matches stock.operations.prepare",
|
||||
"native SQL scope matches stock.operations.confirm",
|
||||
"native SQL scope matches stock.transfers.receive",
|
||||
"native SQL scope matches stock.lots.review",
|
||||
"native SQL scope matches stock.items.prepare",
|
||||
"native SQL scope matches stock.items.review",
|
||||
"native SQL scope matches stock.planning.view",
|
||||
"native SQL scope matches stock.planning.prepare",
|
||||
"native SQL scope matches stock.planning.review",
|
||||
"native SQL scope matches stock.disposition.view",
|
||||
"native SQL scope matches stock.disposition.prepare",
|
||||
"native SQL scope matches stock.disposition.review",
|
||||
"actual unit creation grants only the two original base rights",
|
||||
"new unit seed never receives module rights automatically",
|
||||
"unknown rights remain forbidden",
|
||||
"existing module right is offered only at its unit scope",
|
||||
"interface receives a concrete action label",
|
||||
"unit right cannot be granted at company scope",
|
||||
"foreign unit cannot receive a module grant",
|
||||
"administrator cannot delegate a right they do not hold",
|
||||
"target must already be allowed to consult that unit",
|
||||
"repeated grant creates one scoped right",
|
||||
"administrative list includes the scoped module grant",
|
||||
"revocation takes immediate effect",
|
||||
"module revocation preserves existing unit access",
|
||||
"revoked administrator cannot list accesses",
|
||||
"revoked administrator cannot repeat a grant",
|
||||
"existing immutable access audit is reused",
|
||||
"rollback preserves permission_grants",
|
||||
"rollback preserves company_memberships",
|
||||
"rollback preserves identity_audit",
|
||||
"rollback preserves units",
|
||||
"rollback preserves users"
|
||||
],
|
||||
"tested_sources": {
|
||||
"resources/js/app.jsx": "45a6a2fc477673ddf9ddd267d2d239cb500270dcf363bbf84c01c57d6ba5b49f",
|
||||
"scripts/sgf-purchasing-access-proof.php": "aeccf8d0a12900ec8ea185723069ef1ab9320ba0850865d22f42f1aaf893ece7",
|
||||
"sgc:integrations/sgf/access/AccessOverlay.php": "b0b32b6545ea104a027dc7a1df1169db712b9b344af35a6bc6787a31a09c8fea",
|
||||
"sgc:integrations/sgf/access/NativeAccessCatalogue.php": "8b8a328846a5c3342a6a4a9e574a9392b9e16470487b837a8a1d993dd7430eb0",
|
||||
"sgc:integrations/sgf/operational/AdminUiOverlay.php": "e76feecbb567e90dda37cd71422511b5769701c331ae47bca5e00ba40a2e92bf"
|
||||
},
|
||||
"prepared_sources": {
|
||||
"app/Modules/Identity/Services/Permissions.php": {
|
||||
"before_sha256": "97a860b632de0cb5022b2d9153261ecfa2211c100961eb6b9e6a09d30f798e63",
|
||||
"after_sha256": "8096322cf25c615647ea669fede7ff08d17f741d9aee7583ed892528b357f085"
|
||||
},
|
||||
"app/Modules/Identity/Services/IdentityWorkflow.php": {
|
||||
"before_sha256": "66da58c37c7e57b45700807b7262a5b5cc9c6e4192231342fa31bb854fc4ee0a",
|
||||
"after_sha256": "9fed5b36934d89a6ba6b4dad3497328e23fc1e21363ad5cfe87bb5dd4db5e9fa"
|
||||
}
|
||||
},
|
||||
"rolled_back": true,
|
||||
"persistent_grants": 0,
|
||||
"new_accounts": 0,
|
||||
"visual_review": false
|
||||
},
|
||||
"candidate_sources_verified": true,
|
||||
"frontend_private_build": true,
|
||||
"visual_review": false,
|
||||
"schema_changes_in_this_increment": false,
|
||||
"financial_proofs_repeated": false,
|
||||
"new_accounts": 0,
|
||||
"persistent_grants": 0,
|
||||
"independent_sgc": true,
|
||||
"global_integration_complete": false
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
{
|
||||
"format": "tempo.sgf-workflow-inventory.v1",
|
||||
"manifest_sha256": "7709a3d447d54c17d2fb4be4f9a0f70455c4a38c34e4bb8c643f6b5169071556",
|
||||
"bundle_integrity": true,
|
||||
"read_only": true,
|
||||
"functional_acceptance": false,
|
||||
"processes": {
|
||||
"context_permissions": {
|
||||
"source_equivalent": false,
|
||||
"components": {
|
||||
"app/Services/WorkContext.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "8bedc8f420d2a67dd54a926b10659b1aa2ca006f75c2bbc2ba8a3b7babd694b1",
|
||||
"accepted_source_sha256": "f1fc39399d6bc0798d08909801ec370b2e6f00cef402c0f84c9b4bc2bd9b5b26"
|
||||
},
|
||||
"app/Models/Concerns/HasWorkContext.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "ffc8dc7bb6f9334a20031531e2fffec16cf063d66caf284b178bab219b02e686",
|
||||
"accepted_source_sha256": "1cdccd697dbbc0dcc7610b8dfba745533c73fb00c6d28ec3f05706c97750cb1d"
|
||||
},
|
||||
"app/Services/CurrentActor.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "ae88aa7313e7a499fb38be9297a5b605cd0949022807f23a91a9e364170a017f",
|
||||
"accepted_source_sha256": "c425b065099d8b29c064edf2d68fc13ed79ece44eca9c810f277255e2b4b5be4"
|
||||
},
|
||||
"app/Services/OrganizationAccess.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "9acc83889c9ada84d0d3e6a60c3088c4850c4c80e2b23d8c85dd6efc8c71278c",
|
||||
"accepted_source_sha256": "fc22e0e53472b83998bdd0b4d48f51b2e2e2d35a2726c9ce669711538812ecb5"
|
||||
}
|
||||
}
|
||||
},
|
||||
"requisition_budget": {
|
||||
"source_equivalent": false,
|
||||
"components": {
|
||||
"app/Services/RequisitionWorkflow.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "17ce02f241d87aaf86be31563b06c097932f6debd5425af539d2f84212471330",
|
||||
"accepted_source_sha256": "b6bf90c760f50a55a2c98c1d8f707ef644a99ad414e13860d64c7b13096e1868"
|
||||
},
|
||||
"app/Services/BudgetWorkflow.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "5c5a69334fc0b803f9dc16f1e5c7472cdaaa4f3d0fe77c480984566bd0f49276",
|
||||
"accepted_source_sha256": "ef6c631fe1543afab2c977d785bc1336dfff6761f00dab7cd22ba8e691c8591c"
|
||||
},
|
||||
"app/Services/InternalRequisitionPort.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "57f9fc7f1fef0256d267c0fdcda365f568d293a1bc246b8bc92e9e96acf5ec53",
|
||||
"accepted_source_sha256": "ea3652f8f4ca6bf3f4ba7704fce77f83315197ff46033581c9a8a2f7e268938c"
|
||||
},
|
||||
"app/Models/Requisition.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "1137b5d78274b56aefea3be97477a0d60ee36163ef133811f33fa2d3c7a47132",
|
||||
"accepted_source_sha256": "411e50450d0148bd2fadab3723484ac09cde98776ac75834dfe811b867b692fe"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sourcing_award": {
|
||||
"source_equivalent": false,
|
||||
"components": {
|
||||
"app/Services/PurchaseWorkflow.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "dabf06852944acbc1f69f0993d77575f2395cd6d83e4071ef7fe1db8e4c71bf0",
|
||||
"accepted_source_sha256": "84f9db1286058087ecb8cf08c64fcd3afc94c91d1509b985b634a3fcafd81295"
|
||||
},
|
||||
"app/Services/ProposalComparison.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "11cb15ad88ac7d66375707df9e05090dd76c2f24092e0220d9657f7847cdaaef",
|
||||
"accepted_source_sha256": "f34e7f736a18ae9e21bba324ebdf738c02cdcc6b4841367a13a5868631cd5dfa"
|
||||
},
|
||||
"app/Services/ConflictGuard.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "b5b7e28a96741e31d99e02a0865d5938ff4345fc88f3a66907b5a0832979f60f",
|
||||
"accepted_source_sha256": "99990d13512f59f488632a5da48409155af0c63bc58d0916ae005217d711ed14"
|
||||
},
|
||||
"app/Services/ConflictReleases.php": {
|
||||
"status": "not_transferred",
|
||||
"source_sha256": "2fbe67958d4772d6f7c580456679f3d27385c8780775ed672b9b26d46fd65566",
|
||||
"accepted_source_sha256": null
|
||||
}
|
||||
}
|
||||
},
|
||||
"orders_receipts": {
|
||||
"source_equivalent": false,
|
||||
"components": {
|
||||
"app/Services/ReceiptWorkflow.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "c8a497769c48fe20b34e8566454ed1f8a5dcc4f16e849d5537d8ac6ea35eda03",
|
||||
"accepted_source_sha256": "a7325d4fdb09d1767d0d4fa3661bcf9b254e8506285080d6063bbed487bb522c"
|
||||
},
|
||||
"app/Services/OrderCancellationWorkflow.php": {
|
||||
"status": "not_transferred",
|
||||
"source_sha256": "1f45c710e45e577d79c164d14254697c604af626ac56612ab44ab78d2a917da7",
|
||||
"accepted_source_sha256": null
|
||||
},
|
||||
"app/Policies/GoodsReceiptPolicy.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "888ba3d9315ad6b361a3086259bf8e9c57854a7dc9d5d732144d5a2674b5a56b",
|
||||
"accepted_source_sha256": "ad29228db8f687e7a5b45f189c5bba50cada24265f54e573f49eb9e41fece391"
|
||||
},
|
||||
"app/Services/ReceiptDocuments.php": {
|
||||
"status": "source_unchanged",
|
||||
"source_sha256": "2f529ccc0c790d5e3c5ccedea974d80bb10eb1c4eeff8e729311649a18230ce1",
|
||||
"accepted_source_sha256": "2f529ccc0c790d5e3c5ccedea974d80bb10eb1c4eeff8e729311649a18230ce1"
|
||||
}
|
||||
}
|
||||
},
|
||||
"obligations": {
|
||||
"source_equivalent": false,
|
||||
"components": {
|
||||
"app/Services/InvoiceWorkflow.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "d9e0aff66f94e8928b19b9cc213b6a274aa307e08494b98643d112ad61a81e85",
|
||||
"accepted_source_sha256": "f1e8530315e33d3c8eb23752699b3bbcba0af5248af478e861f3b3e75a462c11"
|
||||
},
|
||||
"app/Services/SupplierPayables.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "35d4029616e987438f7feedcd98e70fb155f9298e144dac00be5959b92549a4c",
|
||||
"accepted_source_sha256": "1f6afc26040f3a4dd583c3489292351358d213ff743c96f9fb2fd007f770ae0d"
|
||||
}
|
||||
}
|
||||
},
|
||||
"warehouse": {
|
||||
"source_equivalent": false,
|
||||
"components": {
|
||||
"app/Services/StockWorkflow.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "da41a8bc70da8ff5786dc9311f3c1368818d4a89ba8f5e1a1e52fa6e930b5b6b",
|
||||
"accepted_source_sha256": "18ddaa075432b84c0b0ee5241ff56ab9de9aa8e8db4e6132693bc7fd904b3a58"
|
||||
},
|
||||
"app/Services/WarehouseRequests.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "4f33f7cbd508ad895de69a32064469efe954b78bbf083491fcff0f59a569df74",
|
||||
"accepted_source_sha256": "729265408efa13d942f86f0c71370a50ac5286f1f00da3d34daa4eb627e476de"
|
||||
},
|
||||
"app/Services/WarehouseReservations.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "7079a19a40714c2a1ae64a8000d34e7dff50a01abc0e87d275dcad70e0ac4b38",
|
||||
"accepted_source_sha256": "3120eaf6d9c8cedf3c991edcb41133f5107ca62736cea7e082ae4773755ffb54"
|
||||
},
|
||||
"app/Services/WarehouseFulfilment.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "97645402c119f67b4df12a509ef9aefce5510cc1323f8ee02e4cf1b06e2ca709",
|
||||
"accepted_source_sha256": "52130ff23382d10e7244b7b4211734772eb4d66518bb9002fc35dfb99f183c02"
|
||||
}
|
||||
}
|
||||
},
|
||||
"replenishment": {
|
||||
"source_equivalent": false,
|
||||
"components": {
|
||||
"app/Services/SupplyPlanning.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "d52dba0bc2f01119ef28c79dfaf416f77987d8b7c8ad30c6d1f1e2da193ec33c",
|
||||
"accepted_source_sha256": "3086dbc6d8d87904255035c6379b2f7d3ed13f2ba762fa3beaaa7a7ab6ee4c28"
|
||||
},
|
||||
"app/Services/SupplySuggestions.php": {
|
||||
"status": "source_unchanged",
|
||||
"source_sha256": "d6841c3bbe87cb43e3c134cedf4f18c60ab3b0ab6c3f4629e85ff90aa74eeecf",
|
||||
"accepted_source_sha256": "d6841c3bbe87cb43e3c134cedf4f18c60ab3b0ab6c3f4629e85ff90aa74eeecf"
|
||||
},
|
||||
"app/Services/AutomaticPurchases.php": {
|
||||
"status": "source_changed",
|
||||
"source_sha256": "dbb973d7620f8a99bdc4752d975d58c5a684ffe5404b974884c812bff5d47149",
|
||||
"accepted_source_sha256": "24dcdda538bee7e46356f26f93411e4f91e64e13db4bb6b09f88356c8bb18c1c"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"authorisation": "Express approval on 2026-11-30 for zero cost receipts, independent review and isolated tests; no operational installation or publication.",
|
||||
"increment_complete": true,
|
||||
"integration_operationally_accepted": false,
|
||||
"supersedes": "sgf-merchandise-valuation-recovery-20261130.json",
|
||||
"candidate": {
|
||||
"id": "MERCHANDISE-V2-6e1b9710e9094c5a",
|
||||
"manifest_sha256": "6e1b9710e9094c5ab91987a1465e6f2e3e3067af4856e93b0053280bfb380760",
|
||||
"archive_sha256": "6c2bc3501849515ab49db7c5200be7a265f789b3defd1f81bab8a5686fc61037",
|
||||
"review_manifest_sha256": "bd787c45e6f91bf08b2b38a958645c8bfcb5301652452800d10bf6cd6dbd76b8",
|
||||
"review_archive_sha256": "e4dd24f3450dad3a78ce041c0bf32b004ad52165d822c493c9899b0e7b178a85",
|
||||
"compatibility_manifest_sha256": "ea7bb21a3e3780d84b6f27a4275998b50f8a24f55724cdccffb4bcd39bda972f",
|
||||
"baseline_git_commit": "fe02d1d5d03c5b02a7aa6602dcfd55c88fb69d96",
|
||||
"files": 168,
|
||||
"host_overlays": 99,
|
||||
"schema_sources_requiring_separate_receipt": 27,
|
||||
"code_recovery_checks": 202,
|
||||
"code_recovery_proof": "storage/framework/testing/merchandise-v2-957d5d2ef984/recovery-result.json",
|
||||
"installed": false
|
||||
},
|
||||
"scope": {
|
||||
"book": "b4093c6f6707",
|
||||
"tenant_company_unit": [1, 2, 2],
|
||||
"native_writer": "PayableJournal",
|
||||
"zero_receipt_table": "gl_stock_zero_costs",
|
||||
"cost_facts_view": "gl_stock_cost_facts",
|
||||
"zero_receipt_creates_journal": false,
|
||||
"zero_receipt_creates_stock_movement": false,
|
||||
"positive_explicit_input_cost_requirement_preserved": true,
|
||||
"rounding": "half_up_final_balance",
|
||||
"independent_review": true,
|
||||
"separate_journal_and_zero_receipt_identities": true
|
||||
},
|
||||
"native_proofs": {
|
||||
"fifo_zero_below_half_final_residual_concurrency_used_data_restore": {"run": "20261130-203737-d83fb894", "checks": 153},
|
||||
"weighted_average_half_cent_zero_residual_concurrency_used_data_restore": {"run": "20261130-203751-65891c96", "checks": 155},
|
||||
"original_receipt_return_reconciliation": {"run": "20261130-203805-b7652c1e", "checks": 166},
|
||||
"positive_input": {"run": "20261130-203820-73ca9047", "checks": 157},
|
||||
"transit_reconciliation": {"run": "20261130-203835-21f7fea6", "checks": 163},
|
||||
"schema_data_recovery": {"run": "20261130-203849-194565f3", "checks": 17},
|
||||
"retained_service_finance": {"run": "20261130-203900-041ddf77", "checks": 26}
|
||||
},
|
||||
"previous_valid_proofs_reused": {"resale_policy_checks": 24, "suggestion_integration_checks": 43},
|
||||
"counts_overlap_do_not_sum": true,
|
||||
"focused_checks": {"stock_costing_tests": 26, "stock_costing_assertions": 83, "projection_tests": 11, "projection_assertions": 21, "simulated_ui_tests": 14, "php_lint_passed": true, "new_class_formatting_passed": true},
|
||||
"concurrency_scope": {
|
||||
"connections": 2,
|
||||
"actual_exclusion_function_and_constraints_copied": true,
|
||||
"cases": ["zero_zero", "zero_positive", "positive_zero"],
|
||||
"blocking_observed": true,
|
||||
"second_effect_refused": true,
|
||||
"one_temporary_sql_schema_created_and_removed_per_run": true,
|
||||
"financial_authorisation_and_arithmetic_tested_separately_in_native_writer": true,
|
||||
"two_complete_http_sessions_tested": false
|
||||
},
|
||||
"preservation": {
|
||||
"new_databases": 0,
|
||||
"new_demonstrations": 0,
|
||||
"new_accounts": 0,
|
||||
"persistent_grants": 0,
|
||||
"operational_installations_touched": false,
|
||||
"sgc_operational_data_touched": false,
|
||||
"connector_activated": false,
|
||||
"published": false,
|
||||
"temporary_opening_item_absent": true,
|
||||
"remaining_temporary_sql_schemas": 0,
|
||||
"new_receipt_tables_rolled_back": true,
|
||||
"original_material_perimeter_sha256": "2e18acc7c460bd3c1574b13b3bad768e0187941f103f59d41acc3186aee9fcff"
|
||||
},
|
||||
"limitations": [
|
||||
"The zero receipt scope is qualified company stock issues calculated from the approved policy, not arbitrary zero-valued incoming costs.",
|
||||
"The SQL owner connection remains an isolated rehearsal limitation, not the client application privilege model.",
|
||||
"Schema/data restore is transactional in the existing isolated book; server loss and ACL/owner restoration are not qualified.",
|
||||
"Visual review, load testing, real company parametrisation and operational installation remain separate."
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
# Saídas cujo custo arredondado é zero — decisão específica
|
||||
|
||||
## Regra existente e lacuna
|
||||
|
||||
A regra aprovada continua a ser arredondamento ao cêntimo, metade para cima, com acerto na última saída. Uma fracção inferior a meio cêntimo pode, por isso, produzir custo financeiro de 0,00 MZN. O cálculo comum já representa esse resultado; `PayableJournal::capture()` e `CompanyStock::capture()` exigem custo positivo. Não se deve inventar um cêntimo, tratar o custo como desconhecido ou enfraquecer a regra geral do diário.
|
||||
|
||||
## Proposta concreta
|
||||
|
||||
Acrescentar um recibo de valorização zero exclusivamente para saídas cujo cálculo comum, com a política empresarial explicitamente aprovada, produza exactamente zero. Recepção ou ajuste de entrada continua a exigir custo positivo explícito; não se aceita um zero livre introduzido pelo utilizador.
|
||||
|
||||
Reutilizar as propostas, revisão por outra identidade, permissões e comando de aplicação do mesmo núcleo contabilístico. A aplicação confirma novamente contexto, origem física, política, versão e dependências. Regista um recibo imutável, sem criar linhas ou lançamento de valor zero no diário. Não cria outro movimento de stock, documento comercial, dívida ou pagamento.
|
||||
|
||||
Preparar uma tabela aditiva `gl_stock_zero_costs`, com contexto, movimento original, proposta/revisão, versão, autor/data, chave de confirmação e evidência congelada. Impor unicidade por movimento e exclusão mútua com um custo positivo já lançado, inclusive em concorrência. O escritor é o `PayableJournal` existente; não acrescentar outro serviço com autoridade financeira.
|
||||
|
||||
Prefixos, histórico e relatórios distinguem custo zero aprovado de custo em falta, usando a referência do recibo sem inventar um identificador de lançamento. Os custos anteriores permanecem intactos; a última saída conserva o acerto do saldo previsto na regra aprovada.
|
||||
|
||||
## Verificação e recuperação propostas
|
||||
|
||||
Ensaiar FIFO/CMP, fracções inferiores e iguais a meio cêntimo, última saída, repetição, concorrência, revisão independente, revogação, isolamento e falha tardia. Usar apenas o livro de regressão existente e dados revertidos. Recuperar código e schema/dados separadamente: remoção apenas de estrutura vazia; recibos utilizados são preservados. Nenhuma nova conta, concessão, demonstração, publicação ou alteração operacional.
|
||||
|
||||
Estado: **autorizada expressamente em 30/11/2026** — «Autorizo implementar os recibos de custo zero, com revisão independente e testes isolados». Implementação e verificação concluídas na candidata privada, sem instalação, publicação, novas contas ou concessões. Não solicitar novamente esta autorização para o mesmo âmbito. [Entrega, matriz e provas actuais](integracao-total-sgf-20261130.md).
|
||||
@@ -1,6 +1,6 @@
|
||||
# Proposta concreta — extensão do contrato de entrega SGF
|
||||
|
||||
Estado: proposta para decisão; não implementa nem autoriza instalação, publicação ou activação.
|
||||
Estado: implementação e testes autorizados pelo proprietário em 30/11/2026, com a resposta «Autorizar implementação e testes da extensão v2». Instalação, publicação, migrações e concessões nas instalações operacionais continuam excluídas. As secções seguintes conservam a proposta aprovada.
|
||||
|
||||
## Motivo
|
||||
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
# Extensão do contrato de execução de Compras no SGF
|
||||
|
||||
Estado: implementação e testes isolados expressamente autorizados pelo proprietário: «Autorizo implementar e testar em isolamento a extensão do contrato proposta». Em desenvolvimento; não instalada ou activada. Concessões persistentes, instalações operacionais e publicação continuam excluídas. As secções seguintes preservam o âmbito autorizado; não voltar a pedir esta autorização.
|
||||
|
||||
## Impedimento confirmado
|
||||
|
||||
O pacote nativo conferido tem manifesto `7709a3d447d54c17d2fb4be4f9a0f70455c4a38c34e4bb8c643f6b5169071556`. Não inclui ConflictReleases nem OrderCancellationWorkflow. A candidata de entrega corrente continua a ser `3d2e9743ecf621d3`, não instalada; esta proposta não a altera.
|
||||
|
||||
ConflictReleases::ready() admite o SGC autónomo qualificado ou, com opção explícita, o ambiente testing nas bases de teste restritas. O SGF utiliza budget-testing e ReceiptRuntime; não satisfaz esse contrato. Alterar o nome do ambiente para contornar a verificação, duplicar o serviço ou ignorar ready() é inadequado.
|
||||
|
||||
O cancelamento actual verifica a versão do componente CommitmentReversal, a localização da classe carregada e os ciclos orçamentais. O componente legado não deve ser usado quando existem ciclos posteriores. Copiar apenas o workflow sem essas verificações arriscaria libertar um compromisso incorrecto.
|
||||
|
||||
São limites do contrato de execução e da autoridade sobre efeitos orçamentais, distintos do instalador de ficheiros v2 já autorizado. A política do repositório exige autorização explícita para alterar contratos de integração ou arquitectura.
|
||||
|
||||
## Alteração concreta proposta
|
||||
|
||||
1. Estender o mecanismo existente de composição, sem outro motor, loader independente ou aplicação. O ReceiptRuntime continua a verificar a instalação física, a identidade actual, o contexto, as correspondências, o manifesto e uma só versão de classes por processo. A composição anterior permanece suportada sem ampliação implícita de capacidades.
|
||||
2. Introduzir uma declaração versionada de capacidades da composição para os serviços partilhados. Deve identificar: versão do contrato, composição, empresa/unidade, hash do pacote de workflows, hashes das dependências financeiras, hash da compatibilidade de schema, capacidades habilitadas e correspondências explícitas de identidade/direitos. A declaração é validada pelo runtime existente antes da execução; não basta uma opção true nem um nome de ambiente.
|
||||
3. Permitir que os serviços originais reconheçam esse contexto de composição validado. As verificações actuais do SGC autónomo e dos testes permanecem. A capacidade recebida só é válida dentro da execução/contexto que a autorizou; não é uma autorização global ou reutilizável depois de mudar de contexto.
|
||||
4. Distribuir no pacote local as versões qualificadas dos serviços, modelos e dependências de Compras necessárias. Os hashes originais e da transformação de namespace ficam no manifesto. Não renomear strings de regras, SQL ou valores de negócio por substituição textual. A instalação SGF não depende da pasta, serviço ou base de uma instalação SGC.
|
||||
5. Para levantamento de impedimentos, reutilizar ConflictReleases, ConflictRelease, ConflictGuard e a migração existente. Exigir a função nativa conflict_release_authorise e o direito específico no SGF, relidos antes de cada execução. Não inferir competência de Direcção a partir de administrador ou financeiro. Conservar fundamento, declaração, raiz, autor, data e histórico; outros conflitos continuam a bloquear.
|
||||
6. Para cancelamento, reutilizar OrderCancellationWorkflow, as políticas/revisões e o componente de reversão por ciclos 0.2.0-rc.1. Conservar os bloqueios por recepções/documentos, a exclusão do autor e demais intervenientes, as regras de peças e a transacção que liga decisão/reversão/auditoria. Não alterar o montante nem criar outro livro. O manifesto exacto do componente e a classe carregada devem coincidir antes de permitir a operação.
|
||||
7. As capacidades novas ficam desligadas por defeito. A preparação do pacote não activa flags, substitui os vínculos privados existentes, concede direitos ou aplica migrações. Os ensaios são explícitos, sintéticos e revertidos no ambiente de regressão existente; não criam outra aplicação ou demonstração.
|
||||
|
||||
Os valores e hashes conhecidos estão no [registo da proposta](proofs/sgf-composition-extension-proposal-20261130.json). Os hashes ali fixados identificam a origem desta análise; qualquer diferença posterior exige nova conferência antes de preparar a candidata. A lista não pretende certificar toda a cadeia de dependências.
|
||||
|
||||
## Direitos e acessos
|
||||
|
||||
Nomes propostos para o catálogo, sempre ao nível da unidade:
|
||||
|
||||
- purchasing_conflicts.view — consultar declarações e histórico autorizado;
|
||||
- purchasing_conflicts.authorise — autorizar levantamento, também exigindo a competência nativa própria;
|
||||
- purchasing_order_cancellations.view — consultar cancelamentos;
|
||||
- purchasing_order_cancellations.prepare — propor cancelamento;
|
||||
- purchasing_order_cancellations.approve — decidir pelo circuito independente existente;
|
||||
- purchasing_order_cancellations.revise — preparar a revisão permitida após cancelamento.
|
||||
|
||||
Não há atribuições a contas nesta proposta. Estes direitos não substituem os direitos nativos nem concedem competência por estarem no catálogo. Não se reutiliza o direito de emitir encomendas para permitir cancelá-las. A implementação preparará as restrições SQL dos nomes/âmbitos; nenhum GRANT/REVOKE ou alteração efectiva de acessos é solicitado.
|
||||
|
||||
Centros, dotações, políticas empresariais e contas reais não são preenchidos. Utilizam-se as ligações e dados sintéticos da regressão autorizada, preservando a limitação conhecida da ligação proprietária; não se adopta esse privilégio para clientes.
|
||||
|
||||
## Verificação e recuperação a executar após autorização
|
||||
|
||||
- Pacote antigo continua válido; pacote novo divergente, capacidade ausente, schema incompatível ou classe de outra versão são recusados.
|
||||
- Identidade, empresa, unidade, módulo/opção, competência específica, autoria, revogação e acesso directo indevido são testados no servidor.
|
||||
- Levantamento preserva a declaração/histórico, repetições não duplicam a autorização e outros conflitos mantêm o bloqueio.
|
||||
- Cancelamento exige política válida e decisão independente, respeita recepções/documentos/ciclos, e não duplica a libertação orçamental em repetição, concorrência ou falha parcial.
|
||||
- Migrações, dados utilizados e recuperação são qualificados em transacções isoladas; versões anteriores continuam reproduzíveis. Reversão de código não elimina schema com histórico utilizado.
|
||||
- Preparar nova candidata pelo instalador v2 existente e actualizar matriz/hashes/provas. Não repetir provas financeiras sem alterações relevantes.
|
||||
|
||||
## Decisão solicitada
|
||||
|
||||
Autorizar exclusivamente a implementação e os testes isolados desta extensão do contrato de execução, incluindo o catálogo dos seis nomes propostos e as estruturas necessárias nos ensaios revertidos. Não autoriza instalar ou activar a candidata, conceder acessos persistentes, alterar instalações operacionais, publicar, fundir bases ou incluir contratações para terceiros no SGF.
|
||||
|
||||
## Decisão adicional: declarações globais por fornecedor
|
||||
|
||||
Esta secção foi identificada durante a implementação e autorizada separadamente pelo proprietário: «Autorizar âmbito de empresa, sem concessões persistentes». A implementação e os testes deste recorte estão autorizados; nenhuma atribuição a contas ou instalação operacional está autorizada por esta decisão.
|
||||
|
||||
ConflictDeclaration permite supplier_id preenchido e requisition_id NULL. Essas declarações aplicam-se à empresa nativa e não têm origem de unidade. A competência nativa conflict_release_authorise permite à Direcção levantá-las, preservando a raiz e a cadeia de correcções. Atribuí-las automaticamente à unidade activa confundiria uma declaração global com um processo dessa unidade.
|
||||
|
||||
Proposta concreta para implementar/testar, sem concessões persistentes:
|
||||
|
||||
- Admitir também o âmbito de **empresa** para purchasing_conflicts.view e purchasing_conflicts.authorise; os mesmos nomes continuam disponíveis no âmbito de unidade para declarações ligadas a processos autorizados dessa unidade.
|
||||
- Uma concessão de unidade nunca permite consultar ou levantar declarações globais por fornecedor. A presença de NULL não é convertida em atribuição de unidade nem alterada nos dados.
|
||||
- Para os registos globais, exigir a concessão de empresa, empresa nativa explicitamente associada à empresa SGF no manifesto, identidade actual, módulo Compras habilitado e a competência nativa própria da Direcção para autorizar. Associações ambíguas entre empresas bloqueiam a operação.
|
||||
- Manter os direitos base de criação de empresa/unidade, sem atribuir automaticamente estes novos âmbitos a administradores ou outras contas. O catálogo permite delegação apenas por quem possui o mesmo direito no mesmo âmbito.
|
||||
- Preservar o alcance global da declaração: o levantamento de um impedimento global não elimina outros conflitos e fica registado como decisão de empresa. Os processos continuam sujeitos ao respectivo contexto e restantes permissões.
|
||||
- Testar separadamente empresa/unidade, autorias, revogação, leitura e recusa de decisão pelo perfil de consulta, sem alterar instalações operacionais ou perfis persistentes.
|
||||
|
||||
Alternativa: manter exclusivamente os direitos de unidade já autorizados. Nesse caso, as declarações globais continuam bloqueadas e ficam explicitamente fora deste incremento SGF; não se declara esse ramo da matriz concluído.
|
||||
@@ -1,6 +1,31 @@
|
||||
# Transferência de Compras e actualizações do SGF
|
||||
|
||||
## Integração integral incluindo mercadorias — 30/11/2026
|
||||
## Estado consolidado da integração — 30/11/2026
|
||||
|
||||
A candidata corrente é **MERCHANDISE-V2-3d2e9743ecf621d3**, não instalada: acrescenta ao preparador existente o catálogo administrativo dos33direitos nativos de Compras/Stock, sem concessões automáticas ou persistentes.54verificações revertidas em PostgreSQL, compilação privada e202verificações de recuperação de código aprovadas. Manifesto `3d2e9743ecf621d3e0113769a5339df7b0a704822d09243ef29a79015034770a`; ZIP `46cfe55141e180565cf7617ec487ca30eacf86494601997bdb466039580a67ac`. [Prova e vínculos exactos](proofs/sgf-purchasing-access-delivery-20261130.json). A6e abaixo é a entrega anterior de valorização, preservada; não é a candidata corrente deste seguimento.
|
||||
|
||||
A [matriz actual](integracao-total-sgf-20261130.md#matriz-actual-consolidada--conferência-das-versões) distingue os recortes aceites das versões posteriores ainda por integrar. A conferência de 25 componentes do pacote nativo encontrou21 fontes divergentes, duas ausentes e duas inalteradas; não é uma nova prova funcional. Levantamento de impedimentos, cancelamento de ordens, diferenças posteriores dos workflows e portabilidade permanecem pendentes. A candidata `6e1b9710e9094c5a` continua inalterada e não instalada. Estados antigos abaixo não substituem esta matriz. Sem aplicação paralela, publicação, alteração operacional ou dependência nova do SGC em execução.
|
||||
|
||||
## Entrega anterior de mercadorias e custo zero — 30/11/2026
|
||||
|
||||
**Candidata desse incremento:** **MERCHANDISE-V2-6e1b9710e9094c5a**, preparada e não instalada, inclui os recibos de custo zero expressamente autorizados, revisão independente, exclusão de custo duplicado e acerto da última saída. Manifesto `6e1b9710e9094c5ab91987a1465e6f2e3e3067af4856e93b0053280bfb380760`; ZIP `6c2bc3501849515ab49db7c5200be7a265f789b3defd1f81bab8a5686fc61037`. 202 verificações de recuperação de código; provas de schema/dados separadas. [Matriz e limitações actuais](integracao-total-sgf-20261130.md). A decisão sobre recibos de zero está cumprida; as referências pendentes seguintes são históricas. Instalações operacionais e SGC preservados, sem publicação.
|
||||
|
||||
**Estado anterior:** candidata privada **MERCHANDISE-V2-815d88bc0f2f7105**, não instalada, com valorização por recepção original, reconciliação independente e recuperação de dados utilizados. 198 verificações de aplicação/repetição/recuperação de código; schema/dados têm provas separadas. Manifesto `815d88bc0f2f7105b0e4783c0b98fff21c0f4fde36f10b717b93da7f10a3c349`; ZIP `d918a6e9908edad20eec86f5f614b1d6e3339d94f91e93a6367f091b7bf84913`. [Matriz, provas e limites actuais](integracao-total-sgf-20261130.md). A tabela seguinte regista o estado anterior deste seguimento; não substitui a matriz actual. Custo financeiro arredondado a zero continua bloqueado, com decisão específica pendente. SGF real em 0.1.1; nenhuma activação/publicação.
|
||||
|
||||
Seguimento de valorização: abertura autorizada de 4 UN/75 MZN ensaiada e revertida; custos explícitos de entradas e reconciliação independente de camadas implementados no mesmo diário, com ecrã, história e recibo. Prova FIFO/reconciliação: 160 verificações; recuperação transaccional de schema/dados: 15. [Provas e limites actuais](integracao-total-sgf-20261130.md). Devoluções de preços mistos ainda não têm percurso financeiro completo. A candidata indicada abaixo permanece anterior a este seguimento.
|
||||
|
||||
| Capacidade deste seguimento | Estado de desenvolvimento | Limite |
|
||||
| --- | --- | --- |
|
||||
| Abertura sem aquisição identificável | Ensaio autorizado concluído e revertido | 4 UN/75 MZN, artigo temporário removido |
|
||||
| Diferença positiva com custo explícito | Implementada e ensaiada | Outra identidade aprova; quarentena original mantida |
|
||||
| Reconciliação de camadas | Implementada e ensaiada | Conserva quantidade/valor; recusa cortes após transferências valorizadas |
|
||||
| Devolução ao custo da recepção original | Parcial | Cálculo PHP/SQL conferido; ligação financeira completa de preços mistos pendente |
|
||||
| Recuperação de schema e dados | Ensaiada em isolamento | Transaccional na mesma base; ACL/proprietários e perda de servidor excluídos |
|
||||
| Entrega destas alterações | Pendente | Sem nova candidata instalada, activação ou publicação |
|
||||
|
||||
Actualização: sugestões de revenda → conferência independente → requisição → submissão/reserva → aprovação integradas em desenvolvimento, com 43 verificações em rollback e 16 testes de interface simulada. Candidata de código actual **MERCHANDISE-V2-9c182cdaabd8f13f**, 155 ficheiros/86 sobreposições, 176 verificações de recuperação de ficheiros; manifesto `9c182cdaabd8f13f17ad94fe891ff41a81ca7e1242135aa53f4af6b9cc1261c0`, ZIP SHA-256 `f428b39507869271cbe220437313ea9ab83f116426d85e282556bcc3b1fd7f47`. Não instalada; 0.1.1 preservada. [Matriz actual e limites](integracao-total-sgf-20261130.md). Os parágrafos seguintes registam entregas anteriores; não são autorização de instalação nem prova de recuperação de dados/schema.
|
||||
|
||||
Continuação mais recente: o proprietário autorizou a extensão v2 do instalador existente. Preparada **MERCHANDISE-V2-46133eee4f4f5ddb**, 147 ficheiros/78 sobreposições, com compilação privada e 160 verificações de aplicação/recuperação em cópia de código. O próprio instalador e o arranque/cálculo incluídos no pacote foram conferidos. A base declarada é a revisão Git `fe02d1d5d03c5b02a7aa6602dcfd55c88fb69d96` e o manifesto de compilação de desenvolvimento explicitamente identificado; **não certifica a base da instalação operacional**. Recibos de compatibilidade de schema/dados reais continuam obrigatórios e não foram fabricados: o ensaio de ficheiros usou recibo sintético apenas na cópia privada. SGF preservado em 0.1.1, sem instalação, activação ou publicação. Políticas de revenda: 24 verificações PostgreSQL e três de interface aprovadas. [Estado detalhado](integracao-total-sgf-20261130.md). A integração funcional integral continua por concluir.
|
||||
|
||||
O proprietário autorizou a integração total, preservando SGC autónomo, sem novas demonstrações ou publicação, com valorização parametrizável por empresa. [Estado, pacote, matriz e limitações](integracao-total-sgf-20261130.md). Em desenvolvimento: facturação de mercadorias, recebível/recebimento/afectação/reversão, venda e custo no mesmo diário, entrega pelo stock original e política FIFO/CMP. Passaram **128 verificações por método** na regressão existente, com dados/schema/acessos temporários repostos. Pacote privado de revisão **510063ae33b53649**, não instalável nem activado. Custos com transferências/devoluções/ajustes e conferência transversal de compras para revenda continuam pendentes; não declarar integração total concluída. Três novos direitos de leitura na 8085 permanecem por autorizar/conceder. A candidata antiga 8d1af50791bd4878 não contém este incremento. As secções seguintes são históricas.
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace Tempo\Purchasing\Delivery;
|
||||
|
||||
require_once __DIR__.'/NativeAccessCatalogue.php';
|
||||
|
||||
/** Builds a review overlay; never writes to the source host. */
|
||||
final class AccessOverlay
|
||||
{
|
||||
@@ -24,6 +26,11 @@ final class AccessOverlay
|
||||
'purchasing_budget.reinforcement.propose', 'purchasing_budget.reinforcement.review',
|
||||
];
|
||||
|
||||
public static function labels(): array
|
||||
{
|
||||
return self::LABELS + NativeAccessCatalogue::UNIT;
|
||||
}
|
||||
|
||||
public static function prepare(string $host): array
|
||||
{
|
||||
$paths = ['app/Modules/Identity/Services/Permissions.php', 'app/Modules/Identity/Services/IdentityWorkflow.php'];
|
||||
@@ -32,8 +39,10 @@ final class AccessOverlay
|
||||
$source = file_get_contents($host.'/'.$path);
|
||||
$before = hash('sha256', $source);
|
||||
if (str_ends_with($path, '/Permissions.php')) {
|
||||
$source = self::replace($source, "public const UNIT = ['unit.view', 'unit.edit'];", 'public const UNIT = '.var_export(['unit.view', 'unit.edit', ...self::RIGHTS], true).';');
|
||||
$source = self::replace($source, "public const UNIT = ['unit.view', 'unit.edit'];", 'public const UNIT = '.var_export(array_values(array_unique(['unit.view', 'unit.edit', ...self::RIGHTS, ...array_keys(NativeAccessCatalogue::UNIT)])), true).';');
|
||||
$source = self::replace($source, 'public const COMPANY = ', 'public static function companyCatalogue(): array { return [...self::COMPANY, ...'.var_export(NativeAccessCatalogue::COMPANY, true).']; }'."\n\n public const COMPANY = ");
|
||||
} else {
|
||||
$source = str_replace('Permissions::COMPANY', 'Permissions::companyCatalogue()', $source);
|
||||
// Expanding a catalogue must never expand creation-time grants.
|
||||
$source = self::replace($source, 'foreach (Permissions::UNIT as $permission)', "foreach (['unit.view', 'unit.edit'] as \$permission)");
|
||||
$source = self::replace($source,
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Tempo\Purchasing\Delivery;
|
||||
|
||||
/** Names already consumed by the adapters. Listing a right never grants it. */
|
||||
final class NativeAccessCatalogue
|
||||
{
|
||||
public const COMPANY = ['purchasing_conflicts.view', 'purchasing_conflicts.authorise'];
|
||||
public const UNIT = [
|
||||
'purchasing_conflicts.view' => 'Consultar impedimentos de Compras',
|
||||
'purchasing_conflicts.authorise' => 'Autorizar levantamento de impedimentos',
|
||||
'purchasing_order_cancellations.view' => 'Consultar cancelamentos de encomendas',
|
||||
'purchasing_order_cancellations.prepare' => 'Propor cancelamento de encomenda',
|
||||
'purchasing_order_cancellations.approve' => 'Decidir cancelamento de encomenda',
|
||||
'purchasing_order_cancellations.revise' => 'Rever requisição após cancelamento',
|
||||
'purchasing_requests.view' => 'Consultar requisições de Compras',
|
||||
'purchasing_requests.prepare' => 'Preparar requisições de Compras',
|
||||
'purchasing_requests.submit' => 'Submeter requisições de Compras',
|
||||
'purchasing_requests.approve' => 'Decidir requisições de Compras',
|
||||
'purchasing_sourcing.view' => 'Consultar consultas e adjudicações',
|
||||
'purchasing_sourcing.prepare' => 'Preparar consultas e cotações',
|
||||
'purchasing_sourcing.evaluate' => 'Avaliar cotações',
|
||||
'purchasing_sourcing.select' => 'Propor adjudicação',
|
||||
'purchasing_sourcing.approve' => 'Confirmar adjudicação',
|
||||
'purchasing_orders.view' => 'Consultar encomendas',
|
||||
'purchasing_orders.issue' => 'Emitir encomendas',
|
||||
'purchasing_receipts.view' => 'Consultar recepções',
|
||||
'purchasing_receipts.confirm' => 'Confirmar recepções',
|
||||
'purchasing_suppliers.view' => 'Consultar fornecedores de Compras',
|
||||
'purchasing_suppliers.prepare' => 'Preparar fornecedores de Compras',
|
||||
'purchasing_suppliers.review' => 'Rever fornecedores de Compras',
|
||||
'purchasing_invoices.view' => 'Consultar documentos de fornecedor',
|
||||
'purchasing_invoices.prepare' => 'Preparar documentos de fornecedor',
|
||||
'purchasing_invoices.validate' => 'Validar documentos de fornecedor',
|
||||
'purchasing_obligations.view' => 'Consultar obrigações de Compras',
|
||||
'stock.view' => 'Consultar stock',
|
||||
'stock.operations.prepare' => 'Preparar operações de stock',
|
||||
'stock.operations.confirm' => 'Confirmar operações de stock',
|
||||
'stock.transfers.receive' => 'Receber transferências de stock',
|
||||
'stock.lots.review' => 'Rever lotes de stock',
|
||||
'stock.items.prepare' => 'Preparar artigos de stock',
|
||||
'stock.items.review' => 'Rever artigos de stock',
|
||||
'stock.planning.view' => 'Consultar políticas e sugestões de reposição',
|
||||
'stock.planning.prepare' => 'Preparar políticas de reposição',
|
||||
'stock.planning.review' => 'Rever políticas de reposição',
|
||||
'stock.disposition.view' => 'Consultar devoluções a fornecedor',
|
||||
'stock.disposition.prepare' => 'Preparar devoluções a fornecedor',
|
||||
'stock.disposition.review' => 'Rever devoluções a fornecedor',
|
||||
];
|
||||
}
|
||||
@@ -7,4 +7,14 @@ foreach (['RequisitionPort', 'RequisitionFailure', 'InternalRequisitions'] as $c
|
||||
foreach (['Schema', 'Port', 'Controller'] as $class) {
|
||||
require_once __DIR__.'/'.$class.'.php';
|
||||
}
|
||||
config(['purchasing-internal.candidate_enabled' => true]);
|
||||
(static function (): void {
|
||||
$file = dirname(__DIR__, 3).'/manifest.json';
|
||||
$format = is_file($file) ? (json_decode(file_get_contents($file), true, 32, JSON_THROW_ON_ERROR)['format'] ?? null) : 'tempo.operational-review.v1';
|
||||
if (! in_array($format, ['tempo.operational-review.v1', 'tempo.operational-review.v2'], true)) {
|
||||
throw new RuntimeException('Composição de requisições desconhecida.');
|
||||
}
|
||||
// Preserve the historical v1 bootstrap. A v2 code delivery never enables a capability.
|
||||
if ($format === 'tempo.operational-review.v1') {
|
||||
config(['purchasing-internal.candidate_enabled' => true]);
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -5,17 +5,24 @@ namespace Tempo\Purchasing\Delivery;
|
||||
/** Native administration consumes the server catalogue; no second authority list. */
|
||||
final class AdminUiOverlay
|
||||
{
|
||||
public static function prepare(string $host, array $files): array
|
||||
public static function catalogue(array $files): array
|
||||
{
|
||||
$workflow = 'app/Modules/Identity/Services/IdentityWorkflow.php';
|
||||
$old = "'catalogue' => ['company' => Permissions::COMPANY, 'unit' => Permissions::UNIT]];";
|
||||
$old = "'catalogue' => ['company' => Permissions::companyCatalogue(), 'unit' => Permissions::UNIT]];";
|
||||
$contents = $files[$workflow]['contents'];
|
||||
if (substr_count($contents, $old) !== 1) {
|
||||
throw new \RuntimeException('Catálogo administrativo do host divergiu.');
|
||||
}
|
||||
$contents = str_replace($old, "'catalogue' => ['company' => Permissions::COMPANY, 'unit' => Permissions::UNIT], 'catalogue_labels' => \\Tempo\\Purchasing\\Delivery\\AccessOverlay::LABELS];", $contents);
|
||||
$contents = str_replace($old, "'catalogue' => ['company' => Permissions::companyCatalogue(), 'unit' => Permissions::UNIT], 'catalogue_labels' => \\Tempo\\Purchasing\\Delivery\\AccessOverlay::labels()];", $contents);
|
||||
$files[$workflow]['contents'] = $contents;
|
||||
$files[$workflow]['after_sha256'] = hash('sha256', $contents);
|
||||
|
||||
return $files;
|
||||
}
|
||||
|
||||
public static function prepare(string $host, array $files): array
|
||||
{
|
||||
$files = self::catalogue($files);
|
||||
$node = getenv('SGF_NODE_BINARY') ?: 'node';
|
||||
$process = proc_open([$node, dirname(__DIR__, 3).'/scripts/sgf-admin-ui-build.mjs', $host], [0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']], $pipes);
|
||||
if (! is_resource($process)) {
|
||||
|
||||
@@ -72,6 +72,85 @@ final class CodeDeployment
|
||||
}
|
||||
}
|
||||
|
||||
private function fileHash(string $relative): ?string
|
||||
{
|
||||
$path = $this->path($relative);
|
||||
if (! file_exists($path)) {
|
||||
return null;
|
||||
}
|
||||
if (! is_file($path)) {
|
||||
throw new \RuntimeException('O destino não é um ficheiro regular.');
|
||||
}
|
||||
|
||||
return hash_file('sha256', $path);
|
||||
}
|
||||
|
||||
private static function v2Path(string $file, bool $overlay): bool
|
||||
{
|
||||
if (str_contains($file, '..') || preg_match('~(^|/)(\.|vendor/|node_modules/|storage/)~i', $file)) {
|
||||
return false;
|
||||
}
|
||||
$host = '~^(app/[A-Za-z0-9_/-]+\.php|config/[A-Za-z0-9_-]+\.php|routes/web\.php|database/(migrations/[A-Za-z0-9_]+\.php|sql/[A-Za-z0-9_-]+\.sql)|resources/views/[A-Za-z0-9_/-]+\.blade\.php|resources/js/[A-Za-z0-9_./-]+\.(jsx?|tsx?)|public/([A-Za-z0-9_-]+\.mjs|build/manifest\.json)|packages/[a-z0-9-]+/(bootstrap\.php|module\.json|README\.md|(src|ui)/[A-Za-z0-9_/-]+\.php))$~D';
|
||||
if (preg_match($host, $file)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return ! $overlay && (bool) preg_match('~^(bootstrap\.php|(integrations|scripts|packages)/[A-Za-z0-9_/-]+\.(php|json|jsx?|mjs|css|md))$~D', $file);
|
||||
}
|
||||
|
||||
private function v2Transition(array $manifest, ?array $old, ?array $previous, string $hash): ?string
|
||||
{
|
||||
$transition = $manifest['composition_transition'];
|
||||
if ($transition['from_manifest_sha256'] !== ($previous['manifest_sha256'] ?? null)) {
|
||||
throw new \RuntimeException('A transição não corresponde à entrega anterior.');
|
||||
}
|
||||
$oldFiles = $old['host_overlays'] ?? [];
|
||||
if (array_diff_key($oldFiles, $manifest['host_overlays']) || array_diff_key($old['support_files'] ?? [], $manifest['support_files'])) {
|
||||
throw new \RuntimeException('A transição não pode retirar ficheiros da composição anterior.');
|
||||
}
|
||||
$added = [];
|
||||
foreach (array_diff_key($manifest['host_overlays'], $oldFiles) as $file => $entry) {
|
||||
$added[$file] = $entry['before_sha256'];
|
||||
}
|
||||
$declared = $transition['added_files'];
|
||||
ksort($added);
|
||||
ksort($declared);
|
||||
if ($added !== $declared) {
|
||||
throw new \RuntimeException('Ampliação da composição não declarada exactamente.');
|
||||
}
|
||||
$schema = [];
|
||||
foreach ($manifest['support_files'] as $file => $after) {
|
||||
if ((str_starts_with($file, 'database/') || preg_match('~Schema\.php$~D', $file)
|
||||
|| in_array($file, ['integrations/sgf/access/AccessOverlay.php', 'integrations/sgf/operational/SqlPrivileges.php', 'integrations/sgf/operational/Installation.php', 'integrations/sgf/operational/budget-contract.json'], true))
|
||||
&& ($old['support_files'][$file] ?? null) !== $after) {
|
||||
$schema[$file] = ['before' => $old['support_files'][$file] ?? null, 'after' => $after];
|
||||
}
|
||||
}
|
||||
$declared = $transition['schema_files'];
|
||||
ksort($schema);
|
||||
ksort($declared);
|
||||
if ($schema !== $declared) {
|
||||
throw new \RuntimeException('Alterações de schema não declaradas exactamente.');
|
||||
}
|
||||
if (! $schema) {
|
||||
return null;
|
||||
}
|
||||
$receiptPath = $this->path('storage/app/private/module-deployments/schema-transition-'.$hash.'.json');
|
||||
$receipt = is_file($receiptPath) ? json_decode(file_get_contents($receiptPath), true, 32, JSON_THROW_ON_ERROR) : [];
|
||||
$changes = $receipt['changes'] ?? [];
|
||||
if (! is_array($changes)) {
|
||||
throw new \RuntimeException('Recibo de schema inválido.');
|
||||
}
|
||||
ksort($changes);
|
||||
if (($receipt['from_manifest_sha256'] ?? null) !== ($previous['manifest_sha256'] ?? null)
|
||||
|| ($receipt['to_manifest_sha256'] ?? null) !== $hash || ($receipt['host'] ?? null) !== $this->host
|
||||
|| ($receipt['schema_verified'] ?? false) !== true || $changes !== $schema) {
|
||||
throw new \RuntimeException('Transição de schema exige recibo exacto e verificado do destino.');
|
||||
}
|
||||
|
||||
return hash_file('sha256', $receiptPath);
|
||||
}
|
||||
|
||||
private function manifest(string $bundle, string $expected): array
|
||||
{
|
||||
if (trim($bundle) === '') {
|
||||
@@ -83,9 +162,30 @@ final class CodeDeployment
|
||||
throw new \RuntimeException('Manifesto divergente.');
|
||||
}
|
||||
$manifest = json_decode($text, true, 32, JSON_THROW_ON_ERROR);
|
||||
if (($manifest['format'] ?? '') !== 'tempo.operational-review.v1') {
|
||||
$v2 = ($manifest['format'] ?? '') === 'tempo.operational-review.v2';
|
||||
if (! $v2 && ($manifest['format'] ?? '') !== 'tempo.operational-review.v1') {
|
||||
throw new \RuntimeException('Formato de entrega desconhecido.');
|
||||
}
|
||||
if ($v2) {
|
||||
$keys = array_keys($manifest);
|
||||
sort($keys);
|
||||
$transition = $manifest['composition_transition'] ?? null;
|
||||
if ($keys !== ['composition_transition', 'format', 'host_overlays', 'support_files']
|
||||
|| ! is_array($transition) || ! is_array($manifest['support_files']) || ! is_array($manifest['host_overlays'])
|
||||
|| ! $manifest['support_files'] || ! $manifest['host_overlays'] || count($manifest['support_files']) > 10000) {
|
||||
throw new \RuntimeException('Contrato v2 inválido.');
|
||||
}
|
||||
$keys = array_keys($transition);
|
||||
sort($keys);
|
||||
if ($keys !== ['added_files', 'from_manifest_sha256', 'schema_files'] || ! is_array($transition['added_files']) || ! is_array($transition['schema_files'])
|
||||
|| ($transition['from_manifest_sha256'] !== null && (! is_string($transition['from_manifest_sha256']) || ! preg_match('/^[a-f0-9]{64}$/D', $transition['from_manifest_sha256'])))) {
|
||||
throw new \RuntimeException('Plano de composição v2 inválido.');
|
||||
}
|
||||
$names = array_map('strtolower', array_keys($manifest['support_files']));
|
||||
if (count($names) !== count(array_unique($names))) {
|
||||
throw new \RuntimeException('Caminhos equivalentes recusados.');
|
||||
}
|
||||
}
|
||||
$expectedFiles = array_fill_keys([...array_keys($manifest['support_files']), 'manifest.json'], true);
|
||||
foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($bundle, \FilesystemIterator::SKIP_DOTS)) as $entry) {
|
||||
$relative = str_replace('\\', '/', substr($entry->getPathname(), strlen($bundle) + 1));
|
||||
@@ -95,13 +195,19 @@ final class CodeDeployment
|
||||
}
|
||||
foreach ($manifest['support_files'] as $file => $hash) {
|
||||
$resolved = str_replace('\\', '/', realpath($bundle.'/'.$file) ?: '');
|
||||
if (str_contains($file, '..') || ! preg_match('~^(bootstrap\.php|(app|packages|integrations|scripts)/[A-Za-z0-9_./-]+|resources/js/(app|PurchasingHome)\.jsx|public/build/manifest\.json)$~D', $file)
|
||||
$allowed = $v2 ? self::v2Path($file, false) : (bool) preg_match('~^(bootstrap\.php|(app|packages|integrations|scripts)/[A-Za-z0-9_./-]+|resources/js/(app|PurchasingHome)\.jsx|public/build/manifest\.json)$~D', $file);
|
||||
if (str_contains($file, '..') || ! $allowed || ! is_string($hash) || ! preg_match('/^[a-f0-9]{64}$/D', $hash)
|
||||
|| ! str_starts_with(strtolower($resolved), strtolower(str_replace('\\', '/', $bundle)).'/') || is_link($bundle.'/'.$file) || ! is_file($bundle.'/'.$file) || ! hash_equals($hash, hash_file('sha256', $bundle.'/'.$file))) {
|
||||
throw new \RuntimeException('Integridade do bundle divergente.');
|
||||
}
|
||||
}
|
||||
foreach ($manifest['host_overlays'] as $file => $hashes) {
|
||||
if ((! str_starts_with($file, 'app/') && ! in_array($file, ['resources/js/app.jsx', 'resources/js/PurchasingHome.jsx', 'public/build/manifest.json'], true)) || ($manifest['support_files'][$file] ?? null) !== $hashes['after_sha256']) {
|
||||
if ($v2 && (! is_array($hashes) || count($hashes) !== 2 || ! array_key_exists('before_sha256', $hashes) || ! isset($hashes['after_sha256'])
|
||||
|| ($hashes['before_sha256'] !== null && (! is_string($hashes['before_sha256']) || ! preg_match('/^[a-f0-9]{64}$/D', $hashes['before_sha256']))))) {
|
||||
throw new \RuntimeException('Baseline v2 inválida.');
|
||||
}
|
||||
$allowed = $v2 ? self::v2Path($file, true) : (str_starts_with($file, 'app/') || in_array($file, ['resources/js/app.jsx', 'resources/js/PurchasingHome.jsx', 'public/build/manifest.json'], true));
|
||||
if (! $allowed || ($manifest['support_files'][$file] ?? null) !== $hashes['after_sha256']) {
|
||||
throw new \RuntimeException('Sobreposição inválida.');
|
||||
}
|
||||
$this->path($file);
|
||||
@@ -114,6 +220,7 @@ final class CodeDeployment
|
||||
{
|
||||
$this->cachePaths();
|
||||
[, $manifest] = $this->manifest($bundle, $manifestHash);
|
||||
$v2 = $manifest['format'] === 'tempo.operational-review.v2';
|
||||
$pointer = $this->path('packages/purchasing/current.json');
|
||||
$pointerHash = hash_file('sha256', $pointer);
|
||||
$previous = $this->current();
|
||||
@@ -128,14 +235,17 @@ final class CodeDeployment
|
||||
}
|
||||
$this->verifyApplied($journal, $previous['deployment_id']);
|
||||
[, $oldManifest] = $this->manifest($this->path('packages/internal-requisitions'), $previous['manifest_sha256']);
|
||||
if (array_keys($oldManifest['host_overlays']) !== array_keys($manifest['host_overlays'])) {
|
||||
if (! $v2 && $oldManifest['format'] === 'tempo.operational-review.v2') {
|
||||
throw new \RuntimeException('Uma composição v2 exige transição v2 explícita.');
|
||||
}
|
||||
if (! $v2 && array_keys($oldManifest['host_overlays']) !== array_keys($manifest['host_overlays'])) {
|
||||
throw new \RuntimeException('Mudança de composição do host exige plano próprio.');
|
||||
}
|
||||
foreach (['integrations/sgf/operational/BudgetSchema.php', 'integrations/sgf/operational/BudgetUiSchema.php', 'integrations/sgf/operational/SqlPrivileges.php', 'integrations/sgf/operational/Installation.php', 'integrations/sgf/operational/budget-contract.json', 'integrations/sgf/internal-requisitions/Schema.php', 'integrations/sgf/access/AccessOverlay.php'] as $file) {
|
||||
foreach ($v2 ? [] : ['integrations/sgf/operational/BudgetSchema.php', 'integrations/sgf/operational/BudgetUiSchema.php', 'integrations/sgf/operational/SqlPrivileges.php', 'integrations/sgf/operational/Installation.php', 'integrations/sgf/operational/budget-contract.json', 'integrations/sgf/internal-requisitions/Schema.php', 'integrations/sgf/access/AccessOverlay.php'] as $file) {
|
||||
if (($oldManifest['support_files'][$file] ?? null) !== ($manifest['support_files'][$file] ?? null)) {
|
||||
$receiptPath=$this->path('storage/app/private/module-deployments/schema-transition-'.$manifestHash.'.json');
|
||||
$receipt=is_file($receiptPath)?json_decode(file_get_contents($receiptPath),true,32,JSON_THROW_ON_ERROR):[];
|
||||
if(($receipt['from_manifest_sha256']??null)!==$previous['manifest_sha256']||($receipt['to_manifest_sha256']??null)!==$manifestHash||($receipt['host']??null)!==$this->host||($receipt['changes'][$file]['before']??null)!==($oldManifest['support_files'][$file]??null)||($receipt['changes'][$file]['after']??null)!==($manifest['support_files'][$file]??null)||($receipt['schema_verified']??false)!==true){
|
||||
$receiptPath = $this->path('storage/app/private/module-deployments/schema-transition-'.$manifestHash.'.json');
|
||||
$receipt = is_file($receiptPath) ? json_decode(file_get_contents($receiptPath), true, 32, JSON_THROW_ON_ERROR) : [];
|
||||
if (($receipt['from_manifest_sha256'] ?? null) !== $previous['manifest_sha256'] || ($receipt['to_manifest_sha256'] ?? null) !== $manifestHash || ($receipt['host'] ?? null) !== $this->host || ($receipt['changes'][$file]['before'] ?? null) !== ($oldManifest['support_files'][$file] ?? null) || ($receipt['changes'][$file]['after'] ?? null) !== ($manifest['support_files'][$file] ?? null) || ($receipt['schema_verified'] ?? false) !== true) {
|
||||
throw new \RuntimeException('Transição de schema exige migração própria e recibo exacto do destino.');
|
||||
}
|
||||
}
|
||||
@@ -143,11 +253,13 @@ final class CodeDeployment
|
||||
} elseif ($previous !== null) {
|
||||
throw new \RuntimeException('Registo activo sem bundle; recuperar a implantação anterior.');
|
||||
}
|
||||
$schemaReceipt = $v2 ? $this->v2Transition($manifest, $oldManifest, $previous, $manifestHash) : null;
|
||||
$before = [];
|
||||
foreach ($manifest['host_overlays'] as $file => $hashes) {
|
||||
$hash = hash_file('sha256', $this->path($file));
|
||||
$expected = $oldManifest === null ? $hashes['before_sha256'] : $oldManifest['host_overlays'][$file]['after_sha256'];
|
||||
if ($oldManifest !== null && $hashes['before_sha256'] !== $oldManifest['host_overlays'][$file]['before_sha256']) {
|
||||
$hash = $this->fileHash($file);
|
||||
$prior = $oldManifest['host_overlays'][$file] ?? null;
|
||||
$expected = $prior === null ? $hashes['before_sha256'] : $prior['after_sha256'];
|
||||
if ($prior !== null && $hashes['before_sha256'] !== ($v2 ? $prior['after_sha256'] : $prior['before_sha256'])) {
|
||||
throw new \RuntimeException('Baseline do host mudou entre versões.');
|
||||
}
|
||||
if ($hash !== $expected) {
|
||||
@@ -155,7 +267,11 @@ final class CodeDeployment
|
||||
}
|
||||
$before[$file] = $hash;
|
||||
}
|
||||
$target = hash('sha256', json_encode([$this->host, $pointerHash, $before, $previous], JSON_THROW_ON_ERROR));
|
||||
$identity = [$this->host, $pointerHash, $before, $previous];
|
||||
if ($v2) {
|
||||
$identity[] = [$manifestHash, $schemaReceipt];
|
||||
}
|
||||
$target = hash('sha256', json_encode($identity, JSON_THROW_ON_ERROR));
|
||||
|
||||
return ['target_sha256' => $target, 'pointer_sha256' => $pointerHash, 'host_files' => $before, 'manifest_sha256' => $manifestHash, 'previous' => $previous, 'deployment_id' => $this->attempt($manifestHash), 'writes' => false];
|
||||
}
|
||||
@@ -357,7 +473,9 @@ final class CodeDeployment
|
||||
'previous' => $plan['previous'],
|
||||
'pointer_sha256' => $plan['pointer_sha256'], 'files' => [], 'cache_files' => [], 'bundle_files' => $manifest['support_files']];
|
||||
foreach ($manifest['host_overlays'] as $file => $hashes) {
|
||||
if ($plan['host_files'][$file] !== null) {
|
||||
self::write($this->path($prefix.'/before/'.$file), file_get_contents($this->path($file)));
|
||||
}
|
||||
$hashes['before_sha256'] = $plan['host_files'][$file];
|
||||
$data['files'][$file] = $hashes;
|
||||
}
|
||||
@@ -371,9 +489,17 @@ final class CodeDeployment
|
||||
$data['cache_files'][$relative] = hash_file('sha256', $cache);
|
||||
}
|
||||
foreach ($manifest['support_files'] as $file => $hash) {
|
||||
self::write($this->path($prefix.'/staged/'.$file), file_get_contents($bundle.'/'.$file));
|
||||
$body = file_get_contents($bundle.'/'.$file);
|
||||
if (! hash_equals($hash, hash('sha256', $body))) {
|
||||
throw new \RuntimeException('Fonte da candidata mudou durante a preparação.');
|
||||
}
|
||||
self::write($this->path($prefix.'/staged/manifest.json'), file_get_contents($bundle.'/manifest.json'));
|
||||
self::write($this->path($prefix.'/staged/'.$file), $body);
|
||||
}
|
||||
$manifestBody = file_get_contents($bundle.'/manifest.json');
|
||||
if (! hash_equals($manifestHash, hash('sha256', $manifestBody))) {
|
||||
throw new \RuntimeException('Manifesto mudou durante a preparação.');
|
||||
}
|
||||
self::write($this->path($prefix.'/staged/manifest.json'), $manifestBody);
|
||||
$this->journal($id, $data);
|
||||
$checkpoint && $checkpoint('prepared');
|
||||
$data['state'] = 'applying';
|
||||
@@ -388,10 +514,14 @@ final class CodeDeployment
|
||||
}
|
||||
$checkpoint && $checkpoint('caches-cleared');
|
||||
foreach ($data['files'] as $file => $hashes) {
|
||||
if (! hash_equals($hashes['before_sha256'], hash_file('sha256', $this->path($file)))) {
|
||||
if ($hashes['before_sha256'] !== $this->fileHash($file)) {
|
||||
throw new \RuntimeException('Ficheiro mudou durante implantação.');
|
||||
}
|
||||
self::write($this->path($file), file_get_contents($bundle.'/'.$file));
|
||||
$body = file_get_contents($this->path($prefix.'/staged/'.$file));
|
||||
if (! hash_equals($hashes['after_sha256'], hash('sha256', $body))) {
|
||||
throw new \RuntimeException('Cópia preparada da candidata divergiu.');
|
||||
}
|
||||
self::write($this->path($file), $body);
|
||||
$checkpoint && $checkpoint('file:'.$file);
|
||||
}
|
||||
// Both resolved paths are checked within the host before this directory move.
|
||||
@@ -428,7 +558,7 @@ final class CodeDeployment
|
||||
}
|
||||
$this->manifest($this->path('packages/internal-requisitions'), $data['manifest_sha256']);
|
||||
foreach ($data['files'] as $file => $hashes) {
|
||||
if (! hash_equals($hashes['after_sha256'], hash_file('sha256', $this->path($file)))) {
|
||||
if ($hashes['after_sha256'] !== $this->fileHash($file)) {
|
||||
throw new \RuntimeException('Código aplicado alterado.');
|
||||
}
|
||||
}
|
||||
@@ -471,10 +601,10 @@ final class CodeDeployment
|
||||
throw new \RuntimeException('Cache mudou após compilação registada.');
|
||||
}
|
||||
foreach ($data['files'] as $file => $hashes) {
|
||||
if (! in_array(hash_file('sha256', $this->path($file)), [$hashes['before_sha256'], $hashes['after_sha256']], true)) {
|
||||
if (! in_array($this->fileHash($file), [$hashes['before_sha256'], $hashes['after_sha256']], true)) {
|
||||
throw new \RuntimeException('Código local alterado; recuperação recusada.');
|
||||
}
|
||||
if (! hash_equals($hashes['before_sha256'], hash_file('sha256', $this->path($prefix.'/before/'.$file)))) {
|
||||
if ($hashes['before_sha256'] !== $this->fileHash($prefix.'/before/'.$file)) {
|
||||
throw new \RuntimeException('Backup de código divergente.');
|
||||
}
|
||||
}
|
||||
@@ -518,8 +648,17 @@ final class CodeDeployment
|
||||
$data['state'] = 'rolling-back';
|
||||
$this->journal($id, $data);
|
||||
foreach ($data['files'] as $file => $hashes) {
|
||||
if (! in_array($this->fileHash($file), [$hashes['before_sha256'], $hashes['after_sha256']], true)) {
|
||||
throw new \RuntimeException('Código mudou durante a recuperação.');
|
||||
}
|
||||
if ($hashes['before_sha256'] === null) {
|
||||
if ($this->fileHash($file) !== null && ! unlink($this->path($file))) {
|
||||
throw new \RuntimeException('Falha ao repor ausência anterior.');
|
||||
}
|
||||
} else {
|
||||
self::write($this->path($file), file_get_contents($this->path($prefix.'/before/'.$file)));
|
||||
}
|
||||
}
|
||||
if ($rebuilt) {
|
||||
foreach ($data['built_cache_files'] as $file => $hash) {
|
||||
self::write($this->path($prefix.'/rollback-cache/'.$file), file_get_contents($this->path($file)));
|
||||
|
||||
@@ -1,6 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Tempo\Purchasing\Inventory\StockCosting;
|
||||
|
||||
// Copied as <local bundle>/bootstrap.php, without a source-project dependency.
|
||||
if (config('merchandise_invoices.costs_enabled') === true) {
|
||||
(static function (): void {
|
||||
if (! is_file(__DIR__.'/manifest.json') || is_link(__DIR__.'/manifest.json') || ! is_readable(__DIR__.'/manifest.json')) {
|
||||
throw new RuntimeException('Manifesto local da composição ausente.');
|
||||
}
|
||||
$relative = 'packages/purchasing/src/StockCosting.php';
|
||||
$manifest = json_decode(file_get_contents(__DIR__.'/manifest.json'), true, 32, JSON_THROW_ON_ERROR);
|
||||
$pin = $manifest['support_files'][$relative] ?? null;
|
||||
$file = realpath(__DIR__.'/'.$relative);
|
||||
$base = realpath(__DIR__);
|
||||
if (! in_array($manifest['format'] ?? null, ['tempo.operational-review.v1', 'tempo.operational-review.v2'], true)
|
||||
|| ! is_string($pin) || ! preg_match('/^[a-f0-9]{64}$/D', $pin) || ! $file || ! $base
|
||||
|| ! str_starts_with(strtolower($file), strtolower($base.DIRECTORY_SEPARATOR))
|
||||
|| is_link(__DIR__.'/'.$relative) || ! hash_equals($pin, hash_file('sha256', $file))) {
|
||||
throw new RuntimeException('Cálculo comum da composição ausente ou divergente.');
|
||||
}
|
||||
$class = StockCosting::class;
|
||||
if (class_exists($class, false)) {
|
||||
if (! hash_equals($pin, hash_file('sha256', (new ReflectionClass($class))->getFileName()))) {
|
||||
throw new RuntimeException('Outra versão do cálculo comum já foi carregada.');
|
||||
}
|
||||
} else {
|
||||
require_once $file;
|
||||
}
|
||||
})();
|
||||
}
|
||||
require_once __DIR__.'/integrations/sgf/operational/bootstrap.php';
|
||||
require_once __DIR__.'/integrations/sgf/operational/RuntimeContext.php';
|
||||
require_once __DIR__.'/integrations/sgf/operational/Composition.php';
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
require_once __DIR__.'/src/ReplenishmentProjection.php';
|
||||
require_once __DIR__.'/src/StockCosting.php';
|
||||
require_once __DIR__.'/src/ExecutionContext.php';
|
||||
require_once __DIR__.'/src/QuotationPricing.php';
|
||||
require_once __DIR__.'/src/ProposalScoring.php';
|
||||
require_once __DIR__.'/src/RequisitionPort.php';
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace Tempo\Purchasing\Composition;
|
||||
|
||||
use Closure;
|
||||
use LogicException;
|
||||
|
||||
/** Transaction-scoped evidence supplied by the host runtime, never a permission grant. */
|
||||
final class ExecutionContext
|
||||
{
|
||||
public const CONTRACT = 'COMPRAS-SGF-EXECUTION-v1';
|
||||
|
||||
private ?array $frame = null;
|
||||
|
||||
public function within(array $declaration, object $connection, Closure $verify, Closure $work): mixed
|
||||
{
|
||||
if ($this->frame !== null) {
|
||||
throw new LogicException('COMPOSITION_NESTED_EXECUTION');
|
||||
}
|
||||
self::validate($declaration);
|
||||
$verify();
|
||||
$this->frame = [$declaration, $connection, $verify];
|
||||
try {
|
||||
return $work();
|
||||
} finally {
|
||||
$this->frame = null;
|
||||
}
|
||||
}
|
||||
|
||||
public function allows(string $feature, object $connection): bool
|
||||
{
|
||||
if ($this->frame === null || $this->frame[1] !== $connection) {
|
||||
return false;
|
||||
}
|
||||
($this->frame[2])(); // Re-read identity, context, permissions, pins and schema.
|
||||
|
||||
return array_key_exists($feature, $this->frame[0]['features']);
|
||||
}
|
||||
|
||||
public function component(string $feature, object $connection): array
|
||||
{
|
||||
if (! $this->allows($feature, $connection)) {
|
||||
throw new LogicException('COMPOSITION_CAPABILITY_ABSENT');
|
||||
}
|
||||
|
||||
return $this->frame[0]['features'][$feature];
|
||||
}
|
||||
|
||||
public function permits(string $operation, object $connection): bool
|
||||
{
|
||||
$feature = str_starts_with($operation, 'purchasing_conflicts.') ? 'conflict-release'
|
||||
: (str_starts_with($operation, 'purchasing_order_cancellations.') ? 'order-cancellation-cycles' : null);
|
||||
|
||||
return $feature !== null && $this->allows($feature, $connection) && $this->frame[0]['operation'] === $operation;
|
||||
}
|
||||
|
||||
private static function validate(array $declaration): void
|
||||
{
|
||||
$keys = array_keys($declaration);
|
||||
sort($keys);
|
||||
if ($keys !== ['actor', 'composition', 'contract', 'features', 'generation', 'operation', 'schema_sha256', 'scope', 'workflow_sha256']
|
||||
|| $declaration['contract'] !== self::CONTRACT
|
||||
|| ! is_string($declaration['composition']) || ! preg_match('/^[a-f0-9]{12}$/D', $declaration['composition'])) {
|
||||
throw new LogicException('COMPOSITION_CONTRACT');
|
||||
}
|
||||
if (! is_string($declaration['operation']) || ! preg_match('/^[a-z][a-z0-9_]*(?:\.[a-z0-9_]+)+$/D', $declaration['operation'])) {
|
||||
throw new LogicException('COMPOSITION_OPERATION');
|
||||
}
|
||||
foreach (['generation', 'schema_sha256', 'workflow_sha256'] as $field) {
|
||||
if (! is_string($declaration[$field]) || ! preg_match('/^[a-f0-9]{64}$/D', $declaration[$field])) {
|
||||
throw new LogicException('COMPOSITION_HASH');
|
||||
}
|
||||
}
|
||||
foreach (['scope' => ['tenant_id', 'company_id', 'unit_id'], 'actor' => ['host_id', 'native_id']] as $field => $expected) {
|
||||
if (! is_array($declaration[$field]) || count($declaration[$field]) !== count($expected)
|
||||
|| array_diff($expected, array_keys($declaration[$field]))) {
|
||||
throw new LogicException('COMPOSITION_SCOPE');
|
||||
}
|
||||
foreach ($declaration[$field] as $id) {
|
||||
if (! is_int($id) || $id < 1) {
|
||||
throw new LogicException('COMPOSITION_SCOPE');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (! is_array($declaration['features']) || array_diff(array_keys($declaration['features']), ['conflict-release', 'order-cancellation-cycles'])) {
|
||||
throw new LogicException('COMPOSITION_FEATURE');
|
||||
}
|
||||
foreach ($declaration['features'] as $feature => $component) {
|
||||
if ($feature === 'conflict-release' && $component !== []) {
|
||||
if (! is_array($component) || array_keys($component) !== ['company_view', 'company_authorise']
|
||||
|| ! is_bool($component['company_view']) || ! is_bool($component['company_authorise'])) {
|
||||
throw new LogicException('COMPOSITION_FEATURE');
|
||||
}
|
||||
}
|
||||
if ($feature === 'order-cancellation-cycles'
|
||||
&& (! is_array($component) || array_keys($component) !== ['root', 'manifest_sha256']
|
||||
|| ! is_string($component['root']) || trim($component['root']) === ''
|
||||
|| ! is_string($component['manifest_sha256']) || ! preg_match('/^[a-f0-9]{64}$/D', $component['manifest_sha256']))) {
|
||||
throw new LogicException('COMPOSITION_COMPONENT');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,8 +52,9 @@ final class StockCosting
|
||||
throw new \DomainException('Opening value without stock is inconsistent.');
|
||||
}
|
||||
$layers = [];
|
||||
$origins = [];
|
||||
$head = 0;
|
||||
if ($method === 'fifo') {
|
||||
if ($method === 'fifo' || ($opening['layers'] ?? []) !== []) {
|
||||
$sumQuantity = 0;
|
||||
$sumValue = BigRational::of(0);
|
||||
foreach ($opening['layers'] ?? [] as $layer) {
|
||||
@@ -64,12 +65,22 @@ final class StockCosting
|
||||
}
|
||||
$sumQuantity += $q;
|
||||
$sumValue = $sumValue->plus($v);
|
||||
$layers[] = ['quantity_milli' => $q, 'value' => $v];
|
||||
$reference = $layer['reference'] ?? (count($opening['layers'] ?? []) === 1 ? $opening['reference'] : null);
|
||||
$layers[] = ['quantity_milli' => $q, 'value' => $v, 'reference' => $reference];
|
||||
if (is_string($reference) && trim($reference) !== '') {
|
||||
if (isset($origins[$reference])) {
|
||||
throw new \DomainException('Duplicate opening receipt reference.');
|
||||
}
|
||||
$origins[$reference] = ['available_milli' => $q, 'unit_value' => $v->dividedBy($q)];
|
||||
}
|
||||
}
|
||||
if ($sumQuantity !== $quantity || ! $sumValue->isEqualTo($value)) {
|
||||
throw new \DomainException('FIFO opening requires reconciled historical layers.');
|
||||
}
|
||||
}
|
||||
if ($method === 'weighted_average' && $quantity > 0 && ($opening['layers'] ?? []) === []) {
|
||||
$origins[$opening['reference']] = ['available_milli' => $quantity, 'unit_value' => $value->dividedBy($quantity)];
|
||||
}
|
||||
$last = 0;
|
||||
$results = [];
|
||||
foreach ($movements as $movement) {
|
||||
@@ -86,9 +97,50 @@ final class StockCosting
|
||||
}
|
||||
$quantity += $q;
|
||||
$value = $value->plus($amount);
|
||||
if ($method === 'fifo') {
|
||||
$layers[] = ['quantity_milli' => $q, 'value' => $amount];
|
||||
if (isset($origins[$movement['reference']])) {
|
||||
throw new \DomainException('Duplicate receipt reference.');
|
||||
}
|
||||
$origins[$movement['reference']] = ['available_milli' => $q, 'unit_value' => $amount->dividedBy($q)];
|
||||
if ($method === 'fifo') {
|
||||
$layers[] = ['quantity_milli' => $q, 'value' => $amount, 'reference' => $movement['reference']];
|
||||
}
|
||||
} elseif (($movement['kind'] ?? null) === 'receipt_return') {
|
||||
$reference = $movement['receipt_reference'] ?? null;
|
||||
if (! is_string($reference) || ! isset($origins[$reference]) || $q > $quantity) {
|
||||
throw new \DomainException('An identified original receipt and sufficient stock are required.');
|
||||
}
|
||||
$amount = $origins[$reference]['unit_value']->multipliedBy($q);
|
||||
if ($method === 'fifo') {
|
||||
$index = null;
|
||||
foreach ($layers as $key => $layer) {
|
||||
if ($layer['reference'] === $reference) {
|
||||
$index = $key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($index === null || $layers[$index]['quantity_milli'] < $q) {
|
||||
throw new \DomainException('Original receipt layer already consumed; independently reconciled opening required.');
|
||||
}
|
||||
$layers[$index]['quantity_milli'] -= $q;
|
||||
$layers[$index]['value'] = $layers[$index]['value']->minus($amount);
|
||||
if ($layers[$index]['quantity_milli'] === 0) {
|
||||
unset($layers[$index]);
|
||||
}
|
||||
} elseif ($origins[$reference]['available_milli'] < $q) {
|
||||
throw new \DomainException('Original receipt availability is not proven after prior issues; independent reconciliation required.');
|
||||
}
|
||||
if ($rounding === 'half_up_final_balance') {
|
||||
$amount = $q === $quantity ? $value : $amount->toScale(0, RoundingMode::HalfUp)->toBigRational();
|
||||
}
|
||||
if ($amount->isGreaterThan($value)) {
|
||||
throw new \DomainException('Return exceeds remaining stock value; independent reconciliation required.');
|
||||
}
|
||||
if (array_key_exists('value_minor', $movement) && ! $amount->isEqualTo(self::integer($movement['value_minor']))) {
|
||||
throw new \DomainException('Posted return differs from its original receipt cost; never revalue prior journals.');
|
||||
}
|
||||
$origins[$reference]['available_milli'] -= $q;
|
||||
$quantity -= $q;
|
||||
$value = $value->minus($amount);
|
||||
} elseif (($movement['kind'] ?? null) === 'issue') {
|
||||
if (array_key_exists('value_minor', $movement)) {
|
||||
throw new \InvalidArgumentException('An issue cannot override its calculated cost.');
|
||||
@@ -102,6 +154,9 @@ final class StockCosting
|
||||
} else {
|
||||
$remaining = $q;
|
||||
while ($remaining > 0) {
|
||||
while (! isset($layers[$head])) {
|
||||
$head++;
|
||||
}
|
||||
$take = min($remaining, $layers[$head]['quantity_milli']);
|
||||
$part = $layers[$head]['value']->multipliedBy($take)->dividedBy($layers[$head]['quantity_milli']);
|
||||
$amount = $amount->plus($part);
|
||||
@@ -122,10 +177,20 @@ final class StockCosting
|
||||
}
|
||||
$quantity -= $q;
|
||||
$value = $value->minus($amount);
|
||||
if ($method === 'weighted_average') {
|
||||
// Without qualified lot allocations no receipt may claim units already issued.
|
||||
foreach ($origins as &$origin) {
|
||||
$origin['available_milli'] = max(0, $origin['available_milli'] - $q);
|
||||
}
|
||||
unset($origin);
|
||||
}
|
||||
} else {
|
||||
throw new \InvalidArgumentException('Unknown qualified movement kind.');
|
||||
}
|
||||
$results[] = ['id' => $id, 'reference' => $movement['reference'], 'kind' => $movement['kind'], 'quantity_milli' => $q, 'value' => self::amount($amount)];
|
||||
if ($movement['kind'] === 'receipt_return') {
|
||||
$results[array_key_last($results)]['receipt_reference'] = $movement['receipt_reference'];
|
||||
}
|
||||
}
|
||||
|
||||
return ['method' => $method, 'opening_reference' => $opening['reference'], 'movements' => $results,
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
@import 'tailwindcss';
|
||||
@import 'tailwindcss' source(none);
|
||||
|
||||
@import 'tw-animate-css';
|
||||
|
||||
@source '../js';
|
||||
@source '../views';
|
||||
@source '../../app';
|
||||
@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
|
||||
|
||||
@custom-variant dark (&:is(.dark *));
|
||||
|
||||
@@ -12,9 +12,9 @@ export default function AppearanceToggleTab({
|
||||
const { appearance, updateAppearance } = useAppearance();
|
||||
|
||||
const tabs: { value: Appearance; icon: LucideIcon; label: string }[] = [
|
||||
{ value: 'light', icon: Sun, label: 'Light' },
|
||||
{ value: 'dark', icon: Moon, label: 'Dark' },
|
||||
{ value: 'system', icon: Monitor, label: 'System' },
|
||||
{ value: 'light', icon: Sun, label: 'Claro' },
|
||||
{ value: 'dark', icon: Moon, label: 'Escuro' },
|
||||
{ value: 'system', icon: Monitor, label: 'Sistema' },
|
||||
];
|
||||
|
||||
return (
|
||||
|
||||
@@ -23,14 +23,14 @@ export default function DeleteUser() {
|
||||
<div className="space-y-6">
|
||||
<Heading
|
||||
variant="small"
|
||||
title="Delete account"
|
||||
description="Delete your account and all of its resources"
|
||||
title="Apagar conta"
|
||||
description="Apagar a sua conta e todos os dados associados"
|
||||
/>
|
||||
<div className="space-y-4 rounded-lg border border-red-100 bg-red-50 p-4 dark:border-red-200/10 dark:bg-red-700/10">
|
||||
<div className="relative space-y-0.5 text-red-600 dark:text-red-100">
|
||||
<p className="font-medium">Warning</p>
|
||||
<p className="font-medium">Atenção</p>
|
||||
<p className="text-sm">
|
||||
Please proceed with caution, this cannot be undone.
|
||||
Proceda com cuidado: esta acção não pode ser desfeita.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -40,18 +40,17 @@ export default function DeleteUser() {
|
||||
variant="destructive"
|
||||
data-test="delete-user-button"
|
||||
>
|
||||
Delete account
|
||||
Apagar conta
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
<DialogContent>
|
||||
<DialogTitle>
|
||||
Are you sure you want to delete your account?
|
||||
Tem a certeza de que quer apagar a sua conta?
|
||||
</DialogTitle>
|
||||
<DialogDescription>
|
||||
Once your account is deleted, all of its resources
|
||||
and data will also be permanently deleted. Please
|
||||
enter your password to confirm you would like to
|
||||
permanently delete your account.
|
||||
Depois de apagada, a conta e todos os seus dados são
|
||||
eliminados de forma permanente. Introduza a
|
||||
palavra-passe para confirmar.
|
||||
</DialogDescription>
|
||||
|
||||
<Form
|
||||
@@ -70,14 +69,14 @@ export default function DeleteUser() {
|
||||
htmlFor="password"
|
||||
className="sr-only"
|
||||
>
|
||||
Password
|
||||
Palavra-passe
|
||||
</Label>
|
||||
|
||||
<PasswordInput
|
||||
id="password"
|
||||
name="password"
|
||||
ref={passwordInput}
|
||||
placeholder="Password"
|
||||
placeholder="Palavra-passe"
|
||||
autoComplete="current-password"
|
||||
/>
|
||||
|
||||
@@ -92,7 +91,7 @@ export default function DeleteUser() {
|
||||
resetAndClearErrors()
|
||||
}
|
||||
>
|
||||
Cancel
|
||||
Cancelar
|
||||
</Button>
|
||||
</DialogClose>
|
||||
|
||||
@@ -105,7 +104,7 @@ export default function DeleteUser() {
|
||||
type="submit"
|
||||
data-test="confirm-delete-user-button"
|
||||
>
|
||||
Delete account
|
||||
Apagar conta
|
||||
</button>
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
|
||||
@@ -23,7 +23,11 @@ export default function PasswordInput({
|
||||
type="button"
|
||||
onClick={() => setShowPassword((prev) => !prev)}
|
||||
className="absolute inset-y-0 right-0 flex items-center rounded-r-md px-3 text-muted-foreground hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring focus-visible:outline-none"
|
||||
aria-label={showPassword ? 'Hide password' : 'Show password'}
|
||||
aria-label={
|
||||
showPassword
|
||||
? 'Ocultar palavra-passe'
|
||||
: 'Mostrar palavra-passe'
|
||||
}
|
||||
tabIndex={-1}
|
||||
>
|
||||
{showPassword ? (
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
Search,
|
||||
X,
|
||||
} from 'lucide-react';
|
||||
import { Fragment, useEffect, useRef, useState } from 'react';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import {
|
||||
@@ -29,7 +29,10 @@ import {
|
||||
activeProcurementEntry,
|
||||
procurementNavigation,
|
||||
} from '@/lib/procurement-navigation';
|
||||
import type { CommonFinanceNavigation } from '@/lib/procurement-navigation';
|
||||
import type {
|
||||
CommonFinanceNavigation,
|
||||
ProcurementEntry,
|
||||
} from '@/lib/procurement-navigation';
|
||||
import { roleLabels } from '@/types/procurement';
|
||||
import type { WorkContextState } from '@/types/work-context';
|
||||
import { WorkContextChange } from '@/components/work-context-change';
|
||||
@@ -40,6 +43,17 @@ import {
|
||||
searchProcurementMenu,
|
||||
} from '@/lib/procurement-menu-search';
|
||||
|
||||
/** Agrupa entradas consecutivas pela secção, mantendo a ordem do menu. */
|
||||
function menuSections(entries: ProcurementEntry[]) {
|
||||
const sections: { label?: string; entries: ProcurementEntry[] }[] = [];
|
||||
for (const entry of entries) {
|
||||
const last = sections[sections.length - 1];
|
||||
if (last && last.label === entry.section) last.entries.push(entry);
|
||||
else sections.push({ label: entry.section, entries: [entry] });
|
||||
}
|
||||
return sections;
|
||||
}
|
||||
|
||||
export function SgcWorkspaceShell({ children }: { children: ReactNode }) {
|
||||
const page = usePage();
|
||||
const user = page.props.auth?.user;
|
||||
@@ -252,14 +266,14 @@ export function SgcWorkspaceShell({ children }: { children: ReactNode }) {
|
||||
</summary>
|
||||
<ul className="mt-1 mb-3 ml-5 space-y-1 border-l border-white/10 pl-3">
|
||||
{group.entries.map((entry, index) => {
|
||||
const className = `block rounded-md px-3 py-2 text-[13px] leading-5 transition-colors focus-visible:outline-2 focus-visible:outline-white ${activeId === entry.id ? 'bg-red-500/15 font-medium text-red-300' : 'text-slate-400 hover:bg-white/5 hover:text-white'}`;
|
||||
const className = `block rounded-md px-3 py-2 text-[13px] leading-5 transition-colors focus-visible:outline-2 focus-visible:outline-white ${activeId === entry.id ? 'bg-white/10 font-medium text-white shadow-[inset_2px_0_0_#ed1c24]' : 'text-slate-300 hover:bg-white/5 hover:text-white'}`;
|
||||
return (
|
||||
<li key={entry.id}>
|
||||
{entry.section &&
|
||||
entry.section !==
|
||||
group.entries[index - 1]
|
||||
?.section && (
|
||||
<p className="px-3 pt-3 pb-1 text-xs font-semibold text-slate-500">
|
||||
<p className="px-3 pt-3 pb-1 text-[10px] font-semibold tracking-[0.14em] text-slate-400 uppercase">
|
||||
{entry.section}
|
||||
</p>
|
||||
)}
|
||||
@@ -427,27 +441,51 @@ export function SgcWorkspaceShell({ children }: { children: ReactNode }) {
|
||||
<DropdownMenuContent
|
||||
align="start"
|
||||
sideOffset={8}
|
||||
className="max-h-[min(70vh,32rem)] w-72 overflow-y-auto border-white/10 bg-[#101715] p-2 text-white"
|
||||
className={`max-h-[min(75vh,36rem)] overflow-y-auto rounded-xl border-white/10 bg-[#101715] p-3 text-white shadow-2xl ${menuSections(group.entries).length > 1 ? 'w-[min(34rem,calc(100vw-2rem))]' : 'w-72'}`}
|
||||
>
|
||||
{group.entries.map((entry, index) => (
|
||||
<Fragment key={entry.id}>
|
||||
{entry.section &&
|
||||
entry.section !==
|
||||
group.entries[index - 1]
|
||||
?.section && (
|
||||
<DropdownMenuLabel className="px-3 pt-3 pb-1 text-xs text-slate-500">
|
||||
{entry.section}
|
||||
<div
|
||||
className={
|
||||
menuSections(group.entries)
|
||||
.length > 1
|
||||
? 'grid grid-cols-2 gap-x-4 gap-y-3'
|
||||
: ''
|
||||
}
|
||||
>
|
||||
{menuSections(group.entries).map(
|
||||
(section) => (
|
||||
<div
|
||||
key={
|
||||
section.label ??
|
||||
group.id
|
||||
}
|
||||
role="group"
|
||||
aria-label={
|
||||
section.label ??
|
||||
group.label
|
||||
}
|
||||
>
|
||||
{section.label && (
|
||||
<DropdownMenuLabel className="mb-1 border-b border-white/10 px-3 pt-1 pb-2 text-[10px] font-semibold tracking-[0.14em] text-slate-400 uppercase">
|
||||
{section.label}
|
||||
</DropdownMenuLabel>
|
||||
)}
|
||||
{section.entries.map(
|
||||
(entry) => (
|
||||
<DropdownMenuItem
|
||||
key={entry.id}
|
||||
key={
|
||||
entry.id
|
||||
}
|
||||
asChild
|
||||
className={`rounded-md px-3 py-2 text-[13px] leading-5 focus:bg-white/5 focus:text-white ${activeId === entry.id ? 'bg-red-500/15 font-medium text-red-300' : 'text-slate-400'}`}
|
||||
className={`rounded-md border-l-2 px-3 py-2 text-[13px] leading-5 focus:bg-white/10 focus:text-white ${activeId === entry.id ? 'border-[#ed1c24] bg-white/10 font-medium text-white' : 'border-transparent text-slate-200'}`}
|
||||
>
|
||||
{entry.fullPage ? (
|
||||
<a
|
||||
href={entry.path}
|
||||
onClick={navigate}
|
||||
href={
|
||||
entry.path
|
||||
}
|
||||
onClick={
|
||||
navigate
|
||||
}
|
||||
aria-current={
|
||||
activeId ===
|
||||
entry.id
|
||||
@@ -455,12 +493,18 @@ export function SgcWorkspaceShell({ children }: { children: ReactNode }) {
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
{entry.label}
|
||||
{
|
||||
entry.label
|
||||
}
|
||||
</a>
|
||||
) : (
|
||||
<Link
|
||||
href={entry.path}
|
||||
onClick={navigate}
|
||||
href={
|
||||
entry.path
|
||||
}
|
||||
onClick={
|
||||
navigate
|
||||
}
|
||||
aria-current={
|
||||
activeId ===
|
||||
entry.id
|
||||
@@ -468,12 +512,18 @@ export function SgcWorkspaceShell({ children }: { children: ReactNode }) {
|
||||
: undefined
|
||||
}
|
||||
>
|
||||
{entry.label}
|
||||
{
|
||||
entry.label
|
||||
}
|
||||
</Link>
|
||||
)}
|
||||
</DropdownMenuItem>
|
||||
</Fragment>
|
||||
))}
|
||||
),
|
||||
)}
|
||||
</div>
|
||||
),
|
||||
)}
|
||||
</div>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
))}
|
||||
|
||||
@@ -13,6 +13,7 @@ export default function TwoFactorManagement({
|
||||
const [enabled, setEnabled] = useState(initialEnabled);
|
||||
const [pending, setPending] = useState(initialPending);
|
||||
const [secret, setSecret] = useState('');
|
||||
const [qrSvg, setQrSvg] = useState('');
|
||||
const [code, setCode] = useState('');
|
||||
const [codes, setCodes] = useState<string[]>([]);
|
||||
const [busy, setBusy] = useState(false);
|
||||
@@ -76,8 +77,12 @@ export default function TwoFactorManagement({
|
||||
}
|
||||
}
|
||||
const loadSecret = async () => {
|
||||
const data = await request('/user/two-factor-secret-key');
|
||||
setSecret(data.secretKey);
|
||||
const [key, qr] = await Promise.all([
|
||||
request('/user/two-factor-secret-key'),
|
||||
request('/user/two-factor-qr-code'),
|
||||
]);
|
||||
setSecret(key.secretKey);
|
||||
setQrSvg(typeof qr?.svg === 'string' ? qr.svg : '');
|
||||
};
|
||||
const loadCodes = async () => {
|
||||
setCodes(await request('/user/two-factor-recovery-codes'));
|
||||
@@ -130,8 +135,22 @@ export default function TwoFactorManagement({
|
||||
{pending && secret && (
|
||||
<>
|
||||
<p className="text-sm">
|
||||
Na aplicação autenticadora, adicione uma conta com esta
|
||||
chave manual. Não partilhe esta chave.
|
||||
Na aplicação autenticadora (por exemplo Google
|
||||
Authenticator ou Microsoft Authenticator), leia este
|
||||
código QR. Não partilhe o código nem a chave.
|
||||
</p>
|
||||
{qrSvg && (
|
||||
<div
|
||||
role="img"
|
||||
aria-label="Código QR para a aplicação autenticadora"
|
||||
className="inline-block rounded-lg border bg-white p-3 [&_svg]:size-48"
|
||||
// SVG gerado pelo servidor (Fortify) a partir do segredo da própria conta.
|
||||
dangerouslySetInnerHTML={{ __html: qrSvg }}
|
||||
/>
|
||||
)}
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Se não conseguir ler o código QR, introduza esta chave
|
||||
manualmente:
|
||||
</p>
|
||||
<code className="block rounded bg-muted p-3 break-all">
|
||||
{secret}
|
||||
@@ -149,6 +168,7 @@ export default function TwoFactorManagement({
|
||||
setEnabled(true);
|
||||
setPending(false);
|
||||
setSecret('');
|
||||
setQrSvg('');
|
||||
setCode('');
|
||||
await loadCodes();
|
||||
});
|
||||
@@ -240,6 +260,7 @@ export default function TwoFactorManagement({
|
||||
setEnabled(false);
|
||||
setPending(false);
|
||||
setSecret('');
|
||||
setQrSvg('');
|
||||
setCode('');
|
||||
setCodes([]);
|
||||
} else {
|
||||
|
||||
@@ -12,17 +12,17 @@ import type { NavItem } from '@/types';
|
||||
|
||||
const sidebarNavItems: NavItem[] = [
|
||||
{
|
||||
title: 'Profile',
|
||||
title: 'Perfil',
|
||||
href: edit(),
|
||||
icon: null,
|
||||
},
|
||||
{
|
||||
title: 'Security',
|
||||
title: 'Segurança',
|
||||
href: editSecurity(),
|
||||
icon: null,
|
||||
},
|
||||
{
|
||||
title: 'Appearance',
|
||||
title: 'Aparência',
|
||||
href: editAppearance(),
|
||||
icon: null,
|
||||
},
|
||||
@@ -34,15 +34,15 @@ export default function SettingsLayout({ children }: PropsWithChildren) {
|
||||
return (
|
||||
<div className="px-4 py-6">
|
||||
<Heading
|
||||
title="Settings"
|
||||
description="Manage your profile and account settings"
|
||||
title="Definições"
|
||||
description="Gerir o perfil e a segurança da sua conta"
|
||||
/>
|
||||
|
||||
<div className="flex flex-col lg:flex-row lg:space-x-12">
|
||||
<aside className="w-full max-w-xl lg:w-48">
|
||||
<nav
|
||||
className="flex flex-col space-y-1 space-x-0"
|
||||
aria-label="Settings"
|
||||
aria-label="Definições"
|
||||
>
|
||||
{sidebarNavItems.map((item, index) => (
|
||||
<Button
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
Wallet,
|
||||
Warehouse,
|
||||
FileBarChart,
|
||||
Settings,
|
||||
} from 'lucide-react';
|
||||
import type { LucideIcon } from 'lucide-react';
|
||||
|
||||
@@ -612,15 +613,11 @@ export function procurementNavigation(
|
||||
],
|
||||
},
|
||||
];
|
||||
const purchasing = groups.filter((group) =>
|
||||
['requests', 'approvals', 'sourcing', 'suppliers'].includes(group.id),
|
||||
);
|
||||
const compact = [
|
||||
{
|
||||
id: 'purchasing',
|
||||
label: 'Compras',
|
||||
icon: ClipboardList,
|
||||
entries: purchasing.flatMap((group) =>
|
||||
// Agrupamento visível: pedir → comprar → receber → pagar → controlar.
|
||||
const withSections = (ids: string[]) =>
|
||||
groups
|
||||
.filter((group) => ids.includes(group.id))
|
||||
.flatMap((group) =>
|
||||
(group.id === 'sourcing'
|
||||
? [
|
||||
...group.entries.filter(
|
||||
@@ -639,29 +636,58 @@ export function procurementNavigation(
|
||||
: group.id === 'sourcing' &&
|
||||
entry.id.startsWith('supply_')
|
||||
? 'Fornecimento e reposição'
|
||||
: group.id === 'sourcing'
|
||||
? 'Cotações e ordens'
|
||||
: group.label,
|
||||
})),
|
||||
);
|
||||
const byId = (id: string) =>
|
||||
groups.find((group) => group.id === id) as ProcurementGroup;
|
||||
const administration = byId('administration');
|
||||
const audit = byId('audit');
|
||||
const conflicts = administration.entries.filter(
|
||||
(entry) => entry.id === 'conflicts',
|
||||
);
|
||||
const compact: ProcurementGroup[] = [
|
||||
{
|
||||
id: 'requests_area',
|
||||
label: 'Pedidos',
|
||||
icon: ClipboardList,
|
||||
entries: withSections(['requests', 'approvals']),
|
||||
},
|
||||
{
|
||||
id: 'purchasing',
|
||||
label: 'Compras',
|
||||
icon: Scale,
|
||||
entries: withSections(['sourcing', 'suppliers']),
|
||||
},
|
||||
byId('people'),
|
||||
{ ...byId('receiving'), label: 'Armazém e activos' },
|
||||
byId('finance'),
|
||||
byId('reports'),
|
||||
{
|
||||
id: 'control',
|
||||
label: 'Controlo',
|
||||
icon: BadgeCheck,
|
||||
entries: [
|
||||
...conflicts.map((entry) => ({
|
||||
...entry,
|
||||
section: 'Integridade',
|
||||
})),
|
||||
...audit.entries.map((entry) => ({
|
||||
...entry,
|
||||
section: 'Auditoria',
|
||||
})),
|
||||
],
|
||||
},
|
||||
{
|
||||
...administration,
|
||||
label: 'Administração',
|
||||
icon: Settings,
|
||||
entries: administration.entries.filter(
|
||||
(entry) => entry.id !== 'conflicts',
|
||||
),
|
||||
},
|
||||
...groups
|
||||
.filter(
|
||||
(group) =>
|
||||
![
|
||||
'requests',
|
||||
'approvals',
|
||||
'sourcing',
|
||||
'suppliers',
|
||||
].includes(group.id),
|
||||
)
|
||||
.map((group) => ({
|
||||
...group,
|
||||
label:
|
||||
group.id === 'administration'
|
||||
? 'Administração'
|
||||
: group.id === 'receiving'
|
||||
? 'Armazém e activos'
|
||||
: group.label,
|
||||
})),
|
||||
];
|
||||
return compact
|
||||
.map((group) => ({
|
||||
|
||||
@@ -6,15 +6,15 @@ import { edit as editAppearance } from '@/routes/appearance';
|
||||
export default function Appearance() {
|
||||
return (
|
||||
<>
|
||||
<Head title="Appearance settings" />
|
||||
<Head title="Aparência" />
|
||||
|
||||
<h1 className="sr-only">Appearance settings</h1>
|
||||
<h1 className="sr-only">Aparência</h1>
|
||||
|
||||
<div className="space-y-6">
|
||||
<Heading
|
||||
variant="small"
|
||||
title="Appearance settings"
|
||||
description="Update the appearance settings for your account"
|
||||
title="Aparência"
|
||||
description="Escolha o tema da aplicação neste dispositivo"
|
||||
/>
|
||||
<AppearanceTabs />
|
||||
</div>
|
||||
@@ -25,7 +25,7 @@ export default function Appearance() {
|
||||
Appearance.layout = {
|
||||
breadcrumbs: [
|
||||
{
|
||||
title: 'Appearance settings',
|
||||
title: 'Aparência',
|
||||
href: editAppearance(),
|
||||
},
|
||||
],
|
||||
|
||||
@@ -18,15 +18,15 @@ export default function Profile() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<Head title="Profile settings" />
|
||||
<Head title="Perfil" />
|
||||
|
||||
<h1 className="sr-only">Profile settings</h1>
|
||||
<h1 className="sr-only">Perfil</h1>
|
||||
|
||||
<div className="space-y-6">
|
||||
<Heading
|
||||
variant="small"
|
||||
title="Profile"
|
||||
description="Update your name and email address"
|
||||
title="Perfil"
|
||||
description="Actualize o seu nome e endereço de email"
|
||||
/>
|
||||
|
||||
<Form
|
||||
@@ -39,7 +39,7 @@ export default function Profile() {
|
||||
{({ processing, errors }) => (
|
||||
<>
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="name">Name</Label>
|
||||
<Label htmlFor="name">Nome</Label>
|
||||
|
||||
<Input
|
||||
id="name"
|
||||
@@ -48,7 +48,7 @@ export default function Profile() {
|
||||
name="name"
|
||||
required
|
||||
autoComplete="name"
|
||||
placeholder="Full name"
|
||||
placeholder="Nome completo"
|
||||
/>
|
||||
|
||||
<InputError
|
||||
@@ -58,7 +58,7 @@ export default function Profile() {
|
||||
</div>
|
||||
|
||||
<div className="grid gap-2">
|
||||
<Label htmlFor="email">Email address</Label>
|
||||
<Label htmlFor="email">Endereço de email</Label>
|
||||
|
||||
<Input
|
||||
id="email"
|
||||
@@ -68,7 +68,7 @@ export default function Profile() {
|
||||
name="email"
|
||||
required
|
||||
autoComplete="username"
|
||||
placeholder="Email address"
|
||||
placeholder="Endereço de email"
|
||||
/>
|
||||
|
||||
<InputError
|
||||
@@ -82,7 +82,7 @@ export default function Profile() {
|
||||
disabled={processing}
|
||||
data-test="update-profile-button"
|
||||
>
|
||||
Save
|
||||
Guardar
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
@@ -98,7 +98,7 @@ export default function Profile() {
|
||||
Profile.layout = {
|
||||
breadcrumbs: [
|
||||
{
|
||||
title: 'Profile settings',
|
||||
title: 'Perfil',
|
||||
href: edit(),
|
||||
},
|
||||
],
|
||||
|
||||
@@ -148,7 +148,7 @@ export default function Security(props: Props) {
|
||||
Security.layout = {
|
||||
breadcrumbs: [
|
||||
{
|
||||
title: 'Security settings',
|
||||
title: 'Segurança da conta',
|
||||
href: edit(),
|
||||
},
|
||||
],
|
||||
|
||||
@@ -185,8 +185,9 @@ log "Executar health check local."
|
||||
|
||||
HEALTH_OK=0
|
||||
|
||||
for attempt in 1 2 3 4 5; do
|
||||
HTTP_CODE="$(
|
||||
# /dashboard exige sessão e responde 302 para /login; o health check usa
|
||||
# /up (arranque do Laravel) e /login (página pública renderizada).
|
||||
health_code() {
|
||||
/usr/bin/curl \
|
||||
--noproxy '*' \
|
||||
--silent \
|
||||
@@ -195,12 +196,16 @@ for attempt in 1 2 3 4 5; do
|
||||
--write-out '%{http_code}' \
|
||||
--resolve "$HOST:443:127.0.0.1" \
|
||||
--max-time 15 \
|
||||
"https://$HOST/dashboard" || true
|
||||
)"
|
||||
"https://$HOST$1" || true
|
||||
}
|
||||
|
||||
log "Health check $attempt: HTTP $HTTP_CODE"
|
||||
for attempt in 1 2 3 4 5; do
|
||||
UP_CODE="$(health_code /up)"
|
||||
LOGIN_CODE="$(health_code /login)"
|
||||
|
||||
if [ "$HTTP_CODE" = "200" ]; then
|
||||
log "Health check $attempt: /up HTTP $UP_CODE, /login HTTP $LOGIN_CODE"
|
||||
|
||||
if [ "$UP_CODE" = "200" ] && [ "$LOGIN_CODE" = "200" ]; then
|
||||
HEALTH_OK=1
|
||||
break
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
final class SgfWorkflowExtension
|
||||
{
|
||||
public static function transform(string $php): string
|
||||
{
|
||||
$result = '';
|
||||
foreach (token_get_all($php, TOKEN_PARSE) as $token) {
|
||||
if (! is_array($token)) {
|
||||
$result .= $token;
|
||||
|
||||
continue;
|
||||
}
|
||||
[$type, $text] = $token;
|
||||
if (in_array($type, [T_NAME_QUALIFIED, T_NAME_FULLY_QUALIFIED], true)) {
|
||||
$text = preg_replace('/^(\\\\?)App\\\\/', '$1Tempo\\Purchasing\\Embedded\\', $text);
|
||||
}
|
||||
$result .= $text;
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function prepare(string $source, string $base, string $baseHash, string $output, array $updates): array
|
||||
{
|
||||
if (! preg_match('/^[a-f0-9]{64}$/D', $baseHash) || is_link($base) || is_link($output)
|
||||
|| ! hash_equals($baseHash, hash_file('sha256', $base.'/manifest.json'))) {
|
||||
throw new LogicException('Workflow predecessor mismatch.');
|
||||
}
|
||||
$manifest = json_decode(file_get_contents($base.'/manifest.json'), true, 64, JSON_THROW_ON_ERROR);
|
||||
$bodies = [];
|
||||
foreach ($manifest['files'] as $path => $hash) {
|
||||
self::path($path);
|
||||
if (is_link($base.'/'.$path) || ! hash_equals($hash, hash_file('sha256', $base.'/'.$path))) {
|
||||
throw new LogicException('Workflow predecessor file mismatch.');
|
||||
}
|
||||
$bodies[$path] = file_get_contents($base.'/'.$path);
|
||||
}
|
||||
foreach ($updates as $path) {
|
||||
self::path($path);
|
||||
if (! str_starts_with($path, 'app/') || is_link($source.'/'.$path) || ! is_file($source.'/'.$path)) {
|
||||
throw new LogicException('Canonical workflow source missing.');
|
||||
}
|
||||
$bytes = file_get_contents($source.'/'.$path);
|
||||
$manifest['originals'][$path] = hash('sha256', $bytes);
|
||||
$bodies[$path] = self::transform($bytes);
|
||||
}
|
||||
ksort($bodies);
|
||||
$manifest['files'] = array_map(fn ($bytes) => hash('sha256', $bytes), $bodies);
|
||||
$manifest['predecessor_sha256'] = $baseHash;
|
||||
$manifest['extension_contract'] = 'COMPRAS-SGF-EXECUTION-v1';
|
||||
$bytes = json_encode($manifest, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR)."\n";
|
||||
$hash = hash('sha256', $bytes);
|
||||
$directory = $output.'/'.substr($hash, 0, 16).'/bundle';
|
||||
foreach ($bodies + ['manifest.json' => $bytes] as $path => $body) {
|
||||
$file = $directory.'/'.$path;
|
||||
if (is_link($file) || (is_file($file) && ! hash_equals(hash('sha256', $body), hash_file('sha256', $file)))) {
|
||||
throw new LogicException('Immutable workflow candidate differs.');
|
||||
}
|
||||
if (! is_dir(dirname($file))) {
|
||||
mkdir(dirname($file), 0700, true);
|
||||
}
|
||||
if (! is_file($file)) {
|
||||
file_put_contents($file, $body);
|
||||
}
|
||||
if (! hash_equals(hash('sha256', $body), hash_file('sha256', $file))) {
|
||||
throw new LogicException('Incomplete workflow candidate.');
|
||||
}
|
||||
}
|
||||
|
||||
return ['directory' => $directory, 'sha256' => $hash, 'predecessor_sha256' => $baseHash, 'updated_sources' => array_intersect_key($manifest['originals'], array_flip($updates))];
|
||||
}
|
||||
|
||||
private static function path(string $path): void
|
||||
{
|
||||
if (! preg_match('~^(app|fortify)/[A-Za-z0-9_/]+\.php$~D', $path)) {
|
||||
throw new LogicException('Unsafe workflow path.');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
/** Read-only comparison: an accepted old bundle is not evidence of current workflow equivalence. */
|
||||
final class SgfWorkflowInventory
|
||||
{
|
||||
public static function inspect(string $source, string $bundle, string $manifestHash, array $processes): array
|
||||
{
|
||||
if (! preg_match('/^[a-f0-9]{64}$/D', $manifestHash)) {
|
||||
throw new RuntimeException('Manifest hash required.');
|
||||
}
|
||||
$manifestPath = self::file($bundle, 'manifest.json');
|
||||
if (! hash_equals($manifestHash, hash_file('sha256', $manifestPath))) {
|
||||
throw new RuntimeException('Unrecognised workflow manifest.');
|
||||
}
|
||||
$manifest = json_decode(file_get_contents($manifestPath), true, 64, JSON_THROW_ON_ERROR);
|
||||
if (! is_array($manifest['files'] ?? null) || ! is_array($manifest['originals'] ?? null)) {
|
||||
throw new RuntimeException('Original and distributed hashes required.');
|
||||
}
|
||||
// Check the whole supplied bundle, including dependencies outside the process selection.
|
||||
foreach ($manifest['files'] as $path => $hash) {
|
||||
if (! is_string($hash) || ! preg_match('/^[a-f0-9]{64}$/D', $hash)
|
||||
|| ! hash_equals($hash, hash_file('sha256', self::file($bundle, $path)))) {
|
||||
throw new RuntimeException('Workflow bundle integrity failure.');
|
||||
}
|
||||
}
|
||||
$result = [];
|
||||
foreach ($processes as $process => $paths) {
|
||||
$components = [];
|
||||
foreach ($paths as $path) {
|
||||
self::relative($path);
|
||||
$current = is_file($source.'/'.$path) ? hash_file('sha256', self::file($source, $path)) : null;
|
||||
$original = $manifest['originals'][$path] ?? null;
|
||||
if ($original !== null && (! is_string($original) || ! preg_match('/^[a-f0-9]{64}$/D', $original))) {
|
||||
throw new RuntimeException('Invalid original source hash.');
|
||||
}
|
||||
$status = $current === null ? 'source_missing' : ($original === null || ! isset($manifest['files'][$path])
|
||||
? 'not_transferred' : (hash_equals($original, $current) ? 'source_unchanged' : 'source_changed'));
|
||||
$components[$path] = ['status' => $status, 'source_sha256' => $current, 'accepted_source_sha256' => $original];
|
||||
}
|
||||
$result[$process] = ['source_equivalent' => $components !== [] && count(array_filter($components, fn ($entry) => $entry['status'] !== 'source_unchanged')) === 0, 'components' => $components];
|
||||
}
|
||||
|
||||
return ['format' => 'tempo.sgf-workflow-inventory.v1', 'manifest_sha256' => $manifestHash,
|
||||
'bundle_integrity' => true, 'read_only' => true, 'functional_acceptance' => false, 'processes' => $result];
|
||||
}
|
||||
|
||||
private static function relative(string $path): void
|
||||
{
|
||||
if (! preg_match('#^[A-Za-z0-9_.-]+(?:/[A-Za-z0-9_.-]+)*$#D', $path)
|
||||
|| in_array('..', explode('/', $path), true) || in_array('.', explode('/', $path), true)) {
|
||||
throw new RuntimeException('Invalid workflow path.');
|
||||
}
|
||||
}
|
||||
|
||||
private static function file(string $root, string $path): string
|
||||
{
|
||||
self::relative($path);
|
||||
if (is_link($root)) {
|
||||
throw new RuntimeException('Workflow links are forbidden.');
|
||||
}
|
||||
$base = realpath($root);
|
||||
$file = realpath($root.'/'.$path);
|
||||
$cursor = $root;
|
||||
foreach (explode('/', $path) as $part) {
|
||||
$cursor .= '/'.$part;
|
||||
if (is_link($cursor)) {
|
||||
throw new RuntimeException('Workflow links are forbidden.');
|
||||
}
|
||||
}
|
||||
if (! $base || ! $file || ! is_file($file)
|
||||
|| ! str_starts_with(strtolower($file), strtolower($base.DIRECTORY_SEPARATOR))) {
|
||||
throw new RuntimeException('Workflow file outside the supplied root or missing.');
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,273 @@
|
||||
<?php
|
||||
|
||||
// Prepare and rehearse files only. Never boots Laravel, connects to a DB or installs a destination.
|
||||
require dirname(__DIR__).'/integrations/sgf/operational/CodeDeployment.php';
|
||||
|
||||
use Tempo\Purchasing\Delivery\CodeDeployment;
|
||||
|
||||
if ($argc !== 6) {
|
||||
throw new InvalidArgumentException('Pass review directory/hash, compatibility directory/hash and the exact SGF baseline Git commit.');
|
||||
}
|
||||
$root = dirname(__DIR__);
|
||||
$host = realpath($root.'/../sgf-tempo');
|
||||
$review = realpath($argv[1]);
|
||||
$reviewHash = $argv[2];
|
||||
$compat = realpath($argv[3]);
|
||||
$compatHash = $argv[4];
|
||||
$commit = $argv[5];
|
||||
$inside = fn ($path, $base) => $path && $base && str_starts_with(strtolower(str_replace('\\', '/', $path)), strtolower(str_replace('\\', '/', $base)).'/');
|
||||
if (! $host || ! $inside($review, realpath($host.'/storage/framework/testing/merchandise-invoices-20261130/review'))
|
||||
|| ! $inside($compat, realpath($root.'/storage/app/private/candidates')) || ! preg_match('/^[a-f0-9]{40}$/D', $commit)
|
||||
|| ! preg_match('/^[a-f0-9]{64}$/D', $reviewHash) || ! preg_match('/^[a-f0-9]{64}$/D', $compatHash)) {
|
||||
throw new LogicException('Explicit private sources and baseline required.');
|
||||
}
|
||||
$git = function (array $arguments) use ($host): array {
|
||||
$process = proc_open(['git', '-C', $host, ...$arguments], [0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']], $pipes);
|
||||
if (! is_resource($process)) {
|
||||
throw new RuntimeException('Cannot read Git baseline.');
|
||||
}
|
||||
fclose($pipes[0]);
|
||||
$out = stream_get_contents($pipes[1]);
|
||||
$error = stream_get_contents($pipes[2]);
|
||||
fclose($pipes[1]);
|
||||
fclose($pipes[2]);
|
||||
|
||||
return [proc_close($process), $out, $error];
|
||||
};
|
||||
[$status, $resolved] = $git(['rev-parse', $commit.'^{commit}']);
|
||||
if ($status !== 0 || trim($resolved) !== $commit) {
|
||||
throw new LogicException('Baseline commit does not exist.');
|
||||
}
|
||||
$blob = function (string $path) use ($git, $commit): ?string {
|
||||
[$status, $text] = $git(['cat-file', 'blob', $commit.':'.$path]);
|
||||
if ($status === 128) {
|
||||
return null;
|
||||
}
|
||||
if ($status !== 0) {
|
||||
throw new RuntimeException('Cannot resolve baseline file: '.$path);
|
||||
}
|
||||
|
||||
return $text;
|
||||
};
|
||||
$read = function (string $directory, string $hash): array {
|
||||
$text = file_get_contents($directory.'/manifest.json');
|
||||
if (! hash_equals($hash, hash('sha256', $text))) {
|
||||
throw new LogicException('Source manifest changed.');
|
||||
}
|
||||
|
||||
return json_decode($text, true, 64, JSON_THROW_ON_ERROR);
|
||||
};
|
||||
$reviewManifest = $read($review, $reviewHash);
|
||||
$compatManifest = $read($compat, $compatHash);
|
||||
if ($reviewManifest['format'] !== 'tempo.integration-review.v1' || $reviewManifest['installable'] !== false || $compatManifest['format'] !== 'tempo.operational-review.v1') {
|
||||
throw new LogicException('Unexpected preparation source.');
|
||||
}
|
||||
(new ReflectionMethod(CodeDeployment::class, 'manifest'))->invoke(new CodeDeployment($host), $compat, $compatHash);
|
||||
$bodies = [];
|
||||
$runtime = [];
|
||||
foreach ($compatManifest['support_files'] as $file => $hash) {
|
||||
$bodies[$file] = file_get_contents($compat.'/'.$file);
|
||||
}
|
||||
if (! isset($bodies['integrations/sgf/operational/CodeDeployment.php'])
|
||||
|| ! hash_equals(hash('sha256', $bodies['integrations/sgf/operational/CodeDeployment.php']), hash_file('sha256', $root.'/integrations/sgf/operational/CodeDeployment.php'))) {
|
||||
throw new LogicException('Refresh compatibility preparation with the tested deployment contract.');
|
||||
}
|
||||
foreach ($reviewManifest['files'] as $file => $hash) {
|
||||
if (str_contains($file, '..') || ! preg_match('~^[A-Za-z0-9_./-]+$~D', $file) || is_link($review.'/'.$file)
|
||||
|| ! $inside(realpath($review.'/'.$file), $review) || ! hash_equals($hash, hash_file('sha256', $review.'/'.$file))) {
|
||||
throw new LogicException('Review source changed.');
|
||||
}
|
||||
$body = file_get_contents($review.'/'.$file);
|
||||
if (str_starts_with($file, 'sgf/')) {
|
||||
$runtime[substr($file, 4)] = $body;
|
||||
} elseif (str_starts_with($file, 'shared/general-ledger/')) {
|
||||
$runtime['packages/general-ledger/'.substr($file, strlen('shared/general-ledger/'))] = $body;
|
||||
} elseif (str_starts_with($file, 'shared/purchasing/src/')) {
|
||||
$destination = 'packages/purchasing/src/'.substr($file, strlen('shared/purchasing/src/'));
|
||||
if (! isset($bodies[$destination]) || ! hash_equals(hash('sha256', $body), hash('sha256', $bodies[$destination]))) {
|
||||
throw new LogicException('Common calculation sources disagree.');
|
||||
}
|
||||
}
|
||||
}
|
||||
// The compiled frontend may contain only the baseline plus explicitly reviewed changes.
|
||||
foreach (['diff', 'ls-files'] as $mode) {
|
||||
$arguments = $mode === 'diff' ? ['diff', '--name-only', $commit, '--', 'resources', 'package.json', 'vite.config.js'] : ['ls-files', '--others', '--exclude-standard', '--', 'resources'];
|
||||
[$status, $paths] = $git($arguments);
|
||||
if ($status !== 0) {
|
||||
throw new RuntimeException('Cannot freeze frontend sources.');
|
||||
}
|
||||
foreach (array_filter(explode("\n", trim($paths))) as $file) {
|
||||
if (! isset($runtime[$file]) || ! hash_equals(hash('sha256', $runtime[$file]), hash_file('sha256', $host.'/'.$file))) {
|
||||
throw new LogicException('Unreviewed frontend change: '.$file);
|
||||
}
|
||||
}
|
||||
}
|
||||
$overlays = [];
|
||||
$beforeBodies = [];
|
||||
$developmentBuild = [];
|
||||
foreach ($runtime as $file => $body) {
|
||||
if (! isset($compatManifest['host_overlays'][$file])) {
|
||||
$bodies[$file] = $body;
|
||||
} elseif ($compatManifest['host_overlays'][$file]['before_sha256'] !== hash('sha256', $body)) {
|
||||
throw new LogicException('Merged overlay used another source: '.$file);
|
||||
}
|
||||
}
|
||||
foreach (array_unique([...array_keys($runtime), ...array_keys($compatManifest['host_overlays'])]) as $file) {
|
||||
$before = $blob($file);
|
||||
if ($file === 'public/build/manifest.json' && $before === null) {
|
||||
$before = file_get_contents($host.'/'.$file);
|
||||
$developmentBuild[$file] = hash('sha256', $before);
|
||||
}
|
||||
if (isset($compatManifest['host_overlays'][$file]) && ! isset($runtime[$file])) {
|
||||
$checkout = file_get_contents($host.'/'.$file);
|
||||
if ($before === null || hash('sha256', $checkout) !== $compatManifest['host_overlays'][$file]['before_sha256']
|
||||
|| str_replace("\r\n", "\n", $before) !== str_replace("\r\n", "\n", $checkout)) {
|
||||
throw new LogicException('Compatibility overlay contains an unreviewed baseline change: '.$file);
|
||||
}
|
||||
}
|
||||
$beforeBodies[$file] = $before;
|
||||
$overlays[$file] = ['before_sha256' => $before === null ? null : hash('sha256', $before), 'after_sha256' => hash('sha256', $bodies[$file])];
|
||||
}
|
||||
$bodies['scripts/merchandise-delivery-metadata.json'] = json_encode(['baseline_git_commit' => $commit, 'baseline_bytes' => 'canonical_git_blobs_and_explicit_development_build_manifest',
|
||||
'development_build_baseline' => $developmentBuild, 'operational_destination_verified' => false, 'source_review_manifest_sha256' => $reviewHash,
|
||||
'source_compatibility_manifest_sha256' => $compatHash, 'installed' => false, 'activated' => false, 'schema_installed' => false,
|
||||
'core_pointer_preserved' => '0.1.1', 'operational_schema_receipt_required' => true], JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR);
|
||||
ksort($bodies);
|
||||
ksort($overlays);
|
||||
$files = array_map(fn ($body) => hash('sha256', $body), $bodies);
|
||||
$added = [];
|
||||
$schema = [];
|
||||
foreach ($overlays as $file => $entry) {
|
||||
$added[$file] = $entry['before_sha256'];
|
||||
}
|
||||
foreach ($files as $file => $hash) {
|
||||
if (str_starts_with($file, 'database/') || preg_match('~Schema\.php$~D', $file)
|
||||
|| in_array($file, ['integrations/sgf/access/AccessOverlay.php', 'integrations/sgf/operational/SqlPrivileges.php', 'integrations/sgf/operational/Installation.php', 'integrations/sgf/operational/budget-contract.json'], true)) {
|
||||
$schema[$file] = ['before' => null, 'after' => $hash];
|
||||
}
|
||||
}
|
||||
$manifest = ['format' => 'tempo.operational-review.v2', 'support_files' => $files, 'host_overlays' => $overlays,
|
||||
'composition_transition' => ['from_manifest_sha256' => null, 'added_files' => $added, 'schema_files' => $schema]];
|
||||
$manifestText = json_encode($manifest, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR)."\n";
|
||||
$hash = hash('sha256', $manifestText);
|
||||
$directory = $root.'/storage/app/private/candidates/MERCHANDISE-V2-'.substr($hash, 0, 16);
|
||||
$write = function (string $path, string $body): void {
|
||||
if (is_file($path) && ! hash_equals(hash('sha256', $body), hash_file('sha256', $path))) {
|
||||
throw new LogicException('Preserve immutable preparation.');
|
||||
}
|
||||
if (! is_dir(dirname($path))) {
|
||||
mkdir(dirname($path), 0700, true);
|
||||
}
|
||||
if (! is_file($path) && file_put_contents($path, $body) !== strlen($body)) {
|
||||
throw new RuntimeException('Incomplete file.');
|
||||
}
|
||||
};
|
||||
foreach ($bodies + ['manifest.json' => $manifestText] as $file => $body) {
|
||||
$write($directory.'/'.$file, $body);
|
||||
}
|
||||
// File-only recovery rehearsal. This synthetic receipt is never included in the candidate.
|
||||
$copy = $root.'/storage/framework/testing/merchandise-v2-'.bin2hex(random_bytes(6));
|
||||
foreach ($beforeBodies as $file => $body) {
|
||||
if ($body !== null) {
|
||||
$write($copy.'/'.$file, $body);
|
||||
}
|
||||
}
|
||||
$pointer = file_get_contents($host.'/packages/purchasing/current.json');
|
||||
if (json_decode($pointer, true, 16, JSON_THROW_ON_ERROR)['version'] !== '0.1.1') {
|
||||
throw new LogicException('Preserve the known module version.');
|
||||
}
|
||||
$write($copy.'/packages/purchasing/current.json', $pointer);
|
||||
$write($copy.'/storage/framework/down', '{}');
|
||||
if (! is_dir($copy.'/bootstrap/cache')) {
|
||||
mkdir($copy.'/bootstrap/cache', 0700, true);
|
||||
}
|
||||
$copy = str_replace('\\', '/', realpath($copy));
|
||||
$receipt = ['from_manifest_sha256' => null, 'to_manifest_sha256' => $hash, 'host' => $copy, 'schema_verified' => true, 'changes' => $schema, 'synthetic_code_only_test' => true];
|
||||
$write($copy.'/storage/app/private/module-deployments/schema-transition-'.$hash.'.json', json_encode($receipt, JSON_THROW_ON_ERROR));
|
||||
$deploy = new CodeDeployment($copy);
|
||||
$plan = $deploy->plan($directory, $hash);
|
||||
$result = $deploy->apply($directory, $hash, $plan['target_sha256'], 'Synthetic file-copy rehearsal', true);
|
||||
$checks = 0;
|
||||
foreach ($overlays as $file => $entry) {
|
||||
if (hash_file('sha256', $copy.'/'.$file) !== $entry['after_sha256']) {
|
||||
throw new LogicException('Applied bytes differ.');
|
||||
} $checks++;
|
||||
}
|
||||
if (! $deploy->apply($directory, $hash, $plan['target_sha256'], 'Synthetic replay', true)['replayed']) {
|
||||
throw new LogicException('Replay failed.');
|
||||
} $checks++;
|
||||
$deploy->rollback($result['deployment_id'], 'Synthetic file recovery', true);
|
||||
foreach ($overlays as $file => $entry) {
|
||||
$actual = is_file($copy.'/'.$file) ? hash_file('sha256', $copy.'/'.$file) : null;
|
||||
if ($actual !== $entry['before_sha256']) {
|
||||
throw new LogicException('Original bytes or absence not restored.');
|
||||
} $checks++;
|
||||
}
|
||||
if (file_get_contents($host.'/packages/purchasing/current.json') !== $pointer || file_get_contents($copy.'/packages/purchasing/current.json') !== $pointer) {
|
||||
throw new LogicException('Module pointer changed.');
|
||||
} $checks++;
|
||||
$runPhp = function (string $script): string {
|
||||
$process = proc_open([PHP_BINARY, '-r', $script], [0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']], $pipes);
|
||||
if (! is_resource($process)) {
|
||||
throw new RuntimeException('Cannot qualify the delivered code.');
|
||||
}
|
||||
fclose($pipes[0]);
|
||||
$out = stream_get_contents($pipes[1]);
|
||||
$error = stream_get_contents($pipes[2]);
|
||||
fclose($pipes[1]);
|
||||
fclose($pipes[2]);
|
||||
if (proc_close($process) !== 0) {
|
||||
throw new RuntimeException('Delivered code qualification failed: '.$error);
|
||||
}
|
||||
|
||||
return $out;
|
||||
};
|
||||
$script = 'require '.var_export($directory.'/integrations/sgf/operational/CodeDeployment.php', true).';'
|
||||
.'$deploy=new Tempo\\Purchasing\\Delivery\\CodeDeployment('.var_export($copy, true).');'
|
||||
.'$plan=$deploy->plan('.var_export($directory, true).','.var_export($hash, true).'); echo json_encode($plan["writes"]);';
|
||||
if ($runPhp($script) !== 'false') {
|
||||
throw new LogicException('Bundled updater does not accept its own candidate.');
|
||||
}
|
||||
$checks++;
|
||||
$script = 'require '.var_export($host.'/vendor/autoload.php', true).';'
|
||||
.'Illuminate\\Container\\Container::getInstance()->instance("config",new Illuminate\\Config\\Repository(["merchandise_invoices"=>["costs_enabled"=>true],"purchasing-internal"=>["candidate_enabled"=>false]]));'
|
||||
.'require '.var_export($directory.'/bootstrap.php', true).';'
|
||||
.'if(config("purchasing-internal.candidate_enabled")!==false)throw new RuntimeException("Code activated requisitions");'
|
||||
.'$result=Tempo\\Purchasing\\Inventory\\StockCosting::project("fifo",["reference"=>"synthetic-opening","quantity_milli"=>3000,"value_minor"=>100,"layers"=>[["quantity_milli"=>3000,"value_minor"=>100]]],'
|
||||
.'[["id"=>1,"reference"=>"synthetic-issue","kind"=>"issue","quantity_milli"=>1000],["id"=>2,"reference"=>"synthetic-final","kind"=>"issue","quantity_milli"=>2000]],"half_up_final_balance");'
|
||||
.'if($result["movements"][0]["value"]["amount_minor"]!=="33"||$result["movements"][1]["value"]["amount_minor"]!=="67")throw new RuntimeException("Calculation mismatch");echo "BOOT_AND_COST_OK";';
|
||||
if ($runPhp($script) !== 'BOOT_AND_COST_OK') {
|
||||
throw new LogicException('Incomplete candidate bootstrap.');
|
||||
}
|
||||
$checks++;
|
||||
$archive = $root.'/storage/app/private/candidate-archives/'.basename($directory).'.zip';
|
||||
$zip = new ZipArchive;
|
||||
if (! is_file($archive)) {
|
||||
$temporary = $archive.'.'.bin2hex(random_bytes(4)).'.next';
|
||||
if ($zip->open($temporary, ZipArchive::CREATE | ZipArchive::EXCL) !== true) {
|
||||
throw new RuntimeException('Cannot prepare archive.');
|
||||
}
|
||||
foreach (array_keys($bodies + ['manifest.json' => $manifestText]) as $file) {
|
||||
$zip->addFile($directory.'/'.$file, $file);
|
||||
$zip->setMtimeName($file, 946684800);
|
||||
}
|
||||
if (! $zip->close() || ! rename($temporary, $archive)) {
|
||||
throw new RuntimeException('Cannot finish archive.');
|
||||
}
|
||||
}
|
||||
if ($zip->open($archive, ZipArchive::RDONLY) !== true || $zip->numFiles !== count($bodies) + 1) {
|
||||
throw new LogicException('Unexpected archive.');
|
||||
}
|
||||
foreach ($bodies + ['manifest.json' => $manifestText] as $file => $body) {
|
||||
if (! hash_equals(hash('sha256', $body), hash('sha256', $zip->getFromName($file)))) {
|
||||
throw new LogicException('Archive bytes differ.');
|
||||
}
|
||||
}
|
||||
$zip->close();
|
||||
$proof = ['passed' => true, 'checks' => $checks, 'candidate' => basename($directory), 'manifest_sha256' => $hash, 'archive_sha256' => hash_file('sha256', $archive),
|
||||
'bundled_updater_qualified' => true, 'bundled_bootstrap_and_cost_qualified' => true, 'bootstrap_did_not_enable_requisitions' => true,
|
||||
'baseline_git_commit' => $commit, 'code_copy' => $copy, 'schema_or_data_recovery_qualified' => false, 'synthetic_schema_receipt_only' => true,
|
||||
'database_connected' => false, 'destination_installed' => false, 'pointer_preserved' => '0.1.1', 'published' => false];
|
||||
$write($copy.'/recovery-result.json', json_encode($proof, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
|
||||
echo json_encode(['directory' => $directory, 'archive' => $archive, 'manifest_sha256' => $hash, 'archive_sha256' => $proof['archive_sha256'],
|
||||
'files' => count($files), 'host_overlays' => count($overlays), 'schema_sources_requiring_receipt' => count($schema), 'checks' => $checks, 'proof' => $copy.'/recovery-result.json', 'installed' => false], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR)."\n";
|
||||
@@ -18,7 +18,7 @@ $frontend = AdminUiOverlay::prepare($host, $files);
|
||||
$files = $frontend['files'];
|
||||
$root = dirname(__DIR__);
|
||||
$support = [];
|
||||
foreach (['integrations/sgf/operational', 'integrations/sgf/access', 'integrations/sgf/internal-requisitions', 'packages/purchasing/src'] as $directory) {
|
||||
foreach (['integrations/sgf/operational', 'integrations/sgf/access', 'integrations/sgf/internal-requisitions', 'integrations/sgf/sourcing', 'packages/purchasing/src'] as $directory) {
|
||||
foreach (new DirectoryIterator($root.'/'.$directory) as $file) {
|
||||
if ($file->isFile() && ! $file->isLink()) {
|
||||
$support[$directory.'/'.$file->getFilename()] = file_get_contents($file->getPathname());
|
||||
|
||||
@@ -128,9 +128,9 @@ if ($action === 'prepare') {
|
||||
$budget = $db->table('cb_budgets')->first();
|
||||
$decision = $db->table('ir_steps')->first();
|
||||
$report = ['passed' => true, 'identity' => $identity, 'scope' => '1:1:1', 'added_grants' => $added, 'existing_grants_preserved' => true, 'existing_accounts_preserved' => true, 'single_approved_request' => true, 'single_reservation' => true, 'reservation' => $db->table('cb_budget_entries')->where('kind', 'reserve')->first(), 'budget' => $budget, 'decision' => $decision, 'pointer_preserved' => true, 'backup_sha256' => $baseline['backup_sha256'], 'recovery_directory' => $recovery, 'checked_at' => gmdate('c'), 'owner_runtime_limitation' => true, 'visual_review' => false, 'read_only_record_visibility_limitation' => true];
|
||||
file_put_contents($root.'/docs/proofs/sgf-demo-8039-delivery.json',json_encode($report,JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
|
||||
file_put_contents($host.'/config/purchasing-access.php','<?php return ["initialisation_scopes"=>[]];');
|
||||
echo json_encode($report,JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR);
|
||||
file_put_contents($root.'/docs/proofs/sgf-demo-8039-delivery.json', json_encode($report, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
|
||||
file_put_contents($host.'/config/purchasing-access.php', '<?php return ["initialisation_scopes"=>[]];');
|
||||
echo json_encode($report, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR);
|
||||
} else {
|
||||
throw new RuntimeException('Use prepare, install or verify');
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ $fingerprints = function () use ($db) {
|
||||
$hashes[$t->tablename] = hash('sha256', json_encode(array_column($rows, 'data'), JSON_THROW_ON_ERROR));
|
||||
}
|
||||
|
||||
return $hashes;
|
||||
return $hashes;
|
||||
});
|
||||
};
|
||||
$action = $argv[1] ?? '';
|
||||
@@ -97,11 +97,11 @@ if ($action === 'prepare') {
|
||||
} elseif (in_array($action, ['apply', 'reapply'], true)) {
|
||||
$plan = $deploy->plan($candidate['directory'], $candidate['archive']['manifest_sha256']);
|
||||
$result = $deploy->apply($candidate['directory'], $candidate['archive']['manifest_sha256'], $plan['target_sha256'], 'Authorised read-only visibility correction 8039', true);
|
||||
file_put_contents($recovery.'/'.($action === 'apply' ? 'applied' : 'reapplied').'.json',json_encode($result,JSON_PRETTY_PRINT));
|
||||
file_put_contents($recovery.'/'.($action === 'apply' ? 'applied' : 'reapplied').'.json', json_encode($result, JSON_PRETTY_PRINT));
|
||||
} else {
|
||||
throw new RuntimeException('Use prepare/apply/rollback/reapply/verify');
|
||||
}
|
||||
unlink($host.'/storage/framework/down');
|
||||
echo json_encode($result,JSON_PRETTY_PRINT);
|
||||
echo json_encode($result, JSON_PRETTY_PRINT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,5 +38,5 @@ foreach ([...array_keys($payload), 'manifest.json'] as $path) {
|
||||
}
|
||||
$zip->close();
|
||||
$result = ['directory' => $dir, 'archive' => ['file' => $archive, 'sha256' => hash_file('sha256', $archive), 'manifest_sha256' => hash('sha256', $manifestText)], 'prior_manifest_sha256' => $prior['artifact']['archive']['manifest_sha256'], 'changed_files' => [$file], 'schema_changed' => false, 'rights_changed' => false, 'installed_real' => false];
|
||||
file_put_contents($root.'/docs/proofs/sgf-read-candidate.json', json_encode($result,JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
|
||||
echo json_encode($result,JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR);
|
||||
file_put_contents($root.'/docs/proofs/sgf-read-candidate.json', json_encode($result, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
|
||||
echo json_encode($result, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR);
|
||||
|
||||
@@ -66,5 +66,5 @@ $check($ok['confirmed']['confirmed_by'] === 4 && $ok['confirmed']['proposal']['p
|
||||
$deny(fn () => $step($ok, 1, 'quote', []), 409, 'Confirmed process cannot be rewritten');
|
||||
$check($state['proposals'][0]['comparison']['fingerprint'] === $comparison['fingerprint'], 'Comparison snapshot and justification preserved');
|
||||
$report = ['passed' => true, 'checks' => $checks, 'synthetic_only' => true, 'persistent_demo_accounts_created' => false, 'checked_at' => gmdate('c')];
|
||||
file_put_contents(dirname(__DIR__).'/docs/proofs/sgf-sourcing-core.json',json_encode($report,JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
|
||||
echo json_encode($report,JSON_PRETTY_PRINT);
|
||||
file_put_contents(dirname(__DIR__).'/docs/proofs/sgf-sourcing-core.json', json_encode($report, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
|
||||
echo json_encode($report, JSON_PRETTY_PRINT);
|
||||
|
||||
@@ -153,12 +153,12 @@ try {
|
||||
throw new RuntimeException('Incomplete comparison must not be awarded');
|
||||
}
|
||||
$report = ['passed' => true, 'identity' => $identity, 'scope' => '1:1:1', 'candidate' => $candidate, 'protected_users_requisition_reservation_consumption_unchanged' => true, 'previous_grants_preserved' => true, 'new_grants' => $new, 'persistent_accounts_created' => false, 'proposals' => 0, 'confirmed' => false, 'suppliers_selected' => count($state['suppliers']), 'quotations' => count($state['quotes']), 'pending' => 'Second eligible evaluator and independent confirmer absent; no account created by owner decision.', 'backup_sha256' => $baseline['backup_sha256'], 'recovery_directory' => $recovery, 'checked_at' => gmdate('c')];
|
||||
file_put_contents($root.'/docs/proofs/sgf-sourcing-demo.json',json_encode($report,JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
|
||||
echo json_encode($report,JSON_PRETTY_PRINT);
|
||||
file_put_contents($root.'/docs/proofs/sgf-sourcing-demo.json', json_encode($report, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
|
||||
echo json_encode($report, JSON_PRETTY_PRINT);
|
||||
} else {
|
||||
throw new RuntimeException('Use prepare/apply/verify');
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
fwrite(STDERR,$e->getMessage()."\n");
|
||||
fwrite(STDERR, $e->getMessage()."\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -60,6 +60,6 @@ try {
|
||||
file_put_contents($host.'/storage/app/private/module-deployments/schema-transition-'.$manifestHash.'.json', json_encode($receipt, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
|
||||
echo json_encode($result + ['activated' => false, 'rights_granted' => false], JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR);
|
||||
} catch (Throwable $e) {
|
||||
fwrite(STDERR,$e->getMessage()."\n");
|
||||
fwrite(STDERR, $e->getMessage()."\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
// No Laravel bootstrap, connection, command execution or application configuration mutation.
|
||||
require __DIR__.'/lib/SgfWorkflowInventory.php';
|
||||
if ($argc !== 3) {
|
||||
fwrite(STDERR, "Usage: php scripts/sgf-workflow-inventory.php <accepted-bundle> <manifest-sha256>\n");
|
||||
exit(2);
|
||||
}
|
||||
$processes = [
|
||||
'context_permissions' => ['app/Services/WorkContext.php', 'app/Models/Concerns/HasWorkContext.php', 'app/Services/CurrentActor.php', 'app/Services/OrganizationAccess.php'],
|
||||
'requisition_budget' => ['app/Services/RequisitionWorkflow.php', 'app/Services/BudgetWorkflow.php', 'app/Services/InternalRequisitionPort.php', 'app/Models/Requisition.php'],
|
||||
'sourcing_award' => ['app/Services/PurchaseWorkflow.php', 'app/Services/ProposalComparison.php', 'app/Services/ConflictGuard.php', 'app/Services/ConflictReleases.php'],
|
||||
'orders_receipts' => ['app/Services/ReceiptWorkflow.php', 'app/Services/OrderCancellationWorkflow.php', 'app/Policies/GoodsReceiptPolicy.php', 'app/Services/ReceiptDocuments.php'],
|
||||
'obligations' => ['app/Services/InvoiceWorkflow.php', 'app/Services/SupplierPayables.php'],
|
||||
'warehouse' => ['app/Services/StockWorkflow.php', 'app/Services/WarehouseRequests.php', 'app/Services/WarehouseReservations.php', 'app/Services/WarehouseFulfilment.php'],
|
||||
'replenishment' => ['app/Services/SupplyPlanning.php', 'app/Services/SupplySuggestions.php', 'app/Services/AutomaticPurchases.php'],
|
||||
];
|
||||
try {
|
||||
echo json_encode(SgfWorkflowInventory::inspect(dirname(__DIR__), $argv[1], $argv[2], $processes), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR).PHP_EOL;
|
||||
} catch (Throwable $error) {
|
||||
fwrite(STDERR, $error->getMessage().PHP_EOL);
|
||||
exit(1);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"started_at": "2026-11-30T10:38:47+00:00",
|
||||
"finished_at": "2026-11-30T10:38:47+00:00",
|
||||
"started_at": "2026-11-30T21:03:46+00:00",
|
||||
"finished_at": "2026-11-30T21:03:47+00:00",
|
||||
"scope": "SGC replenishment command",
|
||||
"result": "passed",
|
||||
"exit_code": 0,
|
||||
|
||||
@@ -154,6 +154,6 @@ final class CommonReceiptStockTest extends TestCase
|
||||
file_put_contents($root.'/receipt-results.json', json_encode(['identity' => $i, 'physical_accepted_milli' => 4000, 'rejected_milli' => 2000, 'movement_count_main' => 1,
|
||||
'source_version_stale_refused' => true, 'core_replay_same_movement' => true, 'fault_atomic_and_recovered' => true, 'concurrency' => ['actual_lock_wait' => true, 'wait_event' => $wait->wait_event, 'same_receipt' => true, 'one_movement' => true],
|
||||
'link' => ['tenant' => (int) $f['tenant']->id, 'warehouse' => (int) $f['warehouse']->id, 'item' => (int) $f['stock']->id, 'movement' => (int) $movement->id, 'reference' => $movement->snapshot['reference']],
|
||||
'writer_manifest_sha256' => hash_file('sha256',base_path('packages/inventory-write/releases/0.1.0/manifest.json'))], JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
|
||||
'writer_manifest_sha256' => hash_file('sha256', base_path('packages/inventory-write/releases/0.1.0/manifest.json'))], JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,10 +13,13 @@ use App\Models\Supplier;
|
||||
use App\Models\Tenant;
|
||||
use App\Models\User;
|
||||
use App\Services\ConflictGuard;
|
||||
use App\Services\ConflictReleases;
|
||||
use App\Services\RequisitionWorkflow;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
use Inertia\Testing\AssertableInertia as Assert;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Tempo\Purchasing\Composition\ExecutionContext;
|
||||
|
||||
function personalConflict(int $supplierId, ?int $requisitionId = null, bool $hasConflict = true): array
|
||||
{
|
||||
@@ -382,3 +385,38 @@ test('guests cannot consult or submit declarations', function () {
|
||||
$this->get('/conflitos')->assertRedirect('/login');
|
||||
$this->post('/conflitos', personalConflict($this->supplier->id))->assertRedirect('/login');
|
||||
});
|
||||
|
||||
test('composed conflict authority is scoped and never inferred from the environment', function () {
|
||||
require_once dirname(__DIR__, 2).'/packages/purchasing/src/ExecutionContext.php';
|
||||
$execution = new ExecutionContext;
|
||||
app()->instance(ExecutionContext::class, $execution);
|
||||
config(['conflict-releases.qa_enabled' => true]);
|
||||
$service = app(ConflictReleases::class);
|
||||
expect($service->ready())->toBeFalse();
|
||||
$this->post('/conflitos', personalConflict($this->supplier->id, $this->r->id))->assertSessionHasNoErrors();
|
||||
$declaration = ConflictDeclaration::query()->firstOrFail();
|
||||
configureConflictDirection($this->admin);
|
||||
$this->actingAs($this->admin);
|
||||
app()->instance('env', 'budget-testing');
|
||||
$metadata = ['contract' => $execution::CONTRACT, 'composition' => 'b4093c6f6707', 'operation' => 'purchasing_conflicts.authorise',
|
||||
'scope' => ['tenant_id' => 1, 'company_id' => 2, 'unit_id' => 2],
|
||||
'actor' => ['host_id' => 15, 'native_id' => $this->admin->id],
|
||||
'generation' => str_repeat('a', 64), 'schema_sha256' => str_repeat('b', 64),
|
||||
'workflow_sha256' => str_repeat('c', 64), 'features' => ['conflict-release' => []]];
|
||||
$input = ['operation_key' => (string) Str::uuid(), 'reason' => 'Autorização sintética de direcção no contexto composto.'];
|
||||
$before = $declaration->getAttributes();
|
||||
try {
|
||||
$execution->within($metadata, DB::connection(), fn () => null, function () use ($service, $input, $declaration) {
|
||||
expect($service->ready())->toBeTrue();
|
||||
$first = $service->authorise($this->admin, $declaration, $input);
|
||||
expect($service->authorise($this->admin, $declaration, $input)->id)->toBe($first->id)
|
||||
->and(ConflictRelease::query()->count())->toBe(1);
|
||||
DB::table('organization_memberships')->where('user_id', $this->admin->id)->delete();
|
||||
expect(fn () => $service->authorise($this->admin, $declaration, $input))->toThrow(HttpException::class);
|
||||
});
|
||||
expect($service->ready())->toBeFalse()->and($declaration->fresh()->getAttributes())->toBe($before);
|
||||
} finally {
|
||||
app()->instance('env', 'testing');
|
||||
app()->forgetInstance(ExecutionContext::class);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -273,11 +273,11 @@ final class NativePayablePageTest extends TestCase
|
||||
$pipes = [];
|
||||
$environment = getenv();
|
||||
$environment['COMMON_PAYABLES_PATH'] = base_path('packages/payables');
|
||||
$p = proc_open([PHP_BINARY, base_path('tests/Support/native-payable-page-worker.php'), $input],[0 => ['pipe', 'r'], 1 => ['file', $dir.'/stdout', 'w'], 2 => ['file', $dir.'/stderr', 'w']],$pipes,base_path(),$environment);
|
||||
$p = proc_open([PHP_BINARY, base_path('tests/Support/native-payable-page-worker.php'), $input], [0 => ['pipe', 'r'], 1 => ['file', $dir.'/stdout', 'w'], 2 => ['file', $dir.'/stderr', 'w']], $pipes, base_path(), $environment);
|
||||
$this->assertIsResource($p);
|
||||
fclose($pipes[0]);
|
||||
$this->assertSame(0,proc_close($p));
|
||||
$r = json_decode(file_get_contents($input.'.result'),true);
|
||||
$this->assertSame(503,$r['status']);
|
||||
$this->assertSame(0, proc_close($p));
|
||||
$r = json_decode(file_get_contents($input.'.result'), true);
|
||||
$this->assertSame(503, $r['status']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -562,16 +562,16 @@ final class WarehouseReturnIntegrationTest extends TestCase
|
||||
});
|
||||
$first = $this->getJson('/api/stock-returns')->assertOk()->assertJsonPath('pagination.total', 51)->assertJsonPath('pagination.last_page', 3)->assertJsonCount(25, 'rows')->json('rows');
|
||||
$capture = false;
|
||||
$this->assertLessThanOrEqual(4,count($queries));
|
||||
$second = $this->getJson('/api/stock-returns?page=2')->assertOk()->assertJsonCount(25,'rows')->json('rows');
|
||||
$this->assertEmpty(array_intersect(array_column($first,'id'),array_column($second,'id')));
|
||||
$this->assertGreaterThan($second[0]['id'],$first[24]['id']);
|
||||
$this->getJson('/api/stock-returns?page=3')->assertOk()->assertJsonCount(1,'rows');
|
||||
$this->assertLessThanOrEqual(4, count($queries));
|
||||
$second = $this->getJson('/api/stock-returns?page=2')->assertOk()->assertJsonCount(25, 'rows')->json('rows');
|
||||
$this->assertEmpty(array_intersect(array_column($first, 'id'), array_column($second, 'id')));
|
||||
$this->assertGreaterThan($second[0]['id'], $first[24]['id']);
|
||||
$this->getJson('/api/stock-returns?page=3')->assertOk()->assertJsonCount(1, 'rows');
|
||||
$this->actingAs($this->f['receiver']);
|
||||
$this->confirm($p)->assertOk();
|
||||
$this->getJson('/api/stock-returns?state=prepared')->assertOk()->assertJsonPath('pagination.total',50);
|
||||
$this->getJson('/api/stock-returns?state=confirmed')->assertOk()->assertJsonPath('pagination.total',1);
|
||||
$this->assertSame(8000,$this->balance());
|
||||
file_put_contents((string) getenv('STOCK_RECEIPT_ROOT').'/return-history-metrics.json',json_encode(['fixture_records' => 51, 'page_size' => 25, 'supply_record_selects_for_page' => count($queries), 'pages_disjoint' => true, 'state_filters_cover_latest_versions' => true, 'not_a_load_capacity_benchmark' => true],JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
|
||||
$this->getJson('/api/stock-returns?state=prepared')->assertOk()->assertJsonPath('pagination.total', 50);
|
||||
$this->getJson('/api/stock-returns?state=confirmed')->assertOk()->assertJsonPath('pagination.total', 1);
|
||||
$this->assertSame(8000, $this->balance());
|
||||
file_put_contents((string) getenv('STOCK_RECEIPT_ROOT').'/return-history-metrics.json', json_encode(['fixture_records' => 51, 'page_size' => 25, 'supply_record_selects_for_page' => count($queries), 'pages_disjoint' => true, 'state_filters_cover_latest_versions' => true, 'not_a_load_capacity_benchmark' => true], JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -385,13 +385,13 @@ final class SgfInvoiceDispatchesTest extends TestCase
|
||||
file_put_contents($this->privateRoot.'/screen-preview.html', $html);
|
||||
$this->post('/facturas/envio-sgf/1/operar', ['version' => 3, 'action' => 'confirm', 'reason' => 'Confirmar apenas este impacto mostrado.', 'approval_hash' => $match[1]])->assertRedirect('/facturas/envio-sgf/1');
|
||||
$done = $this->get('/facturas/envio-sgf/1')->assertOk()->assertSee('Recibo conservado')->assertDontSee('Confirmar individualmente')->assertSee('http://127.0.0.1:8085/compras?', false)->getContent();
|
||||
file_put_contents($this->privateRoot.'/screen-receipt.html',$done);
|
||||
self::assertCount(1,$this->remote);
|
||||
file_put_contents($this->privateRoot.'/screen-receipt.html', $done);
|
||||
self::assertCount(1, $this->remote);
|
||||
}
|
||||
|
||||
public function test_missing_schema_is_refused_without_activating_or_migrating(): void
|
||||
{
|
||||
$migration = require dirname(__DIR__,2).'/database/migrations/2026_11_10_000001_create_sgf_invoice_dispatches.php';
|
||||
$migration = require dirname(__DIR__, 2).'/database/migrations/2026_11_10_000001_create_sgf_invoice_dispatches.php';
|
||||
$migration->down();
|
||||
$this->get('/facturas/envio-sgf')->assertStatus(503);
|
||||
Http::assertNothingSent();
|
||||
@@ -402,8 +402,8 @@ final class SgfInvoiceDispatchesTest extends TestCase
|
||||
{
|
||||
$row = $this->prepared();
|
||||
$event = DB::table('sgf_invoice_dispatch_events')->orderByDesc('id')->first();
|
||||
$state = json_decode($event->after_state,true);
|
||||
self::assertSame(1,$state['preview_actor_id']);
|
||||
self::assertSame($row->source_context_hash,$state['source_context_hash']);
|
||||
$state = json_decode($event->after_state, true);
|
||||
self::assertSame(1, $state['preview_actor_id']);
|
||||
self::assertSame($row->source_context_hash, $state['source_context_hash']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,4 +38,4 @@ try {
|
||||
$result = ['status' => $e->getStatusCode()];
|
||||
}
|
||||
$result['elapsed_ms'] = round((hrtime(true) - $start) / 1e6, 3);
|
||||
file_put_contents($file.'.result', json_encode($result,JSON_THROW_ON_ERROR));
|
||||
file_put_contents($file.'.result', json_encode($result, JSON_THROW_ON_ERROR));
|
||||
|
||||
@@ -65,4 +65,4 @@ foreach (['equipment', 'part'] as $unsupported) {
|
||||
}
|
||||
$data = json_decode(DB::table('ir_requests')->where('id', $id)->value('data'), true, 32, JSON_THROW_ON_ERROR);
|
||||
$check(array_column($data['items'], 'purchase_type') === ['consumable', 'service', 'other'], 'approved lifecycle covers the three supported basic types');
|
||||
$check(DB::table('ir_requests')->count() === 1 && DB::table('cb_budget_entries')->where('kind','reserve')->count() === 1, 'unsupported types create neither a second request nor reservation');
|
||||
$check(DB::table('ir_requests')->count() === 1 && DB::table('cb_budget_entries')->where('kind', 'reserve')->count() === 1, 'unsupported types create neither a second request nor reservation');
|
||||
|
||||
@@ -126,6 +126,6 @@ try {
|
||||
throw new RuntimeException('Use setup/verify');
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
fwrite(STDERR,get_class($e).': '.$e->getMessage()."\n");
|
||||
fwrite(STDERR, get_class($e).': '.$e->getMessage()."\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -46,4 +46,4 @@ try {
|
||||
} catch (HttpExceptionInterface $e) {
|
||||
$out = ['status' => $e->getStatusCode()];
|
||||
}
|
||||
file_put_contents($file.'.result',json_encode($out,JSON_THROW_ON_ERROR));
|
||||
file_put_contents($file.'.result', json_encode($out, JSON_THROW_ON_ERROR));
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
use Tempo\Purchasing\Composition\ExecutionContext;
|
||||
|
||||
require_once dirname(__DIR__, 2).'/packages/purchasing/src/ExecutionContext.php';
|
||||
|
||||
function compositionDeclaration(): array
|
||||
{
|
||||
return ['contract' => ExecutionContext::CONTRACT, 'composition' => 'b4093c6f6707', 'operation' => 'purchasing_conflicts.authorise',
|
||||
'scope' => ['tenant_id' => 1, 'company_id' => 2, 'unit_id' => 2], 'actor' => ['host_id' => 15, 'native_id' => 1],
|
||||
'generation' => str_repeat('a', 64), 'schema_sha256' => str_repeat('b', 64), 'workflow_sha256' => str_repeat('c', 64),
|
||||
'features' => ['conflict-release' => []]];
|
||||
}
|
||||
|
||||
test('capability exists only within the checked connection and execution', function () {
|
||||
$context = new ExecutionContext;
|
||||
$db = new stdClass;
|
||||
$checks = 0;
|
||||
expect($context->allows('conflict-release', $db))->toBeFalse();
|
||||
$result = $context->within(compositionDeclaration(), $db, function () use (&$checks) {
|
||||
$checks++;
|
||||
}, function () use ($context, $db) {
|
||||
expect($context->allows('conflict-release', $db))->toBeTrue()
|
||||
->and($context->allows('conflict-release', new stdClass))->toBeFalse()
|
||||
->and($context->allows('order-cancellation-cycles', $db))->toBeFalse();
|
||||
|
||||
return 'complete';
|
||||
});
|
||||
expect($checks)->toBe(3)->and($result)->toBe('complete')->and($context->allows('conflict-release', $db))->toBeFalse();
|
||||
});
|
||||
|
||||
test('revocation is rechecked and an exception clears the execution', function () {
|
||||
$context = new ExecutionContext;
|
||||
$db = new stdClass;
|
||||
$authorised = true;
|
||||
try {
|
||||
$context->within(compositionDeclaration(), $db, function () use (&$authorised) {
|
||||
if (! $authorised) {
|
||||
throw new RuntimeException('revoked');
|
||||
}
|
||||
}, function () use ($context, $db, &$authorised) {
|
||||
$authorised = false;
|
||||
$context->allows('conflict-release', $db);
|
||||
});
|
||||
} catch (RuntimeException $error) {
|
||||
expect($error->getMessage())->toBe('revoked');
|
||||
}
|
||||
expect($context->allows('conflict-release', $db))->toBeFalse();
|
||||
});
|
||||
|
||||
test('invalid declarations never enter the business closure', function (string $case) {
|
||||
$declaration = compositionDeclaration();
|
||||
match ($case) {
|
||||
'contract' => $declaration['contract'] = 'unknown',
|
||||
'extra' => $declaration['admin'] = true,
|
||||
'hash' => $declaration['workflow_sha256'] = 'unknown',
|
||||
'scope' => $declaration['scope']['unit_id'] = null,
|
||||
'identity' => $declaration['actor']['native_id'] = 0,
|
||||
'feature' => $declaration['features']['all'] = [],
|
||||
'component' => $declaration['features']['order-cancellation-cycles'] = ['root' => '/unknown'],
|
||||
};
|
||||
(new ExecutionContext)->within($declaration, new stdClass, fn () => null, fn () => throw new RuntimeException('business executed'));
|
||||
})->with(['contract', 'extra', 'hash', 'scope', 'identity', 'feature', 'component'])->throws(LogicException::class);
|
||||
|
||||
test('nested execution cannot replace the original authority', function () {
|
||||
$context = new ExecutionContext;
|
||||
$db = new stdClass;
|
||||
$context->within(compositionDeclaration(), $db, fn () => null, function () use ($context, $db) {
|
||||
expect(fn () => $context->within(compositionDeclaration(), $db, fn () => null, fn () => null))->toThrow(LogicException::class);
|
||||
expect($context->allows('conflict-release', $db))->toBeTrue();
|
||||
});
|
||||
expect($context->allows('conflict-release', $db))->toBeFalse();
|
||||
});
|
||||
|
||||
test('read authority cannot execute a write even when the feature is available', function () {
|
||||
$context = new ExecutionContext;
|
||||
$db = new stdClass;
|
||||
$declaration = compositionDeclaration();
|
||||
$declaration['operation'] = 'purchasing_conflicts.view';
|
||||
$context->within($declaration, $db, fn () => null, function () use ($context, $db) {
|
||||
expect($context->allows('conflict-release', $db))->toBeTrue()
|
||||
->and($context->permits('purchasing_conflicts.view', $db))->toBeTrue()
|
||||
->and($context->permits('purchasing_conflicts.authorise', $db))->toBeFalse();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,218 @@
|
||||
<?php
|
||||
|
||||
use Tempo\Purchasing\Delivery\CodeDeployment;
|
||||
|
||||
require_once __DIR__.'/../../integrations/sgf/operational/CodeDeployment.php';
|
||||
|
||||
function deploymentV2Write(string $path, string $body): void
|
||||
{
|
||||
if (! is_dir(dirname($path))) {
|
||||
mkdir(dirname($path), 0700, true);
|
||||
}
|
||||
file_put_contents($path, $body);
|
||||
}
|
||||
|
||||
function deploymentV2Fixture(): array
|
||||
{
|
||||
$root = dirname(__DIR__, 2).'/storage/framework/testing/deployment-v2-'.bin2hex(random_bytes(6));
|
||||
$host = $root.'/host';
|
||||
deploymentV2Write($host.'/app/Existing.php', 'original');
|
||||
deploymentV2Write($host.'/packages/purchasing/current.json', '{"version":"0.1.1"}');
|
||||
deploymentV2Write($host.'/storage/framework/down', '{}');
|
||||
deploymentV2Write($host.'/bootstrap/cache/config.php', '<?php return [];');
|
||||
|
||||
return [$root, $host, new CodeDeployment($host)];
|
||||
}
|
||||
|
||||
function deploymentV2Bundle(string $root, array $bodies, array $before, string $format = 'v2', ?string $from = null, array $added = [], array $schema = []): array
|
||||
{
|
||||
$dir = $root.'/bundle-'.bin2hex(random_bytes(4));
|
||||
$files = [];
|
||||
$overlays = [];
|
||||
foreach ($bodies as $file => $body) {
|
||||
deploymentV2Write($dir.'/'.$file, $body);
|
||||
$files[$file] = hash('sha256', $body);
|
||||
$overlays[$file] = ['before_sha256' => $before[$file], 'after_sha256' => $files[$file]];
|
||||
}
|
||||
$manifest = ['format' => 'tempo.operational-review.'.$format, 'support_files' => $files, 'host_overlays' => $overlays];
|
||||
if ($format === 'v2') {
|
||||
$manifest['composition_transition'] = ['from_manifest_sha256' => $from, 'added_files' => $added, 'schema_files' => $schema];
|
||||
}
|
||||
deploymentV2Write($dir.'/manifest.json', json_encode($manifest, JSON_THROW_ON_ERROR));
|
||||
|
||||
return [$dir, hash_file('sha256', $dir.'/manifest.json')];
|
||||
}
|
||||
|
||||
function deploymentV2Apply(CodeDeployment $deploy, string $dir, string $hash): array
|
||||
{
|
||||
$plan = $deploy->plan($dir, $hash);
|
||||
|
||||
return $deploy->apply($dir, $hash, $plan['target_sha256'], 'Synthetic file-only rehearsal', true);
|
||||
}
|
||||
|
||||
test('v1 still applies replays and restores its exact code cache and module pointer', function () {
|
||||
[$root, $host, $deploy] = deploymentV2Fixture();
|
||||
[$dir, $hash] = deploymentV2Bundle($root, ['app/Existing.php' => 'v1'], ['app/Existing.php' => hash('sha256', 'original')], 'v1');
|
||||
$result = deploymentV2Apply($deploy, $dir, $hash);
|
||||
expect(deploymentV2Apply($deploy, $dir, $hash)['replayed'])->toBeTrue();
|
||||
$deploy->rollback($result['deployment_id'], 'Synthetic recovery', true);
|
||||
expect(file_get_contents($host.'/app/Existing.php'))->toBe('original')
|
||||
->and(file_get_contents($host.'/bootstrap/cache/config.php'))->toBe('<?php return [];')
|
||||
->and(file_get_contents($host.'/packages/purchasing/current.json'))->toBe('{"version":"0.1.1"}');
|
||||
});
|
||||
|
||||
test('v2 expands v1 updates new files and recovers their original absence in order', function () {
|
||||
[$root, $host, $deploy] = deploymentV2Fixture();
|
||||
[$v1, $h1] = deploymentV2Bundle($root, ['app/Existing.php' => 'v1'], ['app/Existing.php' => hash('sha256', 'original')], 'v1');
|
||||
$first = deploymentV2Apply($deploy, $v1, $h1);
|
||||
[$v2, $h2] = deploymentV2Bundle($root, ['app/Existing.php' => 'v2', 'config/merchandise.php' => '<?php return false;'],
|
||||
['app/Existing.php' => hash('sha256', 'v1'), 'config/merchandise.php' => null], 'v2', $h1, ['config/merchandise.php' => null]);
|
||||
$secondPlan = $deploy->plan($v2, $h2);
|
||||
$second = deploymentV2Apply($deploy, $v2, $h2);
|
||||
expect($deploy->apply($v2, $h2, $secondPlan['target_sha256'], 'Replay same operation', true)['replayed'])->toBeTrue()
|
||||
->and(file_get_contents($host.'/config/merchandise.php'))->toBe('<?php return false;');
|
||||
[$v3, $h3] = deploymentV2Bundle($root, ['app/Existing.php' => 'v3', 'config/merchandise.php' => '<?php return null;'],
|
||||
['app/Existing.php' => hash('sha256', 'v2'), 'config/merchandise.php' => hash('sha256', '<?php return false;')], 'v2', $h2);
|
||||
$third = deploymentV2Apply($deploy, $v3, $h3);
|
||||
$deploy->rollback($third['deployment_id'], 'Recover third', true);
|
||||
expect(file_get_contents($host.'/config/merchandise.php'))->toBe('<?php return false;');
|
||||
$deploy->rollback($second['deployment_id'], 'Recover second', true);
|
||||
expect(file_exists($host.'/config/merchandise.php'))->toBeFalse()
|
||||
->and(file_get_contents($host.'/app/Existing.php'))->toBe('v1');
|
||||
$deploy->rollback($first['deployment_id'], 'Recover first', true);
|
||||
expect(file_get_contents($host.'/app/Existing.php'))->toBe('original');
|
||||
});
|
||||
|
||||
test('v2 rejects an undeclared expansion wrong predecessor or existing supposedly new file', function (string $case) {
|
||||
[$root, $host, $deploy] = deploymentV2Fixture();
|
||||
$added = ['config/merchandise.php' => null];
|
||||
if ($case === 'undeclared') {
|
||||
$added = [];
|
||||
}
|
||||
if ($case === 'existing') {
|
||||
deploymentV2Write($host.'/config/merchandise.php', 'preserve');
|
||||
}
|
||||
[$dir, $hash] = deploymentV2Bundle($root, ['config/merchandise.php' => 'new'], ['config/merchandise.php' => null], 'v2', $case === 'predecessor' ? str_repeat('a', 64) : null, $added);
|
||||
expect(fn () => $deploy->plan($dir, $hash))->toThrow(RuntimeException::class);
|
||||
expect(file_get_contents($host.'/app/Existing.php'))->toBe('original');
|
||||
})->with(['undeclared', 'predecessor', 'existing']);
|
||||
|
||||
test('v2 partial failure recovers newly created files without touching unknown edits', function (bool $unknownEdit) {
|
||||
[$root, $host, $deploy] = deploymentV2Fixture();
|
||||
[$dir, $hash] = deploymentV2Bundle($root, ['app/New.php' => 'candidate', 'app/Existing.php' => 'updated'],
|
||||
['app/New.php' => null, 'app/Existing.php' => hash('sha256', 'original')], 'v2', null,
|
||||
['app/New.php' => null, 'app/Existing.php' => hash('sha256', 'original')]);
|
||||
$plan = $deploy->plan($dir, $hash);
|
||||
try {
|
||||
$deploy->apply($dir, $hash, $plan['target_sha256'], 'Synthetic interruption', true, function ($point) {
|
||||
if ($point === 'file:app/New.php') {
|
||||
throw new RuntimeException('Synthetic interruption');
|
||||
}
|
||||
});
|
||||
test()->fail('Expected interruption.');
|
||||
} catch (RuntimeException $error) {
|
||||
expect($error->getMessage())->toBe('Synthetic interruption');
|
||||
}
|
||||
if ($unknownEdit) {
|
||||
deploymentV2Write($host.'/app/New.php', 'user edit');
|
||||
expect(fn () => $deploy->rollback($plan['deployment_id'], 'Recover', true))->toThrow(RuntimeException::class)
|
||||
->and(file_get_contents($host.'/app/New.php'))->toBe('user edit');
|
||||
} else {
|
||||
$deploy->rollback($plan['deployment_id'], 'Recover', true);
|
||||
expect(file_exists($host.'/app/New.php'))->toBeFalse();
|
||||
}
|
||||
expect(file_get_contents($host.'/app/Existing.php'))->toBe('original');
|
||||
})->with([false, true]);
|
||||
|
||||
test('v2 requires an exact schema receipt and pins it to the reviewed target', function () {
|
||||
[$root, $host, $deploy] = deploymentV2Fixture();
|
||||
$file = 'database/sql/synthetic.sql';
|
||||
$body = '-- synthetic, never executed';
|
||||
$schema = [$file => ['before' => null, 'after' => hash('sha256', $body)]];
|
||||
[$dir, $hash] = deploymentV2Bundle($root, [$file => $body], [$file => null], 'v2', null, [$file => null], $schema);
|
||||
expect(fn () => $deploy->plan($dir, $hash))->toThrow(RuntimeException::class);
|
||||
$receiptPath = $host.'/storage/app/private/module-deployments/schema-transition-'.$hash.'.json';
|
||||
$receipt = ['from_manifest_sha256' => null, 'to_manifest_sha256' => $hash, 'host' => str_replace('\\', '/', realpath($host)), 'schema_verified' => true, 'changes' => $schema];
|
||||
deploymentV2Write($receiptPath, json_encode($receipt, JSON_THROW_ON_ERROR));
|
||||
$plan = $deploy->plan($dir, $hash);
|
||||
$receipt['review_reference'] = 'changed after planning';
|
||||
deploymentV2Write($receiptPath, json_encode($receipt, JSON_THROW_ON_ERROR));
|
||||
expect(fn () => $deploy->apply($dir, $hash, $plan['target_sha256'], 'Synthetic', true))->toThrow(RuntimeException::class);
|
||||
expect(file_exists($host.'/'.$file))->toBeFalse();
|
||||
});
|
||||
|
||||
test('v2 rejects forbidden paths extra content and equivalent Windows paths', function (string $case) {
|
||||
[$root, $host, $deploy] = deploymentV2Fixture();
|
||||
[$dir] = deploymentV2Bundle($root, ['app/New.php' => 'candidate'], ['app/New.php' => null], 'v2', null, ['app/New.php' => null]);
|
||||
$manifest = json_decode(file_get_contents($dir.'/manifest.json'), true, 32, JSON_THROW_ON_ERROR);
|
||||
if ($case === 'extra') {
|
||||
deploymentV2Write($dir.'/unexpected.php', 'unlisted');
|
||||
} elseif ($case === 'equivalent') {
|
||||
$manifest['support_files']['app/new.php'] = hash('sha256', 'candidate');
|
||||
} elseif ($case === 'hash') {
|
||||
deploymentV2Write($dir.'/app/New.php', 'tampered');
|
||||
} elseif ($case === 'format') {
|
||||
$manifest['format'] = 'tempo.operational-review.v999';
|
||||
} else {
|
||||
$manifest['host_overlays'] = [$case => $manifest['host_overlays']['app/New.php']];
|
||||
}
|
||||
deploymentV2Write($dir.'/manifest.json', json_encode($manifest, JSON_THROW_ON_ERROR));
|
||||
expect(fn () => $deploy->plan($dir, hash_file('sha256', $dir.'/manifest.json')))->toThrow(RuntimeException::class);
|
||||
expect(file_exists($host.'/app/New.php'))->toBeFalse();
|
||||
})->with(['extra', 'equivalent', 'hash', 'format', '../outside.php', '.env', 'public/vendor/secret.php', 'packages/purchasing/current.json', 'routes/console.php']);
|
||||
|
||||
test('v2 update interruption restores the prior bundle at each durable stage', function (string $point) {
|
||||
[$root, $host, $deploy] = deploymentV2Fixture();
|
||||
[$v1, $h1] = deploymentV2Bundle($root, ['app/Existing.php' => 'v1'], ['app/Existing.php' => hash('sha256', 'original')], 'v1');
|
||||
$first = deploymentV2Apply($deploy, $v1, $h1);
|
||||
[$v2, $h2] = deploymentV2Bundle($root, ['app/Existing.php' => 'v2', 'public/sgf-new.mjs' => 'candidate'],
|
||||
['app/Existing.php' => hash('sha256', 'v1'), 'public/sgf-new.mjs' => null], 'v2', $h1, ['public/sgf-new.mjs' => null]);
|
||||
$plan = $deploy->plan($v2, $h2);
|
||||
try {
|
||||
$deploy->apply($v2, $h2, $plan['target_sha256'], 'Interrupt update', true, function ($at) use ($point) {
|
||||
if ($at === $point) {
|
||||
throw new RuntimeException('Synthetic interruption');
|
||||
}
|
||||
});
|
||||
test()->fail('Expected interruption.');
|
||||
} catch (RuntimeException $error) {
|
||||
expect($error->getMessage())->toBe('Synthetic interruption');
|
||||
}
|
||||
$deploy->rollback($plan['deployment_id'], 'Recover update', true);
|
||||
expect(file_get_contents($host.'/app/Existing.php'))->toBe('v1')
|
||||
->and(file_exists($host.'/public/sgf-new.mjs'))->toBeFalse()
|
||||
->and(hash_file('sha256', $host.'/packages/internal-requisitions/manifest.json'))->toBe($h1)
|
||||
->and(json_decode(file_get_contents($host.'/storage/app/private/module-deployments/current.json'), true)['deployment_id'])->toBe($first['deployment_id']);
|
||||
})->with(['prepared', 'caches-cleared', 'file:app/Existing.php', 'file:public/sgf-new.mjs', 'previous-bundle-preserved', 'bundle-switched']);
|
||||
|
||||
test('deployment uses the verified staged bytes instead of a mutable source directory', function () {
|
||||
[$root, $host, $deploy] = deploymentV2Fixture();
|
||||
[$dir, $hash] = deploymentV2Bundle($root, ['app/New.php' => 'candidate'], ['app/New.php' => null], 'v2', null, ['app/New.php' => null]);
|
||||
$plan = $deploy->plan($dir, $hash);
|
||||
$result = $deploy->apply($dir, $hash, $plan['target_sha256'], 'Stage isolation', true, function ($point) use ($dir) {
|
||||
if ($point === 'prepared') {
|
||||
deploymentV2Write($dir.'/app/New.php', 'source changed after staging');
|
||||
}
|
||||
});
|
||||
expect(file_get_contents($host.'/app/New.php'))->toBe('candidate');
|
||||
$deploy->rollback($result['deployment_id'], 'Recover', true);
|
||||
expect(file_exists($host.'/app/New.php'))->toBeFalse();
|
||||
});
|
||||
|
||||
test('v2 refuses links in either payload or destination', function (string $side) {
|
||||
[$root, $host, $deploy] = deploymentV2Fixture();
|
||||
deploymentV2Write($root.'/outside/New.php', 'preserve outside host');
|
||||
$file = $side === 'host' ? 'app/Linked/New.php' : 'app/New.php';
|
||||
[$dir, $hash] = deploymentV2Bundle($root, [$file => 'candidate'], [$file => null], 'v2', null, [$file => null]);
|
||||
if ($side === 'host') {
|
||||
$linked = @symlink($root.'/outside', $host.'/app/Linked');
|
||||
} else {
|
||||
unlink($dir.'/app/New.php');
|
||||
$linked = @symlink($root.'/outside/New.php', $dir.'/app/New.php');
|
||||
}
|
||||
if (! $linked) {
|
||||
test()->markTestSkipped('Creating symbolic links is unavailable; no privileges were changed.');
|
||||
}
|
||||
expect(fn () => $deploy->plan($dir, $hash))->toThrow(RuntimeException::class);
|
||||
expect(file_get_contents($root.'/outside/New.php'))->toBe('preserve outside host');
|
||||
})->with(['host', 'bundle']);
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
test('composition loads only its verified local calculation when explicitly enabled', function (string $mode) {
|
||||
$root = dirname(__DIR__, 2);
|
||||
$bundle = $root.'/storage/framework/testing/cost-bootstrap-'.bin2hex(random_bytes(6));
|
||||
mkdir($bundle, 0700, true);
|
||||
foreach (['integrations/sgf/operational/bootstrap.php', 'integrations/sgf/operational/RuntimeContext.php', 'integrations/sgf/operational/Composition.php', 'integrations/sgf/sourcing/bootstrap.php'] as $stub) {
|
||||
if (! is_dir(dirname($bundle.'/'.$stub))) {
|
||||
mkdir(dirname($bundle.'/'.$stub), 0700, true);
|
||||
}
|
||||
file_put_contents($bundle.'/'.$stub, '<?php // Test double for unrelated application boot.');
|
||||
}
|
||||
copy($root.'/integrations/sgf/operational/entry.php', $bundle.'/bootstrap.php');
|
||||
$relative = 'packages/purchasing/src/StockCosting.php';
|
||||
mkdir(dirname($bundle.'/'.$relative), 0700, true);
|
||||
copy($root.'/packages/purchasing/src/StockCosting.php', $bundle.'/'.$relative);
|
||||
$pin = hash_file('sha256', $bundle.'/'.$relative);
|
||||
file_put_contents($bundle.'/manifest.json', json_encode(['format' => 'tempo.operational-review.v2', 'support_files' => [$relative => $pin]], JSON_THROW_ON_ERROR));
|
||||
if ($mode === 'tampered') {
|
||||
file_put_contents($bundle.'/'.$relative, '<?php // tampered');
|
||||
}
|
||||
if ($mode === 'disabled') {
|
||||
unlink($bundle.'/'.$relative);
|
||||
}
|
||||
$script = 'require '.var_export($root.'/vendor/autoload.php', true).';'
|
||||
.'Illuminate\\Container\\Container::getInstance()->instance("config", new Illuminate\\Config\\Repository(["merchandise_invoices"=>["costs_enabled"=>'.($mode === 'disabled' ? 'false' : 'true').']]));';
|
||||
if ($mode === 'different_loaded_version') {
|
||||
file_put_contents($bundle.'/different.php', '<?php namespace Tempo\\Purchasing\\Inventory; final class StockCosting {}');
|
||||
$script .= 'require '.var_export($bundle.'/different.php', true).';';
|
||||
}
|
||||
$script .= 'try { require '.var_export($bundle.'/bootstrap.php', true).'; echo "BOOT_OK:".(int)class_exists(Tempo\\Purchasing\\Inventory\\StockCosting::class,false); } catch (RuntimeException $error) { echo "REFUSED:".$error->getMessage(); }';
|
||||
// Subprocess avoids sharing a PHP class definition between composition variants.
|
||||
$process = proc_open([PHP_BINARY, '-r', $script], [0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']], $pipes);
|
||||
expect(is_resource($process))->toBeTrue();
|
||||
fclose($pipes[0]);
|
||||
$out = stream_get_contents($pipes[1]);
|
||||
$error = stream_get_contents($pipes[2]);
|
||||
fclose($pipes[1]);
|
||||
fclose($pipes[2]);
|
||||
expect(proc_close($process))->toBe(0, $error);
|
||||
expect($out)->toStartWith(in_array($mode, ['tampered', 'different_loaded_version'], true) ? 'REFUSED:' : 'BOOT_OK:'.($mode === 'disabled' ? '0' : '1'));
|
||||
})->with(['enabled', 'disabled', 'tampered', 'different_loaded_version']);
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
require_once dirname(__DIR__, 2).'/scripts/lib/SgfWorkflowExtension.php';
|
||||
|
||||
test('workflow namespace transfer preserves rule strings comments and SQL', function () {
|
||||
$source = <<<'PHP'
|
||||
<?php
|
||||
namespace App\Services;
|
||||
use App\Models\User;
|
||||
// App\Models\User is a comment, not a PHP name token.
|
||||
final class Example {
|
||||
public function run(\App\Models\User $user): string {
|
||||
$literal = 'App\Models\User';
|
||||
$sql = "SELECT 'App\\Models\\User'";
|
||||
return $literal;
|
||||
}
|
||||
}
|
||||
PHP;
|
||||
$output = SgfWorkflowExtension::transform($source);
|
||||
expect($output)->toContain('namespace Tempo\Purchasing\Embedded\Services;')
|
||||
->toContain('use Tempo\Purchasing\Embedded\Models\User;')
|
||||
->toContain('run(\Tempo\Purchasing\Embedded\Models\User $user)')
|
||||
->toContain("'App\\Models\\User'")->toContain('// App\Models\User is a comment')
|
||||
->toContain('SELECT \'App\\\\Models\\\\User\'');
|
||||
});
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
require_once dirname(__DIR__, 2).'/scripts/lib/SgfWorkflowInventory.php';
|
||||
|
||||
beforeEach(function () {
|
||||
$this->inventoryRoot = sys_get_temp_dir().'/sgf-inventory-'.bin2hex(random_bytes(8));
|
||||
mkdir($this->inventoryRoot.'/source/app', 0700, true);
|
||||
mkdir($this->inventoryRoot.'/bundle/app', 0700, true);
|
||||
file_put_contents($this->inventoryRoot.'/source/app/Workflow.php', '<?php // current');
|
||||
file_put_contents($this->inventoryRoot.'/bundle/app/Workflow.php', '<?php // embedded');
|
||||
$this->manifest = ['files' => ['app/Workflow.php' => hash_file('sha256', $this->inventoryRoot.'/bundle/app/Workflow.php')],
|
||||
'originals' => ['app/Workflow.php' => hash_file('sha256', $this->inventoryRoot.'/source/app/Workflow.php')]];
|
||||
$this->inspect = function (?array $manifest = null, array $paths = ['app/Workflow.php']) {
|
||||
file_put_contents($this->inventoryRoot.'/bundle/manifest.json', json_encode($manifest ?? $this->manifest));
|
||||
|
||||
return SgfWorkflowInventory::inspect($this->inventoryRoot.'/source', $this->inventoryRoot.'/bundle',
|
||||
hash_file('sha256', $this->inventoryRoot.'/bundle/manifest.json'), ['process' => $paths]);
|
||||
};
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->inventoryRoot, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST);
|
||||
foreach ($iterator as $file) {
|
||||
$file->isDir() && ! $file->isLink() ? rmdir($file->getPathname()) : unlink($file->getPathname());
|
||||
}
|
||||
rmdir($this->inventoryRoot);
|
||||
});
|
||||
|
||||
test('recognises preserved source without claiming functional acceptance', function () {
|
||||
$result = ($this->inspect)();
|
||||
expect($result['processes']['process']['source_equivalent'])->toBeTrue()
|
||||
->and($result['functional_acceptance'])->toBeFalse()->and($result['read_only'])->toBeTrue();
|
||||
});
|
||||
|
||||
test('reports source drift rather than treating old acceptance as current', function () {
|
||||
file_put_contents($this->inventoryRoot.'/source/app/Workflow.php', '<?php // changed');
|
||||
$result = ($this->inspect)();
|
||||
expect($result['processes']['process']['source_equivalent'])->toBeFalse()
|
||||
->and($result['processes']['process']['components']['app/Workflow.php']['status'])->toBe('source_changed');
|
||||
});
|
||||
|
||||
test('distinguishes missing source from untransferred source', function () {
|
||||
file_put_contents($this->inventoryRoot.'/source/app/New.php', '<?php // new');
|
||||
$result = ($this->inspect)(null, ['app/New.php', 'app/Missing.php']);
|
||||
expect($result['processes']['process']['components']['app/New.php']['status'])->toBe('not_transferred')
|
||||
->and($result['processes']['process']['components']['app/Missing.php']['status'])->toBe('source_missing');
|
||||
});
|
||||
|
||||
test('refuses tampering anywhere in the distributed bundle', function () {
|
||||
file_put_contents($this->inventoryRoot.'/bundle/app/Workflow.php', '<?php // tampered');
|
||||
($this->inspect)();
|
||||
})->throws(RuntimeException::class, 'Workflow bundle integrity failure.');
|
||||
|
||||
test('refuses unsafe manifest paths', function (string $path) {
|
||||
($this->inspect)(['files' => [$path => str_repeat('a', 64)], 'originals' => []]);
|
||||
})->with(['../outside.php', '/absolute.php', 'C:/outside.php', 'app/../outside.php', 'app\\outside.php'])
|
||||
->throws(RuntimeException::class, 'Invalid workflow path.');
|
||||
|
||||
test('refuses an unpinned manifest', function () {
|
||||
file_put_contents($this->inventoryRoot.'/bundle/manifest.json', json_encode($this->manifest));
|
||||
SgfWorkflowInventory::inspect($this->inventoryRoot.'/source', $this->inventoryRoot.'/bundle', str_repeat('0', 64), []);
|
||||
})->throws(RuntimeException::class, 'Unrecognised workflow manifest.');
|
||||
|
||||
test('does not accept an original hash without its distributed file', function () {
|
||||
$manifest = $this->manifest;
|
||||
$manifest['files'] = [];
|
||||
$result = ($this->inspect)($manifest);
|
||||
expect($result['processes']['process']['source_equivalent'])->toBeFalse()
|
||||
->and($result['processes']['process']['components']['app/Workflow.php']['status'])->toBe('not_transferred');
|
||||
});
|
||||
|
||||
test('requires both source and distributed inventories', function () {
|
||||
($this->inspect)(['files' => $this->manifest['files']]);
|
||||
})->throws(RuntimeException::class, 'Original and distributed hashes required.');
|
||||
@@ -76,3 +76,61 @@ test('half cent rounds upwards and the last issue receives the residual', functi
|
||||
test('an unrecognised rounding policy cannot silently change costs', function () {
|
||||
expect(fn () => StockCosting::project('fifo', costingOpening(), [], 'automatic'))->toThrow(InvalidArgumentException::class);
|
||||
});
|
||||
|
||||
test('approved zero issues preserve half up and the exact final balance', function (string $method, array $quantities, array $amounts) {
|
||||
$facts = [costingReceipt(1, 1000, 1)];
|
||||
foreach ($quantities as $index => $quantity) {
|
||||
$facts[] = costingIssue($index + 2, $quantity);
|
||||
}
|
||||
$result = StockCosting::project($method, costingOpening(), $facts, 'half_up_final_balance');
|
||||
expect(array_column(array_column(array_slice($result['movements'], 1), 'value'), 'amount_minor'))->toBe($amounts)
|
||||
->and($result['closing']['quantity_milli'])->toBe(0)
|
||||
->and($result['closing']['value']['amount_minor'])->toBe('0')
|
||||
->and($result['stock_written'])->toBeFalse()->and($result['journals_written'])->toBeFalse();
|
||||
})->with([
|
||||
['fifo', [100, 400, 500], ['0', '0', '1']],
|
||||
['weighted_average', [100, 400, 500], ['0', '0', '1']],
|
||||
['fifo', [500, 100, 400], ['1', '0', '0']],
|
||||
['weighted_average', [500, 100, 400], ['1', '0', '0']],
|
||||
]);
|
||||
|
||||
test('supplier return uses its identified receipt rather than the oldest or average price', function (string $method, string $nextCost) {
|
||||
$facts = [costingReceipt(1, 1000, 100), costingReceipt(2, 1000, 300),
|
||||
['id' => 3, 'reference' => 'synthetic-return-3', 'kind' => 'receipt_return', 'quantity_milli' => 500, 'receipt_reference' => 'synthetic-receipt-2', 'value_minor' => 150], costingIssue(4, 500)];
|
||||
$result = StockCosting::project($method, costingOpening(), $facts, 'half_up_final_balance');
|
||||
expect($result['movements'][2]['value']['amount_minor'])->toBe('150')
|
||||
->and($result['movements'][3]['value']['amount_minor'])->toBe($nextCost)
|
||||
->and($result['movements'][0]['value']['amount_minor'])->toBe('100')
|
||||
->and($result['stock_written'])->toBeFalse()->and($result['journals_written'])->toBeFalse();
|
||||
})->with([['fifo', '50'], ['weighted_average', '83']]);
|
||||
|
||||
test('returning an exhausted original layer requires reconciliation without changing prior costs', function (string $method) {
|
||||
$facts = [costingReceipt(1, 1000, 100), costingIssue(2, 1000), costingReceipt(3, 1000, 300),
|
||||
['id' => 4, 'reference' => 'synthetic-return-4', 'kind' => 'receipt_return', 'quantity_milli' => 500, 'receipt_reference' => 'synthetic-receipt-1']];
|
||||
expect(fn () => StockCosting::project($method, costingOpening(), $facts))->toThrow(DomainException::class);
|
||||
expect(StockCosting::project($method, costingOpening(), array_slice($facts, 0, 3))['movements'][1]['value']['amount_minor'])->toBe('100');
|
||||
})->with(['fifo', 'weighted_average']);
|
||||
|
||||
test('FIFO skips a completely returned layer and never consumes its value again', function () {
|
||||
$facts = [costingReceipt(1, 1000, 100), costingReceipt(2, 1000, 300),
|
||||
['id' => 3, 'reference' => 'synthetic-return-3', 'kind' => 'receipt_return', 'quantity_milli' => 1000, 'receipt_reference' => 'synthetic-receipt-1'], costingIssue(4, 1000)];
|
||||
$result = StockCosting::project('fifo', costingOpening(), $facts);
|
||||
expect($result['movements'][3]['value']['amount_minor'])->toBe('300')->and($result['closing']['value']['amount_minor'])->toBe('0');
|
||||
});
|
||||
|
||||
test('an incompatible posted return is refused instead of rewriting a journal', function () {
|
||||
$facts = [costingReceipt(1, 1000, 100), ['id' => 2, 'reference' => 'synthetic-return-2', 'kind' => 'receipt_return', 'quantity_milli' => 500, 'receipt_reference' => 'synthetic-receipt-1', 'value_minor' => 51]];
|
||||
expect(fn () => StockCosting::project('fifo', costingOpening(), $facts))->toThrow(DomainException::class);
|
||||
});
|
||||
|
||||
test('approved reconstructed layers retain receipt cost for a return and conserve the final balance', function (string $method) {
|
||||
$opening = ['reference' => 'approved-opening-1', 'quantity_milli' => 2000, 'value_minor' => 400,
|
||||
'layers' => [['reference' => 'original-receipt-1', 'quantity_milli' => 1000, 'value_minor' => 100],
|
||||
['reference' => 'reconciled-balance-1', 'quantity_milli' => 1000, 'value_minor' => 300]]];
|
||||
$facts = [['id' => 10, 'reference' => 'return-10', 'kind' => 'receipt_return', 'quantity_milli' => 500, 'receipt_reference' => 'original-receipt-1', 'value_minor' => 50], costingIssue(11, 1500)];
|
||||
$result = StockCosting::project($method, $opening, $facts, 'half_up_final_balance');
|
||||
expect($result['movements'][0]['value']['amount_minor'])->toBe('50')
|
||||
->and($result['movements'][1]['value']['amount_minor'])->toBe('350')
|
||||
->and($result['closing']['value']['amount_minor'])->toBe('0')
|
||||
->and($result['closing']['quantity_milli'])->toBe(0);
|
||||
})->with(['fifo', 'weighted_average']);
|
||||
|
||||
Reference in New Issue
Block a user