ar-saas 0.3.2 → 0.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/dist/generator.js +2 -6
- package/package.json +1 -1
- package/templates/backend/.env.example +1 -1
- package/templates/backend/package.json +5 -2
- package/templates/backend/src/app.module.ts +68 -40
- package/templates/backend/src/common/interceptors/workspace-tenant.interceptor.ts +27 -45
- package/templates/backend/src/main.ts +50 -51
- package/templates/backend/src/modules/auth/auth.controller.ts +162 -158
- package/templates/backend/src/modules/auth/auth.service.ts +236 -257
- package/templates/backend/src/modules/auth/strategies/jwt.strategy.ts +45 -43
- package/templates/backend/src/modules/users/users.controller.ts +28 -0
- package/templates/backend/src/modules/users/users.module.ts +16 -14
- package/templates/backend/src/modules/users/users.repository.ts +57 -51
- package/templates/backend/src/modules/users/users.service.ts +130 -104
- package/templates/backend/src/modules/workspaces/workspaces.repository.ts +38 -34
- package/templates/backend/src/modules/workspaces/workspaces.service.ts +51 -42
- package/templates/frontend/package.json +2 -5
- package/templates/frontend/pnpm-workspace.yaml +2 -2
- package/templates/frontend/src/app/(auth)/layout.tsx +29 -28
- package/templates/frontend/src/app/(dashboard)/billing/page.tsx +111 -111
- package/templates/frontend/src/app/(dashboard)/profile/page.tsx +241 -226
- package/templates/frontend/src/app/(dashboard)/settings/page.tsx +155 -156
- package/templates/frontend/src/app/(dashboard)/team/page.tsx +179 -178
- package/templates/frontend/src/app/layout.tsx +29 -26
- package/templates/frontend/src/app/page.tsx +1 -1
- package/templates/frontend/src/app/setup/page.tsx +1 -1
- package/templates/frontend/src/components/dashboard/header.tsx +5 -3
- package/templates/frontend/src/config/site.ts +1 -1
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { CreditCard,
|
|
4
|
-
import { siteConfig } from '@/config/site'
|
|
5
|
-
import { Button } from '@/components/ui/button'
|
|
6
|
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
|
7
|
-
import { Badge } from '@/components/ui/badge'
|
|
8
|
-
import { Separator } from '@/components/ui/separator'
|
|
9
|
-
|
|
10
|
-
const currentPlan = siteConfig.pricing[0]
|
|
11
|
-
|
|
12
|
-
const invoiceHistory = [
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<Button
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
</div>
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
</CardContent>
|
|
108
|
-
</Card>
|
|
109
|
-
</div>
|
|
110
|
-
)
|
|
111
|
-
}
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { CreditCard, ArrowUpRight } from 'lucide-react'
|
|
4
|
+
import { siteConfig } from '@/config/site'
|
|
5
|
+
import { Button } from '@/components/ui/button'
|
|
6
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
|
|
7
|
+
import { Badge } from '@/components/ui/badge'
|
|
8
|
+
import { Separator } from '@/components/ui/separator'
|
|
9
|
+
|
|
10
|
+
const currentPlan = siteConfig.pricing[0]
|
|
11
|
+
|
|
12
|
+
const invoiceHistory: Array<{ id: string; date: string; amount: string; status: string; plan: string }> = []
|
|
13
|
+
|
|
14
|
+
export default function BillingPage() {
|
|
15
|
+
return (
|
|
16
|
+
<div className="max-w-2xl space-y-6">
|
|
17
|
+
{/* Current plan */}
|
|
18
|
+
<Card>
|
|
19
|
+
<CardHeader>
|
|
20
|
+
<div className="flex items-start justify-between">
|
|
21
|
+
<div>
|
|
22
|
+
<CardTitle>Plan actual</CardTitle>
|
|
23
|
+
<CardDescription>Tus beneficios y límites vigentes.</CardDescription>
|
|
24
|
+
</div>
|
|
25
|
+
<Badge variant="secondary">{currentPlan.name}</Badge>
|
|
26
|
+
</div>
|
|
27
|
+
</CardHeader>
|
|
28
|
+
<CardContent className="space-y-4">
|
|
29
|
+
<div className="flex items-end gap-1">
|
|
30
|
+
<span className="text-3xl font-bold">{currentPlan.price}</span>
|
|
31
|
+
{currentPlan.period && (
|
|
32
|
+
<span className="mb-1 text-sm text-muted-foreground">{currentPlan.period}</span>
|
|
33
|
+
)}
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<ul className="space-y-2">
|
|
37
|
+
{currentPlan.features.map((f) => (
|
|
38
|
+
<li key={f} className="flex items-center gap-2 text-sm">
|
|
39
|
+
<span className="size-4 text-primary flex items-center justify-center">✓</span>
|
|
40
|
+
{f}
|
|
41
|
+
</li>
|
|
42
|
+
))}
|
|
43
|
+
</ul>
|
|
44
|
+
|
|
45
|
+
<Separator />
|
|
46
|
+
|
|
47
|
+
<div className="flex flex-col gap-2 sm:flex-row">
|
|
48
|
+
<Button className="gap-2">
|
|
49
|
+
<ArrowUpRight className="size-4" />
|
|
50
|
+
Actualizar a Pro
|
|
51
|
+
</Button>
|
|
52
|
+
<Button variant="outline" disabled>
|
|
53
|
+
Cancelar suscripción
|
|
54
|
+
</Button>
|
|
55
|
+
</div>
|
|
56
|
+
</CardContent>
|
|
57
|
+
</Card>
|
|
58
|
+
|
|
59
|
+
{/* Payment method */}
|
|
60
|
+
<Card>
|
|
61
|
+
<CardHeader>
|
|
62
|
+
<CardTitle>Método de pago</CardTitle>
|
|
63
|
+
<CardDescription>Administrá tus tarjetas guardadas.</CardDescription>
|
|
64
|
+
</CardHeader>
|
|
65
|
+
<CardContent>
|
|
66
|
+
<div className="flex items-center justify-between rounded-lg border p-4">
|
|
67
|
+
<div className="flex items-center gap-3">
|
|
68
|
+
<CreditCard className="size-5 text-muted-foreground" />
|
|
69
|
+
<div>
|
|
70
|
+
<p className="text-sm font-medium">Sin método de pago</p>
|
|
71
|
+
<p className="text-xs text-muted-foreground">Agregá una tarjeta para actualizar tu plan</p>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
<Button variant="outline" size="sm" disabled>
|
|
75
|
+
Agregar tarjeta
|
|
76
|
+
</Button>
|
|
77
|
+
</div>
|
|
78
|
+
</CardContent>
|
|
79
|
+
</Card>
|
|
80
|
+
|
|
81
|
+
{/* History */}
|
|
82
|
+
<Card>
|
|
83
|
+
<CardHeader>
|
|
84
|
+
<CardTitle>Historial de facturación</CardTitle>
|
|
85
|
+
<CardDescription>Tus últimas facturas generadas.</CardDescription>
|
|
86
|
+
</CardHeader>
|
|
87
|
+
<CardContent>
|
|
88
|
+
{invoiceHistory.length === 0 ? (
|
|
89
|
+
<p className="text-sm text-muted-foreground">No hay facturas todavía.</p>
|
|
90
|
+
) : (
|
|
91
|
+
<div className="space-y-2">
|
|
92
|
+
{invoiceHistory.map((inv) => (
|
|
93
|
+
<div key={inv.id} className="flex items-center justify-between rounded-md border p-3 text-sm">
|
|
94
|
+
<div className="flex items-center gap-4">
|
|
95
|
+
<span className="font-mono text-xs text-muted-foreground">{inv.id}</span>
|
|
96
|
+
<span>{inv.date}</span>
|
|
97
|
+
<Badge variant="outline">{inv.plan}</Badge>
|
|
98
|
+
</div>
|
|
99
|
+
<div className="flex items-center gap-4">
|
|
100
|
+
<span className="font-medium">{inv.amount}</span>
|
|
101
|
+
<Badge variant="secondary" className="text-xs">{inv.status}</Badge>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
))}
|
|
105
|
+
</div>
|
|
106
|
+
)}
|
|
107
|
+
</CardContent>
|
|
108
|
+
</Card>
|
|
109
|
+
</div>
|
|
110
|
+
)
|
|
111
|
+
}
|