@pulsecharterconnect/types 0.0.7 → 0.0.9

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.
@@ -1,4 +1,4 @@
1
- export type OrganizationType = 'System Admin' | 'Transplant Center' | 'Transportation Provider' | 'Surgical Provider' | 'Donor Hospital';
1
+ export type OrganizationType = 'System Admin' | 'Transplant Center' | 'Transportation Operator' | 'Surgical Provider' | 'Donor Hospital';
2
2
  export type AirService = 'Jet' | 'TurboProp' | 'Helicopter';
3
3
  export type GroundService = 'Ambulance' | 'Limo' | 'Car' | 'Mid-Size SUV' | 'Full-Size SUV';
4
4
  export type Aircraft = {
@@ -19,22 +19,6 @@ export type Facility = {
19
19
  };
20
20
  utcOffsetMinutes: number;
21
21
  };
22
- export type OrganizationDetails = {
23
- type: 'System Admin';
24
- details: ISystemAdminOrganization;
25
- } | {
26
- type: 'Transplant Center';
27
- details: ITransplantCenterOrganization;
28
- } | {
29
- type: 'Transportation Provider';
30
- details: ITranportationOperatorOrganization;
31
- } | {
32
- type: 'Surgical Provider';
33
- details: {};
34
- } | {
35
- type: 'Donor Hospital';
36
- details: {};
37
- };
38
22
  export interface ISystemAdminOrganization {
39
23
  }
40
24
  export interface ITransplantCenterOrganization {
@@ -54,13 +38,17 @@ export interface IOrganization {
54
38
  workOsId: string;
55
39
  name: string;
56
40
  type: OrganizationType;
57
- organizationDetails: OrganizationDetails;
41
+ systemAdminOrganizationDetails?: ISystemAdminOrganization;
42
+ transplantCenterOrganizationDetails?: ITransplantCenterOrganization;
43
+ transportationOperatorOrganizationDetails?: ITranportationOperatorOrganization;
58
44
  }
59
45
  export declare class Organization implements IOrganization {
60
46
  id: string;
61
47
  workOsId: string;
62
48
  name: string;
63
49
  type: OrganizationType;
64
- organizationDetails: OrganizationDetails;
65
- constructor(id: string, workOsId: string, name: string, type: OrganizationType, organizationDetails: OrganizationDetails);
50
+ systemAdminOrganizationDetails?: ISystemAdminOrganization;
51
+ transplantCenterOrganizationDetails?: ITransplantCenterOrganization;
52
+ transportationOperatorOrganizationDetails?: ITranportationOperatorOrganization;
53
+ constructor(id: string, workOsId: string, name: string, type: OrganizationType, systemAdminOrganizationDetails?: ISystemAdminOrganization, transplantCenterOrganizationDetails?: ITransplantCenterOrganization, transportationOperatorOrganizationDetails?: ITranportationOperatorOrganization);
66
54
  }
@@ -2,12 +2,24 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Organization = void 0;
4
4
  class Organization {
5
- constructor(id, workOsId, name, type, organizationDetails) {
5
+ constructor(id, workOsId, name, type, systemAdminOrganizationDetails, transplantCenterOrganizationDetails, transportationOperatorOrganizationDetails) {
6
6
  this.id = id;
7
7
  this.workOsId = workOsId;
8
8
  this.name = name;
9
9
  this.type = type;
10
- this.organizationDetails = organizationDetails;
10
+ switch (type) {
11
+ case 'System Admin':
12
+ this.systemAdminOrganizationDetails = systemAdminOrganizationDetails;
13
+ break;
14
+ case 'Transplant Center':
15
+ this.transplantCenterOrganizationDetails = transplantCenterOrganizationDetails;
16
+ break;
17
+ case 'Transportation Operator':
18
+ this.transportationOperatorOrganizationDetails = transportationOperatorOrganizationDetails;
19
+ break;
20
+ default:
21
+ throw new Error('Organization type not recognized');
22
+ }
11
23
  }
12
24
  }
13
25
  exports.Organization = Organization;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulsecharterconnect/types",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "A TypeScript library for enhanced type safety.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",