@ossy/consultancy 3.9.0 → 3.11.0
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/package.json +2 -2
- package/src/Overview.jsx +6 -1
- package/src/contract.schema.js +1 -0
- package/src/create-company.flow.js +46 -0
- package/src/delete-company.flow.js +37 -0
- package/src/disable-consultancy.flow.js +50 -0
- package/src/employee.schema.js +1 -0
- package/src/en.translations.json +6 -0
- package/src/enable-consultancy.flow.js +49 -0
- package/src/sv.translations.json +6 -0
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": "3.
|
|
4
|
+
"version": "3.11.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"module": "./src/index.js",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"@ossy/router-react": "*",
|
|
31
31
|
"react": "*"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "53ff8456920e09151c9d88df4a6c3ee958d811eb"
|
|
34
34
|
}
|
package/src/Overview.jsx
CHANGED
|
@@ -56,7 +56,12 @@ export const Overview = () => {
|
|
|
56
56
|
: '—'
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
|
-
<View
|
|
59
|
+
<View
|
|
60
|
+
data-consultancy="overview"
|
|
61
|
+
layout="row-wrap"
|
|
62
|
+
gap="m"
|
|
63
|
+
style={{ alignItems: 'stretch' }}
|
|
64
|
+
>
|
|
60
65
|
<View style={{ flex: '1 1 280px', minWidth: 0 }}>
|
|
61
66
|
<SectionPanel title={t('consultancy.overview.fiscalYears')}>
|
|
62
67
|
<View gap="s" inset="m">
|
package/src/contract.schema.js
CHANGED
|
@@ -12,6 +12,7 @@ export default {
|
|
|
12
12
|
{ name: 'startDate', type: 'date' },
|
|
13
13
|
{ name: 'endDate', type: 'date' },
|
|
14
14
|
{ name: 'noticePeriodInDays', type: 'number' },
|
|
15
|
+
{ name: 'billingPeriod', type: 'select', options: ['weekly', 'monthly'] },
|
|
15
16
|
{ name: 'paymentTermsDueDate', type: 'select', options: ['net30'] },
|
|
16
17
|
{ name: 'paymentTermsInvoiceDate', type: 'select', options: ['dayAfterServicePeriodEnd', 'sameDayAsServicePeriodEnd'] },
|
|
17
18
|
],
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import signUpFlow from '@ossy/authentication/sign-up.flow.js'
|
|
2
|
+
import { ConsultancySchema, location } from '@ossy/consultancy'
|
|
3
|
+
import { CreateResource, CreateDocumentForm } from '@ossy/resources'
|
|
4
|
+
|
|
5
|
+
export const metadata = {
|
|
6
|
+
id: '@ossy/consultancy/flows/create-company',
|
|
7
|
+
feature: 'consultancy',
|
|
8
|
+
requires: ['server', 'database'],
|
|
9
|
+
timeout: 120_000,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Happy path for issue #5 — consultancy empty state to company-basic-info ready.
|
|
14
|
+
*/
|
|
15
|
+
export default {
|
|
16
|
+
title: 'Create company',
|
|
17
|
+
description:
|
|
18
|
+
'Signed-in user sees consultancy empty, creates company-basic-info via create-document, then sees the ready overview',
|
|
19
|
+
steps: [
|
|
20
|
+
...signUpFlow.steps,
|
|
21
|
+
{ page: '@consultancy/home' },
|
|
22
|
+
{ result: { selector: '[data-consultancy-status="empty"]', timeout: 15000 } },
|
|
23
|
+
{
|
|
24
|
+
page: '@create-document',
|
|
25
|
+
search: {
|
|
26
|
+
location,
|
|
27
|
+
category: 'Consultancy',
|
|
28
|
+
schemaId: ConsultancySchema.companyBasicInfo,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
{ result: { selector: '[data-flow-stage="create-document"]', timeout: 15000 } },
|
|
32
|
+
{
|
|
33
|
+
result: {
|
|
34
|
+
selector: `[data-schema-id="${ConsultancySchema.companyBasicInfo}"]`,
|
|
35
|
+
timeout: 10000,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{ result: { action: CreateResource, timeout: 10000 } },
|
|
39
|
+
{ form: CreateDocumentForm, fields: { name: 'e2e-company' } },
|
|
40
|
+
{ action: CreateResource },
|
|
41
|
+
{ result: { page: '@storage/home', timeout: 20000 } },
|
|
42
|
+
{ page: '@consultancy/home' },
|
|
43
|
+
{ result: { selector: '[data-consultancy-status="ready"]', timeout: 15000 } },
|
|
44
|
+
{ result: { selector: '[data-consultancy="overview"]', timeout: 10000 } },
|
|
45
|
+
],
|
|
46
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import createCompanyFlow from './create-company.flow.js'
|
|
2
|
+
import { location } from '@ossy/consultancy'
|
|
3
|
+
import { DeleteResource } from '@ossy/resources'
|
|
4
|
+
|
|
5
|
+
export const metadata = {
|
|
6
|
+
id: '@ossy/consultancy/flows/delete-company',
|
|
7
|
+
feature: 'consultancy',
|
|
8
|
+
requires: ['server', 'database'],
|
|
9
|
+
timeout: 150_000,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* After creating company-basic-info, open it in storage and delete it.
|
|
14
|
+
* Consultancy home should return to the empty state.
|
|
15
|
+
*/
|
|
16
|
+
export default {
|
|
17
|
+
title: 'Delete company',
|
|
18
|
+
description:
|
|
19
|
+
'Signed-in user creates a company, deletes it from storage, and sees consultancy empty again',
|
|
20
|
+
steps: [
|
|
21
|
+
...createCompanyFlow.steps,
|
|
22
|
+
{ page: '@storage/home', search: { location } },
|
|
23
|
+
{ result: { selector: '[data-resource-name="e2e-company"]', timeout: 20000 } },
|
|
24
|
+
{ click: { selector: '[data-resource-name="e2e-company"]' } },
|
|
25
|
+
{ result: { action: DeleteResource, timeout: 15000 } },
|
|
26
|
+
{ action: DeleteResource },
|
|
27
|
+
{
|
|
28
|
+
result: {
|
|
29
|
+
selector: '[data-resource-name="e2e-company"]',
|
|
30
|
+
hidden: true,
|
|
31
|
+
timeout: 20000,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
{ page: '@consultancy/home' },
|
|
35
|
+
{ result: { selector: '[data-consultancy-status="empty"]', timeout: 15000 } },
|
|
36
|
+
],
|
|
37
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import enableConsultancyFlow from './enable-consultancy.flow.js'
|
|
2
|
+
import { DisableService, EnableService } from '@ossy/workspaces'
|
|
3
|
+
|
|
4
|
+
const CONSULTANCY = '@ossy/consultancy'
|
|
5
|
+
|
|
6
|
+
export const metadata = {
|
|
7
|
+
id: '@ossy/consultancy/flows/disable-consultancy',
|
|
8
|
+
feature: 'consultancy',
|
|
9
|
+
requires: ['server', 'database'],
|
|
10
|
+
timeout: 120_000,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* After enabling consultancy, disable from the package catalog detail toggle.
|
|
15
|
+
* Consultancy has no sales home — assert EnableService returns on the catalog.
|
|
16
|
+
*/
|
|
17
|
+
export default {
|
|
18
|
+
title: 'Disable consultancy',
|
|
19
|
+
description:
|
|
20
|
+
'Signed-in user enables consultancy, disables it from the package catalog, and sees Enable again',
|
|
21
|
+
steps: [
|
|
22
|
+
...enableConsultancyFlow.steps,
|
|
23
|
+
{ page: '@packages/detail', params: { packageSlug: 'consultancy' } },
|
|
24
|
+
{
|
|
25
|
+
result: {
|
|
26
|
+
action: { ...DisableService, service: CONSULTANCY },
|
|
27
|
+
timeout: 15000,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
result: {
|
|
32
|
+
selector: `[data-package-service="${CONSULTANCY}"][data-service-enabled="true"]`,
|
|
33
|
+
timeout: 10000,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{ action: { ...DisableService, service: CONSULTANCY } },
|
|
37
|
+
{
|
|
38
|
+
result: {
|
|
39
|
+
action: { ...EnableService, service: CONSULTANCY },
|
|
40
|
+
timeout: 20000,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
result: {
|
|
45
|
+
selector: `[data-package-service="${CONSULTANCY}"][data-service-enabled="false"]`,
|
|
46
|
+
timeout: 10000,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
}
|
package/src/employee.schema.js
CHANGED
package/src/en.translations.json
CHANGED
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
|
|
33
33
|
"@ossy/consultancy/schema/employee.name.label": "Name",
|
|
34
34
|
"@ossy/consultancy/schema/employee.name.description": "The employee’s full name.",
|
|
35
|
+
"@ossy/consultancy/schema/employee.email.label": "Email",
|
|
36
|
+
"@ossy/consultancy/schema/employee.email.description": "Work email used for timesheet reminders and other notifications.",
|
|
35
37
|
"@ossy/consultancy/schema/employee.monthlySalary.label": "Monthly salary",
|
|
36
38
|
"@ossy/consultancy/schema/employee.monthlySalary.description": "Gross monthly salary in SEK, before employer social costs.",
|
|
37
39
|
"@ossy/consultancy/schema/employee.workHoursPerDay.label": "Work hours per day",
|
|
@@ -55,6 +57,10 @@
|
|
|
55
57
|
"@ossy/consultancy/schema/contract.endDate.description": "Last day of the contract. Leave empty if it is ongoing.",
|
|
56
58
|
"@ossy/consultancy/schema/contract.noticePeriodInDays.label": "Notice period (days)",
|
|
57
59
|
"@ossy/consultancy/schema/contract.noticePeriodInDays.description": "How many days of notice the contract requires.",
|
|
60
|
+
"@ossy/consultancy/schema/contract.billingPeriod.label": "Billing period",
|
|
61
|
+
"@ossy/consultancy/schema/contract.billingPeriod.description": "How often timesheets are generated for this assignment.",
|
|
62
|
+
"@ossy/consultancy/schema/contract.billingPeriod.option.weekly": "Weekly",
|
|
63
|
+
"@ossy/consultancy/schema/contract.billingPeriod.option.monthly": "Monthly",
|
|
58
64
|
"@ossy/consultancy/schema/contract.paymentTermsDueDate.label": "Payment terms",
|
|
59
65
|
"@ossy/consultancy/schema/contract.paymentTermsDueDate.description": "When the invoice is due, e.g. net 30 days.",
|
|
60
66
|
"@ossy/consultancy/schema/contract.paymentTermsInvoiceDate.label": "Invoice date",
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import signUpFlow from '@ossy/authentication/sign-up.flow.js'
|
|
2
|
+
import { DisableService, EnableService } from '@ossy/workspaces'
|
|
3
|
+
|
|
4
|
+
const CONSULTANCY = '@ossy/consultancy'
|
|
5
|
+
|
|
6
|
+
export const metadata = {
|
|
7
|
+
id: '@ossy/consultancy/flows/enable-consultancy',
|
|
8
|
+
feature: 'consultancy',
|
|
9
|
+
requires: ['server', 'database'],
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Consultancy has no sales home — enable from the package catalog detail toggle.
|
|
14
|
+
* Uses live workspace entitlements (not app-test `devEntitlements` sidebar overlay).
|
|
15
|
+
*/
|
|
16
|
+
export default {
|
|
17
|
+
title: 'Enable consultancy',
|
|
18
|
+
description:
|
|
19
|
+
'New user registers, opens the consultancy package detail, and enables the workspace service',
|
|
20
|
+
steps: [
|
|
21
|
+
...signUpFlow.steps,
|
|
22
|
+
{ page: '@packages/detail', params: { packageSlug: 'consultancy' } },
|
|
23
|
+
{
|
|
24
|
+
result: {
|
|
25
|
+
action: { ...EnableService, service: CONSULTANCY },
|
|
26
|
+
timeout: 15000,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
result: {
|
|
31
|
+
selector: `[data-package-service="${CONSULTANCY}"][data-service-enabled="false"]`,
|
|
32
|
+
timeout: 10000,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{ action: { ...EnableService, service: CONSULTANCY } },
|
|
36
|
+
{
|
|
37
|
+
result: {
|
|
38
|
+
action: { ...DisableService, service: CONSULTANCY },
|
|
39
|
+
timeout: 20000,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
result: {
|
|
44
|
+
selector: `[data-package-service="${CONSULTANCY}"][data-service-enabled="true"]`,
|
|
45
|
+
timeout: 10000,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
}
|
package/src/sv.translations.json
CHANGED
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
|
|
33
33
|
"@ossy/consultancy/schema/employee.name.label": "Namn",
|
|
34
34
|
"@ossy/consultancy/schema/employee.name.description": "Den anställdas fullständiga namn.",
|
|
35
|
+
"@ossy/consultancy/schema/employee.email.label": "E-post",
|
|
36
|
+
"@ossy/consultancy/schema/employee.email.description": "Arbetse-post för tidrapportpåminnelser och andra aviseringar.",
|
|
35
37
|
"@ossy/consultancy/schema/employee.monthlySalary.label": "Månadslön",
|
|
36
38
|
"@ossy/consultancy/schema/employee.monthlySalary.description": "Bruttolön per månad i SEK, före arbetsgivaravgifter.",
|
|
37
39
|
"@ossy/consultancy/schema/employee.workHoursPerDay.label": "Arbetstimmar per dag",
|
|
@@ -55,6 +57,10 @@
|
|
|
55
57
|
"@ossy/consultancy/schema/contract.endDate.description": "Sista dagen på avtalet. Lämna tomt om det pågår.",
|
|
56
58
|
"@ossy/consultancy/schema/contract.noticePeriodInDays.label": "Uppsägningstid (dagar)",
|
|
57
59
|
"@ossy/consultancy/schema/contract.noticePeriodInDays.description": "Hur många dagars uppsägning avtalet kräver.",
|
|
60
|
+
"@ossy/consultancy/schema/contract.billingPeriod.label": "Faktureringsperiod",
|
|
61
|
+
"@ossy/consultancy/schema/contract.billingPeriod.description": "Hur ofta tidrapporter skapas för uppdraget.",
|
|
62
|
+
"@ossy/consultancy/schema/contract.billingPeriod.option.weekly": "Veckovis",
|
|
63
|
+
"@ossy/consultancy/schema/contract.billingPeriod.option.monthly": "Månadsvis",
|
|
58
64
|
"@ossy/consultancy/schema/contract.paymentTermsDueDate.label": "Betalningsvillkor",
|
|
59
65
|
"@ossy/consultancy/schema/contract.paymentTermsDueDate.description": "När fakturan förfaller, t.ex. 30 dagar netto.",
|
|
60
66
|
"@ossy/consultancy/schema/contract.paymentTermsInvoiceDate.label": "Fakturadatum",
|