@hobenakicoffee/libraries 1.18.0 → 1.20.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hobenakicoffee/libraries",
3
- "version": "1.18.0",
3
+ "version": "1.20.0",
4
4
  "type": "module",
5
5
  "types": "src/index.ts",
6
6
  "exports": {
@@ -4,13 +4,30 @@ import { ServiceTypes } from "./services";
4
4
 
5
5
  describe("ServiceTypes", () => {
6
6
  test("should contain all expected service type keys", () => {
7
- const expectedKeys = ["GIFT", "EXCLUSIVE_CONTENT", "WITHDRAWAL", "FOLLOW"];
7
+ const expectedKeys = [
8
+ "GIFT",
9
+ "DIGITAL_CONTENT",
10
+ "MY_SHOP",
11
+ "CONSULTANCY_1ON1",
12
+ "HIRE_ME",
13
+ "COURSES",
14
+ "LIVE_STREAMS",
15
+ "NEWSLETTER",
16
+ "WITHDRAWAL",
17
+ "FOLLOW",
18
+ ];
8
19
  expect(Object.keys(ServiceTypes)).toEqual(expectedKeys);
9
20
  });
10
21
 
11
22
  test("should have correct values for each service type", () => {
12
23
  expect(ServiceTypes.GIFT).toBe("gift");
13
- expect(ServiceTypes.EXCLUSIVE_CONTENT).toBe("exclusive_content");
24
+ expect(ServiceTypes.DIGITAL_CONTENT).toBe("digital_content");
25
+ expect(ServiceTypes.MY_SHOP).toBe("my_shop");
26
+ expect(ServiceTypes.CONSULTANCY_1ON1).toBe("consultancy_1on1");
27
+ expect(ServiceTypes.HIRE_ME).toBe("hire_me");
28
+ expect(ServiceTypes.COURSES).toBe("courses");
29
+ expect(ServiceTypes.LIVE_STREAMS).toBe("live_streams");
30
+ expect(ServiceTypes.NEWSLETTER).toBe("newsletter");
14
31
  expect(ServiceTypes.WITHDRAWAL).toBe("withdrawal");
15
32
  expect(ServiceTypes.FOLLOW).toBe("follow");
16
33
  });
@@ -27,15 +44,15 @@ describe("ServiceTypes", () => {
27
44
  expect(validType).toBe("gift");
28
45
  });
29
46
 
30
- test("should have 4 service types", () => {
31
- expect(Object.keys(ServiceTypes).length).toBe(4);
47
+ test("should have 10 service types", () => {
48
+ expect(Object.keys(ServiceTypes).length).toBe(10);
32
49
  });
33
50
 
34
51
  test("all values should be lowercase or snake_case strings", () => {
35
- Object.values(ServiceTypes).forEach((type) => {
52
+ for (const type of Object.values(ServiceTypes)) {
36
53
  expect(typeof type).toBe("string");
37
- // Check that it only contains lowercase letters and underscores
38
- expect(type).toMatch(/^[a-z_]+$/);
39
- });
54
+ // Check that it only contains lowercase letters, numbers, and underscores
55
+ expect(type).toMatch(/^[a-z0-9_]+$/);
56
+ }
40
57
  });
41
58
  });
@@ -1,8 +1,21 @@
1
1
  export const ServiceTypes = {
2
2
  GIFT: "gift",
3
- EXCLUSIVE_CONTENT: "exclusive_content",
3
+ DIGITAL_CONTENT: "digital_content",
4
+ MY_SHOP: "my_shop",
5
+ CONSULTANCY_1ON1: "consultancy_1on1",
6
+ HIRE_ME: "hire_me",
7
+ COURSES: "courses",
8
+ LIVE_STREAMS: "live_streams",
9
+ NEWSLETTER: "newsletter",
4
10
  WITHDRAWAL: "withdrawal",
5
11
  FOLLOW: "follow",
6
12
  } as const;
7
13
 
8
14
  export type ServiceType = (typeof ServiceTypes)[keyof typeof ServiceTypes];
15
+
16
+ export type ServiceCategory =
17
+ | "monetization"
18
+ | "content"
19
+ | "engagement"
20
+ | "service"
21
+ | "community";
@@ -594,6 +594,53 @@ export type Database = {
594
594
  };
595
595
  Relationships: [];
596
596
  };
597
+ service_requests: {
598
+ Row: {
599
+ admin_note: string | null;
600
+ category: string;
601
+ created_at: string | null;
602
+ description: string;
603
+ id: string;
604
+ is_custom: boolean | null;
605
+ profile_id: string;
606
+ service_name: string;
607
+ status: Database["public"]["Enums"]["service_request_status"] | null;
608
+ updated_at: string | null;
609
+ };
610
+ Insert: {
611
+ admin_note?: string | null;
612
+ category: string;
613
+ created_at?: string | null;
614
+ description: string;
615
+ id?: string;
616
+ is_custom?: boolean | null;
617
+ profile_id: string;
618
+ service_name: string;
619
+ status?: Database["public"]["Enums"]["service_request_status"] | null;
620
+ updated_at?: string | null;
621
+ };
622
+ Update: {
623
+ admin_note?: string | null;
624
+ category?: string;
625
+ created_at?: string | null;
626
+ description?: string;
627
+ id?: string;
628
+ is_custom?: boolean | null;
629
+ profile_id?: string;
630
+ service_name?: string;
631
+ status?: Database["public"]["Enums"]["service_request_status"] | null;
632
+ updated_at?: string | null;
633
+ };
634
+ Relationships: [
635
+ {
636
+ foreignKeyName: "service_requests_profile_id_fkey";
637
+ columns: ["profile_id"];
638
+ isOneToOne: false;
639
+ referencedRelation: "profiles";
640
+ referencedColumns: ["id"];
641
+ },
642
+ ];
643
+ };
597
644
  supporters: {
598
645
  Row: {
599
646
  conversation_id: string | null;
@@ -1084,7 +1131,11 @@ export type Database = {
1084
1131
  | "developers.create"
1085
1132
  | "developers.view"
1086
1133
  | "developers.update"
1087
- | "developers.delete";
1134
+ | "developers.delete"
1135
+ | "service_requests.view"
1136
+ | "service_requests.approve"
1137
+ | "service_requests.reject"
1138
+ | "service_requests.mark_implemented";
1088
1139
  manager_role:
1089
1140
  | "super_admin"
1090
1141
  | "content_manager"
@@ -1121,6 +1172,14 @@ export type Database = {
1121
1172
  | "withdraw_release"
1122
1173
  | "withdraw_complete"
1123
1174
  | "manual_adjustment";
1175
+ service_request_status:
1176
+ | "pending"
1177
+ | "reviewing"
1178
+ | "approved"
1179
+ | "implementing"
1180
+ | "implemented"
1181
+ | "rejected"
1182
+ | "duplicate";
1124
1183
  supporter_platform_enum:
1125
1184
  | "facebook"
1126
1185
  | "x"
@@ -1305,6 +1364,10 @@ export const Constants = {
1305
1364
  "developers.view",
1306
1365
  "developers.update",
1307
1366
  "developers.delete",
1367
+ "service_requests.view",
1368
+ "service_requests.approve",
1369
+ "service_requests.reject",
1370
+ "service_requests.mark_implemented",
1308
1371
  ],
1309
1372
  manager_role: [
1310
1373
  "super_admin",
@@ -1346,6 +1409,15 @@ export const Constants = {
1346
1409
  "withdraw_complete",
1347
1410
  "manual_adjustment",
1348
1411
  ],
1412
+ service_request_status: [
1413
+ "pending",
1414
+ "reviewing",
1415
+ "approved",
1416
+ "implementing",
1417
+ "implemented",
1418
+ "rejected",
1419
+ "duplicate",
1420
+ ],
1349
1421
  supporter_platform_enum: [
1350
1422
  "facebook",
1351
1423
  "x",