@unaffi/schema 1.0.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/README.md +4 -0
- package/base.schema.d.ts +5 -0
- package/collections/action.schema.d.ts +24 -0
- package/collections/collaborator.schema.d.ts +14 -0
- package/collections/contactpoint.schema.d.ts +20 -0
- package/collections/facility.schema.d.ts +26 -0
- package/collections/file.schema.d.ts +25 -0
- package/collections/form.schema.d.ts +52 -0
- package/collections/instance.schema.d.ts +48 -0
- package/collections/location.schema.d.ts +32 -0
- package/collections/order.schema.d.ts +27 -0
- package/collections/org.schema.d.ts +34 -0
- package/collections/payment.schema.d.ts +29 -0
- package/collections/profile.schema.d.ts +62 -0
- package/collections/schedule.schema.d.ts +105 -0
- package/collections/seat.schema.d.ts +19 -0
- package/collections/service.schema.d.ts +33 -0
- package/collections/servicetype.schema.d.ts +19 -0
- package/collections/token.schema.d.ts +13 -0
- package/common.d.ts +18 -0
- package/index.d.ts +17 -0
- package/package.json +23 -0
package/README.md
ADDED
package/base.schema.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Base } from '../base.schema';
|
|
2
|
+
import type * as DB from '../index';
|
|
3
|
+
|
|
4
|
+
export interface Action extends Base {
|
|
5
|
+
readonly action_id: string;
|
|
6
|
+
|
|
7
|
+
action_template?: string;
|
|
8
|
+
|
|
9
|
+
data?: {
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
org_id?: DB.Org['org_id'];
|
|
14
|
+
org?: DB.Org;
|
|
15
|
+
|
|
16
|
+
order_id?: DB.Order['order_id'];
|
|
17
|
+
order?: DB.Order;
|
|
18
|
+
|
|
19
|
+
instance_id?: DB.Instance['instance_id'];
|
|
20
|
+
instance?: DB.Instance;
|
|
21
|
+
|
|
22
|
+
profile_id?: DB.Profile['profile_id'];
|
|
23
|
+
profile?: DB.Profile;
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Base } from '../base.schema';
|
|
2
|
+
import type * as DB from '../index';
|
|
3
|
+
|
|
4
|
+
export interface Collaborator extends Base {
|
|
5
|
+
readonly collaborator_id: string;
|
|
6
|
+
|
|
7
|
+
role?: 'owner' | 'admin';
|
|
8
|
+
|
|
9
|
+
org_id?: DB.Org['org_id'];
|
|
10
|
+
org?: DB.Org;
|
|
11
|
+
|
|
12
|
+
profile_id?: DB.Profile['profile_id'];
|
|
13
|
+
profile?: DB.Profile;
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Base } from '../base.schema';
|
|
2
|
+
import type { Org } from './org.schema';
|
|
3
|
+
import type { Profile } from './profile.schema';
|
|
4
|
+
|
|
5
|
+
export interface Contactpoint extends Base {
|
|
6
|
+
readonly contactpoint_id: string;
|
|
7
|
+
|
|
8
|
+
type?: string;
|
|
9
|
+
point?: string;
|
|
10
|
+
details: {
|
|
11
|
+
descname?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
org_id?: Org['org_id'];
|
|
16
|
+
org?: Org;
|
|
17
|
+
|
|
18
|
+
profile_id?: Profile['profile_id'];
|
|
19
|
+
profile?: Profile;
|
|
20
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Base } from '../base.schema';
|
|
2
|
+
import type * as DB from '../index';
|
|
3
|
+
import type { GeoLocation } from '../common';
|
|
4
|
+
|
|
5
|
+
export interface Facility extends Base {
|
|
6
|
+
readonly facility_id: string;
|
|
7
|
+
|
|
8
|
+
linked_facility_ids: DB.Facility['facility_id'][];
|
|
9
|
+
linked_facilities: DB.Facility;
|
|
10
|
+
|
|
11
|
+
details: {
|
|
12
|
+
descname?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
geo_location?: GeoLocation;
|
|
15
|
+
};
|
|
16
|
+
config: {
|
|
17
|
+
hidden: boolean;
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
org_id?: DB.Org['org_id'];
|
|
22
|
+
org?: DB.Org;
|
|
23
|
+
|
|
24
|
+
location_id?: DB.Location['location_id'];
|
|
25
|
+
location?: DB.Location;
|
|
26
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Base } from '../base.schema';
|
|
2
|
+
import type * as DB from '../index';
|
|
3
|
+
|
|
4
|
+
export interface File extends Base {
|
|
5
|
+
readonly file_id: string;
|
|
6
|
+
|
|
7
|
+
details: {
|
|
8
|
+
descname?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
readonly upload_info?: {
|
|
13
|
+
[x: string]: any;
|
|
14
|
+
};
|
|
15
|
+
readonly storage_details?: {
|
|
16
|
+
[x: string]: any;
|
|
17
|
+
};
|
|
18
|
+
readonly access_url?: string;
|
|
19
|
+
|
|
20
|
+
org_id?: DB.Org['org_id'];
|
|
21
|
+
org?: DB.Org;
|
|
22
|
+
|
|
23
|
+
profile_id?: DB.Profile['profile_id'];
|
|
24
|
+
profile?: DB.Profile;
|
|
25
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Base } from '../base.schema';
|
|
2
|
+
import type * as DB from '../index';
|
|
3
|
+
|
|
4
|
+
export interface Form extends Base {
|
|
5
|
+
readonly form_id: string;
|
|
6
|
+
|
|
7
|
+
type?: FormType;
|
|
8
|
+
details?: {
|
|
9
|
+
descname?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
// These are the questions to be filled in.
|
|
12
|
+
fields?: Field[];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
org_id?: DB.Org['org_id'];
|
|
16
|
+
org?: DB.Org;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type FormType = 'fields';
|
|
20
|
+
export type FieldType =
|
|
21
|
+
| 'text'
|
|
22
|
+
| 'textarea'
|
|
23
|
+
| 'number'
|
|
24
|
+
| 'boolean'
|
|
25
|
+
| 'date'
|
|
26
|
+
| 'image'
|
|
27
|
+
| 'map'
|
|
28
|
+
| 'html'
|
|
29
|
+
| 'dropdown'
|
|
30
|
+
| 'time'
|
|
31
|
+
| 'page'
|
|
32
|
+
| 'category';
|
|
33
|
+
|
|
34
|
+
export interface Field {
|
|
35
|
+
// What type of question
|
|
36
|
+
fieldtype?: FieldType;
|
|
37
|
+
// In what field will the answer be stored
|
|
38
|
+
name?: string;
|
|
39
|
+
// The question's text
|
|
40
|
+
label?: string;
|
|
41
|
+
|
|
42
|
+
index: number;
|
|
43
|
+
|
|
44
|
+
required?: boolean;
|
|
45
|
+
|
|
46
|
+
options?: FieldOption[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface FieldOption {
|
|
50
|
+
label: string;
|
|
51
|
+
value?: any;
|
|
52
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Base } from '../base.schema';
|
|
2
|
+
import type * as DB from '../index';
|
|
3
|
+
|
|
4
|
+
export interface Instance extends Base {
|
|
5
|
+
readonly instance_id: string;
|
|
6
|
+
|
|
7
|
+
status: InstanceStatuses;
|
|
8
|
+
|
|
9
|
+
slots: InstanceSlot[];
|
|
10
|
+
settings: Settings;
|
|
11
|
+
seats: DB.Seat[];
|
|
12
|
+
|
|
13
|
+
seat_profiles: (DB.Seat & DB.Profile)[];
|
|
14
|
+
|
|
15
|
+
is_historical: boolean;
|
|
16
|
+
|
|
17
|
+
org_id?: DB.Org['org_id'];
|
|
18
|
+
org?: DB.Org;
|
|
19
|
+
|
|
20
|
+
service_id?: DB.Service['service_id'];
|
|
21
|
+
service?: DB.Service;
|
|
22
|
+
|
|
23
|
+
profile_id?: DB.Profile['profile_id'];
|
|
24
|
+
profile?: DB.Profile;
|
|
25
|
+
|
|
26
|
+
service_schedule?: DB.Schedule;
|
|
27
|
+
|
|
28
|
+
actions: DB.Action[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
type InstanceStatuses = 'signup-pending' | 'payment-pending' | 'confirmed' | 'seats-pending';
|
|
32
|
+
|
|
33
|
+
export type InstanceSlot = {
|
|
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
|
+
type Settings = {
|
|
47
|
+
[x: string]: any;
|
|
48
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Base } from '../base.schema';
|
|
2
|
+
import type * as DB from '../index';
|
|
3
|
+
import type { GeoLocation, Photo } from '../common';
|
|
4
|
+
|
|
5
|
+
export interface Location extends Base {
|
|
6
|
+
readonly location_id: string;
|
|
7
|
+
|
|
8
|
+
details: {
|
|
9
|
+
descname?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
address_string?: string;
|
|
12
|
+
is_obscured: boolean;
|
|
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
|
+
|
|
23
|
+
display_contactpoints: DB.Contactpoint[];
|
|
24
|
+
cover_files: Photo[];
|
|
25
|
+
|
|
26
|
+
org_id?: DB.Org['org_id'];
|
|
27
|
+
org?: DB.Org;
|
|
28
|
+
|
|
29
|
+
services?: DB.Service[];
|
|
30
|
+
|
|
31
|
+
card_background_file?: Photo;
|
|
32
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Base } from '../base.schema';
|
|
2
|
+
import type * as DB from '../index';
|
|
3
|
+
|
|
4
|
+
export interface Order extends Base {
|
|
5
|
+
readonly order_id: string;
|
|
6
|
+
|
|
7
|
+
reference_number?: string;
|
|
8
|
+
|
|
9
|
+
status?: string;
|
|
10
|
+
|
|
11
|
+
authorized_payment?: Record<string, any>;
|
|
12
|
+
fees_summary?: Record<string, any>;
|
|
13
|
+
|
|
14
|
+
seats?: DB.Seat[];
|
|
15
|
+
seat_profiles?: DB.Profile[];
|
|
16
|
+
|
|
17
|
+
org_id: string;
|
|
18
|
+
org?: DB.Org;
|
|
19
|
+
|
|
20
|
+
instance_id: string;
|
|
21
|
+
instance?: DB.Instance;
|
|
22
|
+
|
|
23
|
+
profile_id: string;
|
|
24
|
+
profile?: DB.Profile;
|
|
25
|
+
|
|
26
|
+
actions?: DB.Action[];
|
|
27
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Base } from '../base.schema';
|
|
2
|
+
import type { Photo } from '../common';
|
|
3
|
+
import type * as DB from '../index';
|
|
4
|
+
|
|
5
|
+
export interface Org extends Base {
|
|
6
|
+
readonly org_id: string;
|
|
7
|
+
|
|
8
|
+
details: {
|
|
9
|
+
descname?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
country_code: CountryCodes;
|
|
12
|
+
currency_code: CurrencyCodes;
|
|
13
|
+
logo_file_id: string;
|
|
14
|
+
card_background_file_id: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
display_contactpoints: DB.Contactpoint[];
|
|
18
|
+
cover_files: Photo[];
|
|
19
|
+
logo_file?: Photo;
|
|
20
|
+
card_background_file?: Photo;
|
|
21
|
+
locations?: DB.Location[];
|
|
22
|
+
services?: DB.Service[];
|
|
23
|
+
|
|
24
|
+
// Keeping config to a minimum for now.
|
|
25
|
+
config: {
|
|
26
|
+
active_cover_file_ids: Record<string, number>;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
collaborators?: DB.Collaborator[];
|
|
30
|
+
facilities?: DB.Facility[];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
type CountryCodes = 'ZAF';
|
|
34
|
+
type CurrencyCodes = 'ZAR';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Base } from '../base.schema';
|
|
2
|
+
import type * as DB from '../index';
|
|
3
|
+
|
|
4
|
+
export interface Payment extends Base {
|
|
5
|
+
readonly payment_id: string;
|
|
6
|
+
|
|
7
|
+
status: PaymentStatus;
|
|
8
|
+
payment_provider: PaymentProvider;
|
|
9
|
+
provider_details: { url: string };
|
|
10
|
+
amount?: number;
|
|
11
|
+
|
|
12
|
+
reason: {
|
|
13
|
+
instance_id?: DB.Instance['instance_id'];
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
profile_id?: DB.Profile['profile_id'];
|
|
17
|
+
profile?: DB.Profile;
|
|
18
|
+
|
|
19
|
+
org_id?: DB.Org['org_id'];
|
|
20
|
+
org?: DB.Org;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type PaymentStatus = 'pending' | 'initialized' | 'paid';
|
|
24
|
+
type PaymentProvider = {
|
|
25
|
+
name?: 'paystack';
|
|
26
|
+
details?: {
|
|
27
|
+
[x: string]: any;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Base } from '../base.schema';
|
|
2
|
+
import type * as DB from '../index';
|
|
3
|
+
|
|
4
|
+
export interface Profile extends Base {
|
|
5
|
+
readonly profile_id: string;
|
|
6
|
+
|
|
7
|
+
profile_pic_file?: {
|
|
8
|
+
access_url: string;
|
|
9
|
+
};
|
|
10
|
+
cover_pic_file?: {
|
|
11
|
+
access_url: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
details: {
|
|
15
|
+
first_name?: string;
|
|
16
|
+
last_name?: string;
|
|
17
|
+
mobile_number?: string;
|
|
18
|
+
email_address?: string;
|
|
19
|
+
bio?: string;
|
|
20
|
+
|
|
21
|
+
profile_pic_file_id?: string;
|
|
22
|
+
cover_pic_file_id?: string;
|
|
23
|
+
|
|
24
|
+
is_dependant: boolean;
|
|
25
|
+
relationship_to_owner?: string;
|
|
26
|
+
contact_method: {
|
|
27
|
+
email?: boolean;
|
|
28
|
+
sms?: boolean;
|
|
29
|
+
whatsapp?: boolean;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
authentication?: {
|
|
34
|
+
password: {
|
|
35
|
+
hash: string;
|
|
36
|
+
};
|
|
37
|
+
google: {
|
|
38
|
+
sub: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
payment_cards?: PaymentCard[];
|
|
43
|
+
|
|
44
|
+
latest_session?: {
|
|
45
|
+
time: Date;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
first_session?: {
|
|
49
|
+
time: Date;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
parent_profile_id: DB.Profile['profile_id'];
|
|
53
|
+
parent_profile?: DB.Profile;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface PaymentCard {
|
|
57
|
+
descname?: string;
|
|
58
|
+
is_default?: boolean;
|
|
59
|
+
payment_card_id?: string;
|
|
60
|
+
provider_name?: string;
|
|
61
|
+
provider_details?: Record<string, any>;
|
|
62
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { Base } from '../base.schema';
|
|
2
|
+
import type * as DB from '../index';
|
|
3
|
+
|
|
4
|
+
export interface Schedule extends Base {
|
|
5
|
+
readonly schedule_id: string;
|
|
6
|
+
|
|
7
|
+
details: {
|
|
8
|
+
descname?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
date?: string;
|
|
11
|
+
hide_overlapping_schedules: boolean;
|
|
12
|
+
repeat_settings: {
|
|
13
|
+
frequency?: 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'YEARLY';
|
|
14
|
+
interval?: number;
|
|
15
|
+
count?: number;
|
|
16
|
+
until?: string;
|
|
17
|
+
byweekday?: ('SU' | 'MO' | 'TU' | 'WE' | 'TH' | 'FR' | 'SA')[];
|
|
18
|
+
byweekno?: number[];
|
|
19
|
+
bymonth?: number[];
|
|
20
|
+
bymonthday?: number[];
|
|
21
|
+
bysetpos?: number[];
|
|
22
|
+
};
|
|
23
|
+
instance_settings: {
|
|
24
|
+
is_public: boolean;
|
|
25
|
+
max_seats?: number;
|
|
26
|
+
min_seats: number;
|
|
27
|
+
max_slots?: number;
|
|
28
|
+
min_slots: number;
|
|
29
|
+
max_lead_time?: number;
|
|
30
|
+
min_lead_time: number;
|
|
31
|
+
rate_application: 'per_slot' | 'per_seat';
|
|
32
|
+
approval_required?: boolean;
|
|
33
|
+
signup_form?: {
|
|
34
|
+
form_id: DB.Form['form_id'];
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
config: {
|
|
39
|
+
hidden: boolean;
|
|
40
|
+
disabled: 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
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface Session extends Base {
|
|
68
|
+
readonly session_id: string;
|
|
69
|
+
|
|
70
|
+
descname?: string;
|
|
71
|
+
start_time?: number;
|
|
72
|
+
duration?: number;
|
|
73
|
+
slot_duration?: number;
|
|
74
|
+
max_instances?: number;
|
|
75
|
+
rates: Rate[];
|
|
76
|
+
|
|
77
|
+
schedule_id: string; // Fake
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface Rate {
|
|
81
|
+
rate: number;
|
|
82
|
+
conditions?: Condition[];
|
|
83
|
+
|
|
84
|
+
session_id?: string; // Fake
|
|
85
|
+
schedule_id?: string; // Fake
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface Condition {
|
|
89
|
+
type?: ConditionType;
|
|
90
|
+
service_id?: DB.Service['service_id'];
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// This is compiled by the API – does not appear in the Schema
|
|
94
|
+
export interface Slot {
|
|
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
|
+
}
|
|
104
|
+
|
|
105
|
+
type ConditionType = 'seat_in_service';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Base } from '../base.schema';
|
|
2
|
+
import type * as DB from '../index';
|
|
3
|
+
|
|
4
|
+
export interface Seat extends Base {
|
|
5
|
+
readonly seat_id: string;
|
|
6
|
+
|
|
7
|
+
profile_id?: DB.Profile['profile_id'];
|
|
8
|
+
profile?: DB.Profile;
|
|
9
|
+
|
|
10
|
+
email_address?: string;
|
|
11
|
+
amount_due?: number;
|
|
12
|
+
|
|
13
|
+
applicable_rate?: number;
|
|
14
|
+
standard_rate?: number;
|
|
15
|
+
discount?: number;
|
|
16
|
+
|
|
17
|
+
instance_id?: DB.Instance['instance_id'];
|
|
18
|
+
instance?: DB.Instance;
|
|
19
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Photo } from '../common';
|
|
2
|
+
import type { Base } from '../base.schema';
|
|
3
|
+
import type * as DB from '../index';
|
|
4
|
+
|
|
5
|
+
export interface Service extends Base {
|
|
6
|
+
readonly service_id: string;
|
|
7
|
+
|
|
8
|
+
details: {
|
|
9
|
+
descname?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
logo_file_id?: string;
|
|
12
|
+
};
|
|
13
|
+
config: {
|
|
14
|
+
active_cover_file_ids: Record<string, boolean>;
|
|
15
|
+
display_contactpoint_ids: Record<string, boolean>;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
cover_files: Photo[];
|
|
19
|
+
display_contactpoints: DB.Contactpoint[];
|
|
20
|
+
|
|
21
|
+
org_id?: DB.Org['org_id'];
|
|
22
|
+
org?: DB.Org;
|
|
23
|
+
|
|
24
|
+
servicetype_id?: DB.Servicetype['servicetype_id'];
|
|
25
|
+
servicetype?: DB.Servicetype;
|
|
26
|
+
|
|
27
|
+
location_id?: DB.Location['location_id'];
|
|
28
|
+
location?: DB.Location;
|
|
29
|
+
|
|
30
|
+
schedules?: DB.Schedule[];
|
|
31
|
+
|
|
32
|
+
logo_file?: Photo;
|
|
33
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Base } from '../base.schema';
|
|
2
|
+
|
|
3
|
+
export interface Servicetype extends Base {
|
|
4
|
+
readonly servicetype_id: string;
|
|
5
|
+
|
|
6
|
+
details: {
|
|
7
|
+
descname?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
servicecategory: ServiceCategories;
|
|
10
|
+
icon_class?: string;
|
|
11
|
+
sport_icon_class?: string;
|
|
12
|
+
};
|
|
13
|
+
config: {
|
|
14
|
+
hidden: boolean;
|
|
15
|
+
disabled: boolean;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type ServiceCategories = 'membership' | 'facility_hire' | 'activity' | 'event';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Base } from '../base.schema';
|
|
2
|
+
|
|
3
|
+
export interface Token extends Base {
|
|
4
|
+
readonly token_id: string;
|
|
5
|
+
|
|
6
|
+
expiry_date?: string;
|
|
7
|
+
token_category?: TokenCategory;
|
|
8
|
+
payload: {
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type TokenCategory = 'account_verification' | 'account_recovery' | 'whatsapp_token';
|
package/common.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type Coordinates = { readonly lat: number; readonly lng: number };
|
|
2
|
+
export type GeoLocation = { readonly type: 'Point'; coordinates: Readonly<[number, number]> };
|
|
3
|
+
export type Photo = {
|
|
4
|
+
readonly file_id?: string;
|
|
5
|
+
readonly access_url?: string;
|
|
6
|
+
readonly source?: string;
|
|
7
|
+
};
|
|
8
|
+
export type ContactInfo = {
|
|
9
|
+
operating_hours?: string;
|
|
10
|
+
mobile_number?: string;
|
|
11
|
+
email_address?: string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type ContactMethod = {
|
|
15
|
+
whatsapp?: boolean;
|
|
16
|
+
email?: boolean;
|
|
17
|
+
sms?: boolean;
|
|
18
|
+
};
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from "./collections/action.schema";
|
|
2
|
+
export * from "./collections/collaborator.schema";
|
|
3
|
+
export * from "./collections/contactpoint.schema";
|
|
4
|
+
export * from "./collections/facility.schema";
|
|
5
|
+
export * from "./collections/file.schema";
|
|
6
|
+
export * from "./collections/form.schema";
|
|
7
|
+
export * from "./collections/instance.schema";
|
|
8
|
+
export * from "./collections/location.schema";
|
|
9
|
+
export * from "./collections/order.schema";
|
|
10
|
+
export * from "./collections/org.schema";
|
|
11
|
+
export * from "./collections/payment.schema";
|
|
12
|
+
export * from "./collections/profile.schema";
|
|
13
|
+
export * from "./collections/schedule.schema";
|
|
14
|
+
export * from "./collections/seat.schema";
|
|
15
|
+
export * from "./collections/service.schema";
|
|
16
|
+
export * from "./collections/servicetype.schema";
|
|
17
|
+
export * from "./collections/token.schema";
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@unaffi/schema",
|
|
3
|
+
"version": "1.0.0",
|
|
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
|
+
"types": "index.d.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/UNAFFI/unaffi-schema.git"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"unaffi",
|
|
15
|
+
"schema"
|
|
16
|
+
],
|
|
17
|
+
"author": "Tertius van Niekerk",
|
|
18
|
+
"license": "ISC",
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/UNAFFI/unaffi-schema/issues"
|
|
21
|
+
},
|
|
22
|
+
"homepage": "https://github.com/UNAFFI/unaffi-schema#readme"
|
|
23
|
+
}
|