@things-factory/organization 10.1.182 → 10.1.183

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/organization",
3
- "version": "10.1.182",
3
+ "version": "10.1.183",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -36,10 +36,10 @@
36
36
  "@operato/p13n": "^10.0.0",
37
37
  "@operato/popup": "^10.15.0",
38
38
  "@operato/shell": "^10.0.0",
39
- "@things-factory/auth-base": "^10.1.181",
40
- "@things-factory/code-ui": "^10.1.181",
41
- "@things-factory/contact": "^10.1.182",
39
+ "@things-factory/auth-base": "^10.1.183",
40
+ "@things-factory/code-ui": "^10.1.183",
41
+ "@things-factory/contact": "^10.1.183",
42
42
  "@things-factory/shell": "^10.1.179"
43
43
  },
44
- "gitHead": "f3e3c6640510197808a47db4a5922b2c9127694d"
44
+ "gitHead": "c36684e0db8353f5f4523ed55111df3154bae19e"
45
45
  }
@@ -0,0 +1,26 @@
1
+ import { readFileSync } from 'fs'
2
+ import { join } from 'path'
3
+
4
+ import { EMPLOYEE_PRIVATE_FIELDS, privateFieldsOf } from '../server/service/employee/employee-private'
5
+
6
+ /**
7
+ * An employee's pay account is HR-payroll's (ADR-0139): read under `employee-private`, apart from the roster every
8
+ * seat reads, and written only by whoever may change it.
9
+ */
10
+ describe("an employee's pay account", () => {
11
+ it('★ is declared under employee-private on the employee and its history - the declaration, not a resolver', () => {
12
+ for (const file of ['employee.ts', 'employee-history.ts']) {
13
+ const source = readFileSync(join(__dirname, '..', 'server', 'service', 'employee', file), 'utf8')
14
+ for (const field of EMPLOYEE_PRIVATE_FIELDS) {
15
+ expect([file, field, new RegExp(`@privilege\\(category: "employee-private", privilege: "query"[^\\n]*\\n @Field\\(\\{ nullable: true \\}\\)\\n ${field}\\?:`).test(source)]).toEqual([file, field, true])
16
+ }
17
+ }
18
+ })
19
+
20
+ it('★ a patch that writes it is told apart from one that leaves it alone', () => {
21
+ expect(privateFieldsOf({ name: '홍길동', bankAccount: '123', bankName: undefined })).toEqual(['bankAccount'])
22
+ expect(privateFieldsOf({ name: '홍길동' })).toEqual([])
23
+ expect(privateFieldsOf({ bankName: '' })).toEqual(['bankName'])
24
+ expect(privateFieldsOf(null)).toEqual([])
25
+ })
26
+ })