# @aurora-catalyst-generated
# @source cliter/iam/bounded-context.aurora.yaml

type IamBoundedContext {
  """
  Unique identifier for the bounded context. UUID v4 format, generated automatically on creation. Used as primary key and for references.
  """
  id: ID!
  """
  Auto-incremented sequential identifier for internal database indexing. Used for ordered retrieval and performance optimization. Unique across all bounded contexts.
  """
  rowId: GraphQLInt!
  """
  Human-readable name of the bounded context. Used for display purposes in UI and documentation. Should be unique and descriptive of the domain area it represents (e.g., 'Identity and Access Management', 'Library Management').
  """
  name: GraphQLString!
  """
  Root directory path where the bounded context code is located. Typically matches the module structure (e.g., 'iam', 'library', 'catalog'). Used by code generation tools and for file organization. Must match actual filesystem structure.
  """
  root: GraphQLString!
  """
  Display order for UI lists and navigation menus. Lower numbers appear first. NULL values are sorted last. Allows manual organization of bounded contexts in administrative interfaces.
  """
  sort: GraphQLInt
  """
  Indicates if the bounded context is currently active and available. Inactive bounded contexts are hidden from UI and their permissions are not enforced. Use for temporary disabling without deletion.
  """
  isActive: GraphQLBoolean!
  """
  Collection of permissions associated with this bounded context. Each permission defines access to specific operations within the bounded context's modules. Managed through the grid elements manager component.
  """
  permissions: [IamPermission]
  """
  Timestamp when the bounded context was created. Automatically set on record creation. Used for audit trail and historical tracking.
  """
  createdAt: GraphQLTimestamp
  """
  Timestamp when the bounded context was last updated. Automatically updated on any modification. Used for audit trail and change tracking.
  """
  updatedAt: GraphQLTimestamp
  """
  Soft delete timestamp. NULL indicates active record. When set, the bounded context is excluded from normal queries but preserved for audit and recovery purposes. Cascade affects associated permissions.
  """
  deletedAt: GraphQLTimestamp
}

input IamCreateBoundedContextInput {
  id: ID!
  name: GraphQLString!
  root: GraphQLString!
  sort: GraphQLInt
  isActive: GraphQLBoolean!
}

input IamUpdateBoundedContextByIdInput {
  id: ID!
  name: GraphQLString
  root: GraphQLString
  sort: GraphQLInt
  isActive: GraphQLBoolean
}

input IamUpdateBoundedContextsInput {
  id: ID
  name: GraphQLString
  root: GraphQLString
  sort: GraphQLInt
  isActive: GraphQLBoolean
}
type Query {
  iamFindBoundedContext(query: QueryStatement, constraint: QueryStatement): IamBoundedContext

  iamFindBoundedContextById(id: ID, constraint: QueryStatement): IamBoundedContext

  iamGetBoundedContexts(query: QueryStatement, constraint: QueryStatement): [IamBoundedContext]!

  iamPaginateBoundedContexts(query: QueryStatement, constraint: QueryStatement): Pagination!
}

type Mutation {
  iamCreateBoundedContext(payload: IamCreateBoundedContextInput!): IamBoundedContext

  iamCreateBoundedContexts(payload: [IamCreateBoundedContextInput]!): Boolean!

  iamUpdateBoundedContextById(
    payload: IamUpdateBoundedContextByIdInput!
    constraint: QueryStatement
  ): IamBoundedContext

  iamUpdateBoundedContexts(
    payload: IamUpdateBoundedContextsInput!
    query: QueryStatement
    constraint: QueryStatement
  ): [IamBoundedContext]!

  iamDeleteBoundedContextById(id: ID!, constraint: QueryStatement): IamBoundedContext

  iamDeleteBoundedContexts(query: QueryStatement, constraint: QueryStatement): [IamBoundedContext]!
}
