@justins-home/types 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/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@justins-home/types",
3
+ "version": "1.0.0",
4
+ "private": false,
5
+ "main": "src/index.ts",
6
+ "types": "src/index.ts",
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
10
+ "scripts": {
11
+ "lint": "eslint src",
12
+ "check-types": "tsc --noEmit -p ../../tsconfig.base.json",
13
+ "build": "tsup src/index.ts --format esm,cjs",
14
+ "test": "vitest"
15
+ }
16
+ }
@@ -0,0 +1,33 @@
1
+ export interface ApiResponse<T> {
2
+ message: string;
3
+ data?: T;
4
+ event?: string | null;
5
+ }
6
+
7
+ export interface PaginatedResponse<T> {
8
+ message: string;
9
+
10
+ data: T[];
11
+
12
+ meta: {
13
+ current_page: number;
14
+ last_page: number;
15
+ per_page: number;
16
+ total: number;
17
+ };
18
+
19
+ links: {
20
+ first?: string;
21
+ last?: string;
22
+ prev?: string | null;
23
+ next?: string | null;
24
+ };
25
+
26
+ event?: string | null;
27
+ }
28
+
29
+ export interface ApiErrorResponse {
30
+ message: string;
31
+ errors?: Record<string, any>;
32
+ event?: string | null;
33
+ }
@@ -0,0 +1,37 @@
1
+ export interface UserSummary {
2
+ uid: string;
3
+ name: string;
4
+ }
5
+
6
+ export interface PricePayload {
7
+ amount: string;
8
+ currency: string;
9
+ period?: string;
10
+ }
11
+
12
+ export interface MediaPayload {
13
+ cover?: string | null;
14
+ count?: number;
15
+ }
16
+
17
+ export interface WorkflowState {
18
+ current_step: string;
19
+ can_submit?: boolean;
20
+ missing_requirements?: string[];
21
+ }
22
+
23
+ export interface ListingRef {
24
+ id: number;
25
+ uid: string;
26
+ }
27
+
28
+ export interface PlanRef {
29
+ key: string;
30
+ name: string;
31
+ }
32
+ export interface ConversationRef {
33
+ id: number;
34
+ }
35
+ export interface InspectionRef {
36
+ uid: string;
37
+ }
@@ -0,0 +1,93 @@
1
+ export interface ComplianceDefinition {
2
+ id: number;
3
+
4
+ compliance_key: string;
5
+
6
+ name: string;
7
+
8
+ description?: string | null;
9
+
10
+ enforcement_level: string;
11
+
12
+ validity_type?: string | null;
13
+
14
+ grace_period_days?: number | null;
15
+
16
+ status?: string | null;
17
+
18
+ requirements?: string[];
19
+ }
20
+
21
+ export interface ComplianceRequirement {
22
+ verification_layer_key: string;
23
+ }
24
+
25
+ export interface ComplianceStatus {
26
+ overall: string;
27
+
28
+ breakdown: ComplianceBreakdown[];
29
+ }
30
+
31
+ export interface ComplianceBreakdown {
32
+ compliance_key: string;
33
+
34
+ state: string;
35
+
36
+ valid_until?: string | null;
37
+ }
38
+
39
+ export interface ListingComplianceStateResource {
40
+ listing_uid: string;
41
+
42
+ compliances: ComplianceStatus;
43
+ }
44
+
45
+ export interface ComplianceSubmissionCompliance {
46
+ id: number;
47
+ key: string;
48
+ name: string;
49
+ }
50
+
51
+ export interface ListingComplianceSubmissionResource {
52
+ id: number;
53
+
54
+ listing_id: number;
55
+
56
+ compliance: ComplianceSubmissionCompliance;
57
+
58
+ verification_layer_key: string;
59
+
60
+ status: string;
61
+
62
+ submitted_data: Record<string, any>;
63
+
64
+ rejection_reason?: string | null;
65
+
66
+ reviewed_by?: number | null;
67
+
68
+ reviewed_at?: string | null;
69
+
70
+ created_at: string;
71
+ }
72
+
73
+ export interface TenancyComplianceSubmissionResource {
74
+ id: number;
75
+
76
+ tenancy_id: number;
77
+
78
+ compliance: ComplianceSubmissionCompliance;
79
+
80
+ verification_layer_key: string;
81
+
82
+ status: string;
83
+
84
+ submitted_data: Record<string, any>;
85
+
86
+ rejection_reason?: string | null;
87
+
88
+ reviewed_by?: number | null;
89
+
90
+ reviewed_at?: string | null;
91
+
92
+ created_at: string;
93
+ }
@@ -0,0 +1,38 @@
1
+ export interface Feature {
2
+ id: number;
3
+ name: string;
4
+ is_filterable?: boolean;
5
+ }
6
+
7
+ export interface PropertyFeature extends Feature {
8
+ category_id: number;
9
+
10
+ description?: string;
11
+ icon?: string;
12
+
13
+ is_active: boolean;
14
+ }
15
+
16
+ export interface PropertyFeatureCategory {
17
+ id: number;
18
+
19
+ name: string;
20
+ description?: string;
21
+
22
+ display_order?: number;
23
+
24
+ is_active: boolean;
25
+
26
+ features?: PropertyFeature[];
27
+ }
28
+
29
+ export interface FeatureGroup {
30
+ group: {
31
+ id: number;
32
+ name: string;
33
+ description?: string;
34
+ display_order?: number;
35
+ };
36
+
37
+ features: Feature[];
38
+ }
package/src/index.ts ADDED
@@ -0,0 +1,20 @@
1
+ export * from './api.types';
2
+ export * from './common.types';
3
+
4
+ export * from './user.types';
5
+
6
+ export * from './listing.types';
7
+ export * from './tenancy.types';
8
+ export * from './compliance.types';
9
+
10
+ export * from './inspection.types';
11
+ export * from './maintenance.types';
12
+
13
+ export * from './messaging.types';
14
+ export * from './notification.types';
15
+
16
+ export * from './verification.types';
17
+ export * from './plan.types';
18
+
19
+ export * from './wishlist.types';
20
+ export * from './review.types';
@@ -0,0 +1,37 @@
1
+
2
+ import { UserType } from './user.types';
3
+
4
+ export interface InspectionMedia {
5
+ uid: string;
6
+ file_type: string;
7
+ caption?: string | null;
8
+ path: string;
9
+ }
10
+
11
+
12
+
13
+ export interface InspectionResource {
14
+ uid: string;
15
+
16
+ inspection_type?: string | null;
17
+
18
+ status?: string | null;
19
+
20
+ scheduled_date?: string | null;
21
+
22
+ completed_date?: string | null;
23
+
24
+ condition_rating?: string | null;
25
+
26
+ summary?: string | null;
27
+
28
+ next_inspection_date?: string | null;
29
+
30
+ inspector?: UserType;
31
+
32
+ media?: InspectionMedia[];
33
+
34
+ created_at?: string | null;
35
+
36
+ updated_at?: string | null;
37
+ }
@@ -0,0 +1,65 @@
1
+ import { PricePayload, MediaPayload, WorkflowState } from './common.types';
2
+ import { ComplianceDefinition, ComplianceStatus } from './compliance.types';
3
+ import { UserType } from './user.types';
4
+
5
+ export interface PropertyListingSummary {
6
+ property_type?: string;
7
+
8
+ bedrooms?: number;
9
+
10
+ bathrooms?: number;
11
+
12
+ city?: string;
13
+
14
+ availability?: string;
15
+ }
16
+
17
+ export interface UsedItemListingSummary {
18
+ item_name?: string;
19
+
20
+ condition?: string;
21
+
22
+ category?: string;
23
+
24
+ availability?: string;
25
+ }
26
+
27
+ export interface BaseListingResource {
28
+ uid: string;
29
+
30
+ listing_type: string;
31
+
32
+ state: string;
33
+
34
+ is_visible: boolean;
35
+
36
+ price: PricePayload;
37
+
38
+ owner?: UserType;
39
+
40
+ created_by?: UserType;
41
+
42
+ workflow?: WorkflowState;
43
+
44
+ media?: MediaPayload;
45
+ }
46
+
47
+ export interface PropertyListingResource extends BaseListingResource {
48
+ vertical: 'property';
49
+
50
+ summary?: PropertyListingSummary;
51
+ }
52
+
53
+ export interface UsedItemListingResource extends BaseListingResource {
54
+ vertical: 'used_item';
55
+
56
+ summary?: UsedItemListingSummary;
57
+ }
58
+
59
+ export type ListingResource = PropertyListingResource | UsedItemListingResource;
60
+
61
+ export type ListingWithComplianceResource = ListingResource & {
62
+ compliances: ComplianceDefinition[];
63
+
64
+ compliance_status: ComplianceStatus;
65
+ };
@@ -0,0 +1,59 @@
1
+ import { ListingRef } from './common.types';
2
+ import { UserType } from './user.types';
3
+
4
+ export interface MaintenanceAttachmentResource {
5
+ uid: string;
6
+
7
+ file_type: string;
8
+
9
+ url: string;
10
+
11
+ uploaded_by?: UserType;
12
+
13
+ created_at: string;
14
+ }
15
+
16
+ export interface MaintenanceUpdateResource {
17
+ uid: string;
18
+
19
+ note?: string | null;
20
+
21
+ user: UserType;
22
+
23
+ created_at: string;
24
+ }
25
+
26
+
27
+ export interface MaintenanceRequestResource {
28
+ uid: string;
29
+
30
+ title: string;
31
+
32
+ description?: string | null;
33
+
34
+ status: string;
35
+
36
+ priority: string;
37
+
38
+ reported_at?: string | null;
39
+
40
+ assigned_at?: string | null;
41
+
42
+ completed_at?: string | null;
43
+
44
+ sla_deadline?: string | null;
45
+
46
+ listing?: ListingRef;
47
+
48
+ reporter?: UserType;
49
+
50
+ technician?: UserType;
51
+
52
+ updates?: MaintenanceUpdateResource[];
53
+
54
+ attachments?: MaintenanceAttachmentResource[];
55
+
56
+ created_at: string;
57
+
58
+ updated_at: string;
59
+ }
@@ -0,0 +1,36 @@
1
+ import { ListingRef } from './common.types';
2
+ import { UserType } from './user.types';
3
+
4
+ export interface ConversationResource {
5
+ id: number;
6
+
7
+ type: string;
8
+
9
+ listing?: ListingRef;
10
+
11
+ created_by?: UserType;
12
+
13
+ last_message_at?: string | null;
14
+
15
+ created_at: string;
16
+ }
17
+
18
+ export interface MessageResource {
19
+ id: number;
20
+
21
+ conversation_id: number;
22
+
23
+ sender?: UserType;
24
+
25
+ body?: string | null;
26
+
27
+ attachment_url?: string | null;
28
+
29
+ is_system: boolean;
30
+
31
+ state: string;
32
+
33
+ read_at?: string | null;
34
+
35
+ created_at: string;
36
+ }
@@ -0,0 +1,15 @@
1
+ export interface NotificationResource {
2
+ id: string;
3
+
4
+ type: string;
5
+
6
+ title: string;
7
+
8
+ body: string;
9
+
10
+ data?: Record<string, any>;
11
+
12
+ read_at?: string | null;
13
+
14
+ created_at: string;
15
+ }
@@ -0,0 +1,43 @@
1
+ export interface CapabilityResource {
2
+ key: string;
3
+
4
+ name: string;
5
+
6
+ description?: string | null;
7
+ }
8
+
9
+ export interface EntitlementResource {
10
+ key: string;
11
+
12
+ name: string;
13
+
14
+ description?: string | null;
15
+
16
+ value_type: string;
17
+ }
18
+
19
+ export interface PlanEntitlementResource {
20
+ key: string;
21
+
22
+ name: string;
23
+
24
+ description?: string | null;
25
+
26
+ value: number | string | boolean | null;
27
+ }
28
+
29
+ export interface PlanResource {
30
+ key: string;
31
+
32
+ name: string;
33
+
34
+ user_type: string;
35
+
36
+ is_active: boolean;
37
+
38
+ capabilities?: CapabilityResource[];
39
+
40
+ entitlements?: PlanEntitlementResource[];
41
+
42
+ verification_requirements?: string[];
43
+ }
@@ -0,0 +1,16 @@
1
+ export interface ReviewResource {
2
+ id: number;
3
+
4
+ rating: number;
5
+
6
+ comment?: string;
7
+
8
+ reviewer: {
9
+ id: number;
10
+ name: string;
11
+ };
12
+
13
+ created_at?: string;
14
+
15
+ updated_at?: string;
16
+ }
@@ -0,0 +1,43 @@
1
+ import { ComplianceDefinition } from './compliance.types';
2
+ import { ComplianceStatus } from './compliance.types';
3
+
4
+ export interface TenancyResource {
5
+ uid: string;
6
+
7
+ listing_id: number;
8
+
9
+ landlord_id: number;
10
+ tenant_id: number;
11
+
12
+ rent_amount: string | number;
13
+ deposit_amount: string | number;
14
+
15
+ state: string;
16
+
17
+ start_date: string | null;
18
+ end_date: string | null;
19
+
20
+ is_periodic: boolean;
21
+
22
+ created_at: string;
23
+ }
24
+
25
+ export interface TenancyTransitionResource {
26
+ from_state: string;
27
+
28
+ to_state: string;
29
+
30
+ changed_by_user_id: number;
31
+
32
+ changed_by_name?: string | null;
33
+
34
+ comment?: string | null;
35
+
36
+ created_at: string;
37
+ }
38
+
39
+ export interface TenancyWithComplianceResource extends TenancyResource {
40
+ compliances: ComplianceDefinition[];
41
+
42
+ compliance_status: ComplianceStatus;
43
+ }
@@ -0,0 +1,17 @@
1
+ export interface UserResource {
2
+ uid: string;
3
+
4
+ name: string;
5
+
6
+ email: string;
7
+
8
+ avatar?: string;
9
+ }
10
+
11
+ export interface UserType {
12
+ id: number;
13
+
14
+ uid: string;
15
+
16
+ name: string;
17
+ }
@@ -0,0 +1,65 @@
1
+ export interface VerificationLayerResource {
2
+ id: number;
3
+
4
+ key: string;
5
+
6
+ name: string;
7
+
8
+ description?: string | null;
9
+
10
+ requires_review: boolean;
11
+
12
+ metadata_schema?: Record<string, any> | null;
13
+
14
+ is_active: boolean;
15
+
16
+ created_at: string;
17
+
18
+ updated_at: string;
19
+ }
20
+
21
+ export interface VerificationFlowResource {
22
+ order: number;
23
+
24
+ is_required: boolean;
25
+
26
+ layer?: VerificationLayerResource;
27
+ }
28
+
29
+ export interface VerificationFlowGroupResource {
30
+ user_type: string;
31
+
32
+ user_type_class: string;
33
+
34
+ layers: VerificationFlowResource[];
35
+ }
36
+
37
+ export interface UserVerificationResource {
38
+ id: number;
39
+
40
+ status: string;
41
+
42
+ submitted_data?: Record<string, any>;
43
+
44
+ rejection_reason?: string | null;
45
+
46
+ layer?: VerificationLayerResource;
47
+
48
+ reviewed_by?: number | null;
49
+
50
+ reviewed_at?: string | null;
51
+
52
+ created_at: string;
53
+
54
+ updated_at: string;
55
+ }
56
+
57
+ export interface UserVerificationStateResource {
58
+ current_level: number;
59
+
60
+ completed_layers: string[];
61
+
62
+ pending_layers: string[];
63
+
64
+ last_calculated_at?: string | null;
65
+ }
@@ -0,0 +1,7 @@
1
+ import { ListingResource } from './listing.types';
2
+
3
+ export interface WishlistResource {
4
+ wishlist_uid: string;
5
+
6
+ listing?: ListingResource;
7
+ }