@unaffi/schema 1.0.0 → 1.1.1
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/README.md +44 -2
- package/base.schema.d.ts +3 -3
- package/collections/action.schema.d.ts +23 -15
- package/collections/collaborator.schema.d.ts +8 -8
- package/collections/contactpoint.schema.d.ts +15 -14
- package/collections/facility.schema.d.ts +15 -19
- package/collections/file.schema.d.ts +22 -18
- package/collections/form.schema.d.ts +1 -0
- package/collections/instance.schema.d.ts +36 -29
- package/collections/location.schema.d.ts +30 -24
- package/collections/order.schema.d.ts +16 -16
- package/collections/org.schema.d.ts +29 -26
- package/collections/payment.schema.d.ts +17 -19
- package/collections/profile.schema.d.ts +4 -2
- package/collections/schedule.schema.d.ts +85 -85
- package/collections/searchentry.schema.d.ts +28 -0
- package/collections/seat.schema.d.ts +13 -13
- package/collections/service.schema.d.ts +25 -23
- package/collections/servicetype.schema.d.ts +12 -14
- package/collections/token.schema.d.ts +8 -8
- package/common.d.ts +10 -10
- package/index.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,46 @@
|
|
|
1
|
-
# UNAFFI Schema
|
|
1
|
+
# UNAFFI Schema
|
|
2
|
+
|
|
3
|
+
This reflects what the API returns, **not** what the DB Schema looks like in MongoDB.
|
|
2
4
|
|
|
3
|
-
This reflects what the API returns, and not what the DB Schema looks like in MongoDB.
|
|
4
5
|
Can be imported into any repo and be used by both TS and JS (JSDocs) code.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
```bash
|
|
9
|
+
npm i --save-dev @unaffi/schema
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
Example:
|
|
14
|
+
```js
|
|
15
|
+
/** @type {import('@unaffi/schema').Profile} */
|
|
16
|
+
const profile = await getProfile();
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
or define it at the top of the page to use the type throughout the file:
|
|
20
|
+
```js
|
|
21
|
+
/** @typedef {import('@unaffi/schema').Profile} Profile */
|
|
22
|
+
|
|
23
|
+
/** @type {Profile} */
|
|
24
|
+
const profile = await getProfile();
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Updating the Schema
|
|
28
|
+
1. **Bump the version** in the `package.json`:
|
|
29
|
+
```jsonc
|
|
30
|
+
{
|
|
31
|
+
// …
|
|
32
|
+
"version": "1.0.0", // to "1.0.1" | Always update 3rd number, unless it is a large update (such as an extra table added). Never update 1st number unless we restart unaffi's schema entirely.
|
|
33
|
+
// …
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
2. Update **Github**:
|
|
37
|
+
```bash
|
|
38
|
+
git add .
|
|
39
|
+
git commit -m "Your commit message"
|
|
40
|
+
git push
|
|
41
|
+
```
|
|
42
|
+
3. Update **npm**:
|
|
43
|
+
```bash
|
|
44
|
+
npm login
|
|
45
|
+
npm publish --access public
|
|
46
|
+
```
|
package/base.schema.d.ts
CHANGED
|
@@ -1,24 +1,32 @@
|
|
|
1
|
-
import type { Base } from
|
|
2
|
-
import type * as DB from
|
|
1
|
+
import type { Base } from "../base.schema";
|
|
2
|
+
import type * as DB from "../index";
|
|
3
3
|
|
|
4
4
|
export interface Action extends Base {
|
|
5
|
-
|
|
5
|
+
readonly action_id: string;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
action_template?: string;
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
data?: {
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
};
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
profile_attributes?: {
|
|
14
|
+
is_system?: boolean;
|
|
15
|
+
is_collaborator?: boolean;
|
|
16
|
+
is_instance_seat?: boolean;
|
|
17
|
+
is_order_profile?: boolean;
|
|
18
|
+
is_order_seat?: boolean;
|
|
19
|
+
};
|
|
15
20
|
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
org_id?: DB.Org["org_id"];
|
|
22
|
+
org?: DB.Org;
|
|
18
23
|
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
order_id?: DB.Order["order_id"];
|
|
25
|
+
order?: DB.Order;
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
instance_id?: DB.Instance["instance_id"];
|
|
28
|
+
instance?: DB.Instance;
|
|
29
|
+
|
|
30
|
+
profile_id?: DB.Profile["profile_id"];
|
|
31
|
+
profile?: DB.Profile;
|
|
24
32
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { Base } from
|
|
2
|
-
import type * as DB from
|
|
1
|
+
import type { Base } from "../base.schema";
|
|
2
|
+
import type * as DB from "../index";
|
|
3
3
|
|
|
4
4
|
export interface Collaborator extends Base {
|
|
5
|
-
|
|
5
|
+
readonly collaborator_id: string;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
role?: "owner" | "admin";
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
org_id?: DB.Org["org_id"];
|
|
10
|
+
org?: DB.Org;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
profile_id?: DB.Profile["profile_id"];
|
|
13
|
+
profile?: DB.Profile;
|
|
14
14
|
}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import type { Base } from
|
|
2
|
-
import type { Org } from
|
|
3
|
-
import type { Profile } from
|
|
1
|
+
import type { Base } from "../base.schema";
|
|
2
|
+
import type { Org } from "./org.schema";
|
|
3
|
+
import type { Profile } from "./profile.schema";
|
|
4
4
|
|
|
5
5
|
export interface Contactpoint extends Base {
|
|
6
|
-
|
|
6
|
+
readonly contactpoint_id: string;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
type?: "email_address" | "mobile_number" | "telephone_number";
|
|
9
|
+
point?: string;
|
|
10
|
+
details: {
|
|
11
|
+
descname?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
full_name?: string;
|
|
14
|
+
};
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
org_id?: Org["org_id"];
|
|
17
|
+
org?: Org;
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
profile_id?: Profile["profile_id"];
|
|
20
|
+
profile?: Profile;
|
|
20
21
|
}
|
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
import type { Base } from
|
|
2
|
-
import type * as DB from
|
|
3
|
-
import type { GeoLocation } from
|
|
1
|
+
import type { Base } from "../base.schema";
|
|
2
|
+
import type * as DB from "../index";
|
|
3
|
+
import type { GeoLocation } from "../common";
|
|
4
4
|
|
|
5
5
|
export interface Facility extends Base {
|
|
6
|
-
|
|
6
|
+
readonly facility_id: string;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
linked_facility_ids: DB.Facility["facility_id"][];
|
|
9
|
+
linked_facilities: DB.Facility;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
config: {
|
|
17
|
-
hidden: boolean;
|
|
18
|
-
disabled: boolean;
|
|
19
|
-
};
|
|
11
|
+
details: {
|
|
12
|
+
descname?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
geo_location?: GeoLocation;
|
|
15
|
+
};
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
org_id?: DB.Org["org_id"];
|
|
18
|
+
org?: DB.Org;
|
|
23
19
|
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
location_id?: DB.Location["location_id"];
|
|
21
|
+
location?: DB.Location;
|
|
26
22
|
}
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import type { Base } from
|
|
2
|
-
import type * as DB from
|
|
1
|
+
import type { Base } from "../base.schema";
|
|
2
|
+
import type * as DB from "../index";
|
|
3
3
|
|
|
4
4
|
export interface File extends Base {
|
|
5
|
-
|
|
5
|
+
readonly file_id: string;
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
details?: {
|
|
8
|
+
descname?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
};
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
readonly upload_info?: {
|
|
13
|
+
[x: string]: any;
|
|
14
|
+
};
|
|
15
|
+
readonly storage_details?: {
|
|
16
|
+
[x: string]: any;
|
|
17
|
+
};
|
|
18
|
+
readonly access_url?: string;
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
uploaded_by?: {
|
|
21
|
+
profile_id: string;
|
|
22
|
+
};
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
org_id?: DB.Org["org_id"];
|
|
25
|
+
org?: DB.Org;
|
|
26
|
+
|
|
27
|
+
profile_id?: DB.Profile["profile_id"];
|
|
28
|
+
profile?: DB.Profile;
|
|
25
29
|
}
|
|
@@ -1,48 +1,55 @@
|
|
|
1
|
-
import type { Base } from
|
|
2
|
-
import type * as DB from
|
|
1
|
+
import type { Base } from "../base.schema";
|
|
2
|
+
import type * as DB from "../index";
|
|
3
3
|
|
|
4
4
|
export interface Instance extends Base {
|
|
5
|
-
|
|
5
|
+
readonly instance_id: string;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
status: InstanceStatuses;
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
slots: InstanceSlot[];
|
|
10
|
+
settings: Settings;
|
|
11
|
+
seats: DB.Seat[];
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
seat_profiles: (DB.Seat & DB.Profile)[];
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
is_historical: boolean;
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
org_id?: DB.Org["org_id"];
|
|
18
|
+
org?: DB.Org;
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
service_id?: DB.Service["service_id"];
|
|
21
|
+
service?: DB.Service;
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
profile_id?: DB.Profile["profile_id"];
|
|
24
|
+
profile?: DB.Profile;
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
service_schedule?: DB.Schedule;
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
actions: DB.Action[];
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
type InstanceStatuses =
|
|
31
|
+
type InstanceStatuses = "signup-pending" | "payment-pending" | "confirmed" | "seats-pending";
|
|
32
32
|
|
|
33
33
|
export type InstanceSlot = {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
date: string;
|
|
35
|
+
start_time: number;
|
|
36
|
+
end_time: number;
|
|
37
|
+
start_date: string;
|
|
38
|
+
end_date: string;
|
|
39
|
+
schedule_id: string;
|
|
40
|
+
session_id: string;
|
|
41
|
+
order_allowed: boolean;
|
|
42
|
+
rates: DB.Rate[];
|
|
43
|
+
public_instances: { instance_id: string }[];
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type RateSummary = {
|
|
47
|
+
applicable_rate?: number;
|
|
48
|
+
standard_rate?: number;
|
|
49
|
+
discount?: number;
|
|
50
|
+
is_eligible?: boolean;
|
|
44
51
|
};
|
|
45
52
|
|
|
46
53
|
type Settings = {
|
|
47
|
-
|
|
54
|
+
[x: string]: any;
|
|
48
55
|
};
|
|
@@ -1,32 +1,38 @@
|
|
|
1
|
-
import type { Base } from
|
|
2
|
-
import type * as DB from
|
|
3
|
-
import type { GeoLocation, Photo } from
|
|
1
|
+
import type { Base } from "../base.schema";
|
|
2
|
+
import type * as DB from "../index";
|
|
3
|
+
import type { GeoLocation, Photo } from "../common";
|
|
4
4
|
|
|
5
5
|
export interface Location extends Base {
|
|
6
|
-
|
|
6
|
+
readonly location_id: string;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
8
|
+
details: {
|
|
9
|
+
descname?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
address_string?: string;
|
|
12
|
+
visibility: "public" | "private";
|
|
13
|
+
address: {
|
|
14
|
+
street?: string;
|
|
15
|
+
city?: string;
|
|
16
|
+
region?: string;
|
|
17
|
+
postal_code?: string;
|
|
18
|
+
};
|
|
19
|
+
geo_location?: GeoLocation;
|
|
20
|
+
card_background_file_id: string;
|
|
21
|
+
};
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
display_contactpoints: DB.Contactpoint[];
|
|
24
|
+
cover_files: Photo[];
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
org_id?: DB.Org["org_id"];
|
|
27
|
+
org?: DB.Org;
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
services?: DB.Service[];
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
card_background_file?: Photo;
|
|
32
|
+
|
|
33
|
+
config: {
|
|
34
|
+
disable?: boolean;
|
|
35
|
+
hidden?: boolean;
|
|
36
|
+
active_cover_file_ids: Record<string, number>;
|
|
37
|
+
};
|
|
32
38
|
}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import type { Base } from
|
|
2
|
-
import type * as DB from
|
|
1
|
+
import type { Base } from "../base.schema";
|
|
2
|
+
import type * as DB from "../index";
|
|
3
3
|
|
|
4
4
|
export interface Order extends Base {
|
|
5
|
-
|
|
5
|
+
readonly order_id: string;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
reference_number?: string;
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
status?: string;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
authorized_payment?: Record<string, any>;
|
|
12
|
+
fees_summary?: Record<string, any>;
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
seats?: DB.Seat[];
|
|
15
|
+
seat_profiles?: DB.Profile[];
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
org_id: string;
|
|
18
|
+
org?: DB.Org;
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
instance_id: string;
|
|
21
|
+
instance?: DB.Instance;
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
profile_id: string;
|
|
24
|
+
profile?: DB.Profile;
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
actions?: DB.Action[];
|
|
27
27
|
}
|
|
@@ -1,34 +1,37 @@
|
|
|
1
|
-
import type { Base } from
|
|
2
|
-
import type { Photo } from
|
|
3
|
-
import type * as DB from
|
|
1
|
+
import type { Base } from "../base.schema";
|
|
2
|
+
import type { Photo } from "../common";
|
|
3
|
+
import type * as DB from "../index";
|
|
4
4
|
|
|
5
5
|
export interface Org extends Base {
|
|
6
|
-
|
|
6
|
+
readonly org_id: string;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
dashboard_id?: string;
|
|
9
|
+
details: {
|
|
10
|
+
descname?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
country_code: CountryCodes;
|
|
13
|
+
currency_code: CurrencyCodes;
|
|
14
|
+
logo_file_id: string;
|
|
15
|
+
card_background_file_id: string;
|
|
16
|
+
};
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
display_contactpoints: DB.Contactpoint[];
|
|
19
|
+
cover_files: Photo[];
|
|
20
|
+
logo_file?: Photo;
|
|
21
|
+
card_background_file?: Photo;
|
|
22
|
+
locations?: DB.Location[];
|
|
23
|
+
services?: DB.Service[];
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
// Keeping config to a minimum for now.
|
|
26
|
+
config: {
|
|
27
|
+
disable?: boolean;
|
|
28
|
+
hidden?: boolean;
|
|
29
|
+
active_cover_file_ids: Record<string, number>;
|
|
30
|
+
};
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
collaborators?: DB.Collaborator[];
|
|
33
|
+
facilities?: DB.Facility[];
|
|
31
34
|
}
|
|
32
35
|
|
|
33
|
-
type CountryCodes =
|
|
34
|
-
type CurrencyCodes =
|
|
36
|
+
type CountryCodes = "ZAF";
|
|
37
|
+
type CurrencyCodes = "ZAR";
|
|
@@ -1,29 +1,27 @@
|
|
|
1
|
-
import type { Base } from
|
|
2
|
-
import type * as DB from
|
|
1
|
+
import type { Base } from "../base.schema";
|
|
2
|
+
import type * as DB from "../index";
|
|
3
3
|
|
|
4
4
|
export interface Payment extends Base {
|
|
5
|
-
|
|
5
|
+
readonly payment_id: string;
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
status: PaymentStatus;
|
|
8
|
+
payment_provider: PaymentProvider;
|
|
9
|
+
provider_details: { url: string };
|
|
10
|
+
amount?: number;
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
instance_id?: DB.Instance['instance_id'];
|
|
14
|
-
};
|
|
12
|
+
reason?: "new_payment_card" | "order";
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
profile_id?: DB.Profile["profile_id"];
|
|
15
|
+
profile?: DB.Profile;
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
org_id?: DB.Org["org_id"];
|
|
18
|
+
org?: DB.Org;
|
|
21
19
|
}
|
|
22
20
|
|
|
23
|
-
type PaymentStatus =
|
|
21
|
+
type PaymentStatus = "pending" | "initialized" | "paid";
|
|
24
22
|
type PaymentProvider = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
name?: "paystack";
|
|
24
|
+
details?: {
|
|
25
|
+
[x: string]: any;
|
|
26
|
+
};
|
|
29
27
|
};
|
|
@@ -12,9 +12,11 @@ export interface Profile extends Base {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
details: {
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
names?: string;
|
|
16
|
+
surname?: string;
|
|
17
|
+
preferred_name?: string;
|
|
17
18
|
mobile_number?: string;
|
|
19
|
+
unaffi_number?: string;
|
|
18
20
|
email_address?: string;
|
|
19
21
|
bio?: string;
|
|
20
22
|
|
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
import type { Base } from
|
|
2
|
-
import type * as DB from
|
|
1
|
+
import type { Base } from "../base.schema";
|
|
2
|
+
import type * as DB from "../index";
|
|
3
3
|
|
|
4
4
|
export interface Schedule extends Base {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
5
|
+
readonly schedule_id: string;
|
|
6
|
+
|
|
7
|
+
details: {
|
|
8
|
+
descname?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
date?: string;
|
|
11
|
+
hide_overlapping_schedules: boolean;
|
|
12
|
+
timezone?: string;
|
|
13
|
+
repeat_settings: {
|
|
14
|
+
frequency?: "DAILY" | "WEEKLY" | "MONTHLY" | "YEARLY";
|
|
15
|
+
interval?: number;
|
|
16
|
+
count?: number;
|
|
17
|
+
until?: string;
|
|
18
|
+
byweekday?: ("SU" | "MO" | "TU" | "WE" | "TH" | "FR" | "SA")[];
|
|
19
|
+
byweekno?: number[];
|
|
20
|
+
bymonth?: number[];
|
|
21
|
+
bymonthday?: number[];
|
|
22
|
+
bysetpos?: number[];
|
|
23
|
+
};
|
|
24
|
+
instance_settings: {
|
|
25
|
+
is_public: boolean;
|
|
26
|
+
max_seats?: number;
|
|
27
|
+
min_seats: number;
|
|
28
|
+
max_slots?: number;
|
|
29
|
+
min_slots: number;
|
|
30
|
+
max_lead_time?: number;
|
|
31
|
+
min_lead_time: number;
|
|
32
|
+
rate_application: "per_slot" | "per_seat";
|
|
33
|
+
approval_required?: boolean;
|
|
34
|
+
signup_form?: {
|
|
35
|
+
form_id: DB.Form["form_id"];
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
config: {
|
|
40
|
+
hidden: boolean;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
parent_schedule?: {
|
|
44
|
+
schedule_id: DB.Schedule["schedule_id"];
|
|
45
|
+
session_id: Session["session_id"];
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
sessions: Session[];
|
|
49
|
+
|
|
50
|
+
next_scheduled_slot?: DB.InstanceSlot;
|
|
51
|
+
|
|
52
|
+
org_id?: DB.Org["org_id"];
|
|
53
|
+
org?: DB.Org;
|
|
54
|
+
|
|
55
|
+
service_id?: DB.Service["service_id"];
|
|
56
|
+
service?: DB.Service;
|
|
57
|
+
|
|
58
|
+
facility_ids?: DB.Facility["facility_id"][];
|
|
59
|
+
facilities?: DB.Facility;
|
|
60
|
+
|
|
61
|
+
instance_id?: DB.Instance["instance_id"];
|
|
62
|
+
instance?: DB.Instance;
|
|
63
|
+
|
|
64
|
+
signup_form?: DB.Form;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
export interface Session extends Base {
|
|
68
|
-
|
|
68
|
+
readonly session_id: string;
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
descname?: string;
|
|
71
|
+
start_time?: number;
|
|
72
|
+
duration?: number;
|
|
73
|
+
slot_duration?: number;
|
|
74
|
+
max_instances?: number;
|
|
75
|
+
rates: Rate[];
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
schedule_id: string; // Fake
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
export interface Rate {
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
rate: number;
|
|
82
|
+
conditions?: Condition[];
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
session_id?: string; // Fake
|
|
85
|
+
schedule_id?: string; // Fake
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
export interface Condition {
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
type?: ConditionType;
|
|
90
|
+
service_id?: DB.Service["service_id"];
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
// This is compiled by the API – does not appear in the Schema
|
|
94
94
|
export interface Slot {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
applicable_rate: number;
|
|
96
|
+
schedule_id: string;
|
|
97
|
+
session_id: string;
|
|
98
|
+
date: string;
|
|
99
|
+
start_time: number;
|
|
100
|
+
end_time: number;
|
|
101
|
+
duration: number;
|
|
102
|
+
rate: number;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
type ConditionType =
|
|
105
|
+
type ConditionType = "seat_in_service";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Base } from "../base.schema";
|
|
2
|
+
import { GeoLocation } from "../common";
|
|
3
|
+
import { File } from "./file.schema";
|
|
4
|
+
import { Servicetype } from "./servicetype.schema";
|
|
5
|
+
|
|
6
|
+
export interface Searchentry extends Base {
|
|
7
|
+
readonly searchentry_id: string;
|
|
8
|
+
|
|
9
|
+
details?: {
|
|
10
|
+
descname?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
url?: string;
|
|
13
|
+
address_string?: string;
|
|
14
|
+
date?: string;
|
|
15
|
+
price?: string;
|
|
16
|
+
geo_location?: GeoLocation;
|
|
17
|
+
card_background_file_id?: string;
|
|
18
|
+
repeat_period?: "daily" | "weekly" | "monthly" | "none";
|
|
19
|
+
org_name?: string;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
type?: "community" | "facility_hire" | "activity" | "none";
|
|
23
|
+
|
|
24
|
+
card_background_file?: Partial<File>;
|
|
25
|
+
|
|
26
|
+
servicetype_ids: string[];
|
|
27
|
+
servicetypes?: Servicetype[];
|
|
28
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import type { Base } from
|
|
2
|
-
import type * as DB from
|
|
1
|
+
import type { Base } from "../base.schema";
|
|
2
|
+
import type * as DB from "../index";
|
|
3
3
|
|
|
4
4
|
export interface Seat extends Base {
|
|
5
|
-
|
|
5
|
+
readonly seat_id: string;
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
profile_id?: DB.Profile["profile_id"];
|
|
8
|
+
profile?: DB.Profile;
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
email_address?: string;
|
|
11
|
+
amount_due?: number;
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
applicable_rate?: number;
|
|
14
|
+
standard_rate?: number;
|
|
15
|
+
discount?: number;
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
17
|
+
instance_id?: DB.Instance["instance_id"];
|
|
18
|
+
instance?: DB.Instance;
|
|
19
|
+
}
|
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
import type { Photo } from
|
|
2
|
-
import type { Base } from
|
|
3
|
-
import type * as DB from
|
|
1
|
+
import type { Photo } from "../common";
|
|
2
|
+
import type { Base } from "../base.schema";
|
|
3
|
+
import type * as DB from "../index";
|
|
4
4
|
|
|
5
5
|
export interface Service extends Base {
|
|
6
|
-
|
|
6
|
+
readonly service_id: string;
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
config: {
|
|
14
|
-
active_cover_file_ids: Record<string, boolean>;
|
|
15
|
-
display_contactpoint_ids: Record<string, boolean>;
|
|
16
|
-
};
|
|
8
|
+
details: {
|
|
9
|
+
descname?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
logo_file_id?: string;
|
|
12
|
+
};
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
cover_files: Photo[];
|
|
15
|
+
display_contactpoints: DB.Contactpoint[];
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
org_id?: DB.Org["org_id"];
|
|
18
|
+
org?: DB.Org;
|
|
23
19
|
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
servicetype_id?: DB.Servicetype["servicetype_id"];
|
|
21
|
+
servicetype?: DB.Servicetype;
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
location_id?: DB.Location["location_id"];
|
|
24
|
+
location?: DB.Location;
|
|
29
25
|
|
|
30
|
-
|
|
26
|
+
schedules?: DB.Schedule[];
|
|
31
27
|
|
|
32
|
-
|
|
28
|
+
logo_file?: Photo;
|
|
29
|
+
|
|
30
|
+
config: {
|
|
31
|
+
disable?: boolean;
|
|
32
|
+
hidden?: boolean;
|
|
33
|
+
active_cover_file_ids: Record<string, number>;
|
|
34
|
+
};
|
|
33
35
|
}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import type { Base } from
|
|
1
|
+
import type { Base } from "../base.schema";
|
|
2
2
|
|
|
3
3
|
export interface Servicetype extends Base {
|
|
4
|
-
|
|
4
|
+
readonly servicetype_id: string;
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
disabled: boolean;
|
|
16
|
-
};
|
|
6
|
+
details: {
|
|
7
|
+
descname?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
servicecategory: ServiceCategories;
|
|
10
|
+
icon_class?: string;
|
|
11
|
+
};
|
|
12
|
+
config: {
|
|
13
|
+
hidden: boolean;
|
|
14
|
+
};
|
|
17
15
|
}
|
|
18
16
|
|
|
19
|
-
type ServiceCategories =
|
|
17
|
+
type ServiceCategories = "membership" | "facility_hire" | "activity";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { Base } from
|
|
1
|
+
import type { Base } from "../base.schema";
|
|
2
2
|
|
|
3
3
|
export interface Token extends Base {
|
|
4
|
-
|
|
4
|
+
readonly token_id: string;
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
expiry_date?: string;
|
|
7
|
+
token_category?: TokenCategory;
|
|
8
|
+
payload: {
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
};
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
type TokenCategory =
|
|
13
|
+
type TokenCategory = "account_verification" | "account_recovery" | "whatsapp_token";
|
package/common.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export type Coordinates = { readonly lat: number; readonly lng: number };
|
|
2
|
-
export type GeoLocation = { readonly type:
|
|
2
|
+
export type GeoLocation = { readonly type: "Point"; coordinates: [number, number] };
|
|
3
3
|
export type Photo = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
readonly file_id?: string;
|
|
5
|
+
readonly access_url?: string;
|
|
6
|
+
readonly source?: string;
|
|
7
7
|
};
|
|
8
8
|
export type ContactInfo = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
operating_hours?: string;
|
|
10
|
+
mobile_number?: string;
|
|
11
|
+
email_address?: string;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export type ContactMethod = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
whatsapp?: boolean;
|
|
16
|
+
email?: boolean;
|
|
17
|
+
sms?: boolean;
|
|
18
18
|
};
|
package/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from "./collections/org.schema";
|
|
|
11
11
|
export * from "./collections/payment.schema";
|
|
12
12
|
export * from "./collections/profile.schema";
|
|
13
13
|
export * from "./collections/schedule.schema";
|
|
14
|
+
export * from "./collections/searchentry.schema";
|
|
14
15
|
export * from "./collections/seat.schema";
|
|
15
16
|
export * from "./collections/service.schema";
|
|
16
17
|
export * from "./collections/servicetype.schema";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unaffi/schema",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "This reflects what the API returns, and not what the DB Schema looks like in MongoDB. Can be imported into any repo and be used by both TS and JS (JSDocs) code.",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"scripts": {
|