@iservice365/layer-common 0.1.0 → 0.2.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.
Files changed (93) hide show
  1. package/.playground/app.vue +7 -2
  2. package/.playground/pages/feedback.vue +30 -0
  3. package/CHANGELOG.md +12 -0
  4. package/components/Chat/Bubbles.vue +53 -0
  5. package/components/Chat/Information.vue +187 -0
  6. package/components/Chat/ListCard.vue +62 -0
  7. package/components/Chat/Message.vue +149 -0
  8. package/components/Chat/Navigation.vue +150 -0
  9. package/components/ConfirmDialog.vue +66 -0
  10. package/components/Container/Standard.vue +33 -0
  11. package/components/Feedback/Form.vue +136 -0
  12. package/components/FeedbackDetail.vue +465 -0
  13. package/components/FeedbackMain.vue +454 -0
  14. package/components/FormDialog.vue +65 -0
  15. package/components/Input/File.vue +203 -0
  16. package/components/Input/ListGroupSelection.vue +96 -0
  17. package/components/Input/NewDate.vue +123 -0
  18. package/components/Input/Number.vue +124 -0
  19. package/components/InvitationMain.vue +284 -0
  20. package/components/Layout/Header.vue +14 -4
  21. package/components/ListView.vue +87 -0
  22. package/components/MemberMain.vue +459 -0
  23. package/components/RolePermissionFormCreate.vue +161 -0
  24. package/components/RolePermissionFormPreviewUpdate.vue +183 -0
  25. package/components/RolePermissionMain.vue +361 -0
  26. package/components/ServiceProviderFormCreate.vue +154 -0
  27. package/components/ServiceProviderMain.vue +195 -0
  28. package/components/SignaturePad.vue +73 -0
  29. package/components/SpecificAttr.vue +53 -0
  30. package/components/SwitchContext.vue +26 -5
  31. package/components/TableList.vue +150 -0
  32. package/components/TableListSecondary.vue +164 -0
  33. package/components/WorkOrder/Create.vue +197 -0
  34. package/components/WorkOrder/ListView.vue +96 -0
  35. package/components/WorkOrder/Main.vue +308 -0
  36. package/components/Workorder.vue +1 -0
  37. package/composables/useAddress.ts +107 -0
  38. package/composables/useCommonPermission.ts +130 -0
  39. package/composables/useCustomer.ts +113 -0
  40. package/composables/useFeedback.ts +117 -0
  41. package/composables/useFile.ts +40 -0
  42. package/composables/useInvoice.ts +18 -0
  43. package/composables/useLocal.ts +24 -4
  44. package/composables/useLocalAuth.ts +62 -20
  45. package/composables/useLocalSetup.ts +13 -0
  46. package/composables/useMember.ts +111 -0
  47. package/composables/useOrg.ts +76 -92
  48. package/composables/usePaymentMethod.ts +101 -0
  49. package/composables/usePrice.ts +15 -0
  50. package/composables/usePromoCode.ts +36 -0
  51. package/composables/useRole.ts +38 -7
  52. package/composables/useServiceProvider.ts +218 -0
  53. package/composables/useSite.ts +108 -0
  54. package/composables/useSubscription.ts +149 -0
  55. package/composables/useUser.ts +38 -14
  56. package/composables/useUtils.ts +218 -6
  57. package/composables/useVerification.ts +33 -0
  58. package/composables/useWorkOrder.ts +68 -0
  59. package/middleware/01.auth.ts +11 -0
  60. package/middleware/02.org.ts +18 -0
  61. package/middleware/03.customer.ts +13 -0
  62. package/middleware/member.ts +4 -0
  63. package/nuxt.config.ts +3 -1
  64. package/package.json +7 -3
  65. package/pages/index.vue +3 -0
  66. package/pages/payment-method-linked.vue +31 -0
  67. package/pages/require-customer.vue +56 -0
  68. package/pages/require-organization-membership.vue +47 -0
  69. package/pages/unauthorized.vue +29 -0
  70. package/plugins/API.ts +2 -25
  71. package/plugins/iconify.client.ts +5 -0
  72. package/plugins/secure-member.client.ts +54 -0
  73. package/plugins/vuetify.ts +2 -0
  74. package/public/bg-camera.jpg +0 -0
  75. package/public/bg-city.jpg +0 -0
  76. package/public/bg-condo.jpg +0 -0
  77. package/public/images/icons/delete-icon.png +0 -0
  78. package/public/sprite.svg +1 -0
  79. package/types/address.d.ts +13 -0
  80. package/types/customer.d.ts +15 -0
  81. package/types/feedback.d.ts +63 -0
  82. package/types/local.d.ts +47 -38
  83. package/types/member.d.ts +21 -0
  84. package/types/org.d.ts +13 -0
  85. package/types/permission.d.ts +1 -0
  86. package/types/price.d.ts +17 -0
  87. package/types/promo-code.d.ts +19 -0
  88. package/types/service-provider.d.ts +15 -0
  89. package/types/site.d.ts +13 -0
  90. package/types/subscription.d.ts +23 -0
  91. package/types/user.d.ts +19 -0
  92. package/types/verification.d.ts +20 -0
  93. package/types/work-order.d.ts +40 -0
@@ -0,0 +1,13 @@
1
+ declare type TAddress = {
2
+ _id?: string;
3
+ type: string;
4
+ user?: string;
5
+ org?: string;
6
+ country: string;
7
+ address: string;
8
+ continuedAddress?: string;
9
+ city: string;
10
+ province: string;
11
+ postalCode: string;
12
+ taxId: string;
13
+ };
@@ -0,0 +1,15 @@
1
+ declare type TCustomer = {
2
+ _id: string;
3
+ name: string;
4
+ orgId: string;
5
+ customerOrgId: string;
6
+ createdAt: string;
7
+ updatedAt: string;
8
+ siteName?: string;
9
+ siteDescription?: string;
10
+ };
11
+
12
+ declare type TCustomerCreate = Pick<
13
+ TCustomer,
14
+ "name" | "orgId" | "siteName" | "siteDescription"
15
+ >;
@@ -0,0 +1,63 @@
1
+ declare type TFeedback = {
2
+ _id: string;
3
+ attachments?: string[];
4
+ category: string;
5
+ subject: string;
6
+ location: string;
7
+ description: string;
8
+ createdBy: string;
9
+ createdAt?: string;
10
+ updatedAt?: string;
11
+ status?: string;
12
+ metadata?: TFeedbackMetadata;
13
+ createdByName?: string;
14
+ organization?: string;
15
+ site?: string;
16
+ signature?: string;
17
+ name?: string;
18
+ highPriority?: boolean;
19
+ serviceProvider?: string;
20
+ assignee?: string;
21
+ };
22
+
23
+ declare type TFeedbackMetadata = {
24
+ serviceProvider: string;
25
+ assignee: string;
26
+ organization: string;
27
+ site: string;
28
+ name: string;
29
+ signature: string;
30
+ attachments: string;
31
+ completedAt: string;
32
+ };
33
+
34
+ declare type TFeedbackCreate = Pick<
35
+ TFeedback,
36
+ | "subject"
37
+ | "category"
38
+ | "location"
39
+ | "description"
40
+ | "attachments"
41
+ | "highPriority"
42
+ | "serviceProvider"
43
+ | "assignee"
44
+ | "organization"
45
+ | "site"
46
+ >;
47
+
48
+ declare type TFeedbackUpdate = Pick<
49
+ TFeedback,
50
+ "subject" | "category" | "location" | "description" | "attachments"
51
+ >;
52
+
53
+ declare type TFeedbackUpdate = Pick<
54
+ TFeedback,
55
+ "attachments" | "category" | "subject" | "location" | "description"
56
+ >;
57
+
58
+ declare type TFeedbackStatusComplete = Pick<
59
+ TFeedback,
60
+ "status" | "name" | "signature" | "attachments"
61
+ >;
62
+
63
+ declare type TFeedbackUpdateStatus = Pick<TFeedback, "status">;
package/types/local.d.ts CHANGED
@@ -1,22 +1,3 @@
1
- declare type TUser = {
2
- _id: string;
3
- email: string;
4
- password: string;
5
- firstName: string;
6
- middleName?: string;
7
- lastName: string;
8
- suffix?: string;
9
- birthMonth?: string;
10
- birthDate?: string;
11
- birthYear?: string;
12
- profile?: string;
13
- defaultOrg?: string;
14
- createdAt: string;
15
- updatedAt: string;
16
- status: string;
17
- deletedAt: string;
18
- };
19
-
20
1
  declare type TToken = {
21
2
  accessToken: string;
22
3
  refreshToken: string;
@@ -32,21 +13,8 @@ declare type TNavigationItem = {
32
13
  title: string;
33
14
  icon?: string;
34
15
  route?: TNavigationRoute;
35
- link?: string;
36
16
  children?: TNavigationItem[];
37
- };
38
-
39
- declare type TOrg = {
40
- _id?: string;
41
- name: string;
42
- email: string;
43
- busInst: string;
44
- owner: string;
45
- type: string;
46
- createdAt?: string;
47
- updatedAt?: string;
48
- status?: string;
49
- deletedAt?: string;
17
+ link?: string
50
18
  };
51
19
 
52
20
  declare type TKeyValuePair<
@@ -56,9 +24,50 @@ declare type TKeyValuePair<
56
24
  [key in K]: V;
57
25
  };
58
26
 
59
- declare type TOrgsAsOption = {
60
- value: string;
61
- title: string;
62
- subtitle?: string;
63
- email?: string;
27
+ declare type TFeedbackPaginatedResponse = {
28
+ items: TFeedback[];
29
+ totalItems: number;
30
+ page: number;
31
+ pages: number;
32
+ pageRange: string;
33
+ };
34
+
35
+ declare type TCustomerPaginatedResponse = {
36
+ items: TCustomer[];
37
+ totalItems: number;
38
+ page: number;
39
+ pages: number;
40
+ pageRange: string;
41
+ };
42
+
43
+ declare type TSitePaginatedResponse = {
44
+ items: TSite[];
45
+ totalItems: number;
46
+ page: number;
47
+ pages: number;
48
+ pageRange: string;
49
+ };
50
+
51
+ declare type TServiceProviderPaginatedResponse = {
52
+ items: TServiceProvider[];
53
+ totalItems: number;
54
+ page: number;
55
+ pages: number;
56
+ pageRange: string;
57
+ };
58
+
59
+ declare type TWorkOrderPaginatedResponse = {
60
+ items: TWorkOrder[];
61
+ totalItems: number;
62
+ page: number;
63
+ pages: number;
64
+ pageRange: string;
65
+ };
66
+
67
+ declare type TMemberPaginatedResponse = {
68
+ items: TMember[];
69
+ totalItems: number;
70
+ page: number;
71
+ pages: number;
72
+ pageRange: string;
64
73
  };
@@ -0,0 +1,21 @@
1
+ declare type TMember = {
2
+ _id: string;
3
+ org?: string;
4
+ orgName?: string;
5
+ roleName?: string;
6
+ name: string;
7
+ user: string;
8
+ role: string;
9
+ type: string;
10
+ customerOrgId?: string;
11
+ customerSiteId?: string;
12
+ status?: string;
13
+ createdAt?: string;
14
+ updatedAt?: string;
15
+ deletedAt?: string;
16
+ };
17
+
18
+ declare type TMemberUserCreateVerification = Pick<
19
+ TUser,
20
+ "name" | "password" | "type"
21
+ >;
package/types/org.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ declare type TOrg = {
2
+ _id?: string;
3
+ name: string;
4
+ email: string;
5
+ contact: string;
6
+ busInst: string;
7
+ type: string;
8
+ createdAt?: string;
9
+ updatedAt?: string;
10
+ status?: string;
11
+ deletedAt?: string;
12
+ nature?: string;
13
+ };
@@ -15,6 +15,7 @@ declare type TPermissions = {
15
15
 
16
16
  declare type TRole = {
17
17
  _id?: string;
18
+ default?: boolean;
18
19
  name: string;
19
20
  description: string;
20
21
  permissions: string[];
@@ -0,0 +1,17 @@
1
+ declare type TPriceType =
2
+ | "monthly-subscription"
3
+ | "yearly-subscription"
4
+ | "one-time-payment"
5
+ | "other";
6
+
7
+ declare type TPrice = {
8
+ _id?: string;
9
+ value: number;
10
+ saleValue?: number;
11
+ saleExpiry?: Date;
12
+ name: string;
13
+ type?: TPriceType;
14
+ createdAt?: Date;
15
+ updatedAt?: Date;
16
+ deletedAt?: Date;
17
+ };
@@ -0,0 +1,19 @@
1
+ declare type TPromoTier = {
2
+ min: number;
3
+ max: number;
4
+ price: number;
5
+ };
6
+
7
+ declare type TPromoCode = {
8
+ _id?: ObjectId;
9
+ code: string;
10
+ description?: string;
11
+ type: "tiered" | "fixed";
12
+ tiers?: TPromoTier[];
13
+ fixed_rate?: number;
14
+ appliesTo?: string; // "subscription" | "order"
15
+ createdAt?: string; // Date of creation
16
+ expiresAt?: string; // Optional expiry
17
+ assignedTo?: string | ObjectId; // Store the only ape who used it
18
+ status?: "active" | "expired" | "disabled";
19
+ };
@@ -0,0 +1,15 @@
1
+ declare type TServiceProvider = {
2
+ _id?: string;
3
+ name: string;
4
+ orgId: string;
5
+ customerOrgId: string;
6
+ siteId: string;
7
+ serviceProviderOrgId: string;
8
+ type: string;
9
+ nature: string;
10
+ };
11
+
12
+ declare type TServiceProviderName = {
13
+ _id: string;
14
+ name: string;
15
+ };
@@ -0,0 +1,13 @@
1
+ declare type TSite = {
2
+ _id?: string;
3
+ name: string;
4
+ description: string;
5
+ orgId: string;
6
+ customerOrgId: string;
7
+ customerSiteId: string;
8
+ createdAt?: string;
9
+ updatedAt?: string;
10
+ deletedAt?: string;
11
+ };
12
+
13
+ declare type TSiteCreate = Pick<TSite, "name" | "description" | "orgId">;
@@ -0,0 +1,23 @@
1
+ declare type TSubscription = {
2
+ _id?: string;
3
+ user?: string;
4
+ org?: string;
5
+ customerId: string;
6
+ paymentMethodId: string;
7
+ amount: number;
8
+ description?: string;
9
+ currency: string;
10
+ promoCode?: string;
11
+ type: string;
12
+ paidSeats?: number;
13
+ currentSeats?: number;
14
+ maxSeats?: number;
15
+ status?: string;
16
+ billingCycle: "monthly" | "yearly";
17
+ nextBillingDate?: string;
18
+ lastPaymentStatus?: string;
19
+ failedAttempts?: number;
20
+ createdAt?: string;
21
+ updatedAt?: string;
22
+ deletedAt?: string;
23
+ };
@@ -0,0 +1,19 @@
1
+ declare type TUser = {
2
+ _id: string;
3
+ email: string;
4
+ password: string;
5
+ name: string;
6
+ suffix?: string;
7
+ month?: string;
8
+ day?: number;
9
+ year?: number;
10
+ profile?: string;
11
+ defaultOrg: string;
12
+ createdAt: string;
13
+ updatedAt: string;
14
+ status: string;
15
+ deletedAt: string;
16
+ gender: string;
17
+ contact: string;
18
+ type?: string;
19
+ };
@@ -0,0 +1,20 @@
1
+ declare type TVerificationMetadata = {
2
+ app?: string;
3
+ role?: string;
4
+ };
5
+
6
+ declare type TMiniVerification = Pick<
7
+ TVerification,
8
+ "createdAt" | "email" | "_id"
9
+ >;
10
+
11
+ declare type TVerification = {
12
+ _id: string;
13
+ type: string;
14
+ email: string;
15
+ metadata?: TVerificationMetadata;
16
+ status?: string;
17
+ createdAt: string;
18
+ updatedAt?: string | null;
19
+ expireAt: string;
20
+ };
@@ -0,0 +1,40 @@
1
+ declare type TWorkOrder = {
2
+ _id: string;
3
+ subject: string;
4
+ description: string;
5
+ createdBy: string;
6
+ createdByName?: string;
7
+ service: string;
8
+ provider: string;
9
+ assignee?: string;
10
+ organization: string;
11
+ site: string;
12
+ location: string;
13
+ attachments?: string[];
14
+ feedback?: string;
15
+ status?: string;
16
+ createdAt?: string;
17
+ updatedAt?: string;
18
+ highPriority?: boolean;
19
+ block: string;
20
+ level: string;
21
+ unit: string;
22
+ };
23
+
24
+ declare type TWorkOrderCreate = Pick<
25
+ TWorkOrder,
26
+ | "subject"
27
+ | "description"
28
+ | "attachments"
29
+ | "location"
30
+ | "organization"
31
+ | "site"
32
+ | "block"
33
+ | "level"
34
+ | "unit"
35
+ | "highPriority"
36
+ | "assignee"
37
+ | "feedback"
38
+ | "category"
39
+ | "serviceProvider"
40
+ >;