@umituz/web-dashboard 2.4.0 → 2.4.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/web-dashboard",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "Dashboard Layout System - Customizable, themeable dashboard layouts and settings",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Billing Constants
3
+ *
4
+ * Centralized constants for billing domain to avoid hardcoded strings
5
+ */
6
+
7
+ /**
8
+ * Subscription status constants
9
+ */
10
+ export const SUBSCRIPTION_STATUS = {
11
+ ACTIVE: "active",
12
+ TRIALING: "trialing",
13
+ PAST_DUE: "past_due",
14
+ CANCELED: "canceled",
15
+ UNPAID: "unpaid",
16
+ INCOMPLETE: "incomplete",
17
+ REVOKED: "revoked",
18
+ } as const;
19
+
20
+ export type SubscriptionStatus = typeof SUBSCRIPTION_STATUS[keyof typeof SUBSCRIPTION_STATUS];
21
+
22
+ /**
23
+ * Invoice status constants
24
+ */
25
+ export const INVOICE_STATUS = {
26
+ DRAFT: "draft",
27
+ OPEN: "open",
28
+ PAID: "paid",
29
+ VOID: "void",
30
+ UNCOLLECTIBLE: "uncollectible",
31
+ REFUNDED: "refunded",
32
+ } as const;
33
+
34
+ export type InvoiceStatus = typeof INVOICE_STATUS[keyof typeof INVOICE_STATUS];
35
+
36
+ /**
37
+ * Billing cycle constants
38
+ */
39
+ export const BILLING_CYCLE = {
40
+ MONTHLY: "monthly",
41
+ YEARLY: "yearly",
42
+ } as const;
43
+
44
+ export type BillingCycle = typeof BILLING_CYCLE[keyof typeof BILLING_CYCLE];
45
+
46
+ /**
47
+ * Currency constants
48
+ */
49
+ export const CURRENCY = {
50
+ USD: "USD",
51
+ EUR: "EUR",
52
+ GBP: "GBP",
53
+ TRY: "TRY",
54
+ JPY: "JPY",
55
+ } as const;
56
+
57
+ export type Currency = typeof CURRENCY[keyof typeof CURRENCY];
58
+
59
+ /**
60
+ * Plan type constants
61
+ */
62
+ export const PLAN_TYPE = {
63
+ STANDARD: "standard",
64
+ PRO: "pro",
65
+ BUSINESS: "business",
66
+ ENTERPRISE: "enterprise",
67
+ } as const;
68
+
69
+ export type PlanType = typeof PLAN_TYPE[keyof typeof PLAN_TYPE];
@@ -5,22 +5,22 @@
5
5
  */
6
6
 
7
7
  import type { ComponentType, ReactElement } from "react";
8
+ import { SUBSCRIPTION_STATUS, INVOICE_STATUS, BILLING_CYCLE, CURRENCY } from "../constants/billing";
8
9
 
9
10
  /**
10
11
  * Billing cycle
11
12
  */
12
- export type BillingCycle = "monthly" | "yearly";
13
+ export type BillingCycle = typeof BILLING_CYCLE[keyof typeof BILLING_CYCLE];
13
14
 
14
15
  /**
15
16
  * Subscription status
16
17
  */
17
- export type SubscriptionStatus =
18
- | "active"
19
- | "trialing"
20
- | "past_due"
21
- | "canceled"
22
- | "unpaid"
23
- | "incomplete";
18
+ export type SubscriptionStatus = typeof SUBSCRIPTION_STATUS[keyof typeof SUBSCRIPTION_STATUS];
19
+
20
+ /**
21
+ * Invoice status
22
+ */
23
+ export type InvoiceStatus = typeof INVOICE_STATUS[keyof typeof INVOICE_STATUS];
24
24
 
25
25
  /**
26
26
  * Plan type
@@ -30,7 +30,7 @@ export type PlanType = "free" | "basic" | "pro" | "enterprise" | "custom";
30
30
  /**
31
31
  * Currency
32
32
  */
33
- export type Currency = "USD" | "EUR" | "GBP" | "TRY" | "JPY";
33
+ export type Currency = typeof CURRENCY[keyof typeof CURRENCY];
34
34
 
35
35
  /**
36
36
  * Plan pricing tier
@@ -133,11 +133,6 @@ export interface PaymentMethod {
133
133
  createdAt: string;
134
134
  }
135
135
 
136
- /**
137
- * Invoice status
138
- */
139
- export type InvoiceStatus = "draft" | "open" | "paid" | "void" | "uncollectible";
140
-
141
136
  /**
142
137
  * Invoice item
143
138
  */