Skip to content

implemented property management - #316

Open
henry-casper wants to merge 28 commits into
mainfrom
feat/Implement-property-management-section-on-admin-side-of-Community-Portal
Open

implemented property management#316
henry-casper wants to merge 28 commits into
mainfrom
feat/Implement-property-management-section-on-admin-side-of-Community-Portal

Conversation

@henry-casper

@henry-casper henry-casper commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary by Sourcery

Implement end-to-end property management with full-field CRUD, community authorization, soft deletion, and comprehensive verification coverage.

New Features:

  • Add property management across the domain, application services, GraphQL API, admin UI, API acceptance tests, UI acceptance tests, and end-to-end tests, including full listing, location, ownership, media, amenity, and agent fields.
  • Add community-scoped property authorization based on management permissions and active member accounts.
  • Add property creation, editing, listing, detail viewing, soft deletion, name reuse after deletion, and form validation workflows.
  • Expose member-role lookups and batched owner resolution needed by property management.

Bug Fixes:

  • Prevent soft-deleted properties from appearing in reads or blocking property-name reuse.
  • Preserve zero-valued listing fields and safely handle missing nested property data in persistence adapters.
  • Prevent acceptance-test seed races and ensure asynchronous integration handlers settle before scenario cleanup.
  • Harden staff-role updates against blank or unauthorized enterprise application roles.

Enhancements:

  • Extend property domain behavior with nullable fields, half-step bathroom validation, explicit tag-limit errors, owner clearing, and manage-property permission assertions.
  • Improve request principal handling by validating member/community hints and propagating member context through API test requests.
  • Add shared property form and page abstractions with consistent formatting, validation, ownership controls, and Save & Close behavior.

Build:

  • Pin Azure Functions Core Tools to version 4.13.0 and tighten Playwright and tool-cache installation conditions.
  • Update workspace dependency overrides and lockfile entries.

Tests:

  • Add comprehensive unit, feature, acceptance, UI, Storybook, and E2E coverage for property management, authorization, validation, soft deletion, and full-field workflows.
  • Add regression coverage for staff-role authorization, persistence sessions, populated references, member batching, and application-service principal validation.

Chores:

  • Add the Property entity reference to generated context mappings and seed an additional end-user for cross-community and deactivation scenarios.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@henry-casper
henry-casper requested a review from a team August 10, 2026 02:59
@henry-casper
henry-casper requested a review from a team as a code owner August 10, 2026 02:59

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @henry-casper, your pull request is larger than the review limit of 150000 diff characters

@sourcery-ai

sourcery-ai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Implements end-to-end property management capabilities across API, persistence, GraphQL, admin UI, and verification tests, including permissions, soft-delete semantics, and test-time event handler wiring.

Sequence diagram for soft-deleted property removal via GraphQL

sequenceDiagram
  actor AdminUser
  participant AdminUI as AdminUI_Properties
  participant GraphQL as GraphQL_Server
  participant Resolvers as PropertyResolvers
  participant Service as PropertyApplicationService
  participant Repo as PropertyRepository
  participant DB as MongoDB

  AdminUser->>AdminUI: click RemoveProperty
  AdminUI->>GraphQL: propertyDelete(input.id)
  GraphQL->>Resolvers: Mutation.propertyDelete
  Resolvers->>Service: requestDelete({ id })
  Service->>Repo: getById(id)
  Repo->>DB: findById(id).populate(['community','owner'])
  Repo-->>Service: Property aggregate
  Service-->>Repo: aggregate.requestDelete()
  Repo->>DB: save({ isDeleted: true })
  Repo-->>Service: deleted aggregate
  Service-->>Resolvers: PropertyMutationResult{ status.success }
  Resolvers-->>GraphQL: propertyDelete payload
  GraphQL-->>AdminUI: success, property removed from list
Loading

File-Level Changes

Change Details Files
Add full property management flow (create, update, delete, list, view) across application services, GraphQL schema/resolvers, persistence read/write repos, and readonly data sources, with soft-delete behavior and listing-detail value objects.
  • Introduce Property application-service context with create, update, requestDelete, queryById, and queryByCommunityId commands wired to domain and readonly data sources.
  • Define Property GraphQL types, inputs, mutations, and resolvers that enforce verified-user/community hints, map nullable fields correctly, and surface mutation status with error messages.
  • Extend readonly persistence with PropertyContext and PropertyReadRepository that populates community/owner, filters out soft-deleted properties, and adds tests.
  • Override PropertyRepository.save to implement soft-delete via isDeleted flag while preserving event dispatch and integration-events tracking, plus tests for delete behavior.
packages/ocom/application-services/src/index.ts
packages/ocom/application-services/src/contexts/property/index.ts
packages/ocom/application-services/src/contexts/property/property/index.ts
packages/ocom/application-services/src/contexts/property/property/create.ts
packages/ocom/application-services/src/contexts/property/property/update.ts
packages/ocom/application-services/src/contexts/property/property/request-delete.ts
packages/ocom/application-services/src/contexts/property/property/query-by-id.ts
packages/ocom/application-services/src/contexts/property/property/query-by-community-id.ts
packages/ocom/graphql/src/schema/types/property.graphql
packages/ocom/graphql/src/schema/types/property.resolvers.ts
packages/ocom/graphql/src/schema/types/property.resolvers.unit.test.ts
packages/ocom/persistence/src/datasources/domain/property/property/property.repository.ts
packages/ocom/persistence/src/datasources/domain/property/property/property.repository.soft-delete.test.ts
packages/ocom/persistence/src/datasources/readonly/index.ts
packages/ocom/persistence/src/datasources/readonly/property/index.ts
packages/ocom/persistence/src/datasources/readonly/property/property/property.data.ts
packages/ocom/persistence/src/datasources/readonly/property/property/property.read-repository.ts
packages/ocom/persistence/src/datasources/readonly/property/property/property.read-repository.test.ts
codegen.yml
Expose property management in the admin community UI, guarded by end-user role permissions, with list, create, and detail (edit + delete) flows plus Storybook coverage and mocks for property-specific tests.
  • Add Properties route tree under /community/:communityId/admin/:memberId/properties with list, create, and detail pages wrapped in a PropertiesRouteGuard that enforces canManageProperties from member.role.permissions.propertyPermissions.
  • Implement PropertiesList, PropertiesListContainer, and associated GraphQL fragment/query to render a paginated table with basic property and listing detail columns and View actions.
  • Implement PropertiesCreate and PropertiesCreateContainer that validate propertyName, call propertyCreate mutation, handle success/error via AntD messages, refetch the list, and navigate to the new detail route.
  • Implement PropertiesDetail, PropertiesDetailContainer, and PropertiesDetail form that show meta info, support editing propertyName/propertyType/listingDetail, and provide a guarded Remove flow using propertyUpdate/propertyDelete mutations with AntD messages and navigation.
  • Add Storybook stories for containers, pages, and pure components to exercise success, loading, error, not-found, and remove flows using MockedProvider.
  • Wire admin menu to show Properties when propertyPermissions.canManageProperties is true, and extend AdminSectionLayout GraphQL fragment to fetch role.permissions.propertyPermissions.canManageProperties.
packages/ocom/ui-community-route-admin/src/index.tsx
packages/ocom/ui-community-route-admin/src/section-layout.graphql
packages/ocom/ui-community-route-admin/src/pages/properties.tsx
packages/ocom/ui-community-route-admin/src/pages/properties-list.tsx
packages/ocom/ui-community-route-admin/src/pages/properties-create.tsx
packages/ocom/ui-community-route-admin/src/pages/properties-detail.tsx
packages/ocom/ui-community-route-admin/src/components/properties-route-guard.container.tsx
packages/ocom/ui-community-route-admin/src/components/properties-list.tsx
packages/ocom/ui-community-route-admin/src/components/properties-list.container.tsx
packages/ocom/ui-community-route-admin/src/components/properties-list.container.graphql
packages/ocom/ui-community-route-admin/src/components/properties-create.tsx
packages/ocom/ui-community-route-admin/src/components/properties-create.container.tsx
packages/ocom/ui-community-route-admin/src/components/properties-create.container.graphql
packages/ocom/ui-community-route-admin/src/components/properties-detail.tsx
packages/ocom/ui-community-route-admin/src/components/properties-detail.container.tsx
packages/ocom/ui-community-route-admin/src/components/properties-detail.container.graphql
packages/ocom/ui-community-route-admin/src/components/properties-route-guard.container.stories.tsx
packages/ocom/ui-community-route-admin/src/components/properties-list.stories.tsx
packages/ocom/ui-community-route-admin/src/components/properties-list.container.stories.tsx
packages/ocom/ui-community-route-admin/src/components/properties-create.stories.tsx
packages/ocom/ui-community-route-admin/src/components/properties-create.container.stories.tsx
packages/ocom/ui-community-route-admin/src/components/properties-detail.stories.tsx
packages/ocom/ui-community-route-admin/src/components/properties-detail.container.stories.tsx
packages/ocom/ui-community-route-admin/src/pages/properties.stories.tsx
packages/ocom/ui-community-route-admin/src/pages/properties-list.stories.tsx
packages/ocom/ui-community-route-admin/src/pages/properties-create.stories.tsx
packages/ocom/ui-community-route-admin/src/pages/properties-detail.stories.tsx
Add end-user role property permissions to the GraphQL schema and verification, and ensure member.role resolution works even when the relation is not already populated.
  • Extend EndUserRole GraphQL type with EndUserRolePermissions and nested EndUserRolePropertyPermissions containing canManageProperties/canEditOwnProperty flags used by the admin UI guard.
  • Add MEMBER_ROLE_PROPERTY_PERMISSIONS_QUERY and corresponding question to assert canManageProperties/canEditOwnProperty for a member in acceptance tests.
  • Change Member.role resolver to first try parent.role, then fall back to applicationServices.Community.Member.queryByIdWithRole, and wire queryByIdWithRole through application services and readonly data source.
  • Update member.resolvers.additional.test.ts to cover the async role resolver behavior including the fallback path.
packages/ocom/graphql/src/schema/types/end-user-role.graphql
packages/ocom/graphql/src/schema/types/member.resolvers.ts
packages/ocom/graphql/src/schema/types/member.resolvers.additional.test.ts
packages/ocom/application-services/src/contexts/community/member/index.ts
packages/ocom/application-services/src/contexts/community/member/query-by-id-with-role.ts
packages/ocom-verification/acceptance-api/src/shared/graphql/property-operations.ts
packages/ocom-verification/acceptance-api/src/contexts/property/questions/property-manager-permission.ts
packages/ocom/ui-community-route-admin/src/components/properties-route-guard.container.tsx
packages/ocom/ui-community-route-admin/src/section-layout.graphql
Enhance the Property mongoose model to support soft-delete and avoid invalid default coordinates, and adjust repository behavior accordingly.
  • Add isDeleted: boolean field with default false to the Property schema and interface for soft-delete tracking.
  • Adjust location.type/coordinates definitions to avoid required defaults that conflict with optional coordinates, setting coordinates default to undefined.
  • Ensure PropertyRepository.getById populates community and owner so downstream domain code and read repos have the necessary relations.
  • Cover soft-delete semantics and integration events retention in dedicated tests.
packages/ocom/data-sources-mongoose-models/src/models/property/property.model.ts
packages/ocom/persistence/src/datasources/domain/property/property/property.repository.ts
packages/ocom/persistence/src/datasources/domain/property/property/property.repository.soft-delete.test.ts
Wire property management into verification stacks (API, UI, E2E) with Serenity abilities, tasks, questions, step definitions, and shared page objects, plus event-handler registration and auth context headers.
  • Add CreateProperty, UpdateProperty, DeleteProperty, ProvisionResidentMember abilities for the API tests, and corresponding tasks (BecomePropertyManager, BecomeResidentMember, Create/Update/Delete/Attempt*Property, View list/details) and questions (PropertiesList, PropertyNamed, PropertyField, PropertyOperationStatus/Error, PropertyRetrievable, ViewedProperty, PropertyManagerPermission).
  • Add GraphQL client support for x-member-id/x-community-id headers and test-server context that passes header-derived member/community hints into ApplicationServicesFactory.forRequest.
  • Register production @ocom/event-handler handlers once per test process via registerIntegrationEventHandlersOnce, so CommunityCreated integration events provision admin members and roles for property scenarios.
  • Introduce mock-property-backend ability for acceptance-ui with in-memory state, dynamic Apollo mocks, and questions/tasks to drive UI-level property tests without hitting a real backend.
  • Add Playwright-based admin-portal page ability and property-specific interactions/tasks (login + BecomePropertyManager, OpenAdminPortal, OpenPropertiesList/Detail, Fill/Submit forms, Confirm removal) plus questions around list content, detail fields, retrievability, manage-properties guard, validation, and mutation outcomes.
  • Define feature files for property-management happy-path and authorization scenarios, and hook property step-definition index files into acceptance-api, acceptance-ui, and e2e test suites.
  • Include shared PropertiesListPage and PropertyFormPage page objects for DOM/Playwright reuse.
  • Ensure acceptance-ui tsconfig includes ui-community-route-admin sources so property UI components are type-checked, and expose abilities from the aggregated index.ts.
  • Add @ocom-event-handler and @ocom-verification/verification-shared as devDependencies of acceptance-api for event handler registration and shared test data.
  • Adjust STAFF/USER token handling so end-user tokens resolve to AccountPortal principals used by property scenarios.
packages/ocom-verification/acceptance-api/src/mock-application-services.ts
packages/ocom-verification/acceptance-api/src/servers/api-graphql-test-server.ts
packages/ocom-verification/acceptance-api/src/shared/abilities/actor-auth.ts
packages/ocom-verification/acceptance-api/src/shared/abilities/graphql-client.ts
packages/ocom-verification/acceptance-api/src/shared/abilities/create-property.ts
packages/ocom-verification/acceptance-api/src/shared/abilities/update-property.ts
packages/ocom-verification/acceptance-api/src/shared/abilities/delete-property.ts
packages/ocom-verification/acceptance-api/src/shared/abilities/provision-resident-member.ts
packages/ocom-verification/acceptance-api/src/shared/graphql/property-operations.ts
packages/ocom-verification/acceptance-api/src/world.ts
packages/ocom-verification/acceptance-api/src/shared/abilities/index.ts
packages/ocom-verification/acceptance-api/src/contexts/property/notes/property-notes.ts
packages/ocom-verification/acceptance-api/src/contexts/property/questions/properties-list.ts
packages/ocom-verification/acceptance-api/src/contexts/property/questions/property-named.ts
packages/ocom-verification/acceptance-api/src/contexts/property/questions/property-field.ts
packages/ocom-verification/acceptance-api/src/contexts/property/questions/property-operation-outcome.ts
packages/ocom-verification/acceptance-api/src/contexts/property/questions/property-retrievable.ts
packages/ocom-verification/acceptance-api/src/contexts/property/questions/viewed-property.ts
packages/ocom-verification/acceptance-api/src/contexts/property/questions/property-manager-permission.ts
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/become-property-manager.ts
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/provision-resident-member.ts
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/create-property.ts
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/update-property-input.ts
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/update-property.ts
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/delete-property.ts
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/attempt-create-property.ts
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/attempt-update-property.ts
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/attempt-delete-property.ts
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/view-properties-list.ts
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/view-property-details.ts
packages/ocom-verification/acceptance-api/src/contexts/property/step-definitions/property-management.steps.ts
packages/ocom-verification/acceptance-api/src/contexts/property/step-definitions/index.ts
packages/ocom-verification/verification-shared/src/pages/properties-list.page.ts
packages/ocom-verification/verification-shared/src/pages/property-form.page.ts
packages/ocom-verification/verification-shared/src/pages/index.ts
packages/ocom-verification/verification-shared/src/scenarios/property/property-management.feature
packages/ocom-verification/verification-shared/src/scenarios/property/property-authorization.feature
packages/ocom-verification/acceptance-ui/src/contexts/property/abilities/mock-property-backend.ts
packages/ocom-verification/acceptance-ui/src/contexts/property/notes/property-ui-notes.ts
packages/ocom-verification/acceptance-ui/src/contexts/property/questions/property-screen.ts
packages/ocom-verification/acceptance-ui/src/contexts/property/tasks/properties-screen.ts
packages/ocom-verification/acceptance-ui/src/contexts/property/tasks/manage-property.ts
packages/ocom-verification/acceptance-ui/src/contexts/property/step-definitions/property-management.steps.ts
packages/ocom-verification/acceptance-ui/src/contexts/property/step-definitions/index.ts
packages/ocom-verification/e2e-tests/src/contexts/property/abilities/admin-portal-page.ts
packages/ocom-verification/e2e-tests/src/contexts/property/notes/property-notes.ts
packages/ocom-verification/e2e-tests/src/contexts/property/interactions/open-admin-portal.ts
packages/ocom-verification/e2e-tests/src/contexts/property/interactions/open-properties-list.ts
packages/ocom-verification/e2e-tests/src/contexts/property/interactions/open-create-property-form.ts
packages/ocom-verification/e2e-tests/src/contexts/property/interactions/open-property-detail.ts
packages/ocom-verification/e2e-tests/src/contexts/property/interactions/fill-property-form.ts
packages/ocom-verification/e2e-tests/src/contexts/property/interactions/submit-property-create.ts
packages/ocom-verification/e2e-tests/src/contexts/property/interactions/submit-property-save.ts
packages/ocom-verification/e2e-tests/src/contexts/property/interactions/confirm-property-removal.ts
packages/ocom-verification/e2e-tests/src/contexts/property/interactions/record-property-notes.ts
packages/ocom-verification/e2e-tests/src/contexts/property/tasks/become-property-manager.ts
packages/ocom-verification/e2e-tests/src/contexts/property/tasks/ensure-property-exists.ts
packages/ocom-verification/e2e-tests/src/contexts/property/tasks/create-property.ts
packages/ocom-verification/e2e-tests/src/contexts/property/tasks/update-property.ts
packages/ocom-verification/e2e-tests/src/contexts/property/tasks/delete-property.ts
packages/ocom-verification/e2e-tests/src/contexts/property/tasks/view-properties-list.ts
packages/ocom-verification/e2e-tests/src/contexts/property/tasks/view-property-details.ts
packages/ocom-verification/e2e-tests/src/contexts/property/questions/property-screen.ts
packages/ocom-verification/e2e-tests/src/contexts/property/step-definitions/property-management.steps.ts
packages/ocom-verification/e2e-tests/src/contexts/property/step-definitions/index.ts
packages/ocom-verification/e2e-tests/src/shared/support/graphql-response.ts
packages/ocom-verification/acceptance-api/src/step-definitions/index.ts
packages/ocom-verification/acceptance-ui/src/step-definitions/index.ts
packages/ocom-verification/e2e-tests/src/step-definitions/index.ts
packages/ocom-verification/acceptance-api/package.json
packages/ocom-verification/acceptance-ui/tsconfig.json
packages/ocom-verification/verification-shared/test-data.ts
Security and dependency hygiene updates related to property work, including auth token prefixes, dependency additions, and override bumps.
  • Extend actor-auth with USER_TOKEN_PREFIX and helpers (userTokenFor, actor context headers) to differentiate staff vs end-user principals and carry member/community context via x-member-id/x-community-id headers.
  • Adjust acceptance-api GraphQL test server to pass auth and member/community hints into ApplicationServicesFactory.forRequest.
  • Add @ocom-event-handler and @ocom-verification/verification-shared devDependencies needed by property tests.
  • Update pnpm workspace overrides for brace-expansion, fast-uri, js-yaml, '@apollo/protobufjs', nanoid, and add image-size advisories to auditConfig skip list.
packages/ocom-verification/acceptance-api/src/shared/abilities/actor-auth.ts
packages/ocom-verification/acceptance-api/src/shared/abilities/graphql-client.ts
packages/ocom-verification/acceptance-api/src/servers/api-graphql-test-server.ts
packages/ocom-verification/acceptance-api/package.json
pnpm-workspace.yaml
pnpm-lock.yaml

Possibly linked issues

  • #: PR delivers admin property management: GraphQL API, services, soft-delete persistence, admin UI with route guard, Storybook, and verification tests per issue requirements.
  • #[Community][Admin] Migrate Property Management: PR adds domain, GraphQL, UI, and test support for admin property management, matching the migration’s requested functionality.
  • #: PR implements community admin property management (domain, GraphQL, UI, tests) exactly as requested in the issue.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds end-to-end property management across the domain, persistence, GraphQL API, community-admin UI, and verification suites.

Changes:

  • Adds property CRUD, permissions, role resolution, and soft deletion.
  • Adds guarded admin property list/create/detail pages.
  • Adds extensive Storybook, acceptance, and E2E coverage plus dependency security overrides.

Reviewed changes

Copilot reviewed 128 out of 129 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pnpm-workspace.yaml Updates security overrides and audit exceptions.
packages/ocom/ui-community-route-admin/src/section-layout.graphql Queries property-management permission.
packages/ocom/ui-community-route-admin/src/pages/properties.tsx Adds property routes.
packages/ocom/ui-community-route-admin/src/pages/properties.stories.tsx Tests guarded property page states.
packages/ocom/ui-community-route-admin/src/pages/properties-list.tsx Adds property-list page layout.
packages/ocom/ui-community-route-admin/src/pages/properties-list.stories.tsx Covers list page states.
packages/ocom/ui-community-route-admin/src/pages/properties-detail.tsx Adds property-detail page.
packages/ocom/ui-community-route-admin/src/pages/properties-detail.stories.tsx Covers detail page states.
packages/ocom/ui-community-route-admin/src/pages/properties-create.tsx Adds property-create page.
packages/ocom/ui-community-route-admin/src/pages/properties-create.stories.tsx Covers create page rendering.
packages/ocom/ui-community-route-admin/src/index.tsx Registers property menu and route.
packages/ocom/ui-community-route-admin/src/components/properties-route-guard.container.tsx Enforces route permission.
packages/ocom/ui-community-route-admin/src/components/properties-route-guard.container.stories.tsx Covers guard outcomes.
packages/ocom/ui-community-route-admin/src/components/properties-list.tsx Renders the property table.
packages/ocom/ui-community-route-admin/src/components/properties-list.stories.tsx Covers property-table states.
packages/ocom/ui-community-route-admin/src/components/properties-list.container.tsx Loads and navigates properties.
packages/ocom/ui-community-route-admin/src/components/properties-list.container.stories.tsx Covers list-container behavior.
packages/ocom/ui-community-route-admin/src/components/properties-list.container.graphql Defines property-list query.
packages/ocom/ui-community-route-admin/src/components/properties-detail.tsx Adds edit and removal form.
packages/ocom/ui-community-route-admin/src/components/properties-detail.stories.tsx Covers detail interactions.
packages/ocom/ui-community-route-admin/src/components/properties-detail.container.tsx Handles update and deletion.
packages/ocom/ui-community-route-admin/src/components/properties-detail.container.stories.tsx Covers detail-container flows.
packages/ocom/ui-community-route-admin/src/components/properties-detail.container.graphql Defines detail CRUD operations.
packages/ocom/ui-community-route-admin/src/components/properties-create.tsx Adds property creation form.
packages/ocom/ui-community-route-admin/src/components/properties-create.stories.tsx Covers create-form validation.
packages/ocom/ui-community-route-admin/src/components/properties-create.container.tsx Handles property creation.
packages/ocom/ui-community-route-admin/src/components/properties-create.container.stories.tsx Covers creation outcomes.
packages/ocom/ui-community-route-admin/src/components/properties-create.container.graphql Defines create mutation.
packages/ocom/persistence/src/datasources/readonly/property/property/property.read-repository.ts Adds filtered property reads.
packages/ocom/persistence/src/datasources/readonly/property/property/property.read-repository.test.ts Tests read filtering and population.
packages/ocom/persistence/src/datasources/readonly/property/property/property.data.ts Defines property data source.
packages/ocom/persistence/src/datasources/readonly/property/property/index.ts Exposes property repository.
packages/ocom/persistence/src/datasources/readonly/property/index.ts Builds property read context.
packages/ocom/persistence/src/datasources/readonly/index.ts Registers property read context.
packages/ocom/persistence/src/datasources/domain/property/property/property.repository.ts Adds population and soft-delete saving.
packages/ocom/persistence/src/datasources/domain/property/property/property.repository.soft-delete.test.ts Tests soft-delete persistence.
packages/ocom/graphql/src/schema/types/property.resolvers.ts Adds property query and mutation resolvers.
packages/ocom/graphql/src/schema/types/property.graphql Defines property GraphQL API.
packages/ocom/graphql/src/schema/types/member.resolvers.ts Adds role lookup fallback.
packages/ocom/graphql/src/schema/types/member.resolvers.additional.test.ts Updates role resolver coverage.
packages/ocom/graphql/src/schema/types/end-user-role.graphql Exposes property permissions.
packages/ocom/domain/src/domain/contexts/property/property/index.ts Exports property domain types.
packages/ocom/data-sources-mongoose-models/src/models/property/property.model.ts Adds deletion flag and location changes.
packages/ocom/application-services/src/index.ts Registers property services.
packages/ocom/application-services/src/contexts/property/property/update.ts Implements property updates.
packages/ocom/application-services/src/contexts/property/property/request-delete.ts Implements deletion requests.
packages/ocom/application-services/src/contexts/property/property/query-by-id.ts Adds property lookup.
packages/ocom/application-services/src/contexts/property/property/query-by-community-id.ts Adds community property lookup.
packages/ocom/application-services/src/contexts/property/property/index.ts Composes property operations.
packages/ocom/application-services/src/contexts/property/property/create.ts Implements property creation.
packages/ocom/application-services/src/contexts/property/index.ts Builds property service context.
packages/ocom/application-services/src/contexts/community/member/query-by-id-with-role.ts Adds populated member lookup.
packages/ocom/application-services/src/contexts/community/member/index.ts Registers member-role lookup.
packages/ocom-verification/verification-shared/src/scenarios/property/property-management.feature Specifies property CRUD behavior.
packages/ocom-verification/verification-shared/src/scenarios/property/property-authorization.feature Specifies authorization behavior.
packages/ocom-verification/verification-shared/src/pages/property-form.page.ts Adds shared property-form page object.
packages/ocom-verification/verification-shared/src/pages/properties-list.page.ts Adds shared property-list page object.
packages/ocom-verification/verification-shared/src/pages/index.ts Exports property page objects.
packages/ocom-verification/e2e-tests/src/step-definitions/index.ts Registers property E2E steps.
packages/ocom-verification/e2e-tests/src/shared/support/graphql-response.ts Adds GraphQL response helpers.
packages/ocom-verification/e2e-tests/src/contexts/property/tasks/view-property-details.ts Adds detail-view task.
packages/ocom-verification/e2e-tests/src/contexts/property/tasks/view-properties-list.ts Adds list-view task.
packages/ocom-verification/e2e-tests/src/contexts/property/tasks/update-property.ts Adds update task.
packages/ocom-verification/e2e-tests/src/contexts/property/tasks/ensure-property-exists.ts Adds conditional creation task.
packages/ocom-verification/e2e-tests/src/contexts/property/tasks/delete-property.ts Adds removal task.
packages/ocom-verification/e2e-tests/src/contexts/property/tasks/create-property.ts Adds creation task.
packages/ocom-verification/e2e-tests/src/contexts/property/tasks/become-property-manager.ts Provisions E2E property managers.
packages/ocom-verification/e2e-tests/src/contexts/property/step-definitions/index.ts Loads property steps.
packages/ocom-verification/e2e-tests/src/contexts/property/questions/property-screen.ts Adds property-screen assertions.
packages/ocom-verification/e2e-tests/src/contexts/property/notes/property-notes.ts Defines E2E property state.
packages/ocom-verification/e2e-tests/src/contexts/property/interactions/submit-property-save.ts Captures update outcomes.
packages/ocom-verification/e2e-tests/src/contexts/property/interactions/submit-property-create.ts Captures creation outcomes.
packages/ocom-verification/e2e-tests/src/contexts/property/interactions/record-property-notes.ts Records list baselines.
packages/ocom-verification/e2e-tests/src/contexts/property/interactions/open-property-detail.ts Opens property details.
packages/ocom-verification/e2e-tests/src/contexts/property/interactions/open-properties-list.ts Opens property lists.
packages/ocom-verification/e2e-tests/src/contexts/property/interactions/open-create-property-form.ts Opens creation form.
packages/ocom-verification/e2e-tests/src/contexts/property/interactions/open-admin-portal.ts Opens provisioned admin portal.
packages/ocom-verification/e2e-tests/src/contexts/property/interactions/fill-property-form.ts Fills property forms.
packages/ocom-verification/e2e-tests/src/contexts/property/interactions/confirm-property-removal.ts Confirms property deletion.
packages/ocom-verification/e2e-tests/src/contexts/property/abilities/admin-portal-page.ts Adds property navigation helpers.
packages/ocom-verification/acceptance-ui/tsconfig.json Includes admin route sources.
packages/ocom-verification/acceptance-ui/src/step-definitions/index.ts Registers property UI steps.
packages/ocom-verification/acceptance-ui/src/contexts/property/tasks/properties-screen.ts Renders property acceptance screens.
packages/ocom-verification/acceptance-ui/src/contexts/property/tasks/manage-property.ts Implements UI CRUD tasks.
packages/ocom-verification/acceptance-ui/src/contexts/property/step-definitions/index.ts Loads property UI steps.
packages/ocom-verification/acceptance-ui/src/contexts/property/questions/property-screen.ts Adds UI screen assertions.
packages/ocom-verification/acceptance-ui/src/contexts/property/questions/property-outcome.ts Adds mocked outcome questions.
packages/ocom-verification/acceptance-ui/src/contexts/property/notes/property-ui-notes.ts Defines UI scenario state.
packages/ocom-verification/acceptance-api/src/world.ts Registers property API abilities.
packages/ocom-verification/acceptance-api/src/step-definitions/index.ts Registers property API steps.
packages/ocom-verification/acceptance-api/src/shared/graphql/property-operations.ts Defines verification GraphQL operations.
packages/ocom-verification/acceptance-api/src/shared/abilities/update-property.ts Adds update ability.
packages/ocom-verification/acceptance-api/src/shared/abilities/provision-resident-member.ts Provisions unauthorized residents.
packages/ocom-verification/acceptance-api/src/shared/abilities/index.ts Exports property abilities.
packages/ocom-verification/acceptance-api/src/shared/abilities/graphql-client.ts Adds principal context headers.
packages/ocom-verification/acceptance-api/src/shared/abilities/delete-property.ts Adds deletion ability.
packages/ocom-verification/acceptance-api/src/shared/abilities/create-property.ts Adds creation ability.
packages/ocom-verification/acceptance-api/src/shared/abilities/actor-auth.ts Tracks end-user tokens and context.
packages/ocom-verification/acceptance-api/src/servers/api-graphql-test-server.ts Passes test principal context.
packages/ocom-verification/acceptance-api/src/mock-application-services.ts Registers handlers and end-user validation.
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/view-property-details.ts Adds API detail-view task.
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/view-properties-list.ts Adds API list-view task.
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/update-property.ts Adds API update task.
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/update-property-input.ts Maps update inputs.
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/provision-resident-member.ts Arranges resident actors.
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/delete-property.ts Adds API deletion task.
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/create-property.ts Adds API creation task.
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/become-property-manager.ts Arranges property managers.
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/attempt-update-property.ts Captures rejected updates.
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/attempt-delete-property.ts Captures rejected deletions.
packages/ocom-verification/acceptance-api/src/contexts/property/tasks/attempt-create-property.ts Captures rejected creations.
packages/ocom-verification/acceptance-api/src/contexts/property/step-definitions/index.ts Loads property API steps.
packages/ocom-verification/acceptance-api/src/contexts/property/questions/viewed-property.ts Reads viewed property data.
packages/ocom-verification/acceptance-api/src/contexts/property/questions/property-retrievable.ts Checks post-deletion retrieval.
packages/ocom-verification/acceptance-api/src/contexts/property/questions/property-operation-outcome.ts Reads operation outcomes.
packages/ocom-verification/acceptance-api/src/contexts/property/questions/property-named.ts Finds properties by name.
packages/ocom-verification/acceptance-api/src/contexts/property/questions/property-manager-permission.ts Verifies role permission.
packages/ocom-verification/acceptance-api/src/contexts/property/questions/property-field.ts Reads property fields.
packages/ocom-verification/acceptance-api/src/contexts/property/questions/properties-list.ts Queries community properties.
packages/ocom-verification/acceptance-api/src/contexts/property/notes/property-notes.ts Defines API scenario state.
packages/ocom-verification/acceptance-api/package.json Adds verification dependencies.
codegen.yml Maps GraphQL Property to domain type.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

…scade

npm latest (4.13.2, also 4.13.1) point at CDN artifacts that 404
(Azure.Functions.Cli.linux-x64.<version>.zip missing), breaking the
unpinned global install. 4.13.0 is the newest release with a working
artifact (verified via ranged GET -> HTTP 206).

Also add succeeded() to the func-tools/Playwright install conditions and
replace always() on the Playwright verify step, so a failed install no
longer cascades into misleading 'pnpm: command not found' errors.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…unique name index to active properties

- getById now treats soft-deleted properties as not found, preventing
  update/delete mutations against hidden records (PR review P1)
- getAll filters out soft-deleted documents
- unique {community, propertyName} index is now partial on
  {isDeleted: false} so deleted property names can be reused (PR review P2)
- added compensating {community, isDeleted} index for listing queries
- covered by repository unit tests, index contract tests, and two new
  acceptance-api scenarios

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 132 out of 133 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

…tibility

Reverts the partial {isDeleted: false} unique index and the compensating
{community, isDeleted} index so the PR requires no manual index migration
on deployed databases (createIndex with changed options would conflict
with the existing index). Deleted property names remain reserved.

Keeps the P1 fix: soft-deleted properties are still excluded from the
write repository (getById/getAll), so they cannot be mutated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 131 out of 132 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

- Scope property reads to community members: property/propertiesByCommunityId
  now verify the actor's membership in the target community (Unauthorized otherwise)
- Require canManageProperties for admin property updates via a public
  assertCanManageProperties guard on the Property aggregate
- Forward explicit nulls for bedrooms/bathrooms/squareFeet so numeric
  listing details can be cleared end to end (UI container, resolver, command)
- Evict deleted properties from the Apollo cache after propertyDelete
- Resolve Property.owner through the member read model so nested account
  fields are GraphQL-safe
- Pin func-tools CI cache to exact version key; inexact hits no longer
  skip installation of the pinned Core Tools version
- Drain in-flight integration event handlers before per-scenario DB reset
  and skip the mock server dev seed under tests (SKIP_DEV_SEED) to stop
  acceptance cross-scenario contamination
- Note: member navigation finding was a false positive (MemberReadRepo.isAdmin
  already includes canManageProperties)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 141 out of 142 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

The spec mandates all admin-side property queries enforce
propertyPermissions.canManageProperties. The previous fix only verified
community membership, letting residents without the permission read the
property directory. Reads now load the acting member's role and require
canManageProperties in the target community; the contradictory
resident-can-view scenario is replaced with rejection scenarios for both
list and details.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 141 out of 142 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

…ry application services

Property read authorization now lives in the application services and is
bound to the request's current member/community context:

- Expose the request-scoped passport on DataSources so application
  services can evaluate domain visas on read operations.
- Guard Property queryById/queryByCommunityId with the property visa
  (canManageProperties or system account). The member passport is built
  from the request's x-member-id/x-community-id hints and the
  MemberPropertyVisa denies cross-community roots, so a manager acting
  under a different community context is rejected even if they hold
  manage permissions elsewhere.
- Drop the resolver-level membership lookup that authorized via any
  membership matching the requested community; resolvers now only
  require a verified user and delegate authorization to the services.
- New acceptance scenarios: a manager who switches communities can no
  longer view their original community's list or property details.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 143 out of 144 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 211 out of 226 changed files in this pull request and generated 2 comments.

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

packages/ocom/graphql/src/schema/types/member.resolvers.ts:111

  • This fallback introduces an N+1 query for every list that requests Member.role. membersForCurrentEndUser is built by an aggregation that does not populate roles, so each returned member reaches this line and executes a separate queryByIdWithRole call. Use a request-scoped DataLoader backed by the newly added queryByIdsWithRole, or populate roles in the originating list query, so all role lookups are batched.

Comment thread apps/ui-community/.storybook/apollo-mocks.ts Outdated
…n owner options, flaky story

- Add derived EndUserRolePermissions.isNonPropertyAdmin SDL field (resolver
  mirrors MemberReadRepositoryImpl.isAdmin minus canManageProperties) with
  unit tests; gate the admin Members/Settings menu entries on it so
  property-only managers no longer see unrelated admin sections.
- canAccessAdminPortal: admins holding any non-property admin permission keep
  the legacy portal entry points (even with canManageProperties and no
  ACCEPTED account); the ACCEPTED-account requirement now applies only to
  property-only managers. Updated helper tests and nav queries/mocks.
- Replace the member-management members query in the property create/detail
  containers with a minimal AdminPropertiesOwnerOptions operation (id +
  memberName only) so property managers no longer receive member-management
  data (accounts, profile email/bio); updated all stories and the
  acceptance-ui mock backend.
- De-flake the "Submitting Blocks Duplicate Creates" story: raise the mocked
  create delay to 2s, guard the duplicate click against post-navigation
  detachment, and give the final navigation assertion a generous timeout.
- Reset the property form's Save & Close submit intent on validation failure
  (and consume it on submit) so a later Enter-key submit stays on the page.
- Fix impossible __typename ('PropertyPermissions' ->
  'EndUserRolePropertyPermissions') in community-list story and ui-community
  storybook apollo mocks.
- Pin the nanoid override to 3.3.18 (was >=3.3.17 which resolved to ESM-only
  nanoid 6.x for CJS consumers such as postcss).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 212 out of 228 changed files in this pull request and generated 10 comments.

Suppressed comments (4)

Previously missed (3) — in code that hasn't changed since the last review.

packages/ocom/graphql/src/schema/types/property.graphql:166

  • This field returns every property in the community, while the UI's table pagination is only client-side. Property data and owner resolution therefore grow without bound in one request. Add server-side cursor/page arguments and return a paginated result so large communities do not produce increasingly expensive responses.
    packages/cellix/serenity-framework/src/servers/process-test-server.ts:38
  • This adds a public @cellix/serenity-framework/servers option that controls spawned-process behavior, but process-test-server.test.ts has no coverage for it. Add a test proving overrides reach the child process while inherited variables remain available and inherited NODE_OPTIONS is still stripped.
    packages/ocom/ui-community-route-admin/src/components/property-form.validation.ts:20
  • This comment is now incorrect: normalizeTags throws when more than 50 normalized tags are supplied; it no longer silently keeps the first 50. Update the mirrored-domain description so future validation changes are based on the actual contract.

packages/ocom/ui-community-route-admin/src/index.tsx:55

  • hasPermissions only hides this menu item; MenuComponent never guards the matching route. A property-only manager can still deep-link to /members (and /settings) because those <Route> elements remain unconditional, and the member query only requires an authenticated JWT. Add a route-level non-property-admin guard, as the Properties section does.

Comment thread packages/ocom/graphql/src/schema/types/member.resolvers.ts Outdated
Comment thread packages/ocom/ui-community-route-admin/src/pages/properties.tsx
…batch member roles

- Add packages/ocom/ui-community-route-admin/src/components/countries.ts to
  sonar.cpd.exclusions: it is static ISO country/subdivision data, and its
  1,503 "duplicated" lines were the sole cause of the PR duplication gate
  failure (19.4% vs 4% limit).
- Add propertyOwnerOptions(communityId) root query authorized by the property
  visa (canManageProperties via ensureCommunityPropertiesViewable) and point
  the AdminPropertiesOwnerOptions operation at it, so owner dropdown options
  are no longer served by the JWT-only membersByCommunityId field that let any
  authenticated caller enumerate member ids/names of arbitrary communities.
  New app service queryOwnerOptionsByCommunityId + resolver/unit tests.
- Batch-load roles once in membersForCurrentEndUser via queryByIdsWithRole:
  the external-id read is an aggregation without populated roles, so
  role-selecting queries previously fell back to one role lookup per member
  (N+1) in the Member.role field resolver.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 212 out of 231 changed files in this pull request and generated 1 comment.

Suppressed comments (2)

Previously missed (1) — in code that hasn't changed since the last review.

packages/ocom/ui-community-route-admin/src/components/format-display-address.ts:29

  • The formatter accepts and fetches country but drops it from the rendered address. International properties can therefore display an ambiguous address—or N/A when country is the only populated location field. Include the trimmed country in parts.

packages/ocom/ui-community-route-admin/src/index.tsx:55

  • hasPermissions is only consulted by MenuComponent when building navigation; it does not guard the matching React Router route, and SectionLayout renders <Outlet /> unconditionally. A property-only manager can therefore deep-link to /members (whose membersByCommunityId resolver only requires a verified JWT) or /settings even though these menu items are hidden. Add authorization guards to the route elements themselves, not just the menu entries.

Comment thread packages/ocom/graphql/src/schema/types/property.graphql Outdated
…ered portal links

- Return a dedicated PropertyOwnerOption { id, memberName } type from
  propertyOwnerOptions instead of full Member records, and map to that DTO in
  the application service, so a property-only manager cannot select accounts,
  profile, role, or nested end-user data through the owner dropdown query.
- Add NonPropertyAdminRouteGuardContainer around the Members and Settings
  routes: hiding the navigation entries did not stop a property-only manager
  from deep linking to those URLs. The guard mirrors the menu gating
  (isNonPropertyAdmin) and rejects member ids from other communities.
- Look up each community's member group by community id in the accounts
  community list: the members prop is parallel to the unfiltered communities
  array, so filtered rows previously used the wrong index and produced portal
  links pairing one community with another community's member ids.
- Make the Azure Functions Core Tools install self-verifying and drop its
  Cache@2 task: npm installs the tools into Node's global prefix rather than
  the cached /opt/hostedtoolcache/func path, so a cache hit skipped the
  install without providing func. The step now checks `func --version` and
  installs only when the pinned 4.13.0 is absent.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 210 out of 233 changed files in this pull request and generated 2 comments.

Suppressed comments (2)

Previously missed (2) — in code that hasn't changed since the last review.

packages/ocom/ui-community-route-admin/src/components/properties-detail.container.tsx:42

  • network-only bypasses the cache only when this query executes; it does not make the request's community/member headers dependencies. React Router can reuse this component when those route params change while id stays the same, so no new authorization check runs and the detail from the previous route remains rendered. Explicitly rerun/remount the query when the route context changes (and ensure the Apollo link has the new headers first).
    packages/ocom/ui-community-route-admin/src/components/format-display-address.ts:29
  • country is accepted by this formatter but never added to parts. Consequently a country-only address displays N/A, and every international address silently omits its country. Include the trimmed country in the output and update the formatter tests accordingly.

Comment thread packages/ocom/graphql/src/schema/types/property.graphql Outdated
Comment thread packages/ocom/graphql/src/schema/types/property.graphql
Property.owner returned the unrestricted Member type, so a caller authorized
only to manage properties could traverse owner { accounts profile role ... }
and reach member data the restricted PropertyOwnerOption boundary was added
to protect. The field now returns PropertyOwnerOption and the resolver
projects the batch-loaded member down to id + memberName, keeping the
per-request DataLoader batching intact. All owner-selecting operations
already request only id/memberName, so no client behavior changes.

Also bumps the fast-uri override to ^4.1.3 (with a matching
minimumReleaseAgeExclude entry): Snyk began flagging four new high-severity
CVEs against 4.1.2 (SNYK-JS-FASTURI-19256867/-69/-71/-73), which failed the
pre-commit dependency scan; 4.1.3 is the coordinated patch release.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 210 out of 233 changed files in this pull request and generated 1 comment.

Suppressed comments (3)

Previously missed (2) — in code that hasn't changed since the last review.

packages/ocom/ui-community-route-admin/src/components/property-form.tsx:713

  • The domain now rejects a 51st bedroom-detail row, but this form leaves the Add button enabled indefinitely and has no list-level validation. Users can build an invalid form that only fails after submission; disable adding once fields.length reaches 50 (and surface the limit inline).

This issue also appears on line 772 of the same file.
packages/cellix/serenity-framework/src/servers/process-test-server.ts:38

  • This adds a public ProcessTestServer behavior used to control child-process seeding, but the existing process-test-server.test.ts suite does not verify that overrides reach the spawned process or that inherited environment variables remain intact. Add a contract test that starts a child with an override and asserts the child observes it, including the NODE_OPTIONS sanitization behavior.

packages/ocom/ui-community-route-admin/src/components/property-form.tsx:778

  • The backend caps additional-amenity rows at 50, but this button can keep adding rows past that invariant. Prevent the 51st row in the form (and expose the limit inline) so a user cannot prepare a submission that is guaranteed to be rejected.

Comment thread packages/ocom/graphql/src/schema/types/staff-role.resolvers.ts Outdated
…tier

Tier-label gates alone still allowed privilege escalation through the
permissions payload: a Staff.CaseManager updating a CaseManager-classified
role could set canManageTechAdmin, canManageAllCommunities, or finance
permissions, and staff passports derive capabilities from the persisted
role flags, so the elevated permissions applied on the caller's next
request.

The command mapper now derives a per-tier grantable-flag allow-list that
mirrors the domain default role definitions (TechAdmin: all flags;
CaseManager/SupportLead: their default six; Finance: its default set plus
the finance group) and rejects any flag requested true that is outside the
caller's tiers, unless that flag is already true on the persisted role
(full-payload re-saves keep working) — revocations always pass. Both
staffRoleCreate and staffRoleUpdate are gated; staffRoleUpdate passes the
persisted role's permissions so unchanged elevated flags survive.

Includes 11 new mapper unit tests, 2 resolver tests, and an @api-only
acceptance scenario proving a case manager cannot grant
canManageTechAdmin on the Default Case Manager role.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 208 out of 233 changed files in this pull request and generated 3 comments.

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

packages/ocom/ui-community-route-admin/src/components/format-display-address.ts:29

  • country is accepted and fetched for every row but is never included in parts. As a result, a country-only address renders as N/A, and international addresses omit their country entirely. Append the trimmed country to the display parts and update the country-only test expectation.

Comment thread pnpm-workspace.yaml Outdated
Comment thread packages/ocom/graphql/src/schema/types/staff-role.resolvers.ts Outdated
Comment thread packages/ocom/graphql/src/schema/types/staff-user.resolvers.ts Outdated
Move persisted-state authorization for staffRoleUpdate and
staffUserAssignRole out of resolver pre-reads and into the application
service unit of work, closing the TOCTOU window where a concurrent role
promotion could bypass a stale pre-check. Both commands now carry a
callerContext (allowed enterprise app role tiers, unclassified-role
allowance, grantable permission flags) computed from the verified JWT at
the API boundary and validated against the same role snapshot that gets
mutated or assigned. The mapper keeps input-only gates (blank/over-tier
requested labels, create-side grant gate); error messages are unchanged.

Collapse property update/requestDelete failures for unknown ids and
properties the caller cannot manage into one indistinguishable
"Property not found" error, so mutation responses can no longer be used
to probe property ids across communities (write-side counterpart of the
read-side deny-by-omission). PropertyRepository.getById now throws the
seedwork NotFoundError (same message) so callers can classify missing
ids by error name. New acceptance scenarios pin the identical message
for cross-community and unknown-id update/delete attempts.

The image-size GHSA review finding was false: no patched release exists
(first_patched_version is null for both advisories, npm latest is
2.0.2), so the audit ignores stay with refreshed comments.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 216 out of 241 changed files in this pull request and generated 2 comments.

Comment thread packages/ocom/graphql/src/schema/types/member.resolvers.ts Outdated
Comment thread packages/ocom/ui-community-route-admin/src/components/properties-detail.tsx Outdated
Invalidate stale owner options, secure member role reads, harden validation scenarios, and handle missing property timestamps.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 219 out of 250 changed files in this pull request and generated 2 comments.

Suppressed comments (2)

packages/ocom/data-sources-mongoose-models/src/models/property/property.model.ts:214

  • The read paths treat a missing isDeleted as active ($ne: true), but this index includes only documents where the field is exactly false. Existing properties created before this field was added therefore remain visible while being excluded from the uniqueness constraint, allowing a new active property with the same community/name. A schema declaration also does not replace the previous same-key unique index, which can continue blocking name reuse. Add a deployment migration that backfills isDeleted: false and explicitly replaces the old index before relying on this constraint.
    packages/ocom/application-services/src/contexts/property/property/apply-property-fields.ts:149
  • An omitted or blank category still creates and persists an additional-amenity row because the value-object setter is skipped. This bypasses Category's minimum-length validation and violates the entity's required category property. Assign the value object for every new row so incomplete rows are rejected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement property management section on admin side of Community Portal

2 participants