@ossy/consultancy 1.16.3 → 3.0.2

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.
package/README.md CHANGED
@@ -41,7 +41,7 @@ These schemas support platform automation workflows:
41
41
  | `ConsultancySchema` | Canonical schema id constants |
42
42
  | `employeeSchema`, `contractSchema`, … | Schema definitions for manifest build |
43
43
  | `location` | Workspace storage path (`/@ossy/consultancy/`) |
44
- | `Definition` | Feature metadata for store/sidebar (`statuses: ['beta']`) |
44
+ | `Definition` | Feature metadata for store/sidebar (`status: ['beta']`) |
45
45
 
46
46
  ## Usage
47
47
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ossy/consultancy",
3
3
  "description": "Consultancy feature package — schemas for employees, contracts, opportunities, and proposals",
4
- "version": "1.16.3",
4
+ "version": "3.0.2",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
7
7
  "module": "./src/index.js",
@@ -22,7 +22,7 @@
22
22
  "README.md"
23
23
  ],
24
24
  "dependencies": {
25
- "@ossy/schema": "^1.0.1"
25
+ "@ossy/schema": "^3.0.2"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "@ossy/calendar": "*",
@@ -30,5 +30,5 @@
30
30
  "@ossy/router-react": "*",
31
31
  "react": "*"
32
32
  },
33
- "gitHead": "a0d89185a17f8de8ce328c3a648c108ff1d61d8f"
33
+ "gitHead": "f0a8af3c370bbaffe4f7388c14f9345a5c6c56e5"
34
34
  }
package/src/Definition.js CHANGED
@@ -3,5 +3,5 @@ export const Definition = {
3
3
  title: 'Consultancy',
4
4
  description: 'Consultancy information and service presentation views.',
5
5
  icon: 'abstract',
6
- statuses: ['beta'],
6
+ status: ['beta'],
7
7
  }
@@ -3,7 +3,6 @@ import { Text, View, Button, Page, useLocale, Tags } from '@ossy/design-system'
3
3
  import { Overview } from './Overview.jsx'
4
4
  import { DataLoader } from '@ossy/calendar'
5
5
  import { Definition } from '@ossy/consultancy'
6
- import { moduleStatusTags } from './moduleStatus.js'
7
6
 
8
7
  export const metadata = {
9
8
  id: 'consultancy/home',
@@ -15,7 +14,9 @@ export const metadata = {
15
14
 
16
15
  export const ConsultancyPage = () => {
17
16
  const { t } = useLocale()
18
- const statusTags = moduleStatusTags(Definition)
17
+ const statusTags = (Definition.status ?? [])
18
+ .map((s) => ({ beta: 'Beta', 'coming-soon': 'Coming Soon' }[s]))
19
+ .filter(Boolean)
19
20
 
20
21
  return (
21
22
  <Page
@@ -1,5 +1,47 @@
1
1
  {
2
2
  "consultancy/home.documentTitle": "Consultancy",
3
- "consultancy.home.title": "Consultancy",
4
- "consultancy.home.description": "Consultancy overview"
3
+ "consultancy/home.title": "Consultancy",
4
+ "consultancy/home.description": "Consultancy overview",
5
+ "@ossy/consultancy/schema/contract.employeeId.label": "Employee",
6
+ "@ossy/consultancy/schema/contract.clientName.label": "Client name",
7
+ "@ossy/consultancy/schema/contract.hourlyCompensation.label": "Hourly compensation",
8
+ "@ossy/consultancy/schema/contract.startDate.label": "Start date",
9
+ "@ossy/consultancy/schema/contract.endDate.label": "End date",
10
+ "@ossy/consultancy/schema/contract.noticePeriodInDays.label": "Notice period (days)",
11
+ "@ossy/consultancy/schema/contract.paymentTermsDueDate.label": "Payment terms due date",
12
+ "@ossy/consultancy/schema/contract.paymentTermsInvoiceDate.label": "Payment terms invoice date",
13
+ "@ossy/consultancy/schema/employee.name.label": "Name",
14
+ "@ossy/consultancy/schema/employee.monthlySalary.label": "Monthly salary",
15
+ "@ossy/consultancy/schema/employee.workHoursPerDay.label": "Work hours per day",
16
+ "@ossy/consultancy/schema/employee.holidayDays.label": "Holiday days",
17
+ "@ossy/consultancy/schema/employee.startDate.label": "Start date",
18
+ "@ossy/consultancy/schema/employee.endDate.label": "End date",
19
+ "@ossy/consultancy/schema/opportunity.title.label": "Title",
20
+ "@ossy/consultancy/schema/opportunity.source.label": "Source",
21
+ "@ossy/consultancy/schema/opportunity.status.label": "Status",
22
+ "@ossy/consultancy/schema/opportunity.summary.label": "Summary",
23
+ "@ossy/consultancy/schema/opportunity.fitScore.label": "Fit score",
24
+ "@ossy/consultancy/schema/opportunity.nextAction.label": "Next action",
25
+ "@ossy/consultancy/schema/opportunity.contactEmail.label": "Contact email",
26
+ "@ossy/consultancy/schema/opportunity.contactName.label": "Contact name",
27
+ "@ossy/consultancy/schema/opportunity.linkedProposalId.label": "Linked proposal",
28
+ "@ossy/consultancy/schema/opportunity.feedRef.label": "Feed reference",
29
+ "@ossy/consultancy/schema/proposal.opportunityId.label": "Opportunity",
30
+ "@ossy/consultancy/schema/proposal.title.label": "Title",
31
+ "@ossy/consultancy/schema/proposal.status.label": "Status",
32
+ "@ossy/consultancy/schema/proposal.scope.label": "Scope",
33
+ "@ossy/consultancy/schema/proposal.rate.label": "Rate",
34
+ "@ossy/consultancy/schema/proposal.timeline.label": "Timeline",
35
+ "@ossy/consultancy/schema/proposal.body.label": "Body",
36
+ "@ossy/consultancy/schema/vacation.employeeId.label": "Employee",
37
+ "@ossy/consultancy/schema/vacation.start.label": "Start",
38
+ "@ossy/consultancy/schema/vacation.end.label": "End",
39
+ "@ossy/consultancy/schema/company-basic-info.name.label": "Name",
40
+ "@ossy/consultancy/schema/company-basic-info.registrationDate.label": "Registration date",
41
+ "@ossy/consultancy/schema/company-basic-info.vatNumber.label": "VAT number",
42
+ "@ossy/consultancy/schema/company-basic-info.vatRegistredFrom.label": "VAT registered from",
43
+ "@ossy/consultancy/schema/company-basic-info.vatPaymentResponsibilityFrom.label": "VAT payment responsibility from",
44
+ "@ossy/consultancy/schema/company-basic-info.vatPaymentPeriod.label": "VAT payment period",
45
+ "@ossy/consultancy/schema/company-basic-info.financialYearStart.label": "Financial year start",
46
+ "@ossy/consultancy/schema/company-basic-info.financialYearEnd.label": "Financial year end"
5
47
  }
@@ -1,95 +0,0 @@
1
- /**
2
- * Module lifecycle & visibility helpers.
3
- *
4
- * - `statuses` is a string[] on each Definition (e.g. `['beta']`, `['beta', 'internal']`).
5
- * - Legacy single `status` is still read for compatibility.
6
- * - Optional workspace gating via `workspaceServiceKey` or `workspaceServiceKeys` + `workspaceServiceRequirement`.
7
- */
8
-
9
- export const MODULE_STATUS = {
10
- beta: 'beta',
11
- comingSoon: 'coming-soon',
12
- stable: 'stable',
13
- /** When present, the module is omitted from the primary sidebar. */
14
- hidden: 'hidden',
15
- }
16
-
17
- const STATUS_TO_TAG_LABEL = {
18
- [MODULE_STATUS.beta]: 'Beta',
19
- [MODULE_STATUS.comingSoon]: 'Coming Soon',
20
- [MODULE_STATUS.stable]: null,
21
- [MODULE_STATUS.hidden]: null,
22
- }
23
-
24
- /** Status values that exclude a module from the sidebar (in addition to workspace gating). */
25
- const SIDEBAR_HIDE_STATUSES = new Set([MODULE_STATUS.hidden])
26
-
27
- /**
28
- * Normalize legacy `definition.status` and `definition.statuses` into one array.
29
- * @param {{ status?: string, statuses?: string[] }} definition
30
- * @returns {string[]}
31
- */
32
- export function moduleStatuses(definition) {
33
- const fromArray = Array.isArray(definition?.statuses) ? definition.statuses : []
34
- const fromLegacy = definition?.status && typeof definition.status === 'string' ? [definition.status] : []
35
- if (fromArray.length) return [...new Set(fromArray)]
36
- if (fromLegacy.length) return [...new Set(fromLegacy)]
37
- return []
38
- }
39
-
40
- /**
41
- * @param {{ status?: string, statuses?: string[] }} definition
42
- * @returns {string[]} labels for `<Tags tags={...} />` (stable/hidden emit none)
43
- */
44
- export function moduleStatusTags(definition) {
45
- const labels = []
46
- for (const s of moduleStatuses(definition)) {
47
- const label = STATUS_TO_TAG_LABEL[s]
48
- if (label) labels.push(label)
49
- }
50
- return [...new Set(labels)]
51
- }
52
-
53
- /**
54
- * @param {{ status?: string, statuses?: string[] }} definition
55
- * @returns {boolean}
56
- */
57
- export function isHiddenFromSidebar(definition) {
58
- if (!definition) return true
59
- return moduleStatuses(definition).some(s => SIDEBAR_HIDE_STATUSES.has(s))
60
- }
61
-
62
- /**
63
- * @param {Record<string, boolean> | undefined} services workspace.services
64
- * @param {{ workspaceServiceKey?: string, workspaceServiceKeys?: string[], workspaceServiceRequirement?: 'all' | 'any' }} definition
65
- * @returns {boolean}
66
- */
67
- export function workspaceAllowsModule(services, definition) {
68
- if (!definition) return false
69
- const keys = definition.workspaceServiceKeys?.length
70
- ? definition.workspaceServiceKeys
71
- : definition.workspaceServiceKey
72
- ? [definition.workspaceServiceKey]
73
- : null
74
- if (!keys?.length) return true
75
- const mode = definition.workspaceServiceRequirement || 'all'
76
- const map = services || {}
77
- /** Treat missing keys as allowed (legacy workspaces); only explicit `false` from disable turns a service off. */
78
- const flags = keys.map(k => map[k] !== false)
79
- return mode === 'any' ? flags.some(Boolean) : flags.every(Boolean)
80
- }
81
-
82
- /**
83
- * Router ref for a module’s default page: `@<moduleId>/home`
84
- * @param {string} moduleId — matches `Definition.module.id` / folder name
85
- */
86
- export function moduleHomeRef(moduleId) {
87
- return `@${moduleId}/home`
88
- }
89
-
90
- /**
91
- * @param {{ requiresModules?: Array<{ id: string, label: string, href: string }> }} definition
92
- */
93
- export function moduleRequiresModules(definition) {
94
- return definition?.requiresModules ?? []
95
- }