@23blocks/block-company 3.0.1 → 3.2.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/dist/index.esm.js +172 -2
- package/dist/src/lib/company.block.d.ts +3 -1
- package/dist/src/lib/company.block.d.ts.map +1 -1
- package/dist/src/lib/mappers/employee-assignment.mapper.d.ts +4 -0
- package/dist/src/lib/mappers/employee-assignment.mapper.d.ts.map +1 -0
- package/dist/src/lib/mappers/index.d.ts +2 -0
- package/dist/src/lib/mappers/index.d.ts.map +1 -1
- package/dist/src/lib/mappers/position.mapper.d.ts +4 -0
- package/dist/src/lib/mappers/position.mapper.d.ts.map +1 -0
- package/dist/src/lib/services/employee-assignments.service.d.ts +15 -0
- package/dist/src/lib/services/employee-assignments.service.d.ts.map +1 -0
- package/dist/src/lib/services/index.d.ts +2 -0
- package/dist/src/lib/services/index.d.ts.map +1 -1
- package/dist/src/lib/services/positions.service.d.ts +14 -0
- package/dist/src/lib/services/positions.service.d.ts.map +1 -0
- package/dist/src/lib/types/employee-assignment.d.ts +46 -0
- package/dist/src/lib/types/employee-assignment.d.ts.map +1 -0
- package/dist/src/lib/types/index.d.ts +2 -0
- package/dist/src/lib/types/index.d.ts.map +1 -1
- package/dist/src/lib/types/position.d.ts +41 -0
- package/dist/src/lib/types/position.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -426,13 +426,181 @@ function createQuartersService(transport, _config) {
|
|
|
426
426
|
};
|
|
427
427
|
}
|
|
428
428
|
|
|
429
|
+
const positionMapper = {
|
|
430
|
+
type: 'Position',
|
|
431
|
+
map: (resource)=>({
|
|
432
|
+
id: resource.id,
|
|
433
|
+
uniqueId: parseString(resource.attributes['unique_id']) || resource.id,
|
|
434
|
+
createdAt: parseDate(resource.attributes['created_at']) || new Date(),
|
|
435
|
+
updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
|
|
436
|
+
code: parseString(resource.attributes['code']) || '',
|
|
437
|
+
name: parseString(resource.attributes['name']) || '',
|
|
438
|
+
description: parseString(resource.attributes['description']),
|
|
439
|
+
departmentUniqueId: parseString(resource.attributes['department_unique_id']),
|
|
440
|
+
level: parseNumber(resource.attributes['level']),
|
|
441
|
+
reportsToUniqueId: parseString(resource.attributes['reports_to_unique_id']),
|
|
442
|
+
status: parseStatus(resource.attributes['status']),
|
|
443
|
+
enabled: parseBoolean(resource.attributes['enabled']),
|
|
444
|
+
payload: resource.attributes['payload']
|
|
445
|
+
})
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
function createPositionsService(transport, _config) {
|
|
449
|
+
return {
|
|
450
|
+
async list (params) {
|
|
451
|
+
const queryParams = {};
|
|
452
|
+
if (params == null ? void 0 : params.page) queryParams['page'] = String(params.page);
|
|
453
|
+
if (params == null ? void 0 : params.perPage) queryParams['records'] = String(params.perPage);
|
|
454
|
+
if (params == null ? void 0 : params.departmentUniqueId) queryParams['department_unique_id'] = params.departmentUniqueId;
|
|
455
|
+
if (params == null ? void 0 : params.status) queryParams['status'] = params.status;
|
|
456
|
+
if (params == null ? void 0 : params.search) queryParams['search'] = params.search;
|
|
457
|
+
if (params == null ? void 0 : params.sortBy) queryParams['sort'] = params.sortOrder === 'desc' ? `-${params.sortBy}` : params.sortBy;
|
|
458
|
+
const response = await transport.get('/positions', {
|
|
459
|
+
params: queryParams
|
|
460
|
+
});
|
|
461
|
+
return decodePageResult(response, positionMapper);
|
|
462
|
+
},
|
|
463
|
+
async get (uniqueId) {
|
|
464
|
+
const response = await transport.get(`/positions/${uniqueId}`);
|
|
465
|
+
return decodeOne(response, positionMapper);
|
|
466
|
+
},
|
|
467
|
+
async create (data) {
|
|
468
|
+
const response = await transport.post('/positions', {
|
|
469
|
+
position: {
|
|
470
|
+
code: data.code,
|
|
471
|
+
name: data.name,
|
|
472
|
+
description: data.description,
|
|
473
|
+
department_unique_id: data.departmentUniqueId,
|
|
474
|
+
level: data.level,
|
|
475
|
+
reports_to_unique_id: data.reportsToUniqueId,
|
|
476
|
+
payload: data.payload
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
return decodeOne(response, positionMapper);
|
|
480
|
+
},
|
|
481
|
+
async update (uniqueId, data) {
|
|
482
|
+
const response = await transport.put(`/positions/${uniqueId}`, {
|
|
483
|
+
position: {
|
|
484
|
+
name: data.name,
|
|
485
|
+
description: data.description,
|
|
486
|
+
department_unique_id: data.departmentUniqueId,
|
|
487
|
+
level: data.level,
|
|
488
|
+
reports_to_unique_id: data.reportsToUniqueId,
|
|
489
|
+
enabled: data.enabled,
|
|
490
|
+
status: data.status,
|
|
491
|
+
payload: data.payload
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
return decodeOne(response, positionMapper);
|
|
495
|
+
},
|
|
496
|
+
async delete (uniqueId) {
|
|
497
|
+
await transport.delete(`/positions/${uniqueId}`);
|
|
498
|
+
},
|
|
499
|
+
async listByDepartment (departmentUniqueId) {
|
|
500
|
+
const response = await transport.get(`/departments/${departmentUniqueId}/positions`);
|
|
501
|
+
return decodeMany(response, positionMapper);
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
const employeeAssignmentMapper = {
|
|
507
|
+
type: 'EmployeeAssignment',
|
|
508
|
+
map: (resource)=>{
|
|
509
|
+
var _parseBoolean;
|
|
510
|
+
return {
|
|
511
|
+
id: resource.id,
|
|
512
|
+
uniqueId: parseString(resource.attributes['unique_id']) || resource.id,
|
|
513
|
+
createdAt: parseDate(resource.attributes['created_at']) || new Date(),
|
|
514
|
+
updatedAt: parseDate(resource.attributes['updated_at']) || new Date(),
|
|
515
|
+
userUniqueId: parseString(resource.attributes['user_unique_id']) || '',
|
|
516
|
+
positionUniqueId: parseString(resource.attributes['position_unique_id']) || '',
|
|
517
|
+
departmentUniqueId: parseString(resource.attributes['department_unique_id']),
|
|
518
|
+
teamUniqueId: parseString(resource.attributes['team_unique_id']),
|
|
519
|
+
startDate: parseDate(resource.attributes['start_date']),
|
|
520
|
+
endDate: parseDate(resource.attributes['end_date']),
|
|
521
|
+
isPrimary: (_parseBoolean = parseBoolean(resource.attributes['is_primary'])) != null ? _parseBoolean : false,
|
|
522
|
+
status: parseStatus(resource.attributes['status']),
|
|
523
|
+
enabled: parseBoolean(resource.attributes['enabled']),
|
|
524
|
+
payload: resource.attributes['payload']
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
function createEmployeeAssignmentsService(transport, _config) {
|
|
530
|
+
return {
|
|
531
|
+
async list (params) {
|
|
532
|
+
const queryParams = {};
|
|
533
|
+
if (params == null ? void 0 : params.page) queryParams['page'] = String(params.page);
|
|
534
|
+
if (params == null ? void 0 : params.perPage) queryParams['records'] = String(params.perPage);
|
|
535
|
+
if (params == null ? void 0 : params.userUniqueId) queryParams['user_unique_id'] = params.userUniqueId;
|
|
536
|
+
if (params == null ? void 0 : params.positionUniqueId) queryParams['position_unique_id'] = params.positionUniqueId;
|
|
537
|
+
if (params == null ? void 0 : params.departmentUniqueId) queryParams['department_unique_id'] = params.departmentUniqueId;
|
|
538
|
+
if (params == null ? void 0 : params.teamUniqueId) queryParams['team_unique_id'] = params.teamUniqueId;
|
|
539
|
+
if (params == null ? void 0 : params.status) queryParams['status'] = params.status;
|
|
540
|
+
if (params == null ? void 0 : params.sortBy) queryParams['sort'] = params.sortOrder === 'desc' ? `-${params.sortBy}` : params.sortBy;
|
|
541
|
+
const response = await transport.get('/employee_assignments', {
|
|
542
|
+
params: queryParams
|
|
543
|
+
});
|
|
544
|
+
return decodePageResult(response, employeeAssignmentMapper);
|
|
545
|
+
},
|
|
546
|
+
async get (uniqueId) {
|
|
547
|
+
const response = await transport.get(`/employee_assignments/${uniqueId}`);
|
|
548
|
+
return decodeOne(response, employeeAssignmentMapper);
|
|
549
|
+
},
|
|
550
|
+
async create (data) {
|
|
551
|
+
const response = await transport.post('/employee_assignments', {
|
|
552
|
+
employee_assignment: {
|
|
553
|
+
user_unique_id: data.userUniqueId,
|
|
554
|
+
position_unique_id: data.positionUniqueId,
|
|
555
|
+
department_unique_id: data.departmentUniqueId,
|
|
556
|
+
team_unique_id: data.teamUniqueId,
|
|
557
|
+
start_date: data.startDate,
|
|
558
|
+
end_date: data.endDate,
|
|
559
|
+
is_primary: data.isPrimary,
|
|
560
|
+
payload: data.payload
|
|
561
|
+
}
|
|
562
|
+
});
|
|
563
|
+
return decodeOne(response, employeeAssignmentMapper);
|
|
564
|
+
},
|
|
565
|
+
async update (uniqueId, data) {
|
|
566
|
+
const response = await transport.put(`/employee_assignments/${uniqueId}`, {
|
|
567
|
+
employee_assignment: {
|
|
568
|
+
position_unique_id: data.positionUniqueId,
|
|
569
|
+
department_unique_id: data.departmentUniqueId,
|
|
570
|
+
team_unique_id: data.teamUniqueId,
|
|
571
|
+
start_date: data.startDate,
|
|
572
|
+
end_date: data.endDate,
|
|
573
|
+
is_primary: data.isPrimary,
|
|
574
|
+
enabled: data.enabled,
|
|
575
|
+
status: data.status,
|
|
576
|
+
payload: data.payload
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
return decodeOne(response, employeeAssignmentMapper);
|
|
580
|
+
},
|
|
581
|
+
async delete (uniqueId) {
|
|
582
|
+
await transport.delete(`/employee_assignments/${uniqueId}`);
|
|
583
|
+
},
|
|
584
|
+
async listByUser (userUniqueId) {
|
|
585
|
+
const response = await transport.get(`/users/${userUniqueId}/employee_assignments`);
|
|
586
|
+
return decodeMany(response, employeeAssignmentMapper);
|
|
587
|
+
},
|
|
588
|
+
async listByPosition (positionUniqueId) {
|
|
589
|
+
const response = await transport.get(`/positions/${positionUniqueId}/employee_assignments`);
|
|
590
|
+
return decodeMany(response, employeeAssignmentMapper);
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
|
|
429
595
|
function createCompanyBlock(transport, config) {
|
|
430
596
|
return {
|
|
431
597
|
companies: createCompaniesService(transport),
|
|
432
598
|
departments: createDepartmentsService(transport),
|
|
433
599
|
teams: createTeamsService(transport),
|
|
434
600
|
teamMembers: createTeamMembersService(transport),
|
|
435
|
-
quarters: createQuartersService(transport)
|
|
601
|
+
quarters: createQuartersService(transport),
|
|
602
|
+
positions: createPositionsService(transport),
|
|
603
|
+
employeeAssignments: createEmployeeAssignmentsService(transport)
|
|
436
604
|
};
|
|
437
605
|
}
|
|
438
606
|
const companyBlockMetadata = {
|
|
@@ -444,7 +612,9 @@ const companyBlockMetadata = {
|
|
|
444
612
|
'Department',
|
|
445
613
|
'Team',
|
|
446
614
|
'TeamMember',
|
|
447
|
-
'Quarter'
|
|
615
|
+
'Quarter',
|
|
616
|
+
'Position',
|
|
617
|
+
'EmployeeAssignment'
|
|
448
618
|
]
|
|
449
619
|
};
|
|
450
620
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Transport, BlockConfig, BlockMetadata } from '@23blocks/contracts';
|
|
2
|
-
import { type CompaniesService, type DepartmentsService, type TeamsService, type TeamMembersService, type QuartersService } from './services';
|
|
2
|
+
import { type CompaniesService, type DepartmentsService, type TeamsService, type TeamMembersService, type QuartersService, type PositionsService, type EmployeeAssignmentsService } from './services';
|
|
3
3
|
export interface CompanyBlockConfig extends BlockConfig {
|
|
4
4
|
appId: string;
|
|
5
5
|
tenantId?: string;
|
|
@@ -10,6 +10,8 @@ export interface CompanyBlock {
|
|
|
10
10
|
teams: TeamsService;
|
|
11
11
|
teamMembers: TeamMembersService;
|
|
12
12
|
quarters: QuartersService;
|
|
13
|
+
positions: PositionsService;
|
|
14
|
+
employeeAssignments: EmployeeAssignmentsService;
|
|
13
15
|
}
|
|
14
16
|
export declare function createCompanyBlock(transport: Transport, config: CompanyBlockConfig): CompanyBlock;
|
|
15
17
|
export declare const companyBlockMetadata: BlockMetadata;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"company.block.d.ts","sourceRoot":"","sources":["../../../src/lib/company.block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,
|
|
1
|
+
{"version":3,"file":"company.block.d.ts","sourceRoot":"","sources":["../../../src/lib/company.block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAQL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAChC,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,WAAW,EAAE,kBAAkB,CAAC;IAChC,KAAK,EAAE,YAAY,CAAC;IACpB,WAAW,EAAE,kBAAkB,CAAC;IAChC,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,mBAAmB,EAAE,0BAA0B,CAAC;CACjD;AAED,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,kBAAkB,GACzB,YAAY,CAUd;AAED,eAAO,MAAM,oBAAoB,EAAE,aAalC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ResourceMapper } from '@23blocks/jsonapi-codec';
|
|
2
|
+
import type { EmployeeAssignment } from '../types/employee-assignment';
|
|
3
|
+
export declare const employeeAssignmentMapper: ResourceMapper<EmployeeAssignment>;
|
|
4
|
+
//# sourceMappingURL=employee-assignment.mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"employee-assignment.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/employee-assignment.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGvE,eAAO,MAAM,wBAAwB,EAAE,cAAc,CAAC,kBAAkB,CAmBvE,CAAC"}
|
|
@@ -3,5 +3,7 @@ export * from './department.mapper';
|
|
|
3
3
|
export * from './team.mapper';
|
|
4
4
|
export * from './team-member.mapper';
|
|
5
5
|
export * from './quarter.mapper';
|
|
6
|
+
export * from './position.mapper';
|
|
7
|
+
export * from './employee-assignment.mapper';
|
|
6
8
|
export * from './utils';
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.mapper.d.ts","sourceRoot":"","sources":["../../../../src/lib/mappers/position.mapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD,eAAO,MAAM,cAAc,EAAE,cAAc,CAAC,QAAQ,CAkBnD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
2
|
+
import type { EmployeeAssignment, CreateEmployeeAssignmentRequest, UpdateEmployeeAssignmentRequest, ListEmployeeAssignmentsParams } from '../types/employee-assignment';
|
|
3
|
+
export interface EmployeeAssignmentsService {
|
|
4
|
+
list(params?: ListEmployeeAssignmentsParams): Promise<PageResult<EmployeeAssignment>>;
|
|
5
|
+
get(uniqueId: string): Promise<EmployeeAssignment>;
|
|
6
|
+
create(data: CreateEmployeeAssignmentRequest): Promise<EmployeeAssignment>;
|
|
7
|
+
update(uniqueId: string, data: UpdateEmployeeAssignmentRequest): Promise<EmployeeAssignment>;
|
|
8
|
+
delete(uniqueId: string): Promise<void>;
|
|
9
|
+
listByUser(userUniqueId: string): Promise<EmployeeAssignment[]>;
|
|
10
|
+
listByPosition(positionUniqueId: string): Promise<EmployeeAssignment[]>;
|
|
11
|
+
}
|
|
12
|
+
export declare function createEmployeeAssignmentsService(transport: Transport, _config: {
|
|
13
|
+
appId: string;
|
|
14
|
+
}): EmployeeAssignmentsService;
|
|
15
|
+
//# sourceMappingURL=employee-assignments.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"employee-assignments.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/employee-assignments.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,kBAAkB,EAClB,+BAA+B,EAC/B,+BAA+B,EAC/B,6BAA6B,EAC9B,MAAM,8BAA8B,CAAC;AAGtC,MAAM,WAAW,0BAA0B;IACzC,IAAI,CAAC,MAAM,CAAC,EAAE,6BAA6B,GAAG,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACtF,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACnD,MAAM,CAAC,IAAI,EAAE,+BAA+B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC3E,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,+BAA+B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC7F,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAChE,cAAc,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;CACzE;AAED,wBAAgB,gCAAgC,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,0BAA0B,CAqE7H"}
|
|
@@ -3,4 +3,6 @@ export * from './departments.service';
|
|
|
3
3
|
export * from './teams.service';
|
|
4
4
|
export * from './team-members.service';
|
|
5
5
|
export * from './quarters.service';
|
|
6
|
+
export * from './positions.service';
|
|
7
|
+
export * from './employee-assignments.service';
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Transport, PageResult } from '@23blocks/contracts';
|
|
2
|
+
import type { Position, CreatePositionRequest, UpdatePositionRequest, ListPositionsParams } from '../types/position';
|
|
3
|
+
export interface PositionsService {
|
|
4
|
+
list(params?: ListPositionsParams): Promise<PageResult<Position>>;
|
|
5
|
+
get(uniqueId: string): Promise<Position>;
|
|
6
|
+
create(data: CreatePositionRequest): Promise<Position>;
|
|
7
|
+
update(uniqueId: string, data: UpdatePositionRequest): Promise<Position>;
|
|
8
|
+
delete(uniqueId: string): Promise<void>;
|
|
9
|
+
listByDepartment(departmentUniqueId: string): Promise<Position[]>;
|
|
10
|
+
}
|
|
11
|
+
export declare function createPositionsService(transport: Transport, _config: {
|
|
12
|
+
appId: string;
|
|
13
|
+
}): PositionsService;
|
|
14
|
+
//# sourceMappingURL=positions.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"positions.service.d.ts","sourceRoot":"","sources":["../../../../src/lib/services/positions.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,KAAK,EACV,QAAQ,EACR,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClE,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzC,MAAM,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvD,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzE,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,gBAAgB,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;CACnE;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,gBAAgB,CA4DzG"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { IdentityCore, EntityStatus } from '@23blocks/contracts';
|
|
2
|
+
export interface EmployeeAssignment extends IdentityCore {
|
|
3
|
+
userUniqueId: string;
|
|
4
|
+
positionUniqueId: string;
|
|
5
|
+
departmentUniqueId?: string;
|
|
6
|
+
teamUniqueId?: string;
|
|
7
|
+
startDate?: Date;
|
|
8
|
+
endDate?: Date;
|
|
9
|
+
isPrimary: boolean;
|
|
10
|
+
status: EntityStatus;
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
payload?: Record<string, unknown>;
|
|
13
|
+
}
|
|
14
|
+
export interface CreateEmployeeAssignmentRequest {
|
|
15
|
+
userUniqueId: string;
|
|
16
|
+
positionUniqueId: string;
|
|
17
|
+
departmentUniqueId?: string;
|
|
18
|
+
teamUniqueId?: string;
|
|
19
|
+
startDate?: string;
|
|
20
|
+
endDate?: string;
|
|
21
|
+
isPrimary?: boolean;
|
|
22
|
+
payload?: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
export interface UpdateEmployeeAssignmentRequest {
|
|
25
|
+
positionUniqueId?: string;
|
|
26
|
+
departmentUniqueId?: string;
|
|
27
|
+
teamUniqueId?: string;
|
|
28
|
+
startDate?: string;
|
|
29
|
+
endDate?: string;
|
|
30
|
+
isPrimary?: boolean;
|
|
31
|
+
enabled?: boolean;
|
|
32
|
+
status?: EntityStatus;
|
|
33
|
+
payload?: Record<string, unknown>;
|
|
34
|
+
}
|
|
35
|
+
export interface ListEmployeeAssignmentsParams {
|
|
36
|
+
page?: number;
|
|
37
|
+
perPage?: number;
|
|
38
|
+
userUniqueId?: string;
|
|
39
|
+
positionUniqueId?: string;
|
|
40
|
+
departmentUniqueId?: string;
|
|
41
|
+
teamUniqueId?: string;
|
|
42
|
+
status?: EntityStatus;
|
|
43
|
+
sortBy?: string;
|
|
44
|
+
sortOrder?: 'asc' | 'desc';
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=employee-assignment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"employee-assignment.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/employee-assignment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEtE,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,+BAA+B;IAC9C,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,+BAA+B;IAC9C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,6BAA6B;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { IdentityCore, EntityStatus } from '@23blocks/contracts';
|
|
2
|
+
export interface Position extends IdentityCore {
|
|
3
|
+
code: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
departmentUniqueId?: string;
|
|
7
|
+
level?: number;
|
|
8
|
+
reportsToUniqueId?: string;
|
|
9
|
+
status: EntityStatus;
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
payload?: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
export interface CreatePositionRequest {
|
|
14
|
+
code: string;
|
|
15
|
+
name: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
departmentUniqueId?: string;
|
|
18
|
+
level?: number;
|
|
19
|
+
reportsToUniqueId?: string;
|
|
20
|
+
payload?: Record<string, unknown>;
|
|
21
|
+
}
|
|
22
|
+
export interface UpdatePositionRequest {
|
|
23
|
+
name?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
departmentUniqueId?: string;
|
|
26
|
+
level?: number;
|
|
27
|
+
reportsToUniqueId?: string;
|
|
28
|
+
enabled?: boolean;
|
|
29
|
+
status?: EntityStatus;
|
|
30
|
+
payload?: Record<string, unknown>;
|
|
31
|
+
}
|
|
32
|
+
export interface ListPositionsParams {
|
|
33
|
+
page?: number;
|
|
34
|
+
perPage?: number;
|
|
35
|
+
departmentUniqueId?: string;
|
|
36
|
+
status?: EntityStatus;
|
|
37
|
+
search?: string;
|
|
38
|
+
sortBy?: string;
|
|
39
|
+
sortOrder?: 'asc' | 'desc';
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=position.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../../../src/lib/types/position.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEtE,MAAM,WAAW,QAAS,SAAQ,YAAY;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;CAC5B"}
|
package/package.json
CHANGED