refactor: remove the legacy customer creation path #6

Merged
macoun merged 2 commits from refactor/remove-legacy-customer-path into main 2026-10-16 10:41:41 +00:00
Owner

Summary

Contracts are created for a portal company only (ADR-020). The old path that created
customers from free text and merged them by IČO or name was used only by the practice contract.

  • CreateContractRequest drops customerId / newCustomer; UpdateContractRequest drops customerId
    (the frontend always sent null).
  • The practice contract gets one fixed practice customer, chosen by the server.
  • Removed the unused GET /customers and GET /customers/{id} (no frontend caller).
  • The demo seeder creates its own customers and calls CreateForCustomerAsync, because it runs
    without a signed-in user and cannot reach the portal.
  • Tests create contracts for companies from the portal stub; customer card tests removed with the endpoint.
  • API schema, .http examples and docs updated.
  • Separate commit: fixes 6 nullable warnings in tests.

No database changes. Existing contracts and customers stay as they are.

Testing

  • dotnet build (0 warnings), dotnet test: 234 passed
  • npm run lint, npm run build
  • dotnet ef migrations has-pending-model-changes: no changes
## Summary Contracts are created for a portal company only (ADR-020). The old path that created customers from free text and merged them by IČO or name was used only by the practice contract. - `CreateContractRequest` drops `customerId` / `newCustomer`; `UpdateContractRequest` drops `customerId` (the frontend always sent null). - The practice contract gets one fixed practice customer, chosen by the server. - Removed the unused `GET /customers` and `GET /customers/{id}` (no frontend caller). - The demo seeder creates its own customers and calls `CreateForCustomerAsync`, because it runs without a signed-in user and cannot reach the portal. - Tests create contracts for companies from the portal stub; customer card tests removed with the endpoint. - API schema, `.http` examples and docs updated. - Separate commit: fixes 6 nullable warnings in tests. No database changes. Existing contracts and customers stay as they are. ## Testing - `dotnet build` (0 warnings), `dotnet test`: 234 passed - `npm run lint`, `npm run build` - `dotnet ef migrations has-pending-model-changes`: no changes
Contracts are created for a portal company only. The practice contract gets
one fixed practice customer instead of sending newCustomer from the frontend.

- drop CustomerId/NewCustomer from CreateContractRequest and CustomerId from
  UpdateContractRequest, together with the IČO/name dedupe
- remove the unused GET /customers endpoints (CustomersController/Service)
- demo seeder creates its own customers and calls CreateForCustomerAsync,
  because it runs without a signed-in user and cannot reach the portal
- tests create contracts for companies from the portal stub
- update the API schema, .http examples and docs
test: fix nullable warnings in team and role tests
All checks were successful
Build and publish Docker image / migrations-check (pull_request) Successful in 45s
Build and publish Docker image / frontend (pull_request) Successful in 43s
Build and publish Docker image / test (pull_request) Successful in 1m41s
Build and publish Docker image / build-and-push (pull_request) Has been skipped
0369b2eb5e
macoun merged commit 9ecb8d2068 into main 2026-10-16 10:41:41 +00:00
macoun deleted branch refactor/remove-legacy-customer-path 2026-10-16 10:41:42 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
STATOTEST/contract-microservice!6
No description provided.