The tenant and resource type config entities are headless: the engine ships no admin UI for them, so they can only be created through config import or drush. A resource type also had no notion of tenancy, so a type was global and its per-customer exclusivity pooled across every tenant that used it. This adds the management screens and makes resource types tenant-aware.

Tenant-aware resource types

A resource type becomes a hybrid catalogue, the same shape as the item kind catalogue in the pdv module: its tenant is either empty (shared, offered in every tenant) or a tenant id (private to that tenant, offered only there).

  • A tenant property on the resource type config entity (empty means shared), with schema and a getTenant() accessor, mirroring the existing convention.
  • A ResourceTypeCatalogue service is the single place availability resolves: the types available in a tenant are the shared types plus that tenant's own.
  • The resource Type selector lists only available types (a tenant-aware entity reference selection handler), and an AvailableResourceType validation constraint rejects assigning a type from another tenant.
  • Order constraints now count within the order's tenant (a scopeToTenant() helper on OrderConstraintBase, applied to both shipped constraints). A shared exclusive type therefore pools per tenant, never across tenants.

Admin UI

yoyaku_ui attaches a list, add, edit and delete forms and admin routes to both config entities through hook_entity_type_alter, exactly as it already does for the resource, slot and category entities, plus menu and action links under Booking. The resource type form carries the tenant scope selector.

Tests

Kernel coverage for the catalogue (shared plus scoped resolution, the availability predicate) and for the cross-tenant constraint isolation (a shared exclusive type does not pool across tenants). A functional test guards both collections rendering, their access control and the add form creating a type. Docs and the French translation are updated.

Issue fork yoyaku-3609536

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review

Opened a merge request adding the admin UI (list, add, edit and delete forms and menu links) for the tenant and resource type config entities, and making resource types tenant-aware: a tenant scope on the type (empty means shared), a ResourceTypeCatalogue resolver, a tenant-aware selection handler and validation gate, and per-tenant scoping of the order constraints. Kernel and functional test coverage, docs and the French translation are included.

  • mably committed 91b14cc2 on 1.x
    feat: #3609536 Manage tenants and resource types in the UI, with tenant-...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.