@ossy/consultancy 3.22.0 → 3.24.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 +5 -3
- package/src/ConsultancyNav.jsx +4 -0
- package/src/ConsultancyRecordList.jsx +11 -2
- package/src/CreateConsultancyButton.jsx +3 -2
- package/src/Forecast.jsx +3 -53
- package/src/MonthDayGrid.jsx +68 -0
- package/src/RequestMatches.jsx +52 -0
- package/src/current-month.component.jsx +10 -6
- package/src/en.translations.json +41 -0
- package/src/extract-request.task.js +21 -4
- package/src/extract-request.task.spec.js +44 -2
- package/src/locations.js +3 -0
- package/src/match-resumes.action.js +5 -0
- package/src/match-resumes.js +125 -0
- package/src/match-resumes.spec.js +58 -0
- package/src/match-resumes.task.js +67 -0
- package/src/match-resumes.task.spec.js +68 -0
- package/src/refresh-matches.action.js +5 -0
- package/src/refresh-matches.js +42 -0
- package/src/refresh-matches.spec.js +26 -0
- package/src/refresh-matches.task.js +196 -0
- package/src/refresh-matches.task.spec.js +123 -0
- package/src/request-matches.schema.js +13 -0
- package/src/request.schema.js +1 -1
- package/src/requests.page.jsx +21 -11
- package/src/resume-inbound-screening.task.js +77 -0
- package/src/resume-inbound-screening.task.spec.js +68 -0
- package/src/resumes.page.jsx +121 -0
- package/src/schema-ids.js +1 -0
- package/src/screen-inbound.task.js +63 -14
- package/src/screen-inbound.task.spec.js +59 -2
- package/src/sv.translations.json +41 -0
- package/src/utilization-hours.js +21 -3
- package/src/utilization-hours.spec.js +23 -0
package/src/sv.translations.json
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
"consultancy/contracts.documentTitle": "Avtal",
|
|
8
8
|
"consultancy/opportunities.documentTitle": "Möjligheter",
|
|
9
9
|
"consultancy/requests.documentTitle": "Förfrågningar",
|
|
10
|
+
"consultancy/resumes.documentTitle": "CV",
|
|
10
11
|
"consultancy/reports.documentTitle": "Rapporter",
|
|
11
12
|
"consultancy/proposals.documentTitle": "Offerter",
|
|
12
13
|
"consultancy.home.title": "Översikt",
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
"consultancy.nav.vacations": "Semester",
|
|
21
22
|
"consultancy.nav.contracts": "Avtal",
|
|
22
23
|
"consultancy.nav.requests": "Förfrågningar",
|
|
24
|
+
"consultancy.nav.resumes": "CV",
|
|
23
25
|
"consultancy.nav.opportunities": "Möjligheter",
|
|
24
26
|
"consultancy.nav.proposals": "Offerter",
|
|
25
27
|
"consultancy.nav.reports": "Rapporter",
|
|
@@ -75,6 +77,19 @@
|
|
|
75
77
|
"consultancy.requests.title": "Förfrågningar",
|
|
76
78
|
"consultancy.requests.description": "Uppdrag tolkade från inkommande e-post",
|
|
77
79
|
"consultancy.requests.empty": "Inga förfrågningar ännu.",
|
|
80
|
+
"consultancy.matches.title": "Matchande CV",
|
|
81
|
+
"consultancy.matches.loading": "Matchar CV…",
|
|
82
|
+
"consultancy.matches.empty": "Inga CV att matcha.",
|
|
83
|
+
"consultancy.matches.error": "Kunde inte matcha CV.",
|
|
84
|
+
"consultancy.matches.embeddingsUnavailable": "Visar överlappande taggar. Likhet är inte tillgänglig.",
|
|
85
|
+
"consultancy.matches.pending": "Matchningar tas fram när en förfrågan eller ett CV ändras.",
|
|
86
|
+
"@ossy/consultancy/actions/refresh-matches.label": "Uppdatera matchningar",
|
|
87
|
+
"@ossy/consultancy/actions/refresh-matches.description": "Bädda in ändrade förfrågningar och CV och spara deras matchningar",
|
|
88
|
+
"@ossy/consultancy/actions/match-resumes.label": "Matcha CV",
|
|
89
|
+
"@ossy/consultancy/actions/match-resumes.description": "Rangordna CV i den här workspacen mot en förfrågan efter delade taggar och likhet",
|
|
90
|
+
"consultancy.resumes.title": "CV",
|
|
91
|
+
"consultancy.resumes.description": "CV i den här workspacen, länkade till en profil och erfarenheter",
|
|
92
|
+
"consultancy.resumes.empty": "Inga CV ännu.",
|
|
78
93
|
"consultancy.requests.statsTitle": "Inkommande förfrågningar",
|
|
79
94
|
"consultancy.requests.statsSeries": "Förfrågningar",
|
|
80
95
|
"consultancy.requests.statsUnit": "förfrågningar",
|
|
@@ -165,6 +180,32 @@
|
|
|
165
180
|
"@ossy/consultancy/schema/vacation.start.description": "Första semesterdagen (inklusive). De här dagarna faktureras inte.",
|
|
166
181
|
"@ossy/consultancy/schema/vacation.end.label": "Sista lediga dagen",
|
|
167
182
|
"@ossy/consultancy/schema/vacation.end.description": "Sista semesterdagen (inklusive).",
|
|
183
|
+
"@ossy/consultancy/schema/request.title.label": "Titel",
|
|
184
|
+
"@ossy/consultancy/schema/request.title.description": "Uppdragets titel.",
|
|
185
|
+
"@ossy/consultancy/schema/request.summary.label": "Sammanfattning",
|
|
186
|
+
"@ossy/consultancy/schema/request.summary.description": "Vad kunden frågar efter.",
|
|
187
|
+
"@ossy/consultancy/schema/request.role.label": "Roll",
|
|
188
|
+
"@ossy/consultancy/schema/request.role.description": "Profilen de söker.",
|
|
189
|
+
"@ossy/consultancy/schema/request.tags.label": "Kompetenser",
|
|
190
|
+
"@ossy/consultancy/schema/request.tags.description": "Kompetenser eller tekniker som nämns.",
|
|
191
|
+
"@ossy/consultancy/schema/request.location.label": "Plats",
|
|
192
|
+
"@ossy/consultancy/schema/request.location.description": "Var arbetet sker.",
|
|
193
|
+
"@ossy/consultancy/schema/request.duration.label": "Längd",
|
|
194
|
+
"@ossy/consultancy/schema/request.duration.description": "Hur länge uppdraget pågår.",
|
|
195
|
+
"@ossy/consultancy/schema/request.start.label": "Start",
|
|
196
|
+
"@ossy/consultancy/schema/request.start.description": "När uppdraget startar.",
|
|
197
|
+
"@ossy/consultancy/schema/request.rate.label": "Arvode",
|
|
198
|
+
"@ossy/consultancy/schema/request.rate.description": "Belopp utan valutasymbol.",
|
|
199
|
+
"@ossy/consultancy/schema/request.currency.label": "Valuta",
|
|
200
|
+
"@ossy/consultancy/schema/request.currency.description": "Valuta för arvodet.",
|
|
201
|
+
"@ossy/consultancy/schema/request.contactName.label": "Kontaktperson",
|
|
202
|
+
"@ossy/consultancy/schema/request.contactName.description": "Personen som skickade förfrågan.",
|
|
203
|
+
"@ossy/consultancy/schema/request.contactEmail.label": "Kontaktens e-post",
|
|
204
|
+
"@ossy/consultancy/schema/request.contactEmail.description": "Personens e-postadress.",
|
|
205
|
+
"@ossy/consultancy/schema/request.messageId.label": "Meddelande-id",
|
|
206
|
+
"@ossy/consultancy/schema/request.messageId.description": "Id på det inkommande mejlet.",
|
|
207
|
+
"@ossy/consultancy/schema/request.receivedAt.label": "Mottaget",
|
|
208
|
+
"@ossy/consultancy/schema/request.receivedAt.description": "När mejlet skickades.",
|
|
168
209
|
"@ossy/consultancy/schema/opportunity.title.label": "Titel",
|
|
169
210
|
"@ossy/consultancy/schema/opportunity.title.description": "Kort namn på leadet eller möjligheten.",
|
|
170
211
|
"@ossy/consultancy/schema/opportunity.source.label": "Källa",
|
package/src/utilization-hours.js
CHANGED
|
@@ -175,22 +175,40 @@ export function actualIncomeForMonth ({
|
|
|
175
175
|
* @param {Array<object>} [options.employees]
|
|
176
176
|
* @param {Array<object>} [options.contracts]
|
|
177
177
|
*/
|
|
178
|
+
/**
|
|
179
|
+
* Months after the calendar month of `now` have no timesheets yet.
|
|
180
|
+
* Actual series stay empty there so the chart does not fall to zero.
|
|
181
|
+
*
|
|
182
|
+
* @param {{ year?: number|string, monthNumber?: number|string }} month
|
|
183
|
+
* @param {Date} [now]
|
|
184
|
+
*/
|
|
185
|
+
export function isAfterCurrentMonth (month, now = new Date()) {
|
|
186
|
+
const year = Number(month?.year)
|
|
187
|
+
const monthNumber = Number(month?.monthNumber)
|
|
188
|
+
if (!Number.isFinite(year) || !Number.isFinite(monthNumber)) return false
|
|
189
|
+
const currentYear = now.getFullYear()
|
|
190
|
+
const currentMonth = now.getMonth() + 1
|
|
191
|
+
return year > currentYear || (year === currentYear && monthNumber > currentMonth)
|
|
192
|
+
}
|
|
193
|
+
|
|
178
194
|
export function withUtilizationHours ({
|
|
179
195
|
months = [],
|
|
180
196
|
timesheets = [],
|
|
181
197
|
vacations = [],
|
|
182
198
|
employees = [],
|
|
183
199
|
contracts = [],
|
|
200
|
+
now = new Date(),
|
|
184
201
|
} = {}) {
|
|
185
202
|
return months.map((month) => {
|
|
186
|
-
const actualIncome = actualIncomeForMonth({ month, timesheets, contracts })
|
|
187
203
|
const salary = Number(month.monthlyCostOfEmployees) || 0
|
|
204
|
+
const future = isAfterCurrentMonth(month, now)
|
|
205
|
+
const actualIncome = future ? null : actualIncomeForMonth({ month, timesheets, contracts })
|
|
188
206
|
return {
|
|
189
207
|
...month,
|
|
190
208
|
forecastHours: Number(month.hoursWorked) || 0,
|
|
191
|
-
actualHours: actualHoursForMonth({ month, timesheets, vacations, employees }),
|
|
209
|
+
actualHours: future ? null : actualHoursForMonth({ month, timesheets, vacations, employees }),
|
|
192
210
|
actualIncome,
|
|
193
|
-
actualRevenue: actualIncome - salary,
|
|
211
|
+
actualRevenue: future ? null : actualIncome - salary,
|
|
194
212
|
}
|
|
195
213
|
})
|
|
196
214
|
}
|
|
@@ -131,4 +131,27 @@ describe('withUtilizationHours', () => {
|
|
|
131
131
|
expect(month.actualIncome).toBe(6000)
|
|
132
132
|
expect(month.actualRevenue).toBe(2000)
|
|
133
133
|
})
|
|
134
|
+
|
|
135
|
+
it('leaves actuals empty after the current month', () => {
|
|
136
|
+
const [past, current, future] = withUtilizationHours({
|
|
137
|
+
now: new Date(2026, 0, 15),
|
|
138
|
+
months: [
|
|
139
|
+
{ year: 2025, monthNumber: '12', hoursWorked: 10, monthlyCostOfEmployees: 1000, days: [] },
|
|
140
|
+
{ ...january, monthlyCostOfEmployees: 1000 },
|
|
141
|
+
{ year: 2026, monthNumber: '02', hoursWorked: 10, monthlyCostOfEmployees: 1000, days: [] },
|
|
142
|
+
],
|
|
143
|
+
timesheets: [{
|
|
144
|
+
content: {
|
|
145
|
+
lines: [{ date: new Date(2026, 0, 5).getTime(), hours: 6 }],
|
|
146
|
+
},
|
|
147
|
+
}],
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
expect(past.actualHours).toBe(0)
|
|
151
|
+
expect(current.actualHours).toBe(6)
|
|
152
|
+
expect(future.actualHours).toBeNull()
|
|
153
|
+
expect(future.actualIncome).toBeNull()
|
|
154
|
+
expect(future.actualRevenue).toBeNull()
|
|
155
|
+
expect(future.forecastHours).toBe(10)
|
|
156
|
+
})
|
|
134
157
|
})
|