@hobenakicoffee/libraries 4.3.1 → 4.4.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.3.1",
3
+ "version": "4.4.0",
4
4
  "type": "module",
5
5
  "types": "src/index.ts",
6
6
  "repository": {
@@ -7,3 +7,12 @@ export const ShopProductTypes = {
7
7
 
8
8
  export type ShopProductType =
9
9
  (typeof ShopProductTypes)[keyof typeof ShopProductTypes];
10
+
11
+ export const ShopApprovalStatuses = {
12
+ pending: "pending",
13
+ approved: "approved",
14
+ rejected: "rejected",
15
+ } as const;
16
+
17
+ export type ShopApprovalStatus =
18
+ (typeof ShopApprovalStatuses)[keyof typeof ShopApprovalStatuses];
@@ -1237,6 +1237,63 @@ export type Database = {
1237
1237
  },
1238
1238
  ];
1239
1239
  };
1240
+ shop_category_drafts: {
1241
+ Row: {
1242
+ approval_status: Database["public"]["Enums"]["shop_approval_status_enum"];
1243
+ category_id: string;
1244
+ created_at: string;
1245
+ description: string | null;
1246
+ id: string;
1247
+ name: string;
1248
+ profile_id: string;
1249
+ rejection_reason: string | null;
1250
+ slug: string;
1251
+ sort_order: number;
1252
+ updated_at: string;
1253
+ };
1254
+ Insert: {
1255
+ approval_status?: Database["public"]["Enums"]["shop_approval_status_enum"];
1256
+ category_id: string;
1257
+ created_at?: string;
1258
+ description?: string | null;
1259
+ id?: string;
1260
+ name: string;
1261
+ profile_id: string;
1262
+ rejection_reason?: string | null;
1263
+ slug: string;
1264
+ sort_order?: number;
1265
+ updated_at?: string;
1266
+ };
1267
+ Update: {
1268
+ approval_status?: Database["public"]["Enums"]["shop_approval_status_enum"];
1269
+ category_id?: string;
1270
+ created_at?: string;
1271
+ description?: string | null;
1272
+ id?: string;
1273
+ name?: string;
1274
+ profile_id?: string;
1275
+ rejection_reason?: string | null;
1276
+ slug?: string;
1277
+ sort_order?: number;
1278
+ updated_at?: string;
1279
+ };
1280
+ Relationships: [
1281
+ {
1282
+ foreignKeyName: "shop_category_drafts_category_id_fkey";
1283
+ columns: ["category_id"];
1284
+ isOneToOne: true;
1285
+ referencedRelation: "shop_categories";
1286
+ referencedColumns: ["id"];
1287
+ },
1288
+ {
1289
+ foreignKeyName: "shop_category_drafts_profile_id_fkey";
1290
+ columns: ["profile_id"];
1291
+ isOneToOne: false;
1292
+ referencedRelation: "profiles";
1293
+ referencedColumns: ["id"];
1294
+ },
1295
+ ];
1296
+ };
1240
1297
  shop_download_tokens: {
1241
1298
  Row: {
1242
1299
  buyer_profile_id: string;
@@ -1515,6 +1572,130 @@ export type Database = {
1515
1572
  },
1516
1573
  ];
1517
1574
  };
1575
+ shop_product_drafts: {
1576
+ Row: {
1577
+ approval_status: Database["public"]["Enums"]["shop_approval_status_enum"];
1578
+ category_id: string | null;
1579
+ cod_enabled: boolean;
1580
+ compare_at_price: number | null;
1581
+ cover_image_url: string | null;
1582
+ created_at: string;
1583
+ description: string | null;
1584
+ download_expires_hours: number;
1585
+ id: string;
1586
+ images: string[];
1587
+ is_featured: boolean;
1588
+ low_stock_threshold: number;
1589
+ max_downloads: number;
1590
+ option_definitions: Json;
1591
+ price: number;
1592
+ processing_max_days: number | null;
1593
+ processing_min_days: number | null;
1594
+ product_id: string;
1595
+ profile_id: string;
1596
+ rejection_reason: string | null;
1597
+ requires_shipping: boolean;
1598
+ shipping_fee_inside_dhaka: number;
1599
+ shipping_fee_outside_dhaka: number;
1600
+ sku: string | null;
1601
+ slug: string;
1602
+ sort_order: number;
1603
+ stock_count: number | null;
1604
+ tags: string[];
1605
+ title: string;
1606
+ updated_at: string;
1607
+ weight_grams: number | null;
1608
+ };
1609
+ Insert: {
1610
+ approval_status?: Database["public"]["Enums"]["shop_approval_status_enum"];
1611
+ category_id?: string | null;
1612
+ cod_enabled?: boolean;
1613
+ compare_at_price?: number | null;
1614
+ cover_image_url?: string | null;
1615
+ created_at?: string;
1616
+ description?: string | null;
1617
+ download_expires_hours?: number;
1618
+ id?: string;
1619
+ images?: string[];
1620
+ is_featured?: boolean;
1621
+ low_stock_threshold?: number;
1622
+ max_downloads?: number;
1623
+ option_definitions?: Json;
1624
+ price: number;
1625
+ processing_max_days?: number | null;
1626
+ processing_min_days?: number | null;
1627
+ product_id: string;
1628
+ profile_id: string;
1629
+ rejection_reason?: string | null;
1630
+ requires_shipping?: boolean;
1631
+ shipping_fee_inside_dhaka?: number;
1632
+ shipping_fee_outside_dhaka?: number;
1633
+ sku?: string | null;
1634
+ slug: string;
1635
+ sort_order?: number;
1636
+ stock_count?: number | null;
1637
+ tags?: string[];
1638
+ title: string;
1639
+ updated_at?: string;
1640
+ weight_grams?: number | null;
1641
+ };
1642
+ Update: {
1643
+ approval_status?: Database["public"]["Enums"]["shop_approval_status_enum"];
1644
+ category_id?: string | null;
1645
+ cod_enabled?: boolean;
1646
+ compare_at_price?: number | null;
1647
+ cover_image_url?: string | null;
1648
+ created_at?: string;
1649
+ description?: string | null;
1650
+ download_expires_hours?: number;
1651
+ id?: string;
1652
+ images?: string[];
1653
+ is_featured?: boolean;
1654
+ low_stock_threshold?: number;
1655
+ max_downloads?: number;
1656
+ option_definitions?: Json;
1657
+ price?: number;
1658
+ processing_max_days?: number | null;
1659
+ processing_min_days?: number | null;
1660
+ product_id?: string;
1661
+ profile_id?: string;
1662
+ rejection_reason?: string | null;
1663
+ requires_shipping?: boolean;
1664
+ shipping_fee_inside_dhaka?: number;
1665
+ shipping_fee_outside_dhaka?: number;
1666
+ sku?: string | null;
1667
+ slug?: string;
1668
+ sort_order?: number;
1669
+ stock_count?: number | null;
1670
+ tags?: string[];
1671
+ title?: string;
1672
+ updated_at?: string;
1673
+ weight_grams?: number | null;
1674
+ };
1675
+ Relationships: [
1676
+ {
1677
+ foreignKeyName: "shop_product_drafts_category_id_fkey";
1678
+ columns: ["category_id"];
1679
+ isOneToOne: false;
1680
+ referencedRelation: "shop_categories";
1681
+ referencedColumns: ["id"];
1682
+ },
1683
+ {
1684
+ foreignKeyName: "shop_product_drafts_product_id_fkey";
1685
+ columns: ["product_id"];
1686
+ isOneToOne: true;
1687
+ referencedRelation: "shop_products";
1688
+ referencedColumns: ["id"];
1689
+ },
1690
+ {
1691
+ foreignKeyName: "shop_product_drafts_profile_id_fkey";
1692
+ columns: ["profile_id"];
1693
+ isOneToOne: false;
1694
+ referencedRelation: "profiles";
1695
+ referencedColumns: ["id"];
1696
+ },
1697
+ ];
1698
+ };
1518
1699
  shop_product_files: {
1519
1700
  Row: {
1520
1701
  created_at: string;
@@ -2193,6 +2374,8 @@ export type Database = {
2193
2374
  };
2194
2375
  Returns: Json;
2195
2376
  };
2377
+ approve_shop_category: { Args: { p_category_id: string }; Returns: Json };
2378
+ approve_shop_product: { Args: { p_product_id: string }; Returns: Json };
2196
2379
  authorize_manager: {
2197
2380
  Args: {
2198
2381
  requested_permission: Database["public"]["Enums"]["manager_permission"];
@@ -2656,6 +2839,14 @@ export type Database = {
2656
2839
  Args: { p_post_id: string };
2657
2840
  Returns: undefined;
2658
2841
  };
2842
+ reject_shop_category: {
2843
+ Args: { p_category_id: string; p_rejection_reason: string };
2844
+ Returns: Json;
2845
+ };
2846
+ reject_shop_product: {
2847
+ Args: { p_product_id: string; p_rejection_reason: string };
2848
+ Returns: Json;
2849
+ };
2659
2850
  reorder_shop_categories: {
2660
2851
  Args: { p_category_ids: string[] };
2661
2852
  Returns: Json;
@@ -2702,7 +2893,6 @@ export type Database = {
2702
2893
  Args: {
2703
2894
  p_category_id?: string;
2704
2895
  p_description?: string;
2705
- p_is_visible?: boolean;
2706
2896
  p_name?: string;
2707
2897
  p_slug?: string;
2708
2898
  p_sort_order?: number;
@@ -2726,7 +2916,6 @@ export type Database = {
2726
2916
  p_description?: string;
2727
2917
  p_download_expires_hours?: number;
2728
2918
  p_images?: string[];
2729
- p_is_active?: boolean;
2730
2919
  p_is_featured?: boolean;
2731
2920
  p_low_stock_threshold?: number;
2732
2921
  p_max_downloads?: number;
@@ -2900,6 +3089,7 @@ export type Database = {
2900
3089
  | "implemented"
2901
3090
  | "rejected"
2902
3091
  | "duplicate";
3092
+ shop_approval_status_enum: "pending" | "approved" | "rejected";
2903
3093
  shop_order_item_status_enum:
2904
3094
  | "pending"
2905
3095
  | "paid"
@@ -3179,6 +3369,7 @@ export const Constants = {
3179
3369
  "rejected",
3180
3370
  "duplicate",
3181
3371
  ],
3372
+ shop_approval_status_enum: ["pending", "approved", "rejected"],
3182
3373
  shop_order_item_status_enum: [
3183
3374
  "pending",
3184
3375
  "paid",