/**
 * @aurora-catalyst-generated
 * @source cliter/iam/permission-role.aurora.yaml
 */
import { IamPermissionFieldSchema } from '@app/iam/permission';
import { IamRoleFieldSchema } from '@app/iam/role';
import { FieldSchema } from '@aurorajs.dev/core-back';

/**
 * Field schema for IamPermissionRole, derived from cliter/iam/permission-role.aurora.yaml.
 * Used by @Sanitize decorator, @Format decorator and @ApplySchema decorator.
 */
export const IamPermissionRoleFieldSchema: FieldSchema[] = [
  {
    name: 'permissionId',
    type: 'id',
    nullable: false,
    maxLength: 36,
  },
  {
    name: 'permission',
    type: 'relation',
    cardinality: 'one',
    target: () => IamPermissionFieldSchema,
  },
  {
    name: 'roleId',
    type: 'id',
    nullable: false,
    maxLength: 36,
  },
  {
    name: 'role',
    type: 'relation',
    cardinality: 'one',
    target: () => IamRoleFieldSchema,
  },
];
