Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

Commit 71d05f2

Browse files
committed
better readme
1 parent d3e0c89 commit 71d05f2

File tree

1 file changed

+37
-164
lines changed

1 file changed

+37
-164
lines changed

README.md

Lines changed: 37 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -412,110 +412,6 @@ Either updates the **PrivatePerson** with FREG data if person exists on identifi
412412
}
413413
```
414414

415-
### ```POST /SyncEmployee```
416-
- Creates **PrivatePerson** on person if one doesn't exist
417-
- Updates name and address on **PrivatePerson** if one already exists
418-
- Creates **Employee project** on user if one doesn't exist
419-
- Sends email alert to archive department if there is need for manual operations:
420-
- If manager does not have user in P360
421-
- If manager have several contactpersons on email-address
422-
- If enterprise manager is employed in is missing enterprisenumber
423-
- If several enterprises are found on the same enterprisenumber
424-
- If enterprise does not have access group of type "Lønn" or "Personal"
425-
- If several employee projects are found on one employee
426-
427-
Fetches person info from [Det sentrale folkeregister](https://github.com/vtfk/azf-dsf)
428-
429-
#### `With ssn and upn as parameter`
430-
```json
431-
{
432-
"ssn": "01010101010",
433-
"upn": "per.son@company.no"
434-
}
435-
```
436-
437-
#### `With birthdate and name as parameter (only works with one match)`
438-
```json
439-
{
440-
"birthdate": "010101",
441-
"firstName": "Per",
442-
"lastName": "Son",
443-
"upn": "per.son@company.no"
444-
}
445-
```
446-
447-
#### `Optional: Do not lookup person in DSF (det sentrale folkeregister). (Requires more info) Useful when person is not registered in DSF`
448-
Either updates the **PrivatePerson** with the provided data if person exists on ssn, or creates new **PrivatePerson** with the provided data. Updates or creates **elevmappe** as well.
449-
```json
450-
{
451-
"ssn": "12345678910",
452-
"firstName": "Bjarte",
453-
"lastName": "Bjøstheim",
454-
"streetAddress": "Gamlehjemmet 44",
455-
"zipCode": "1234",
456-
"zipPlace": "Jupiter",
457-
"addressCode": 0,
458-
"skipDSF": true, // Must be set to "true" if you need to skip DSF lookup
459-
"upn": "bjarte.bjostheim@company.no
460-
}
461-
```
462-
463-
#### `Optional: With parameter allowNullValues`
464-
Set **allowNullValues** to **true**, if you want to continue also when accessGroups and enterprise is not found. **REMARK:** Client itself must handle access groups, enterprise, and manager when this parameter is set to true
465-
```json
466-
{
467-
"ssn": "01010101011",
468-
"upn": "per.son@company.no",
469-
"allowNullValues": false // Defaults to "true"
470-
}
471-
```
472-
#### `RETURNS`
473-
```json
474-
{
475-
"dsfPerson": {
476-
"ssn": "010101010101",
477-
"oldSsn": "010101010101", // The same as ssn if no change in DSF, or not specified by client
478-
"firstName": "Per",
479-
"lastName": "Son",
480-
"streetAddress": "Gata 2",
481-
"zipCode": "1234",
482-
"zipPlace": "STED",
483-
"addressType": "VANLIG BOSATT",
484-
"addressCode": 0,
485-
"residentialAddress": {
486-
"ADR": "Gata 2",
487-
"POSTN": "1234",
488-
"POSTS": "STED"
489-
}
490-
},
491-
"privatePerson": {
492-
"ssn": "010101010101",
493-
"oldSsn": "010101010101",
494-
"firstName": "Per",
495-
"lastName": "Son",
496-
"streetAddress": "Gata 2",
497-
"zipCode": "1234",
498-
"zipPlace": "STED",
499-
"addressCode": 0,
500-
"recno": 123456,
501-
"updated": false, // If the privatePerson was updated
502-
"updatedSsn": false // If the ssn of the privatePerson was updated
503-
},
504-
"employee": {
505-
"upn": "per.son@company.no", // Employee userPrincipalName from azure ad
506-
"manager": "herr.sjef@company.no", // Registered manager in azure ad
507-
"enterpriseNumber": "123456", // NOTE: Can be null if allowNullValues is false
508-
"enterpriseName": "Seksjon for surr og tull", // NOTE: Can be null if allowNullValues is false
509-
"accessGroups": {
510-
"personal": "Personal surr og tull", // NOTE: Can be null if allowNullValues is false
511-
"lonn": "Lønn surr og tull" // NOTE: Can be null if allowNullValues is false
512-
},
513-
"recno": 12345, // Recno of employeeProject
514-
"projectNumber": "23-12" // ProjectNumber of employeeProject
515-
}
516-
}
517-
```
518-
519415
### ```POST /SyncSharePointSite```
520416
Endpoint for connecting a Sharepoint site to a archive-project, and a list || documentLibrary || folder to a archive-case
521417

@@ -553,59 +449,48 @@ The Sharepoint site is connected to a archive-projectNumber. The list || documen
553449
```
554450

555451
## Templates
556-
[All templates](https://github.com/vtfk/azf-archive/blob/master/templates)
557-
558-
Currently available archive templates [All templates](https://github.com/vtfk/azf-archive/blob/master/templates)
559-
560-
| System | Template | Languages | Description |
561-
|--------|----------|-----------|-------------|
562-
| elevmappe | create-elevmappe | nb | Create **Elevmappe** by referencing **social security number**.<br>[JSON template and data format available here](https://github.com/vtfk/azf-archive/blob/master/templates/elevmappe-create-elevmappe.json)
563-
| elevmappe | create-private-person | nb | Create **PrivatePerson** in *P360* contact register.<br>[JSON template and data format available here](https://github.com/vtfk/azf-archive/blob/master/templates/elevmappe-create-private-person.json)
564-
| elevmappe | get-documents | nb | Get **Documents** archived on a **caseNumber**.<br>[JSON template and data format available here](https://github.com/vtfk/azf-archive/blob/master/templates/elevmappe-get-documents.json)
565-
| elevmappe | get-elevmappe | nb | Get **Elevmappe** archived on a **social security number**.<br>[JSON template and data format available here](https://github.com/vtfk/azf-archive/blob/master/templates/elevmappe-get-elevmappe.json)
566-
| elevmappe | get-private-person | nb | Get **PrivatePerson** from *P360* contact register by referencing **social security number**.<br>[JSON template and data format available here](https://github.com/vtfk/azf-archive/blob/master/templates/elevmappe-get-private-person.json)
567-
| elevmappe | update-elevmappe | nb | Update **PrivatePerson** on **Elevmappe** archived on a **caseNumber**.<br>[JSON template and data format available here](https://github.com/vtfk/azf-archive/blob/master/templates/elevmappe-update-elevmappe.json)
568-
| elevmappe | update-private-person | nb | Update **PrivatePerson** in *P360* contact register.<br>[JSON template and data format available here](https://github.com/vtfk/azf-archive/blob/master/templates/elevmappe-update-private-person.json)
569-
| iop | hemmelig | nb | Sends a auto generate PDF to school to distribute this manully.<br>[JSON template and data format available here](https://github.com/vtfk/azf-archive/blob/master/templates/iop-hemmelig.json)
570-
| iop | document | nb | Archive an IOP on students elevmappe.<br>[JSON template and data format available here](https://github.com/vtfk/azf-archive/blob/master/templates/iop-document.json)
571-
| masseutsendelse | utsendelsesdokument | nb | Upload document(s)
452+
All templates are found in [the templates folder](./templates/)
453+
572454

573455
## local.settings.json
574456

575457
```json
576458
{
577-
"Values": {
578-
"AzureWebJobsStorage": "",
579-
"FUNCTIONS_WORKER_RUNTIME": "node",
580-
"P360_BASE_URL": "http://p360server.domain.no:3001",
581-
"P360_TOKEN": "bla-bla-bla-bla-123",
582-
"P360_SECURE_BASE_URL": "http://p360sikkerserver.domain.no:3001",
583-
"P360_SECURE_TOKEN": "bla-bla-bla-bla-123",
584-
"P360_VTFK_ROBOT_RECNO": "000000",
585-
"PAPERTRAIL_HOST": "https://logs.collector.solarwinds.com/v1/log",
586-
"PAPERTRAIL_TOKEN": "token",
587-
"NODE_ENV": "production",
588-
"PDF_GENERATOR": "https://pdf.no/generate",
589-
"DSF_JWT_SECRET": "Noe skikkelig hemmelig",
590-
"DSF_URL": "https://dsf.no/lookup",
591-
"DSF_SAKSREF": "systemref",
592-
"DB_USER": "db-user",
593-
"DB_PASSWORD": "db-pass",
594-
"DB_SERVER": "db-server",
595-
"DB_DATABASE": "db-db",
596-
"DB_TABLE": "db-table",
597-
"E18_URL": "https://e18url.net", // optional
598-
"E18_KEY": "secret token", // optional
599-
"E18_SYSTEM": "p360", // optional
600-
"E18_EMPTY_JOB": true // optional
601-
}
459+
"IsEncrypted": false,
460+
"Values": {
461+
"AzureWebJobsStorage": "",
462+
"FUNCTIONS_WORKER_RUNTIME": "node",
463+
"ALLOW_LEGACY_RENEGOTIATION": false,
464+
"ARCHIVE_ROLE": "Archive",
465+
"ARCHIVE_URL": "sif rpc url",
466+
"ARCHIVE_CLIENT_ID": "sif client id",
467+
"ARCHIVE_AUTHKEY": "sif authkey",
468+
"ARCHIVE_ROBOT_RECNO": "recno of robot in p360, used as responsible on elevmapper",
469+
"ARCHIVE_ROBOT_ACCESS_GROUP": "robot access group, used on elevmapper",
470+
"PDF_GENERATOR_URL": "url to pdf api",
471+
"PDF_GENERATOR_KEY": "key for pdf api",
472+
"MAIL_TO_ARCHIVE": "mail address to archive team",
473+
"MAIL_TO_ARCHIVE_7011": "mail address to archive hr team",
474+
"MAIL_TO_ARCHIVE_ADMINISTRATOR": "mail address to archive administrator",
475+
"MAIL_SECRET": "key for mail api",
476+
"MAIL_URL": "url to mail api",
477+
"MAIL_MOBILE": "signature mobile number for emails",
478+
"MAIL_PHONE": "signature phpne number for emails",
479+
"MAIL_COMPANY": "signature company for emails",
480+
"MAIL_TEMPLATE_NAME": "mail template",
481+
"APPREG_CLIENT_ID": "client id of app reg representing this function",
482+
"APPREG_CLIENT_SECRET": "client secret",
483+
"APPREG_TENANT_ID": "tenant id",
484+
"GRAPH_SCOPE": "https://graph.microsoft.com/.default",
485+
"FREG_URL": "url to freg api",
486+
"FREG_SCOPE": "scope for freg api",
487+
"BRREG_URL": "url to brreg api",
488+
"ACCESSGROUP_EXCEPTIONS": "spør en voksen",
489+
"COUNTY_NUMBER": "fylkesnummer"
490+
}
602491
}
603492
```
604493

605-
### E18
606-
607-
To support [E18](https://github.com/vtfk/e18-node#usage), add `E18_URL`, `E18_KEY` and `E18_SYSTEM`
608-
609494
## Deploy
610495

611496
### Azure
@@ -615,21 +500,9 @@ You'll need a valid subscription and to setup the following resources
615500
- resource group
616501
- app service plan
617502
- storage account
618-
619-
#### Setup function
620-
621-
The easiest way to make this function run is to setup an app service, configure the app and get the function from GitHub.
622-
623-
- add function app
624-
- Runtime stack -> Node
625-
626-
Configuration for app (Application settings)
627-
- add values from [local.settings.json](#local.settings.json)
628-
629-
- add function
630-
- Plattform features -> deployment center
631-
- github
632-
- branch master
503+
- function app
504+
- auth enabled with entra id
505+
- app registration
633506

634507
# Development
635508

0 commit comments

Comments
 (0)