Commit graph

260 commits

Author SHA1 Message Date
Alexandre Brandizzi
2327097d5e fix(work-orders): symmetric NTE release, terminal guard, serialized cancel (SH-196)
Three contract gaps found reviewing the frontend consumer:

- Revoking an auto-approved uplift never restored the dispatch NTE. Create
  raises NTE for both auto-approved and approved requests, but revoke restored
  it only for Approved, so the allowance was freed while the NTE stayed raised
  and every create -> auto-approve -> revoke cycle compounded the inflation.
  Revoke now compensates for NoApprovalRequired symmetrically.
- Revoke and cancel had no work-order lifecycle check, so a direct API call
  could still mutate uplifts on a Completed or Canceled work order; the board
  dialog's read-only state is UX only. Both now reject terminal work orders in
  the service.
- WorkOrderBoardCancelService read the pending-uplift list outside any gate, so
  an in-flight create could commit after that read and leave a pending uplift on
  a Canceled work order. The cancel flow now runs inside the same per-work-order
  gate as create, so the pending read, withdrawal and status audit serialize
  against it.
2026-08-18 17:41:14 -03:00
arthur.bassi
aeface594a fix(work-orders): serialize uplift create and atomic cancel (SH-196) 2026-08-18 10:20:05 -03:00
arthur.bassi
4c15669aff fix(work-orders): enforce SH-196 cumulative allowance and one pending per WO
Auto-approval now uses the WO-scoped $500/$5,000 Emergency cap instead of dispatch NTE, rejects a second open request across dispatches, and cancelling a WO withdraws pending uplifts with audit.
2026-08-14 10:36:35 -03:00
arthur.bassi
b81cfbb005 feat(work-orders): WO-scoped uplift endpoints and board summary (SH-196)
Expose workorders/{id}/uplifts list/create/cancel/revoke for the SH-196 dialog, aggregate upliftSummary on board rows, and add service/controller regression tests.
2026-08-13 14:49:56 -03:00
Alexandre Brandizzi
5f614fe893
Merge pull request #63 from Sea-Haven-Industries/feature/sh-188-board-pending-uplift
Some checks failed
Validate and deploy dev / Validate deployable source bundle (push) Has been cancelled
Validate and deploy dev / Deploy shoc-backend to Elastic Beanstalk dev (push) Has been cancelled
feat(work-orders): expose pendingUpliftCount on board rows (SH-188)
2026-08-12 12:10:17 -03:00
Arthur Bassi
29dec00790 fix(work-orders): keep pendingUpliftCount on detail and exclude deleted dispatches
Map board PendingUpliftCount through WorkOrderDetailService.MapInfo and ignore soft-deleted dispatches in the aggregate so SH-188 gating is authoritative for board/search/detail.
2026-08-12 11:50:56 -03:00
Arthur Bassi
aaeeb90f1a feat(work-orders): expose pendingUpliftCount on board rows (SH-188)
Aggregate Pending uplift requests across all dispatches tied to a work
order so the board/search/detail contract can drive the Completed gate.
2026-08-12 09:43:10 -03:00
Alexandre Brandizzi
6f08967e32
Merge pull request #47 from Sea-Haven-Industries/feature/wo-board-completed-date-media
Some checks are pending
Validate and deploy dev / Validate deployable source bundle (push) Waiting to run
Validate and deploy dev / Deploy shoc-backend to Elastic Beanstalk dev (push) Blocked by required conditions
feat(work-orders): board completedDate + media categorize contract
2026-08-11 15:55:00 -03:00
Arthur Bassi
afcb4fde8d Merge branch 'dev' into feature/wo-board-completed-date-media 2026-08-11 15:20:17 -03:00
Arthur Bassi
de0f6da8fb fix(work-orders): scope legacy GET GetComments by account [SH-221]
Pass ClaimsPrincipal into GetCommentsAsync and filter via
GetAllForAccountAsync so account-scoped callers cannot enumerate
cross-tenant comments. ADR + cross-account tests updated.
2026-08-11 15:18:29 -03:00
Arthur Bassi
3c090e2757 fix(work-orders): scope comments and completion-doc by account [SH-221]
Close the remaining SH-221 bypass: board/legacy comments and completion-doc now enforce server-derived account scope, authorize before blob storage, and cover cross-account regressions.
2026-08-11 14:52:02 -03:00
Alexandre Brandizzi
3e8a7115fe
Merge pull request #62 from Sea-Haven-Industries/feat/sh-101-uplift-lifecycle
Some checks are pending
Validate and deploy dev / Validate deployable source bundle (push) Waiting to run
Validate and deploy dev / Deploy shoc-backend to Elastic Beanstalk dev (push) Blocked by required conditions
feat(uplifts): complete vendor approval lifecycle (SH-101)
2026-08-11 13:51:40 -03:00
Arthur Bassi
62a4828e2f fix(work-orders): scope legacy list/detail GETs by account [SH-221]
Close the remaining SH-221 read gap so Getworkorders, filtered lists, and GetWorkorderById enforce the same server-derived account boundary as board/media.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 11:57:37 -03:00
Arthur Bassi
bca2e0d50d test(work-orders): fix sync/webhook/recon fixtures for AccountId stamp [SH-221]
Seed resolvable Customer accounts and mock account resolution so create-path CI tests match fail-closed account scope.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 10:54:23 -03:00
Arthur Bassi
1edcf479ae fix(work-orders): apply account scope across create and reads [SH-221]
Stamp WorkOrder.AccountId on all create paths and filter board/list/search/detail by server-derived account claims so scoped callers cannot cross accounts.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 10:45:37 -03:00
Arthur Bassi
446e43b2c6 !fix(users): restrict DeleteUser to Admin [SH-221]
Align DeleteUser with AddUser/EditUser: Admin role at controller and
service entry, Forbidden for non-Admin, and regression coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 09:44:52 -03:00
Arthur Bassi
d0724a0ac5 !fix(users): restrict AccountId assignment to Admin [SH-221]
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-11 09:28:08 -03:00
Alexandre Brandizzi
c049721b6a
Merge branch 'dev' into feat/sh-101-uplift-lifecycle 2026-08-11 09:02:42 -03:00
Alexandre Brandizzi
f959cc45d0
Merge pull request #57 from Sea-Haven-Industries/feat/sh-98-portal-lifecycle
Some checks are pending
Validate and deploy dev / Validate deployable source bundle (push) Waiting to run
Validate and deploy dev / Deploy shoc-backend to Elastic Beanstalk dev (push) Blocked by required conditions
feat(vendor-portal): complete service request lifecycle (SH-98)
2026-08-11 09:01:59 -03:00
Alexandre Brandizzi
24283b320a feat(uplifts): complete SH-101 approval lifecycle 2026-08-11 08:58:19 -03:00
Alexandre Brandizzi
32387bc913
Merge branch 'dev' into feat/sh-98-portal-lifecycle 2026-08-11 08:53:33 -03:00
Alexandre Brandizzi
c4bac19520
Merge pull request #61 from Sea-Haven-Industries/dependabot/npm_and_yarn/infra/cdk/aws-cdk-2.1135.1
chore(deps-dev): bump aws-cdk from 2.1134.0 to 2.1135.1 in /infra/cdk
2026-08-11 08:49:08 -03:00
dependabot[bot]
03591907e5
chore(deps-dev): bump aws-cdk from 2.1134.0 to 2.1135.1 in /infra/cdk
Bumps [aws-cdk](https://github.com/aws/aws-cdk-cli/tree/HEAD/packages/aws-cdk) from 2.1134.0 to 2.1135.1.
- [Release notes](https://github.com/aws/aws-cdk-cli/releases)
- [Commits](https://github.com/aws/aws-cdk-cli/commits/aws-cdk@v2.1135.1/packages/aws-cdk)

---
updated-dependencies:
- dependency-name: aws-cdk
  dependency-version: 2.1135.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-11 11:44:16 +00:00
Alexandre Brandizzi
1716608b99
Merge pull request #60 from Sea-Haven-Industries/dependabot/npm_and_yarn/infra/cdk/types/node-26.2.0
Some checks are pending
Validate and deploy dev / Validate deployable source bundle (push) Waiting to run
Validate and deploy dev / Deploy shoc-backend to Elastic Beanstalk dev (push) Blocked by required conditions
chore(deps-dev): bump @types/node from 26.1.2 to 26.2.0 in /infra/cdk
2026-08-11 08:42:16 -03:00
Alexandre Brandizzi
548a59de6a
Merge branch 'dev' into dependabot/npm_and_yarn/infra/cdk/types/node-26.2.0 2026-08-11 08:37:17 -03:00
Alexandre Brandizzi
30806b9552
Merge pull request #59 from Sea-Haven-Industries/dependabot/npm_and_yarn/infra/cdk/constructs-10.8.1
chore(deps): bump constructs from 10.7.2 to 10.8.1 in /infra/cdk
2026-08-11 08:37:09 -03:00
Alexandre Brandizzi
3b7302abd6
Merge branch 'dev' into dependabot/npm_and_yarn/infra/cdk/constructs-10.8.1 2026-08-11 08:32:13 -03:00
Alexandre Brandizzi
16ca752558
Merge pull request #58 from Sea-Haven-Industries/dependabot/github_actions/aws-actions/aws-elasticbeanstalk-deploy-1.0.8
chore(deps): bump aws-actions/aws-elasticbeanstalk-deploy from 1.0.6 to 1.0.8
2026-08-11 08:31:43 -03:00
dependabot[bot]
26a7ad53f0
chore(deps-dev): bump @types/node from 26.1.2 to 26.2.0 in /infra/cdk
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 26.1.2 to 26.2.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 26.2.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-11 02:44:51 +00:00
dependabot[bot]
d52b73eba9
chore(deps): bump constructs from 10.7.2 to 10.8.1 in /infra/cdk
Bumps [constructs](https://github.com/aws/constructs) from 10.7.2 to 10.8.1.
- [Release notes](https://github.com/aws/constructs/releases)
- [Commits](https://github.com/aws/constructs/compare/v10.7.2...v10.8.1)

---
updated-dependencies:
- dependency-name: constructs
  dependency-version: 10.8.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-11 02:44:46 +00:00
dependabot[bot]
c0f6f78661
chore(deps): bump aws-actions/aws-elasticbeanstalk-deploy
Bumps [aws-actions/aws-elasticbeanstalk-deploy](https://github.com/aws-actions/aws-elasticbeanstalk-deploy) from 1.0.6 to 1.0.8.
- [Release notes](https://github.com/aws-actions/aws-elasticbeanstalk-deploy/releases)
- [Changelog](https://github.com/aws-actions/aws-elasticbeanstalk-deploy/blob/main/CHANGELOG.md)
- [Commits](cfad3e5e44...7883cdd454)

---
updated-dependencies:
- dependency-name: aws-actions/aws-elasticbeanstalk-deploy
  dependency-version: 1.0.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-11 02:44:28 +00:00
Alexandre Brandizzi
5dcd68b0a1 fix(vendor-portal): block uplift approval after refusal 2026-08-10 13:22:16 -03:00
Alexandre Brandizzi
7dabd25155 feat(vendor-portal): add refusal lifecycle (SH-98) 2026-08-10 13:00:32 -03:00
Arthur Bassi
ea2dedf579 !fix(work-orders): fail-closed media account scope with org_scope claim [SH-221] 2026-08-06 10:26:04 -03:00
Arthur Bassi
fdc315d8fe !feat(work-orders): enforce media account scope and AddMedia freshness [SH-221] 2026-08-06 09:47:34 -03:00
Arthur Bassi
e572786b1c ~docs(work-orders): demote ADR 0001 to Proposed pending CODEOWNERS [SH-116] 2026-08-05 09:57:14 -03:00
Arthur Bassi
8ff4ab1742 fix(work-orders): document single-org media scope (ADR 0001)
Clarify SH-116 tenant scope as board-aligned ApplyBaseScope + claims, and add out-of-org-scope GET/mutation tests for deleted/template/missing WOs.
2026-08-04 16:07:26 -03:00
Arthur Bassi
6b18327d6b fix(work-orders): authorize GET media and forward cancellation
Enforce claims-derived read scope on media list and thread CancellationToken through detail data reads so HTTP cancel stops EF work.
2026-08-04 14:14:37 -03:00
Arthur Bassi
680012d88b fix(work-orders): enforce media role scope and relational concurrency
Derive staff vs technician scope from claims (Assigned for User), map
DbUpdateConcurrencyException to a stable 409, and add SQLite competing-write
tests for categorize-vs-categorize and categorize-vs-delete.
2026-08-04 11:08:18 -03:00
Arthur Bassi
899da0eb4f fix(work-orders): enforce media auth and base scope on mutations
Require an authenticated ClaimsPrincipal at service entry and filter
tracked work orders with board base scope so deleted/template rows
surface as NotFound without disclosure.
2026-08-04 11:08:18 -03:00
Arthur Bassi
2ec85d1193 fix(work-orders): harden media upload contract for review blockers
Enforce MIME/extension/magic-byte validation, auth and workOrderVersion concurrency, audit on category changes, and validate-before-store with blob compensate.
2026-08-04 11:08:18 -03:00
Alexandre Brandizzi
d073a503d1 feat(work-orders): board completedDate + media categorize contract
Expose completedDate on PATCH /workorders/{id}/board so CompDoc can leave legacy EditWorkorder. Allow optional media category on upload, PATCH category afterward, and enforce JPG/PNG/MP4/MOV allowlist (SH-116).
2026-08-04 11:08:18 -03:00
dependabot[bot]
a7b1f3bc40
chore(deps-dev): bump typescript from 5.9.3 to 7.0.2 in /infra/cdk (#53)
Some checks failed
Validate and deploy dev / Validate deployable source bundle (push) Has been cancelled
Validate and deploy dev / Deploy shoc-backend to Elastic Beanstalk dev (push) Has been cancelled
* chore(deps-dev): bump typescript from 5.9.3 to 7.0.2 in /infra/cdk

Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.9.3 to 7.0.2.
- [Release notes](https://github.com/microsoft/TypeScript/releases)
- [Commits](https://github.com/microsoft/TypeScript/commits)

---
updated-dependencies:
- dependency-name: typescript
  dependency-version: 7.0.2
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix(cdk): migrate TypeScript config for TS 7 moduleResolution

Use Node16 module/moduleResolution and explicit .js relative import
so npm run synth succeeds under TypeScript 7.0.2.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Arthur Bassi <arthur.bassi@luby.com.br>
2026-08-04 10:36:09 -03:00
dependabot[bot]
7a72be3088
chore(deps): bump constructs from 10.7.1 to 10.7.2 in /infra/cdk (#55)
Bumps [constructs](https://github.com/aws/constructs) from 10.7.1 to 10.7.2.
- [Release notes](https://github.com/aws/constructs/releases)
- [Commits](https://github.com/aws/constructs/compare/v10.7.1...v10.7.2)

---
updated-dependencies:
- dependency-name: constructs
  dependency-version: 10.7.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandre Brandizzi <alex_brandizzi@hotmail.com>
2026-08-04 10:17:22 -03:00
dependabot[bot]
466a40d8de
chore(deps-dev): bump @types/node from 22.20.1 to 26.1.2 in /infra/cdk (#54)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.20.1 to 26.1.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 26.1.2
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-04 10:10:29 -03:00
dependabot[bot]
b27bf06c8e
chore(deps-dev): bump aws-cdk from 2.1133.0 to 2.1134.0 in /infra/cdk (#52)
Some checks are pending
Validate and deploy dev / Validate deployable source bundle (push) Waiting to run
Validate and deploy dev / Deploy shoc-backend to Elastic Beanstalk dev (push) Blocked by required conditions
Bumps [aws-cdk](https://github.com/aws/aws-cdk-cli/tree/HEAD/packages/aws-cdk) from 2.1133.0 to 2.1134.0.
- [Release notes](https://github.com/aws/aws-cdk-cli/releases)
- [Commits](https://github.com/aws/aws-cdk-cli/commits/aws-cdk@v2.1134.0/packages/aws-cdk)

---
updated-dependencies:
- dependency-name: aws-cdk
  dependency-version: 2.1134.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandre Brandizzi <alex_brandizzi@hotmail.com>
2026-08-04 10:03:06 -03:00
dependabot[bot]
66e1a662c3
chore(deps): bump actions/checkout from 4 to 7 (#51)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v4...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandre Brandizzi <alex_brandizzi@hotmail.com>
2026-08-04 09:56:24 -03:00
dependabot[bot]
c7e7ffa313
chore(deps): bump actions/setup-dotnet from 4 to 6 (#50)
Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 4 to 6.
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](https://github.com/actions/setup-dotnet/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/setup-dotnet
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexandre Brandizzi <alex_brandizzi@hotmail.com>
2026-08-04 09:49:05 -03:00
dependabot[bot]
b2366acdfa
chore(deps): bump actions/setup-node from 6.5.0 to 7.0.0 (#49)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6.5.0 to 7.0.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](249970729c...8207627860)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-04 09:40:55 -03:00
Alexandre Brandizzi
669e9b2932
feat(vendors): add company roster management (SH-198) (#48)
Some checks are pending
Validate and deploy dev / Validate deployable source bundle (push) Waiting to run
Validate and deploy dev / Deploy shoc-backend to Elastic Beanstalk dev (push) Blocked by required conditions
* feat(vendors): add company roster management

* fix(security): remove request-controlled write guards

* fix(vendors): synchronize roster company fields

* fix(vendors): source facets from companies
2026-08-03 17:53:24 -03:00