@hobenakicoffee/libraries 4.9.0 → 5.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hobenakicoffee/libraries",
3
- "version": "4.9.0",
3
+ "version": "5.0.0",
4
4
  "type": "module",
5
5
  "types": "src/index.ts",
6
6
  "repository": {
@@ -206,6 +206,99 @@ export type Database = {
206
206
  };
207
207
  Relationships: [];
208
208
  };
209
+ creator_platform_subscriptions: {
210
+ Row: {
211
+ created_at: string;
212
+ id: number;
213
+ period_end: string;
214
+ period_start: string;
215
+ plan_id: number;
216
+ price_at_purchase: number;
217
+ profile_id: string;
218
+ service_type: string;
219
+ status: string;
220
+ transaction_reference_id: string | null;
221
+ updated_at: string;
222
+ };
223
+ Insert: {
224
+ created_at?: string;
225
+ id?: never;
226
+ period_end: string;
227
+ period_start: string;
228
+ plan_id: number;
229
+ price_at_purchase: number;
230
+ profile_id: string;
231
+ service_type: string;
232
+ status?: string;
233
+ transaction_reference_id?: string | null;
234
+ updated_at?: string;
235
+ };
236
+ Update: {
237
+ created_at?: string;
238
+ id?: never;
239
+ period_end?: string;
240
+ period_start?: string;
241
+ plan_id?: number;
242
+ price_at_purchase?: number;
243
+ profile_id?: string;
244
+ service_type?: string;
245
+ status?: string;
246
+ transaction_reference_id?: string | null;
247
+ updated_at?: string;
248
+ };
249
+ Relationships: [
250
+ {
251
+ foreignKeyName: "creator_platform_subscriptions_plan_id_fkey";
252
+ columns: ["plan_id"];
253
+ isOneToOne: false;
254
+ referencedRelation: "platform_subscription_plans";
255
+ referencedColumns: ["id"];
256
+ },
257
+ {
258
+ foreignKeyName: "creator_platform_subscriptions_profile_id_fkey";
259
+ columns: ["profile_id"];
260
+ isOneToOne: false;
261
+ referencedRelation: "profiles";
262
+ referencedColumns: ["id"];
263
+ },
264
+ {
265
+ foreignKeyName: "creator_platform_subscriptions_transaction_reference_id_fkey";
266
+ columns: ["transaction_reference_id"];
267
+ isOneToOne: false;
268
+ referencedRelation: "transactions";
269
+ referencedColumns: ["reference_id"];
270
+ },
271
+ ];
272
+ };
273
+ creator_subscription_notifications: {
274
+ Row: {
275
+ id: number;
276
+ notification_type: string;
277
+ sent_at: string;
278
+ subscription_id: number;
279
+ };
280
+ Insert: {
281
+ id?: never;
282
+ notification_type: string;
283
+ sent_at?: string;
284
+ subscription_id: number;
285
+ };
286
+ Update: {
287
+ id?: never;
288
+ notification_type?: string;
289
+ sent_at?: string;
290
+ subscription_id?: number;
291
+ };
292
+ Relationships: [
293
+ {
294
+ foreignKeyName: "creator_subscription_notifications_subscription_id_fkey";
295
+ columns: ["subscription_id"];
296
+ isOneToOne: false;
297
+ referencedRelation: "creator_platform_subscriptions";
298
+ referencedColumns: ["id"];
299
+ },
300
+ ];
301
+ };
209
302
  follows: {
210
303
  Row: {
211
304
  created_at: string | null;
@@ -905,6 +998,42 @@ export type Database = {
905
998
  };
906
999
  Relationships: [];
907
1000
  };
1001
+ platform_subscription_plans: {
1002
+ Row: {
1003
+ created_at: string;
1004
+ description: string | null;
1005
+ id: number;
1006
+ is_active: boolean;
1007
+ name: string;
1008
+ price_per_month: number;
1009
+ service_type: string;
1010
+ sort_order: number;
1011
+ updated_at: string;
1012
+ };
1013
+ Insert: {
1014
+ created_at?: string;
1015
+ description?: string | null;
1016
+ id?: never;
1017
+ is_active?: boolean;
1018
+ name: string;
1019
+ price_per_month: number;
1020
+ service_type: string;
1021
+ sort_order?: number;
1022
+ updated_at?: string;
1023
+ };
1024
+ Update: {
1025
+ created_at?: string;
1026
+ description?: string | null;
1027
+ id?: never;
1028
+ is_active?: boolean;
1029
+ name?: string;
1030
+ price_per_month?: number;
1031
+ service_type?: string;
1032
+ sort_order?: number;
1033
+ updated_at?: string;
1034
+ };
1035
+ Relationships: [];
1036
+ };
908
1037
  post_access_grants: {
909
1038
  Row: {
910
1039
  created_at: string;
@@ -1364,6 +1493,7 @@ export type Database = {
1364
1493
  delivered_at: string | null;
1365
1494
  id: string;
1366
1495
  order_id: string;
1496
+ platform_fee_rate: number;
1367
1497
  product_id: string;
1368
1498
  product_title: string;
1369
1499
  product_type: Database["public"]["Enums"]["shop_product_type_enum"];
@@ -1387,6 +1517,7 @@ export type Database = {
1387
1517
  delivered_at?: string | null;
1388
1518
  id?: string;
1389
1519
  order_id: string;
1520
+ platform_fee_rate?: number;
1390
1521
  product_id: string;
1391
1522
  product_title: string;
1392
1523
  product_type: Database["public"]["Enums"]["shop_product_type_enum"];
@@ -1410,6 +1541,7 @@ export type Database = {
1410
1541
  delivered_at?: string | null;
1411
1542
  id?: string;
1412
1543
  order_id?: string;
1544
+ platform_fee_rate?: number;
1413
1545
  product_id?: string;
1414
1546
  product_title?: string;
1415
1547
  product_type?: Database["public"]["Enums"]["shop_product_type_enum"];
@@ -1461,7 +1593,7 @@ export type Database = {
1461
1593
  order_number: string;
1462
1594
  payment_method: Database["public"]["Enums"]["shop_payment_method_enum"];
1463
1595
  platform_fee: number;
1464
- platform_fee_rate: number;
1596
+ platform_fee_rate: number | null;
1465
1597
  seller_net: number;
1466
1598
  seller_notes: string | null;
1467
1599
  seller_profile_id: string;
@@ -1482,7 +1614,7 @@ export type Database = {
1482
1614
  order_number: string;
1483
1615
  payment_method?: Database["public"]["Enums"]["shop_payment_method_enum"];
1484
1616
  platform_fee: number;
1485
- platform_fee_rate: number;
1617
+ platform_fee_rate?: number | null;
1486
1618
  seller_net: number;
1487
1619
  seller_notes?: string | null;
1488
1620
  seller_profile_id: string;
@@ -1503,7 +1635,7 @@ export type Database = {
1503
1635
  order_number?: string;
1504
1636
  payment_method?: Database["public"]["Enums"]["shop_payment_method_enum"];
1505
1637
  platform_fee?: number;
1506
- platform_fee_rate?: number;
1638
+ platform_fee_rate?: number | null;
1507
1639
  seller_net?: number;
1508
1640
  seller_notes?: string | null;
1509
1641
  seller_profile_id?: string;
@@ -2399,6 +2531,15 @@ export type Database = {
2399
2531
  [_ in never]: never;
2400
2532
  };
2401
2533
  Functions: {
2534
+ activate_creator_platform_subscription: {
2535
+ Args: {
2536
+ p_creator_profile_id: string;
2537
+ p_plan_id: number;
2538
+ p_provider: Database["public"]["Enums"]["provider_enum"];
2539
+ p_provider_transaction_id: string;
2540
+ };
2541
+ Returns: Json;
2542
+ };
2402
2543
  add_shop_product_file: {
2403
2544
  Args: {
2404
2545
  p_file_name: string;
@@ -2410,6 +2551,10 @@ export type Database = {
2410
2551
  };
2411
2552
  Returns: Json;
2412
2553
  };
2554
+ admin_grant_creator_subscription: {
2555
+ Args: { p_months?: number; p_plan_id: number; p_profile_id: string };
2556
+ Returns: Json;
2557
+ };
2413
2558
  approve_newsletter_post: { Args: { p_post_id: string }; Returns: Json };
2414
2559
  approve_shop_category: { Args: { p_category_id: string }; Returns: Json };
2415
2560
  approve_shop_product: { Args: { p_product_id: string }; Returns: Json };
@@ -2424,6 +2569,10 @@ export type Database = {
2424
2569
  Args: { p_order_item_id: string; p_reason: string };
2425
2570
  Returns: Json;
2426
2571
  };
2572
+ cancel_creator_platform_subscription: {
2573
+ Args: { p_service_type: string };
2574
+ Returns: Json;
2575
+ };
2427
2576
  check_newsletter_post_access: {
2428
2577
  Args: { p_post_id: string };
2429
2578
  Returns: {
@@ -2506,6 +2655,10 @@ export type Database = {
2506
2655
  unique_supporters_change: number;
2507
2656
  }[];
2508
2657
  };
2658
+ get_creator_effective_fee_rate: {
2659
+ Args: { p_profile_id: string; p_service_type: string };
2660
+ Returns: number;
2661
+ };
2509
2662
  get_followers: { Args: { target_user_id: string }; Returns: string[] };
2510
2663
  get_following: { Args: { target_user_id: string }; Returns: string[] };
2511
2664
  get_messages: {
@@ -2817,7 +2970,6 @@ export type Database = {
2817
2970
  p_identity_hash: string;
2818
2971
  p_is_monthly?: boolean;
2819
2972
  p_message?: string;
2820
- p_platform_fee: number;
2821
2973
  p_provider: Database["public"]["Enums"]["provider_enum"];
2822
2974
  p_provider_transaction_id: string;
2823
2975
  p_reference_type: Database["public"]["Enums"]["reference_type_enum"];
@@ -2827,6 +2979,7 @@ export type Database = {
2827
2979
  };
2828
2980
  Returns: Json;
2829
2981
  };
2982
+ process_creator_subscription_expiry: { Args: never; Returns: undefined };
2830
2983
  process_membership_expiry_notifications: {
2831
2984
  Args: never;
2832
2985
  Returns: undefined;
@@ -2864,7 +3017,6 @@ export type Database = {
2864
3017
  p_identity_hash: string;
2865
3018
  p_message?: string;
2866
3019
  p_plan_id: string;
2867
- p_platform_fee: number;
2868
3020
  p_provider: Database["public"]["Enums"]["provider_enum"];
2869
3021
  p_provider_transaction_id: string;
2870
3022
  p_source?: string;
@@ -2879,7 +3031,6 @@ export type Database = {
2879
3031
  p_buyer_profile_id: string;
2880
3032
  p_identity_hash: string;
2881
3033
  p_message?: string;
2882
- p_platform_fee: number;
2883
3034
  p_post_id: string;
2884
3035
  p_provider: Database["public"]["Enums"]["provider_enum"];
2885
3036
  p_provider_transaction_id: string;
@@ -3128,7 +3279,7 @@ export type Database = {
3128
3279
  | "refunded"
3129
3280
  | "reviewing";
3130
3281
  payout_provider: "bkash" | "nagad" | "rocket" | "bank";
3131
- post_status_enum: "draft" | "published" | "archived" | "review";
3282
+ post_status_enum: "draft" | "published" | "review" | "archived";
3132
3283
  post_version_source_enum:
3133
3284
  | "autosave"
3134
3285
  | "ai_polish"
@@ -3404,7 +3555,7 @@ export const Constants = {
3404
3555
  "reviewing",
3405
3556
  ],
3406
3557
  payout_provider: ["bkash", "nagad", "rocket", "bank"],
3407
- post_status_enum: ["draft", "published", "archived", "review"],
3558
+ post_status_enum: ["draft", "published", "review", "archived"],
3408
3559
  post_version_source_enum: [
3409
3560
  "autosave",
3410
3561
  "ai_polish",