@automateinc/fleet-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.
Files changed (111) hide show
  1. package/README.md +17 -0
  2. package/dist/types/asset-category-field.d.ts +23 -0
  3. package/dist/types/asset-category.d.ts +10 -0
  4. package/dist/types/asset-type.d.ts +6 -0
  5. package/dist/types/asset-value.d.ts +16 -0
  6. package/dist/types/asset.d.ts +17 -0
  7. package/dist/types/attendance-count.d.ts +8 -0
  8. package/dist/types/attendance-leave-reason.d.ts +11 -0
  9. package/dist/types/attendance-presence-check.d.ts +11 -0
  10. package/dist/types/attendance.d.ts +42 -0
  11. package/dist/types/building-contact.d.ts +10 -0
  12. package/dist/types/building-lease-payment.d.ts +13 -0
  13. package/dist/types/building-lease.d.ts +12 -0
  14. package/dist/types/building.d.ts +14 -0
  15. package/dist/types/bunk.d.ts +8 -0
  16. package/dist/types/call-log.d.ts +36 -0
  17. package/dist/types/ceiling.d.ts +9 -0
  18. package/dist/types/client-class.d.ts +9 -0
  19. package/dist/types/client-contact.d.ts +13 -0
  20. package/dist/types/client-site.d.ts +18 -0
  21. package/dist/types/client.d.ts +17 -0
  22. package/dist/types/company.d.ts +13 -0
  23. package/dist/types/config.d.ts +11 -0
  24. package/dist/types/contact.d.ts +9 -0
  25. package/dist/types/contract-allowance.d.ts +17 -0
  26. package/dist/types/contract-benefit.d.ts +8 -0
  27. package/dist/types/contract-deduction.d.ts +12 -0
  28. package/dist/types/contract.d.ts +17 -0
  29. package/dist/types/coords.d.ts +4 -0
  30. package/dist/types/dispatch-attendance.d.ts +10 -0
  31. package/dist/types/dispatch-count.d.ts +9 -0
  32. package/dist/types/dispatch.d.ts +13 -0
  33. package/dist/types/employee-comment-reaction.d.ts +10 -0
  34. package/dist/types/employee-comment.d.ts +10 -0
  35. package/dist/types/employee-status.d.ts +6 -0
  36. package/dist/types/employee.d.ts +40 -0
  37. package/dist/types/file.d.ts +18 -0
  38. package/dist/types/gender.d.ts +1 -0
  39. package/dist/types/index.d.ts +147 -0
  40. package/dist/types/loan-installment.d.ts +14 -0
  41. package/dist/types/loan.d.ts +18 -0
  42. package/dist/types/metadata-documents.d.ts +4 -0
  43. package/dist/types/metadata-expiring-documents.d.ts +7 -0
  44. package/dist/types/metadata-missing-documents.d.ts +5 -0
  45. package/dist/types/metadata-status-check.d.ts +14 -0
  46. package/dist/types/metadata.d.ts +14 -0
  47. package/dist/types/models.d.ts +61 -0
  48. package/dist/types/nfc-tag.d.ts +11 -0
  49. package/dist/types/one-time-password.d.ts +16 -0
  50. package/dist/types/payment-cycle.d.ts +6 -0
  51. package/dist/types/permission-group.d.ts +8 -0
  52. package/dist/types/permission.d.ts +7 -0
  53. package/dist/types/phone-line-commitment.d.ts +11 -0
  54. package/dist/types/phone-line-contract.d.ts +14 -0
  55. package/dist/types/phone-line-package.d.ts +14 -0
  56. package/dist/types/phone-line.d.ts +19 -0
  57. package/dist/types/position-version.d.ts +21 -0
  58. package/dist/types/position.d.ts +10 -0
  59. package/dist/types/recruitment-employment-information-history.d.ts +7 -0
  60. package/dist/types/recruitment-employment-information.d.ts +12 -0
  61. package/dist/types/recruitment-medical-information.d.ts +9 -0
  62. package/dist/types/recruitment-national-card-information.d.ts +13 -0
  63. package/dist/types/recruitment-other-information-additional-information.d.ts +4 -0
  64. package/dist/types/recruitment-other-information.d.ts +8 -0
  65. package/dist/types/recruitment-passport-information.d.ts +12 -0
  66. package/dist/types/recruitment-personal-information.d.ts +18 -0
  67. package/dist/types/recruitment-visa-information.d.ts +8 -0
  68. package/dist/types/recruitment.d.ts +12 -0
  69. package/dist/types/region.d.ts +15 -0
  70. package/dist/types/report-category-field.d.ts +23 -0
  71. package/dist/types/report-category.d.ts +10 -0
  72. package/dist/types/report-comment-reaction.d.ts +10 -0
  73. package/dist/types/report-comment.d.ts +11 -0
  74. package/dist/types/report-type.d.ts +7 -0
  75. package/dist/types/report-value.d.ts +16 -0
  76. package/dist/types/report.d.ts +23 -0
  77. package/dist/types/request-action-execution.d.ts +11 -0
  78. package/dist/types/request-action.d.ts +13 -0
  79. package/dist/types/request-category-field.d.ts +26 -0
  80. package/dist/types/request-category.d.ts +12 -0
  81. package/dist/types/request-type.d.ts +10 -0
  82. package/dist/types/request-value.d.ts +15 -0
  83. package/dist/types/request-verification.d.ts +13 -0
  84. package/dist/types/request.d.ts +22 -0
  85. package/dist/types/restriction.d.ts +14 -0
  86. package/dist/types/role.d.ts +6 -0
  87. package/dist/types/schedule-attendance.d.ts +25 -0
  88. package/dist/types/schedule-draft.d.ts +15 -0
  89. package/dist/types/schedule-site.d.ts +16 -0
  90. package/dist/types/schedule.d.ts +13 -0
  91. package/dist/types/shift-type.d.ts +8 -0
  92. package/dist/types/shift.d.ts +24 -0
  93. package/dist/types/signing-mode.d.ts +8 -0
  94. package/dist/types/standard-operating-procedure.d.ts +13 -0
  95. package/dist/types/tag.d.ts +7 -0
  96. package/dist/types/team.d.ts +6 -0
  97. package/dist/types/unit-room.d.ts +8 -0
  98. package/dist/types/unit.d.ts +8 -0
  99. package/dist/types/user.d.ts +20 -0
  100. package/dist/types/vehicle-contract-payment.d.ts +15 -0
  101. package/dist/types/vehicle-contract.d.ts +17 -0
  102. package/dist/types/vehicle-insurance.d.ts +18 -0
  103. package/dist/types/vehicle-make.d.ts +8 -0
  104. package/dist/types/vehicle-model.d.ts +12 -0
  105. package/dist/types/vehicle-registration.d.ts +15 -0
  106. package/dist/types/vehicle.d.ts +23 -0
  107. package/dist/types/vendor-contact.d.ts +13 -0
  108. package/dist/types/vendor.d.ts +13 -0
  109. package/dist/types/zone.d.ts +8 -0
  110. package/package.json +47 -0
  111. package/tsconfig.json +11 -0
@@ -0,0 +1,23 @@
1
+ export interface IReport {
2
+ id: string;
3
+ createdAt: string;
4
+ updatedAt: string;
5
+ deletedAt?: string;
6
+
7
+ title: string;
8
+ content: string;
9
+
10
+ typeId: string;
11
+ categoryId: string;
12
+
13
+ createdByUserId?: string;
14
+ createdByEmployeeId?: string;
15
+
16
+ userId?: string;
17
+ employeeId?: string;
18
+ vehicleId?: string;
19
+ clientId?: string;
20
+ siteId?: string;
21
+ zoneId?: string;
22
+ buildingId?: string;
23
+ }
@@ -0,0 +1,11 @@
1
+ export interface IRequestActionExecution {
2
+ id: string;
3
+ createdAt: string;
4
+ updatedAt: string;
5
+
6
+ actionId: string;
7
+ status: "PENDING" | "COMPLETED" | "PROCESSING" | "FAILED" | "SKIPPED";
8
+ startedAt: string | null;
9
+ endedAt: string | null;
10
+ failureReason?: string;
11
+ }
@@ -0,0 +1,13 @@
1
+ import { IRequestCategoryField } from ".";
2
+
3
+ export interface IRequestAction {
4
+ createdAt: string;
5
+ updatedAt: string;
6
+ id: string;
7
+ categoryId: string;
8
+ name: string;
9
+ type: "VERIFICATION" | "APPROVAL" | "REJECTION" | "CREATION";
10
+ operation: "HTTP";
11
+ config: Record<string, any>;
12
+ fields: IRequestCategoryField[];
13
+ }
@@ -0,0 +1,26 @@
1
+ import { IModel } from "./models";
2
+
3
+ export interface IRequestCategoryField {
4
+ name: string;
5
+ required: boolean;
6
+ type:
7
+ | "STRING"
8
+ | "NUMBER"
9
+ | "BOOLEAN"
10
+ | "DATE"
11
+ | "DATETIME"
12
+ | "TIME"
13
+ | "UPLOAD"
14
+ | "RELATION"
15
+ | "SINGLE_SELECT"
16
+ | "SIGNATURE";
17
+ model?: IModel;
18
+ config: {
19
+ options: any[];
20
+ optionsUrl: string;
21
+ uploadCategory?: string;
22
+ dependencies?: string[];
23
+ hasDependency?: boolean;
24
+ variant?: string;
25
+ };
26
+ }
@@ -0,0 +1,12 @@
1
+ import { IRequestCategoryField } from "./request-category-field";
2
+
3
+ export interface IRequestCategory {
4
+ id: string;
5
+ name: string;
6
+ typeId: string;
7
+ fields: IRequestCategoryField[];
8
+ requiresVerification: boolean;
9
+ requiresApproval: boolean;
10
+ createdAt: string;
11
+ updatedAt: string;
12
+ }
@@ -0,0 +1,10 @@
1
+ import { IRequestCategory } from ".";
2
+
3
+ export interface IRequestType {
4
+ id: string;
5
+ name: string;
6
+ createdAt: string;
7
+ updatedAt: string;
8
+ categories: IRequestCategory[];
9
+ visible: boolean;
10
+ }
@@ -0,0 +1,15 @@
1
+ import { IFile, IRequestCategoryField } from ".";
2
+ import { IModel } from "./models";
3
+
4
+ export interface IRequestValue {
5
+ type: IRequestCategoryField["type"];
6
+ name: string;
7
+ value: any;
8
+ model?: IModel;
9
+ required?: boolean;
10
+ relation?: {
11
+ [key: string]: any;
12
+ };
13
+ relationValue?: string;
14
+ file?: IFile;
15
+ }
@@ -0,0 +1,13 @@
1
+ import { IEmployee } from ".";
2
+
3
+ export interface IRequestVerification {
4
+ createdAt: string;
5
+ updatedAt: string;
6
+ id: string;
7
+
8
+ status: "APPROVED" | "REJECTED" | "PENDING";
9
+ verifiedById: string;
10
+ verifiedBy: IEmployee;
11
+
12
+ rejectionReason?: string;
13
+ }
@@ -0,0 +1,22 @@
1
+ import { IRequestCategory, IRequestType, IRequestValue } from ".";
2
+
3
+ export interface IRequest {
4
+ approvedAt: Date;
5
+ createdAt: string;
6
+ updatedAt: string;
7
+ id: string;
8
+ category: IRequestCategory;
9
+ categoryId: string;
10
+ createdById: string;
11
+ rejectionReason: null;
12
+ requestForId: string;
13
+ type: IRequestType;
14
+ typeId: string;
15
+ values: IRequestValue[];
16
+ verifiedAt: Date;
17
+ verifiedById?: string;
18
+ rejectedById?: string;
19
+ withdrawnAt?: string;
20
+ status: "PENDING_APPROVAL" | "APPROVED" | "REJECTED" | "WITHDRAWN" | "PENDING_VERIFICATION" | "ARCHIVED";
21
+ actionsExecutionStatus: "PENDING" | "COMPLETED" | "PROCESSING" | "FAILED" | "SKIPPED";
22
+ }
@@ -0,0 +1,14 @@
1
+ export interface IRestriction {
2
+ createdAt: string;
3
+ updatedAt: string;
4
+ id: string;
5
+
6
+ label: string;
7
+ type: "EMPLOYEE" | "CONTRACT" | "ROLE" | "COMPANY";
8
+ operation: "EQUALS" | "NOT_EQUALS" | "CONTAINS" | "NOT_CONTAINS" | "EXISTS" | "NOT_EXISTS";
9
+ category?: string;
10
+ valueA: string;
11
+ valueB?: string;
12
+
13
+ requestCategoryId?: string;
14
+ }
@@ -0,0 +1,6 @@
1
+ export interface IRole {
2
+ createdAt: Date;
3
+ id: string;
4
+ name: string;
5
+ updatedAt: Date;
6
+ }
@@ -0,0 +1,25 @@
1
+ //! This is a fake type definition file to fix type errors when building & retain mock data.
2
+ //TODO: ONLY FOR SHOWCASE REMOVE LATER.
3
+
4
+ export interface IScheduleAttendance {
5
+ id: string;
6
+ client?: string;
7
+ createdAt: string;
8
+ updatedAt: string;
9
+ date: string;
10
+ dispatchTime?: string;
11
+ endTime?: string;
12
+ nationality?: string;
13
+ overtime: boolean;
14
+ position?: string;
15
+ requiredGender: boolean;
16
+ requiredNationality: boolean;
17
+ requiredRetired: boolean;
18
+ roleId: string;
19
+ shiftDuration: number;
20
+ shiftName: string;
21
+ siteZone?: string;
22
+ startTime?: string;
23
+ siteLocation?: string;
24
+ siteName?: string;
25
+ }
@@ -0,0 +1,15 @@
1
+ import { IEmployee } from ".";
2
+
3
+ export interface IScheduleDraft {
4
+ id: string;
5
+ createdAt: string;
6
+ updatedAt: string;
7
+
8
+ status: "DRAFT" | "PENDING" | "ACCEPTED" | "REJECTED";
9
+
10
+ dayOfWeek: "SATURDAY" | "SUNDAY" | "MONDAY" | "TUESDAY" | "WEDNESDAY" | "THURSDAY" | "FRIDAY";
11
+ shiftId: string;
12
+
13
+ employee: IEmployee;
14
+ employeeId?: string;
15
+ }
@@ -0,0 +1,16 @@
1
+ import { IClientSite, IPosition, IZone } from ".";
2
+
3
+ export interface IScheduleSite {
4
+ id: string;
5
+ createdAt: string;
6
+ updatedAt: string;
7
+
8
+ zones?: IZone[];
9
+ positions?: IPosition[];
10
+ site: IClientSite;
11
+
12
+ shiftsCount: number;
13
+ positionsCount: number;
14
+ schedulesCount: number;
15
+ scheduledSchedulesCount: number;
16
+ }
@@ -0,0 +1,13 @@
1
+ import { IEmployee } from ".";
2
+
3
+ export interface ISchedule {
4
+ id: string;
5
+ createdAt: string;
6
+ updatedAt: string;
7
+
8
+ dayOfWeek: "SATURDAY" | "SUNDAY" | "MONDAY" | "TUESDAY" | "WEDNESDAY" | "THURSDAY" | "FRIDAY";
9
+ shiftId?: string;
10
+
11
+ employee: IEmployee;
12
+ employeeId?: string;
13
+ }
@@ -0,0 +1,8 @@
1
+ export interface IShiftType {
2
+ id: string;
3
+ updatedAt: Date;
4
+ createdAt: Date;
5
+
6
+ name: string;
7
+ hours: number;
8
+ }
@@ -0,0 +1,24 @@
1
+ import { IShiftType } from ".";
2
+
3
+ export interface IShift {
4
+ id: string;
5
+ updatedAt: Date;
6
+ createdAt: Date;
7
+
8
+ class: "MAIN" | "OVERTIME";
9
+
10
+ startTime: number;
11
+
12
+ type: IShiftType;
13
+ typeId: string;
14
+
15
+ coversSaturday: boolean;
16
+ coversSunday: boolean;
17
+ coversMonday: boolean;
18
+ coversTuesday: boolean;
19
+ coversWednesday: boolean;
20
+ coversThursday: boolean;
21
+ coversFriday: boolean;
22
+
23
+ positionId: string;
24
+ }
@@ -0,0 +1,8 @@
1
+ export interface ISigningMode {
2
+ createdAt: Date;
3
+ id: string;
4
+ updatedAt: Date;
5
+
6
+ userId: string;
7
+ employeeId?: string;
8
+ }
@@ -0,0 +1,13 @@
1
+ export interface IStandardOperatingProcedure {
2
+ id: string;
3
+ updatedAt: Date;
4
+ createdAt: Date;
5
+
6
+ procedures: Array<{
7
+ values: string[];
8
+ locale: string;
9
+ }>;
10
+
11
+ positionId?: string;
12
+ siteId?: string;
13
+ }
@@ -0,0 +1,7 @@
1
+ export interface ITag {
2
+ id: string;
3
+ createdAt: string;
4
+ updatedAt: string;
5
+ name: string;
6
+ value: string;
7
+ }
@@ -0,0 +1,6 @@
1
+ export interface ITeam {
2
+ id: string;
3
+ name: string;
4
+ createdAt: string;
5
+ updatedAt: string;
6
+ }
@@ -0,0 +1,8 @@
1
+ export interface IUnitRoom {
2
+ id: string;
3
+ createdAt: string;
4
+ updatedAt: string;
5
+
6
+ name: string;
7
+ unitId: string;
8
+ }
@@ -0,0 +1,8 @@
1
+ export interface IUnit {
2
+ id: string;
3
+ createdAt: string;
4
+ updatedAt: string;
5
+ name: string;
6
+ buildingId: string;
7
+ status: "ACTIVE" | "INACTIVE";
8
+ }
@@ -0,0 +1,20 @@
1
+ import { IFile } from ".";
2
+
3
+ export interface IUser {
4
+ id: string;
5
+ email: string;
6
+ password: string;
7
+ googleId: string;
8
+ role: string;
9
+ firstName: string;
10
+ lastName: string;
11
+ folderKey: string;
12
+ profilePicture?: IFile;
13
+ teamRole: string;
14
+ signature?: IFile;
15
+ name: string;
16
+ teamId: string;
17
+ createdAt: string;
18
+ updatedAt: string;
19
+ metadata?: { [key: PropertyKey]: any };
20
+ }
@@ -0,0 +1,15 @@
1
+ export interface IVehicleContractPayment {
2
+ id: string;
3
+ createdAt: string;
4
+ updatedAt: string;
5
+ deletedAt?: string;
6
+
7
+ amount: number;
8
+ dueDate: string;
9
+
10
+ invoiceId: string;
11
+
12
+ contractId: string;
13
+
14
+ status: "PENDING" | "PAID" | "OVERDUE" | "CANCELLED";
15
+ }
@@ -0,0 +1,17 @@
1
+ export interface IVehicleContract {
2
+ id: string;
3
+ createdAt: string;
4
+ updatedAt: string;
5
+ deletedAt?: string;
6
+
7
+ vehicleId: string;
8
+
9
+ startDate: string;
10
+ endDate: string;
11
+
12
+ status: "ACTIVE" | "INACTIVE";
13
+
14
+ vendorId: string;
15
+
16
+ active: boolean;
17
+ }
@@ -0,0 +1,18 @@
1
+ export interface IVehicleInsurance {
2
+ id: string;
3
+ createdAt: string;
4
+ updatedAt: string;
5
+ deletedAt?: string;
6
+
7
+ vehicleId: string;
8
+
9
+ company: string;
10
+ coverageType: string;
11
+ policyNumber: string;
12
+ amount: number;
13
+
14
+ issueDate: string;
15
+ expiryDate: string;
16
+
17
+ active: boolean;
18
+ }
@@ -0,0 +1,8 @@
1
+ export interface IVehicleMake {
2
+ id: string;
3
+ createdAt: string;
4
+ updatedAt: string;
5
+ deletedAt?: string;
6
+
7
+ name: string;
8
+ }
@@ -0,0 +1,12 @@
1
+ export interface IVehicleModel {
2
+ id: string;
3
+ createdAt: string;
4
+ updatedAt: string;
5
+ deletedAt?: string;
6
+
7
+ name: string;
8
+
9
+ makeId: string;
10
+
11
+ regionId: string;
12
+ }
@@ -0,0 +1,15 @@
1
+ export interface IVehicleRegistration {
2
+ id: string;
3
+ createdAt: string;
4
+ updatedAt: string;
5
+ deletedAt?: string;
6
+
7
+ vehicleId: string;
8
+
9
+ amount: number;
10
+
11
+ issueDate: string;
12
+ expiryDate: string;
13
+
14
+ active: boolean;
15
+ }
@@ -0,0 +1,23 @@
1
+ export interface IVehicle {
2
+ id: string;
3
+ createdAt: string;
4
+ updatedAt: string;
5
+ deletedAt?: string;
6
+
7
+ makeId: string;
8
+ modelId: string;
9
+ purchaseDate?: string;
10
+ year: number;
11
+ color: string;
12
+ plateNumber: string;
13
+ vehicleIdentificationNumber: string;
14
+ type: string;
15
+
16
+ companyId: string;
17
+ employeeId?: string;
18
+ userId?: string;
19
+
20
+ regionId: string;
21
+
22
+ assignment: "EMPLOYEE" | "USER" | "POSITION" | "UNASSIGNED";
23
+ }
@@ -0,0 +1,13 @@
1
+ export interface IVendorContact {
2
+ id: string;
3
+ createdAt: string;
4
+ updatedAt: string;
5
+ deletedAt?: string;
6
+
7
+ name: string;
8
+ number: string;
9
+ email?: string;
10
+ notes?: string;
11
+
12
+ vendorId: string;
13
+ }
@@ -0,0 +1,13 @@
1
+ export interface IVendor {
2
+ id: string;
3
+ createdAt: string;
4
+ updatedAt: string;
5
+ deletedAt?: string;
6
+
7
+ name: string;
8
+
9
+ logoId?: string;
10
+ folderKey?: string;
11
+
12
+ regionId: string;
13
+ }
@@ -0,0 +1,8 @@
1
+ export interface IZone {
2
+ id: string;
3
+ createdAt: Date;
4
+ updatedAt: Date;
5
+
6
+ name: string;
7
+ area: string;
8
+ }
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@automateinc/fleet-types",
3
+ "private": false,
4
+ "version": "1.0.0",
5
+ "description": "Reusable TypeScript types and interfaces for Fleet API.",
6
+ "main": "dist/index.js",
7
+ "types": "dist/types/index.d.ts",
8
+ "scripts": {
9
+ "build": "tsc && cp -R src/types dist/",
10
+ "test": "echo \"Error: no test specified\" && exit 1"
11
+ },
12
+ "keywords": [
13
+ "typescript",
14
+ "types",
15
+ "interfaces",
16
+ "api"
17
+ ],
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/automateinc/fleet-types.git"
21
+ },
22
+ "author": "Automate Inc. <hello@automate.bh> (https://automate.bh)",
23
+ "license": "MIT",
24
+ "devDependencies": {
25
+ "@tanstack/react-query": "^4.36.1",
26
+ "axios": "^1.7.9",
27
+ "typescript": "5.1.6"
28
+ },
29
+ "dependencies": {
30
+ "asynckit": "^0.4.0",
31
+ "combined-stream": "^1.0.8",
32
+ "delayed-stream": "^1.0.0",
33
+ "follow-redirects": "^1.15.9",
34
+ "form-data": "^4.0.1",
35
+ "js-tokens": "^4.0.0",
36
+ "loose-envify": "^1.4.0",
37
+ "mime-db": "^1.52.0",
38
+ "mime-types": "^2.1.35",
39
+ "proxy-from-env": "^1.1.0",
40
+ "react": "^18.3.1",
41
+ "use-sync-external-store": "^1.4.0"
42
+ },
43
+ "bugs": {
44
+ "url": "https://github.com/automateinc/fleet-types/issues"
45
+ },
46
+ "homepage": "https://github.com/automateinc/fleet-types#readme"
47
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "compilerOptions": {
3
+ "outDir": "./dist",
4
+ "declaration": true,
5
+ "emitDeclarationOnly": true,
6
+ "strict": true,
7
+ "esModuleInterop": true,
8
+ "skipLibCheck": true
9
+ },
10
+ "include": ["./**/*.ts"],
11
+ }