@nocobase/app-skills 0.1.0-beta.55 → 0.1.0-beta.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/package.json +1 -1
  2. package/skills/nocobase-app-development/SKILL.md +7 -2
  3. package/skills/nocobase-app-development/assets/business-examples/index.json +36 -15
  4. package/skills/nocobase-app-development/assets/business-examples/onboarding/cli/commands/onboarding-reset.ts +68 -0
  5. package/skills/nocobase-app-development/assets/business-examples/onboarding/client/pages/onboarding/choice.tsx +60 -0
  6. package/skills/nocobase-app-development/assets/business-examples/onboarding/client/pages/onboarding/index.tsx +124 -0
  7. package/skills/nocobase-app-development/assets/business-examples/onboarding/client/pages/onboarding/locales.ts +216 -0
  8. package/skills/nocobase-app-development/assets/business-examples/onboarding/client/pages/onboarding/wizard.tsx +1271 -0
  9. package/skills/nocobase-app-development/assets/business-examples/onboarding/database/main/migrations/202611050001_create_onboarding.ts +93 -0
  10. package/skills/nocobase-app-development/assets/business-examples/onboarding/database/main/seeds/202611050001_onboarding.ts +46 -0
  11. package/skills/nocobase-app-development/assets/business-examples/onboarding/database/main/seeds/202611050002_onboarding_samples.ts +30 -0
  12. package/skills/nocobase-app-development/assets/business-examples/onboarding/docs/onboarding.md +49 -0
  13. package/skills/nocobase-app-development/assets/business-examples/onboarding/server/lifecycles/onboarding.ts +22 -0
  14. package/skills/nocobase-app-development/assets/business-examples/onboarding/server/providers/onboarding-registration.ts +27 -0
  15. package/skills/nocobase-app-development/assets/business-examples/onboarding/server/providers/onboarding-reset.ts +28 -0
  16. package/skills/nocobase-app-development/assets/business-examples/onboarding/server/providers/onboarding.ts +436 -0
  17. package/skills/nocobase-app-development/assets/business-examples/onboarding/server/routes/onboarding.ts +294 -0
  18. package/skills/nocobase-app-development/assets/business-examples/onboarding/shared/onboarding.ts +163 -0
  19. package/skills/nocobase-app-development/assets/business-examples/onboarding/tests/client/onboarding.test.tsx +393 -0
  20. package/skills/nocobase-app-development/assets/business-examples/onboarding/tests/database/onboarding.test.ts +54 -0
  21. package/skills/nocobase-app-development/assets/business-examples/onboarding/tests/playwright/onboarding.test.ts +420 -0
  22. package/skills/nocobase-app-development/assets/business-examples/onboarding/tests/server/onboarding.test.ts +546 -0
  23. package/skills/nocobase-app-development/references/business-examples.md +2 -0
  24. package/skills/nocobase-app-development/references/database-connections.md +1 -1
  25. package/skills/nocobase-app-development/references/frontend/references/api.md +5 -2
  26. package/skills/nocobase-app-development/references/frontend/references/testing.md +67 -0
  27. package/skills/nocobase-app-development/references/http-api.md +2 -0
  28. package/skills/nocobase-app-development/references/lifecycle.md +2 -2
  29. package/skills/nocobase-app-development/references/plugins.md +33 -0
  30. package/skills/nocobase-app-development/references/server-routes.md +5 -1
  31. package/skills/nocobase-app-development/references/services-and-jobs.md +2 -0
  32. package/skills/nocobase-app-plugin-development/references/configuration.md +1 -1
  33. package/skills/nocobase-app-plugin-development/references/registration.md +6 -0
  34. package/skills/nocobase-app-plugin-development/references/server.md +1 -1
  35. package/skills/nocobase-app-upgrade/references/realtime-upgrade.md +8 -0
  36. package/skills/nocobase-deployment/SKILL.md +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/app-skills",
3
- "version": "0.1.0-beta.55",
3
+ "version": "0.1.0-beta.57",
4
4
  "description": "Agent Skills for developing applications and plugins, upgrading and deploying NocoBase applications.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -47,7 +47,7 @@ Deliver the requested user operation across its layers: pages invoke real endpoi
47
47
 
48
48
  ## Choose where the feature belongs
49
49
 
50
- For a complete parent/child business flow with scoped references, amounts and single-person review, consult the [business example catalogue](references/business-examples.md) and its runnable scenario index. Its resources supplement the existing list/edit patterns; read each scenario's integration dependencies before adapting it.
50
+ For parent/child business flows, scoped references, single-person review or multi-step forms with private recoverable drafts, consult the [business example catalogue](references/business-examples.md) and its runnable scenario index. Its resources supplement the existing list/edit patterns; read each scenario's integration dependencies before adapting it.
51
51
 
52
52
  Build application-specific features directly in the application by default. Use a plugin when the user requests one or when code reuse or modular organization calls for a separately registered, maintainable feature. Create local plugins under `packages/` with the project plugin development Skill; do not use the source repository's `packages/plugins/` layout. The App builds and packages registered local plugins for deployment without an npm release. Publish only when distributing the plugin through a package registry.
53
53
 
@@ -60,6 +60,7 @@ NocoBase packages may publish Skills under `.agents/skills/`. Current applicatio
60
60
  | The requirement sounds like | Read the Skill for |
61
61
  | -------------------------------------------------------------- | ------------------------------------------------------- |
62
62
  | Email, IM, or in-app messages | `@nocobase/app-plugin-notification` |
63
+ | Knowledge bases, document spaces, search and document review | `@nocobase/app-plugin-knowledge` |
63
64
  | Approval processes, joint decisions and approval tasks | `@nocobase/app-plugin-approval` (commercial Pro plugin) |
64
65
  | Roles, permissions, per-user or per-record access | `@nocobase/app-plugin-authorization` |
65
66
  | Sign-in, registration, sessions | `@nocobase/app-plugin-authentication` |
@@ -72,7 +73,11 @@ NocoBase packages may publish Skills under `.agents/skills/`. Current applicatio
72
73
 
73
74
  Read the relevant Skill before writing the feature, but treat this table as a map rather than an installed-package list. Implementing a permission system, a notification sender, or a scheduler by hand when a registered plugin provides one is the most expensive mistake available here.
74
75
 
75
- For approval requirements, check `@nocobase/app-plugin-approval` first. If missing, tell the user it is a commercial Pro plugin requiring appropriate authorization and a compatible version, and recommend installation before implementing approval. Follow [approval prerequisites](references/lifecycle.md#approval-requests-check-the-pro-plugin-first) and the plugin's installed Skill; do not silently build a substitute approval engine from lifecycle examples. Simple single-person confirmation or rejection can remain lifecycle actions.
76
+ For any required commercial NocoBase package, follow [commercial package access](references/plugins.md#commercial-package-access): automatically probe pkg-v3 with existing credentials, install a compatible authorized package without prompting, and leave a brief conversation notice for unavailable access while continuing independent work. This includes plugins and commercial database drivers; do not infer access to one package from another.
77
+
78
+ For knowledge base requirements, check `@nocobase/app-plugin-knowledge` first and follow [knowledge package integration](references/plugins.md#knowledge-base-integration). Apply the same automatic pkg-v3 access workflow when installation or update is needed. Read its synchronized Skill when available, otherwise its installed README, docs and public exports; do not assume it ships a Skill or build a substitute because one is absent.
79
+
80
+ For approval requirements, check `@nocobase/app-plugin-approval` first and follow [approval integration prerequisites](references/lifecycle.md#approval-requests-check-the-pro-plugin-first), then the plugin's installed Skill. Do not silently build a substitute approval engine from lifecycle examples. Simple single-person confirmation or rejection can remain lifecycle actions.
76
81
 
77
82
  When the stages of a business record are fixed by developers rather than drawn by administrators — an expense report, a ticket, a contract, an order — build it with `@nocobase/lifecycle` as [record lifecycles](references/lifecycle.md) describes: the state stays in the record's own field and changes only through declared transitions. Declare only required business paths with precise sources and destinations; the diagram expands every `from × to` pair rather than analyzing routing logic. Follow [readable process graphs](references/lifecycle-ui.md#keep-process-graphs-readable) before rendering dense definitions.
78
83
 
@@ -114,42 +114,63 @@
114
114
  {
115
115
  "id": "onboarding",
116
116
  "title": "Employee onboarding",
117
- "status": "planned",
117
+ "status": "runnable",
118
118
  "sources": [
119
- "client/pages/onboarding/",
119
+ "shared/onboarding.ts",
120
+ "client/pages/onboarding/index.tsx",
121
+ "client/pages/onboarding/wizard.tsx",
122
+ "client/pages/onboarding/choice.tsx",
123
+ "client/pages/onboarding/locales.ts",
120
124
  "server/routes/onboarding.ts",
121
125
  "server/providers/onboarding.ts",
122
- "database/main/migrations/",
123
- "database/main/seeds/",
126
+ "server/providers/onboarding-registration.ts",
127
+ "server/providers/onboarding-reset.ts",
128
+ "server/lifecycles/onboarding.ts",
129
+ "database/main/migrations/202611050001_create_onboarding.ts",
130
+ "database/main/seeds/202611050001_onboarding.ts",
131
+ "database/main/seeds/202611050002_onboarding_samples.ts",
132
+ "cli/commands/onboarding-reset.ts",
124
133
  "tests/client/onboarding.test.tsx",
125
134
  "tests/server/onboarding.test.ts",
126
135
  "tests/database/onboarding.test.ts",
127
- "tests/playwright/onboarding.test.ts"
136
+ "tests/playwright/onboarding.test.ts",
137
+ "docs/onboarding.md"
128
138
  ],
129
139
  "destination": "assets/business-examples/onboarding/",
130
140
  "entries": {
131
141
  "page": "/onboarding",
132
- "api": []
142
+ "api": [
143
+ "/api/onboarding",
144
+ "/api/onboarding/context",
145
+ "/api/onboarding/candidates",
146
+ "/api/onboarding/{id}",
147
+ "/api/onboarding/{id}/fire"
148
+ ]
133
149
  },
134
150
  "dependencies": [
135
- "Default registered authentication, Users and authorization capabilities",
136
- "lifecycle"
151
+ "Native authentication, Users and authorization with explicit per-user coordinator/viewer roles",
152
+ "Registered lifecycle example server runtime/history or an explicitly adapted application runtime/store",
153
+ "Existing submission provider/receipt migration and template-owned UI components"
137
154
  ],
138
155
  "commands": {
139
156
  "install": "pnpm install",
140
157
  "start": "pnpm dev",
141
- "test": "pnpm test && pnpm test:e2e",
142
- "reset": "implementation must supply isolated test-data reset"
158
+ "test": "pnpm exec vitest run tests/client/onboarding.test.tsx tests/server/onboarding.test.ts tests/database/onboarding.test.ts && pnpm exec playwright test tests/playwright/onboarding.test.ts",
159
+ "reset": "pnpm nocobase app onboarding-reset --dry-run --json; pnpm nocobase app onboarding-reset --force --json"
143
160
  },
144
161
  "applicability": "Application-owned business feature in the Examples template",
145
162
  "replacementPoints": [
146
- "Business fields and labels",
147
- "Reference scope",
148
- "Ownership and action permission rules",
149
- "Lifecycle transitions"
163
+ "Business fields, step grouping and shared validation",
164
+ "Conditional documents and dictionary scope",
165
+ "Ownership and role capabilities",
166
+ "Employee business key and unique constraints"
150
167
  ],
151
168
  "limitations": [
152
- "Not implemented or published by this collection-material change"
169
+ "Documents record type/title/reference only; no file upload",
170
+ "No approval, autosave, draft sharing or post-submission edits",
171
+ "Default integration requires explicit runtime/store and UI composition; see docs/onboarding.md",
172
+ "Confidential cases must not join unscoped generic data or workflow inspection endpoints",
173
+ "Independent agent adaptation and comparative evaluation remain separate"
153
174
  ]
154
175
  },
155
176
  {
@@ -0,0 +1,68 @@
1
+ import { AppCommand, CommandError } from '@nocobase/app-cli';
2
+ import { Flags } from '@oclif/core';
3
+
4
+ export default class OnboardingReset extends AppCommand {
5
+ static override summary =
6
+ 'Clear onboarding cases and their lifecycle history in a disposable development application.';
7
+ static override examples = [
8
+ '<%= config.bin %> <%= command.id %> --dry-run --json',
9
+ ];
10
+ static override flags = {
11
+ 'dry-run': Flags.boolean({
12
+ description: 'Count records without deleting them.',
13
+ default: false,
14
+ }),
15
+ force: Flags.boolean({
16
+ description:
17
+ 'Confirm deletion of every onboarding request in this development database.',
18
+ default: false,
19
+ }),
20
+ };
21
+ async run(): Promise<{
22
+ cases: number;
23
+ documents: number;
24
+ employees: number;
25
+ dryRun: boolean;
26
+ }> {
27
+ const { flags } = await this.parse(OnboardingReset);
28
+ if (process.env.NODE_ENV === 'production')
29
+ throw new CommandError(
30
+ 'Onboarding reset is available only in disposable development applications.',
31
+ { code: 'DEVELOPMENT_ONLY' },
32
+ );
33
+ if (!flags['dry-run'] && !flags.force)
34
+ throw new CommandError(
35
+ 'Preview the onboarding deletion plan, then confirm the disposable database.',
36
+ {
37
+ code: 'FORCE_REQUIRED',
38
+ exit: 2,
39
+ suggestions: [
40
+ {
41
+ message: 'Preview the plan.',
42
+ run: this.cliCommand([
43
+ 'app',
44
+ 'onboarding-reset',
45
+ '--dry-run',
46
+ '--json',
47
+ ]),
48
+ },
49
+ ],
50
+ },
51
+ );
52
+ const result = await this.withApp(async ({ app }) => {
53
+ app.registerProviders();
54
+ const { databaseManagerToken } = await import('@nocobase/db');
55
+ const { resetOnboarding } =
56
+ await import('../../server/providers/onboarding-reset.js');
57
+ return resetOnboarding(
58
+ app.container.resolve(databaseManagerToken).connection(),
59
+ flags['dry-run'],
60
+ );
61
+ });
62
+ if (flags['dry-run']) this.setStatus('success-noop');
63
+ this.log(
64
+ `Onboarding cases: ${result.cases}; documents: ${result.documents}; employees: ${result.employees}.`,
65
+ );
66
+ return result;
67
+ }
68
+ }
@@ -0,0 +1,60 @@
1
+ import { useTranslation } from '@nocobase/i18n/client';
2
+ import {
3
+ Select,
4
+ SelectTrigger,
5
+ SelectValue,
6
+ SelectContent,
7
+ SelectItem,
8
+ } from '#components/ui/select';
9
+ export function Choice({
10
+ label,
11
+ value,
12
+ options,
13
+ onChange,
14
+ disabled,
15
+ selectedName,
16
+ id,
17
+ invalid,
18
+ }: {
19
+ label: string;
20
+ value: string;
21
+ options: { id: string; name: string }[];
22
+ onChange: (value: string) => void;
23
+ disabled?: boolean;
24
+ selectedName?: string;
25
+ id?: string;
26
+ invalid?: boolean;
27
+ }) {
28
+ const { t } = useTranslation();
29
+ const choices = [
30
+ { value: '__empty', label: t('onboarding.select') },
31
+ ...options.map((o) => ({ value: o.id, label: o.name })),
32
+ ];
33
+ const items = [...choices];
34
+ if (value && !options.some((o) => o.id === value))
35
+ items.push({ value, label: selectedName || value });
36
+ return (
37
+ <Select
38
+ value={value || '__empty'}
39
+ items={items}
40
+ onValueChange={(v) => onChange(v === '__empty' ? '' : String(v ?? ''))}
41
+ disabled={disabled}
42
+ >
43
+ <SelectTrigger
44
+ id={id}
45
+ aria-label={label}
46
+ aria-invalid={invalid || undefined}
47
+ className='w-full'
48
+ >
49
+ <SelectValue />
50
+ </SelectTrigger>
51
+ <SelectContent>
52
+ {choices.map((o) => (
53
+ <SelectItem key={o.value} value={o.value}>
54
+ {o.label}
55
+ </SelectItem>
56
+ ))}
57
+ </SelectContent>
58
+ </Select>
59
+ );
60
+ }
@@ -0,0 +1,124 @@
1
+ import type { ColumnDef } from '@tanstack/react-table';
2
+ import { useTranslation } from '@nocobase/i18n/client';
3
+ import { Link, Outlet, useLocation, useSearchParams } from 'react-router';
4
+ import { DataTable } from '#components/data-table';
5
+ import { RecordLink } from '#components/record-link';
6
+ import { PageContainer } from '#components/page-container';
7
+ import { PageHeader } from '#components/page-header';
8
+ import { Input } from '#components/ui/input';
9
+ import { Button } from '#components/ui/button';
10
+ import { Alert, AlertDescription } from '#components/ui/alert';
11
+ import { useListData } from '#hooks/use-list-data';
12
+ import { useTableUrlState } from '#hooks/use-table-url-state';
13
+ import { type OnboardingDetail } from '../../../shared/onboarding.js';
14
+ import { Choice } from './choice.js';
15
+
16
+ type Record = OnboardingDetail['record'];
17
+ export default function OnboardingPage() {
18
+ const { t } = useTranslation();
19
+ const location = useLocation();
20
+ const [params, setParams] = useSearchParams();
21
+ const table = useTableUrlState({ sortColumns: [] });
22
+ const q = params.get('q') ?? '';
23
+ const status = params.get('status') ?? '';
24
+ const request = useListData<{ data: Record[]; meta: { total: number } }>(
25
+ `onboarding?${new URLSearchParams({ q, ...(status ? { status } : {}), page: String(table.paginationState.pageIndex + 1), pageSize: String(table.paginationState.pageSize) })}`,
26
+ );
27
+ const context = useListData<{ data: { coordinate: boolean; view: boolean } }>(
28
+ 'onboarding/context',
29
+ );
30
+ const filter = (key: string, value: string) =>
31
+ setParams((old) => {
32
+ old.set(key, value);
33
+ old.delete('page');
34
+ return old;
35
+ });
36
+ const columns: ColumnDef<Record>[] = [
37
+ {
38
+ accessorKey: 'fullName',
39
+ header: t('onboarding.fullName'),
40
+ cell: ({ row }) => (
41
+ <RecordLink to={{ pathname: row.original.id, search: location.search }}>
42
+ {row.original.fullName || t('onboarding.draft')}
43
+ </RecordLink>
44
+ ),
45
+ },
46
+ {
47
+ accessorKey: 'status',
48
+ header: t('onboarding.all'),
49
+ cell: ({ row }) => t(`onboarding.${row.original.status}`),
50
+ },
51
+ {
52
+ accessorKey: 'workEmail',
53
+ header: t('onboarding.workEmail'),
54
+ cell: ({ row }) => row.original.workEmail,
55
+ },
56
+ ];
57
+ return (
58
+ <PageContainer>
59
+ <PageHeader
60
+ title={t('onboarding.title')}
61
+ description={t('onboarding.description')}
62
+ actions={
63
+ context.data?.data.coordinate ? (
64
+ <Button
65
+ render={
66
+ <Link to={{ pathname: 'new', search: location.search }} />
67
+ }
68
+ nativeButton={false}
69
+ >
70
+ {t('onboarding.new')}
71
+ </Button>
72
+ ) : null
73
+ }
74
+ />
75
+ {context.data &&
76
+ !context.data.data.coordinate &&
77
+ !context.data.data.view ? (
78
+ <Alert>
79
+ <AlertDescription>{t('onboarding.denied')}</AlertDescription>
80
+ </Alert>
81
+ ) : null}
82
+ <div className='flex flex-wrap gap-3'>
83
+ <Input
84
+ className='max-w-sm'
85
+ aria-label={t('onboarding.search')}
86
+ placeholder={t('onboarding.search')}
87
+ value={q}
88
+ onChange={(e) => filter('q', e.target.value)}
89
+ />
90
+ <Choice
91
+ label={t('onboarding.all')}
92
+ value={status}
93
+ onChange={(v) => filter('status', v)}
94
+ options={['draft', 'submitted'].map((id) => ({
95
+ id,
96
+ name: t(`onboarding.${id || 'all'}`),
97
+ }))}
98
+ />
99
+ </div>
100
+ {request.error ? (
101
+ <Alert variant='destructive'>
102
+ <AlertDescription>
103
+ {t('onboarding.failed')}{' '}
104
+ <Button variant='outline' onClick={request.reload}>
105
+ {t('onboarding.retry')}
106
+ </Button>
107
+ </AlertDescription>
108
+ </Alert>
109
+ ) : null}
110
+ <DataTable
111
+ columns={columns}
112
+ data={request.data?.data ?? []}
113
+ loading={request.loading}
114
+ manualPagination
115
+ rowCount={request.data?.meta.total ?? 0}
116
+ paginationState={table.paginationState}
117
+ onPaginationChange={table.onPaginationChange}
118
+ showSelectedCount={false}
119
+ emptyMessage={t('onboarding.empty')}
120
+ />
121
+ <Outlet context={{ reload: request.reload }} />
122
+ </PageContainer>
123
+ );
124
+ }
@@ -0,0 +1,216 @@
1
+ export const enUS = {
2
+ title: 'Employee onboarding',
3
+ description:
4
+ 'Prepare an employee in four steps, save a private draft and submit once.',
5
+ new: 'New onboarding',
6
+ open: 'Onboarding details',
7
+ coordinate: 'Prepare and submit your cases',
8
+ view: 'Read submitted cases',
9
+ coordinatorRole: 'Onboarding coordinator',
10
+ viewerRole: 'HR viewer',
11
+ basic: 'Basic information',
12
+ employment: 'Employment information',
13
+ documents: 'Documents',
14
+ confirmation: 'Confirm submission',
15
+ fullName: 'Full name',
16
+ workEmail: 'Work email',
17
+ nationality: 'Nationality (two-letter code)',
18
+ department: 'Department',
19
+ jobTitle: 'Job title',
20
+ employmentType: 'Employment type',
21
+ fullTime: 'Full-time',
22
+ contractor: 'Contractor',
23
+ startDate: 'Start date',
24
+ probationMonths: 'Probation months',
25
+ contractEndDate: 'Contract end date',
26
+ identity: 'Identity document',
27
+ workPermit: 'Work permit',
28
+ serviceAgreement: 'Service agreement',
29
+ kind: 'Document type',
30
+ documentTitle: 'Document title',
31
+ referenceNo: 'Reference number',
32
+ addDocument: 'Add document',
33
+ removeDocument: 'Remove document',
34
+ previous: 'Previous',
35
+ next: 'Next',
36
+ save: 'Save draft',
37
+ submit: 'Submit onboarding',
38
+ draft: 'Draft',
39
+ submitted: 'Submitted',
40
+ all: 'All statuses',
41
+ status: 'Status',
42
+ search: 'Search onboarding cases',
43
+ empty: 'No onboarding cases.',
44
+ loading: 'Loading onboarding…',
45
+ failed: 'Could not load onboarding.',
46
+ retry: 'Retry',
47
+ reload: 'Reload saved draft',
48
+ unavailable: 'This onboarding case is unavailable.',
49
+ denied: 'Ask an administrator to assign an onboarding role in Users.',
50
+ select: 'Choose an option',
51
+ noDepartments:
52
+ 'No available departments. Ask an administrator to check the department dictionary.',
53
+ invalid:
54
+ 'Check the highlighted fields and required documents before continuing.',
55
+ issueCount: 'Issues to fix: {{count}}',
56
+ required: 'Complete this field with a valid value.',
57
+ documentHint:
58
+ 'Every employee needs an identity document. Non-CN nationals also need a work permit; contractors need a service agreement. Record a title and reference number for each document.',
59
+ employmentHint:
60
+ 'Full-time employees need 1–12 probation months. Contractors need a contract end date after their start date.',
61
+ saveFirst: 'Save your changes before submitting.',
62
+ operationFailed:
63
+ 'The operation failed. Retry the same action to recover an uncertain result.',
64
+ changed:
65
+ 'The case changed. Your input is retained; reload the saved draft before trying again.',
66
+ pending:
67
+ 'The previous result is uncertain. Retry the same action with the original data before editing.',
68
+ history: 'History',
69
+ created: 'Draft created',
70
+ employee: 'Employee created',
71
+ employeeId: 'Employee ID',
72
+ none: 'Not provided',
73
+ back: 'Back to onboarding',
74
+ newDescription:
75
+ 'Four steps. Save a private draft at any time; only you can open it.',
76
+ stepOf: 'Step {{current}} of {{total}}',
77
+ basicSummary: 'Name, email and nationality',
78
+ employmentSummary: 'Department, role and dates',
79
+ documentsSummary: 'Identity and required papers',
80
+ confirmationSummary: 'Review and submit once',
81
+ basicDescription: 'Who is joining. Every field is required.',
82
+ employmentDescription: 'Where and how they will work.',
83
+ documentsDescription:
84
+ 'Record a title and reference number for each document.',
85
+ confirmationDescription:
86
+ 'Check everything once. Submitting creates the employee record and locks this case.',
87
+ submittedDescription:
88
+ 'This case was submitted. It is read-only and its employee record exists.',
89
+ needsAttention: 'Needs attention',
90
+ position: 'Position',
91
+ contract: 'Contract',
92
+ nationalityHint: 'Non-CN nationals also need a work permit in Documents.',
93
+ contractOrder: 'The contract must end after the start date.',
94
+ documentMissing: 'Add a complete {{kind}}.',
95
+ requiredDocuments: 'Required for this employee',
96
+ reasonEveryone: 'every employee',
97
+ reasonNationality: 'nationality {{code}}',
98
+ reasonContractor: 'contractor',
99
+ documentsComplete: 'All required documents are present.',
100
+ noDocuments: 'No documents yet.',
101
+ edit: 'Edit',
102
+ unsaved: 'Unsaved changes',
103
+ saved: 'Draft saved',
104
+ notSaved: 'Not saved yet',
105
+ restored: 'Draft restored',
106
+ discard: 'Discard unsaved changes?',
107
+ discardDescription:
108
+ 'Your changes have not been saved. Keep editing or discard them to leave this page.',
109
+ keepEditing: 'Keep editing',
110
+ discardAction: 'Discard changes',
111
+ restoredDescription:
112
+ 'Continuing from {{step}}, the first step that still needs information.',
113
+ };
114
+ export const zhCN: Record<keyof typeof enUS, string> = {
115
+ title: '员工入职',
116
+ description: '分四步准备入职信息,保存私有草稿并一次提交。',
117
+ new: '新建入职单',
118
+ open: '入职详情',
119
+ coordinate: '准备并提交自己的入职单',
120
+ view: '查看已提交入职单',
121
+ coordinatorRole: '入职专员',
122
+ viewerRole: 'HR 查看者',
123
+ basic: '基本信息',
124
+ employment: '任职信息',
125
+ documents: '入职资料',
126
+ confirmation: '确认提交',
127
+ fullName: '姓名',
128
+ workEmail: '工作邮箱',
129
+ nationality: '国籍(两位代码)',
130
+ department: '部门',
131
+ jobTitle: '职位',
132
+ employmentType: '用工类型',
133
+ fullTime: '全职',
134
+ contractor: '外包',
135
+ startDate: '入职日期',
136
+ probationMonths: '试用期月数',
137
+ contractEndDate: '合同截止日期',
138
+ identity: '身份证明',
139
+ workPermit: '工作许可',
140
+ serviceAgreement: '服务协议',
141
+ kind: '资料类型',
142
+ documentTitle: '资料标题',
143
+ referenceNo: '资料编号',
144
+ addDocument: '添加资料',
145
+ removeDocument: '移除资料',
146
+ previous: '上一步',
147
+ next: '下一步',
148
+ save: '保存草稿',
149
+ submit: '提交入职',
150
+ draft: '草稿',
151
+ submitted: '已提交',
152
+ all: '全部状态',
153
+ status: '状态',
154
+ search: '搜索入职单',
155
+ empty: '暂无入职单。',
156
+ loading: '正在加载入职信息…',
157
+ failed: '无法加载入职信息。',
158
+ retry: '重试',
159
+ reload: '重新加载已保存草稿',
160
+ unavailable: '此入职单不可用。',
161
+ denied: '请管理员在用户管理中分配入职角色。',
162
+ select: '请选择',
163
+ noDepartments: '没有可用部门,请管理员检查部门字典。',
164
+ invalid: '请检查标记的字段及必需资料后继续。',
165
+ issueCount: '待处理问题:{{count}} 项',
166
+ required: '请填写有效值。',
167
+ documentHint:
168
+ '所有员工均需身份证明;非 CN 国籍还需工作许可,外包还需服务协议。每项资料填写标题和编号。',
169
+ employmentHint:
170
+ '全职需填写 1–12 个月试用期;外包合同截止日期须晚于入职日期。',
171
+ saveFirst: '请先保存修改再提交。',
172
+ operationFailed: '操作失败,请重试相同操作以恢复尚未确定的结果。',
173
+ changed: '入职单已变更,当前输入已保留;请重新加载已保存草稿后再试。',
174
+ pending: '上次操作结果尚未确定,请先用原数据重试相同操作再编辑。',
175
+ history: '办理历史',
176
+ created: '已创建草稿',
177
+ employee: '已生成员工记录',
178
+ employeeId: '员工编号',
179
+ none: '未填写',
180
+ back: '返回入职列表',
181
+ newDescription: '共四步,可随时保存私有草稿,只有你本人能打开。',
182
+ stepOf: '第 {{current}} 步,共 {{total}} 步',
183
+ basicSummary: '姓名、邮箱和国籍',
184
+ employmentSummary: '部门、职位和日期',
185
+ documentsSummary: '身份证明及必需资料',
186
+ confirmationSummary: '核对后一次提交',
187
+ basicDescription: '入职员工是谁,所有字段均为必填。',
188
+ employmentDescription: '在哪里工作、以什么方式工作。',
189
+ documentsDescription: '每项资料填写标题和编号。',
190
+ confirmationDescription:
191
+ '提交前请核对一遍。提交后将生成员工记录,入职单不能再修改。',
192
+ submittedDescription: '此入职单已提交,只读,员工记录已生成。',
193
+ needsAttention: '需要处理',
194
+ position: '职位',
195
+ contract: '合同',
196
+ nationalityHint: '非 CN 国籍还需在入职资料中提供工作许可。',
197
+ contractOrder: '合同截止日期须晚于入职日期。',
198
+ documentMissing: '请添加完整的{{kind}}。',
199
+ requiredDocuments: '该员工需要的资料',
200
+ reasonEveryone: '所有员工',
201
+ reasonNationality: '国籍 {{code}}',
202
+ reasonContractor: '外包',
203
+ documentsComplete: '必需资料已齐全。',
204
+ noDocuments: '暂无资料。',
205
+ edit: '修改',
206
+ unsaved: '有未保存的修改',
207
+ saved: '草稿已保存',
208
+ notSaved: '尚未保存',
209
+ restored: '已恢复草稿',
210
+ discard: '放弃未保存的修改?',
211
+ discardDescription:
212
+ '你的修改尚未保存,可以继续编辑,或放弃修改后离开此页面。',
213
+ keepEditing: '继续编辑',
214
+ discardAction: '放弃修改',
215
+ restoredDescription: '已从“{{step}}”继续,这是第一个还需补充信息的步骤。',
216
+ };