Skip to content

implemented property management - #316

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

implemented property management#316
henry-casper wants to merge 13 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

Add full-stack property management support for end users, from GraphQL schema and application services through persistence soft-deletes to community admin UI pages, with role-based permissions and extensive verification across API, UI, and E2E tests.

New Features:

  • Introduce end-user property management capabilities in the community admin portal, including list, create, update, and delete flows guarded by role-based property permissions.
  • Expose property management operations and queries via a new GraphQL Property schema and resolvers backed by application services and persistence.
  • Enable end-user tokens and member/community header context in the acceptance GraphQL test server so scenarios can act as specific community members and property managers.

Bug Fixes:

  • Ensure member roles are correctly resolved in GraphQL by falling back to a Member query when the role field is not populated on the parent.

Enhancements:

  • Implement soft-delete semantics for properties in the domain repository and read-models, filtering out deleted properties while preserving integration event handling.
  • Extend EndUserRole permissions to include property-specific flags (canManageProperties, canEditOwnProperty) and surface them through the UI and tests.
  • Register production integration event handlers in the acceptance API once per process so property-related events and member provisioning behave like the main API.
  • Improve readonly property data access with populated community/owner relations and tests to validate filtering and conversion logic.

Build:

  • Update pnpm overrides and audit config to account for new transitive dependencies and security advisories, including brace-expansion, js-yaml, fast-uri, nanoid, and image-size.

Documentation:

  • Define new GraphQL schema types and documentation for Property, PropertyListingDetail, and related mutations and queries used by the admin property management features.

Tests:

  • Add comprehensive API, UI acceptance, and E2E scenarios plus Storybook stories for property management, covering happy paths, validation errors, authorization, and soft-delete behavior.
  • Introduce unit tests for property GraphQL resolvers, property application services, and readonly property repositories to validate commands, queries, and error handling.

Chores:

  • Wire new property-related abilities, notes, and step-definition contexts into the verification suites and world configuration so property scenarios run alongside existing community and staff flows.

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

…ults

queryByCommunityId previously authorized only returned rows, so an
unauthorized actor querying a community with no properties received an
empty list instead of Unauthorized. The query now evaluates the property
visa against a community-scoped root before reading (property visas
scope by the root's community, so the same manage/system predicate
applies), keeping the per-row check as defense-in-depth.

New red-first coverage: unit tests assert the read repo is never called
on denial and empty communities still reject; acceptance scenario covers
a resident querying an empty community.

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

- Deny property access for deactivated members: MemberPropertyVisa now
  requires the acting user's member account to be ACCEPTED (rejected or
  pending accounts are refused), covering reads and writes through the
  passport choke point. New domain visa scenarios plus acceptance
  scenarios with a provisioned deactivated property manager.
- Omit an empty propertyType from property updates in the admin detail
  container: newly created properties have no type, and the domain
  rejects '' — name/numeric-only edits no longer fail.
- Make delete cache handling truthful: evict and refetch only after the
  server confirms deletion, and stop awaiting the list refetch so a
  refetch failure cannot make a successful removal look failed.
- Resolve Property.owner through the readonly member read model
  (queryByIdWithRole) instead of the transactional unit of work,
  removing a MongoDB transaction per property row.
- Align property name maxLength (100) in create/detail forms with the
  domain and schema limit.

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 149 out of 150 changed files in this pull request and generated no new comments.

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

The Property.owner resolver still issued one readonly member query per
property row. Batch all concurrent owner resolutions of a request into
a single query:

- MemberReadRepo.getByIdsWithRole: fetch members for a set of ids with
  role populated via one $in find (no query when the set is empty).
- Member application service exposes queryByIdsWithRole.
- Property.owner resolves through a per-request DataLoader keyed by the
  request-scoped ApplicationServices instance, so batches and cached
  members never cross request/passport boundaries.

Resolver tests assert concurrent lookups coalesce into one batched
call, missing owners resolve to null, and loaders are request-isolated.

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 154 out of 155 changed files in this pull request and generated no new comments.

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

… active-account gate

Address third-party review findings:

- Zero-valued listing fields become null (P2): the property domain
  adapter used `|| null` on numeric getters, so legal 0 values for
  price, rentHigh, rentLow, lease, maxGuests, bedrooms, bathrooms,
  squareFeet, yearBuilt, and lotSize were corrupted to null on read.
  Getters now use `?? null`.

- Clearing property type reported success without persisting (P2):
  an explicit null propertyType now flows end-to-end. The domain
  aggregate accepts null as a deliberate clear (still visa-guarded),
  the mongoose model/adapter persist and surface null, the update
  application service and GraphQL resolver forward explicit null
  instead of dropping it, and the admin detail form submits null
  when the field is cleared. New acceptance scenario covers the
  round trip.

- Deactivated members passed frontend authorization (P3): the admin
  section-layout query now selects member account statuses and the
  current end user id, and both the Properties nav gate and the
  route guard additionally require an ACCEPTED account for the
  current user, mirroring the backend visa. Deep links and nav now
  deny deactivated or pending members up front.

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 160 out of 161 changed files in this pull request and generated no new comments.

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

…o reads

Review fixes (ninth review, both confirmed real):

- Member.role resolver: the fallback lookup accessed memberWithRole.role
  outside any catch, so a missing/dangling role reference surfaced as a
  GraphQL error instead of the nullable role: null. The fallback access is
  now guarded and returns null.

- PropertyRepository.getById/getAll: reads were not bound to the unit-of-
  work session, so they escaped the transaction snapshot and could race
  concurrent saves/soft-deletes. Reads now join the transaction via
  .session(this.session), enabling MongoDB write-conflict detection with
  the unit of work's retry (fresh repository per attempt re-reads and
  observes isDeleted).

Tests (red first): dangling-role resolver test in
member.resolvers.additional.test.ts; session-binding scenarios in
property.repository.feature/test with session spies on the query chain.

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 160 out of 161 changed files in this pull request and generated no new comments.

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

- Properties list adds price, formatted display address, and owner columns
- Create/detail pages expose all business fields in Overview/Location/Listing
  (Details, Amenities, Media, Agent) sections via shared PropertyForm
- Create accepts all fields at once and returns to the properties list
- Bathrooms restricted to 0.5 increments in domain VO, API, and UI validation
- GraphQL exposes canonical address fields, full listing detail, and owner
  assignment with same-community validation; null-clear semantics preserved
- Detail page titled "Property Details"; Storybook coverage for all changes
- Serenity property-fields scenarios implemented across acceptance-api,
  acceptance-ui, and e2e suites

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 185 out of 186 changed files in this pull request and generated 1 comment.

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

packages/ocom/graphql/src/schema/types/property.resolvers.ts:218

  • An explicit null for tags is currently ignored, but the new form sends tags: null when the field is cleared. Updating a property after removing all tags therefore leaves the old tags persisted. Convert null to an empty array while preserving undefined as “unchanged.”
    packages/ocom/ui-community-route-admin/src/components/properties-create.container.tsx:25
  • The mutation loading state is discarded, so the Create Property button remains enabled while a request is in flight. A double click can submit two create mutations and produce duplicate/error feedback. Pass the mutation's loading state through PropertiesCreate to PropertyForm.submitting so the button displays loading and blocks repeat submission.
    packages/ocom/ui-community-route-admin/src/components/format-display-address.ts:29
  • country is accepted and queried for list rows but is never included in the formatted address. International addresses can therefore render identically despite different countries, and a country-only address incorrectly renders as N/A. Include the trimmed country as the final address part and update the tests accordingly.

listedForRent: { type: Boolean, required: false, default: false },
listedForLease: { type: Boolean, required: false, default: false },
listedInDirectory: { type: Boolean, required: false, default: false },
isDeleted: { type: Boolean, required: false, default: false },
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