// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.

/**
 * Auto-generated by 'os i18n extract' for locale 'en'.
 * Edit translations in place; re-run extract (with --merge) to fill new gaps.
 * Do not hand-edit the structure — only the leaf string values.
 */

import type { TranslationData } from '@objectstack/spec/system';

export const enObjects: NonNullable<TranslationData['objects']> = {
  sys_record_share: {
    label: "Record Share",
    pluralLabel: "Record Shares",
    description: "Per-record sharing grant — extends OWD with explicit access",
    fields: {
      id: {
        label: "Share ID"
      },
      object_name: {
        label: "Object",
        help: "Short object name of the shared record"
      },
      record_id: {
        label: "Record",
        help: "Primary key of the shared record within object_name"
      },
      recipient_type: {
        label: "Recipient Type",
        help: "Kind of principal that holds the grant",
        options: {
          user: "user",
          group: "group",
          role: "role",
          role_and_subordinates: "role_and_subordinates",
          guest: "guest"
        }
      },
      recipient_id: {
        label: "Recipient",
        help: "ID of the user/group/role that receives access"
      },
      access_level: {
        label: "Access Level",
        help: "What the recipient can do — read | edit | full (transfer/share/delete)",
        options: {
          read: "read",
          edit: "edit",
          full: "full"
        }
      },
      source: {
        label: "Source",
        help: "Why this grant exists — used by the rule evaluator to reconcile",
        options: {
          manual: "manual",
          rule: "rule",
          team: "team",
          inherited: "inherited"
        }
      },
      source_id: {
        label: "Source ID",
        help: "Rule name / team id when source != manual"
      },
      granted_by: {
        label: "Granted By",
        help: "User that created the grant (manual only)"
      },
      reason: {
        label: "Reason",
        help: "Optional free-text explanation surfaced to the recipient"
      },
      created_at: {
        label: "Created At"
      },
      updated_at: {
        label: "Updated At"
      }
    },
    _views: {
      granted_to_me: {
        label: "Granted to Me"
      },
      granted_by_me: {
        label: "Granted by Me"
      },
      by_object: {
        label: "By Object"
      },
      manual_grants: {
        label: "Manual Grants"
      },
      rule_grants: {
        label: "Rule Grants"
      },
      all_shares: {
        label: "All"
      }
    }
  },
  sys_sharing_rule: {
    label: "Sharing Rule",
    pluralLabel: "Sharing Rules",
    description: "Declarative sharing rule that auto-materialises sys_record_share grants. Authored via defineSharingRule() in code or the Studio criteria builder.",
    fields: {
      id: {
        label: "Rule ID"
      },
      organization_id: {
        label: "Organization",
        help: "Tenant that owns this rule; null = global"
      },
      name: {
        label: "Name",
        help: "Unique snake_case rule name"
      },
      label: {
        label: "Display Label"
      },
      description: {
        label: "Description"
      },
      object_name: {
        label: "Object",
        help: "Short object name (e.g. opportunity, account)"
      },
      criteria_json: {
        label: "Criteria (FilterCondition JSON)",
        help: "JSON FilterCondition matched against records of object_name. Empty = match all."
      },
      recipient_type: {
        label: "Recipient Type",
        help: "Kind of principal that receives access — expanded to user grants at evaluation time. `department` walks the parent_department_id tree; `team` is flat (better-auth).",
        options: {
          user: "user",
          team: "team",
          department: "department",
          role: "role",
          queue: "queue"
        }
      },
      recipient_id: {
        label: "Recipient",
        help: "department id / team id / role name / queue name / user id depending on recipient_type"
      },
      access_level: {
        label: "Access Level",
        options: {
          read: "read",
          edit: "edit",
          full: "full"
        }
      },
      active: {
        label: "Active",
        help: "Only active rules participate in lifecycle evaluation"
      },
      created_at: {
        label: "Created At"
      },
      updated_at: {
        label: "Updated At"
      }
    },
    _views: {
      active: {
        label: "Active"
      },
      inactive: {
        label: "Inactive"
      },
      by_object: {
        label: "By Object"
      },
      all_rules: {
        label: "All"
      }
    }
  },
  sys_share_link: {
    label: "Share Link",
    pluralLabel: "Share Links",
    description: "Opaque capability token granting access to a single record. Notion/Figma-style public link sharing.",
    fields: {
      id: {
        label: "Link ID"
      },
      token: {
        label: "Token",
        help: "Opaque URL-safe random token (≥ 22 chars). The only secret in this row."
      },
      object_name: {
        label: "Object",
        help: "Short object name of the shared record (e.g. ai_conversation, contracts_contract)"
      },
      record_id: {
        label: "Record",
        help: "Primary key of the shared record within object_name"
      },
      permission: {
        label: "Permission",
        help: "What the link holder can do with the record",
        options: {
          view: "View",
          comment: "Comment",
          edit: "Edit"
        }
      },
      audience: {
        label: "Audience",
        help: "Gating layer applied on top of the token check",
        options: {
          public: "Public (indexable)",
          link_only: "Anyone with the link",
          signed_in: "Signed-in users",
          email: "Specific emails"
        }
      },
      expires_at: {
        label: "Expires At",
        help: "When set, resolveToken returns null after this timestamp"
      },
      email_allowlist: {
        label: "Email Allowlist",
        help: "Lowercased addresses checked when audience=email"
      },
      password_hash: {
        label: "Password Hash",
        help: "Argon2/bcrypt hash. When set, the UI prompts for a password before rendering."
      },
      redact_fields: {
        label: "Per-Link Redactions",
        help: "Extra fields stripped from the response, on top of the object-default set"
      },
      label: {
        label: "Label",
        help: "Free-text shown in the share dialog (e.g. \"ACME Q3 contract\")"
      },
      revoked_at: {
        label: "Revoked At",
        help: "When set, the link is permanently disabled"
      },
      created_by: {
        label: "Created By",
        help: "Issuer of the link"
      },
      created_at: {
        label: "Created At"
      },
      last_used_at: {
        label: "Last Used At",
        help: "Stamped by resolveToken; used by the dashboard to highlight active links"
      },
      use_count: {
        label: "Use Count",
        help: "Incremented by resolveToken on every successful resolution"
      }
    },
    _views: {
      active_links: {
        label: "Active"
      },
      by_me: {
        label: "Created by Me"
      },
      revoked: {
        label: "Revoked"
      },
      all_links: {
        label: "All"
      }
    }
  }
};
