@deepintel-ltd/farmpro-contracts 1.5.14 → 1.5.15

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions.routes.d.ts","sourceRoot":"","sources":["../../src/routes/subscriptions.routes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+J9B,CAAC"}
@@ -0,0 +1,155 @@
1
+ import { initContract } from '@ts-rest/core';
2
+ import { z } from 'zod';
3
+ import { subscriptionResponseSchema, subscriptionListResponseSchema, upgradeSubscriptionAttributesSchema, usageTrackingListResponseSchema, tierLimitsResponseSchema, currentUsageResponseSchema, availablePlansResponseSchema, } from '../schemas/subscriptions.schemas';
4
+ import { jsonApiErrorResponseSchema, jsonApiPaginationQuerySchema, } from '../schemas/common.schemas';
5
+ const c = initContract();
6
+ export const subscriptionsRouter = c.router({
7
+ // Get all available subscription plans (public endpoint for landing page)
8
+ getAvailablePlans: {
9
+ method: 'GET',
10
+ path: '/subscriptions/plans',
11
+ query: z.object({
12
+ 'currency': z.enum(['NGN', 'USD']).optional(),
13
+ 'country': z.string().optional(), // ISO 3166-1 alpha-2 country code (e.g., 'NG', 'US')
14
+ 'farmId': z.string().uuid().optional(), // Optional: use farm location for detection
15
+ }),
16
+ responses: {
17
+ 200: availablePlansResponseSchema,
18
+ },
19
+ summary: 'Get available subscription plans',
20
+ description: 'Get all available subscription tiers with pricing and features. Pricing is automatically detected based on location (farm, IP, or explicit hint).',
21
+ },
22
+ // Get current subscription for a farm
23
+ getCurrentSubscription: {
24
+ method: 'GET',
25
+ path: '/farms/:farmId/subscription',
26
+ pathParams: z.object({ farmId: z.string().uuid() }),
27
+ responses: {
28
+ 200: subscriptionResponseSchema,
29
+ 404: jsonApiErrorResponseSchema,
30
+ 401: jsonApiErrorResponseSchema,
31
+ },
32
+ summary: 'Get current subscription',
33
+ description: 'Get the current active subscription for a farm',
34
+ },
35
+ // Get subscription by ID
36
+ getSubscription: {
37
+ method: 'GET',
38
+ path: '/farms/:farmId/subscriptions/:id',
39
+ pathParams: z.object({
40
+ farmId: z.string().uuid(),
41
+ id: z.string().uuid(),
42
+ }),
43
+ responses: {
44
+ 200: subscriptionResponseSchema,
45
+ 404: jsonApiErrorResponseSchema,
46
+ 401: jsonApiErrorResponseSchema,
47
+ },
48
+ summary: 'Get subscription by ID',
49
+ description: 'Get a specific subscription by ID',
50
+ },
51
+ // List all subscriptions for a farm
52
+ listSubscriptions: {
53
+ method: 'GET',
54
+ path: '/farms/:farmId/subscriptions',
55
+ pathParams: z.object({ farmId: z.string().uuid() }),
56
+ query: jsonApiPaginationQuerySchema.merge(z.object({
57
+ 'filter[status]': z.enum(['active', 'cancelled', 'expired', 'trial']).optional(),
58
+ 'filter[tier]': z.enum(['FREE', 'STARTER_PACK', 'COOPERATIVE', 'ENTERPRISE', 'GOVERNMENT']).optional(),
59
+ })),
60
+ responses: {
61
+ 200: subscriptionListResponseSchema,
62
+ 404: jsonApiErrorResponseSchema,
63
+ 401: jsonApiErrorResponseSchema,
64
+ },
65
+ summary: 'List subscriptions',
66
+ description: 'Get all subscriptions for a farm with optional filtering',
67
+ },
68
+ // Upgrade subscription
69
+ upgradeSubscription: {
70
+ method: 'POST',
71
+ path: '/farms/:farmId/subscriptions/upgrade',
72
+ pathParams: z.object({ farmId: z.string().uuid() }),
73
+ body: z.object({
74
+ data: z.object({
75
+ type: z.literal('subscriptions'),
76
+ attributes: upgradeSubscriptionAttributesSchema,
77
+ }),
78
+ }),
79
+ responses: {
80
+ 200: subscriptionResponseSchema,
81
+ 400: jsonApiErrorResponseSchema,
82
+ 404: jsonApiErrorResponseSchema,
83
+ 401: jsonApiErrorResponseSchema,
84
+ },
85
+ summary: 'Upgrade subscription',
86
+ description: 'Upgrade a farm subscription to a new tier',
87
+ },
88
+ // Cancel subscription
89
+ cancelSubscription: {
90
+ method: 'POST',
91
+ path: '/farms/:farmId/subscriptions/:id/cancel',
92
+ pathParams: z.object({
93
+ farmId: z.string().uuid(),
94
+ id: z.string().uuid(),
95
+ }),
96
+ body: z.object({}).optional(),
97
+ responses: {
98
+ 200: subscriptionResponseSchema,
99
+ 404: jsonApiErrorResponseSchema,
100
+ 401: jsonApiErrorResponseSchema,
101
+ },
102
+ summary: 'Cancel subscription',
103
+ description: 'Cancel an active subscription',
104
+ },
105
+ // Get tier limits
106
+ getTierLimits: {
107
+ method: 'GET',
108
+ path: '/farms/:farmId/subscription/limits',
109
+ pathParams: z.object({ farmId: z.string().uuid() }),
110
+ responses: {
111
+ 200: z.object({
112
+ data: tierLimitsResponseSchema,
113
+ }),
114
+ 404: jsonApiErrorResponseSchema,
115
+ 401: jsonApiErrorResponseSchema,
116
+ },
117
+ summary: 'Get tier limits',
118
+ description: 'Get the limits for the current subscription tier',
119
+ },
120
+ // Get usage tracking
121
+ getUsageTracking: {
122
+ method: 'GET',
123
+ path: '/farms/:farmId/subscription/usage',
124
+ pathParams: z.object({ farmId: z.string().uuid() }),
125
+ query: z.object({
126
+ 'filter[resourceType]': z.string().optional(), // 'ai_image', 'satellite_check', etc.
127
+ 'filter[periodStart]': z.string().datetime().optional(),
128
+ }),
129
+ responses: {
130
+ 200: usageTrackingListResponseSchema,
131
+ 404: jsonApiErrorResponseSchema,
132
+ 401: jsonApiErrorResponseSchema,
133
+ },
134
+ summary: 'Get usage tracking',
135
+ description: 'Get usage tracking data for the current subscription period',
136
+ },
137
+ // Get current usage for a specific resource
138
+ getCurrentUsage: {
139
+ method: 'GET',
140
+ path: '/farms/:farmId/subscription/usage/:resourceType',
141
+ pathParams: z.object({
142
+ farmId: z.string().uuid(),
143
+ resourceType: z.string(), // 'ai_image', 'satellite_check', etc.
144
+ }),
145
+ responses: {
146
+ 200: z.object({
147
+ data: currentUsageResponseSchema,
148
+ }),
149
+ 404: jsonApiErrorResponseSchema,
150
+ 401: jsonApiErrorResponseSchema,
151
+ },
152
+ summary: 'Get current usage',
153
+ description: 'Get current usage for a specific resource type in the current period',
154
+ },
155
+ });
@@ -16,14 +16,17 @@ export declare const signupAttributesSchema: z.ZodObject<{
16
16
  name: z.ZodString;
17
17
  email: z.ZodString;
18
18
  password: z.ZodString;
19
+ phone: z.ZodOptional<z.ZodString>;
19
20
  }, "strip", z.ZodTypeAny, {
20
21
  email: string;
21
22
  password: string;
22
23
  name: string;
24
+ phone?: string | undefined;
23
25
  }, {
24
26
  email: string;
25
27
  password: string;
26
28
  name: string;
29
+ phone?: string | undefined;
27
30
  }>;
28
31
  export declare const googleAuthInitiateAttributesSchema: z.ZodObject<{
29
32
  redirectUri: z.ZodOptional<z.ZodString>;
@@ -97,6 +100,47 @@ export declare const logoutAttributesSchema: z.ZodObject<{
97
100
  }, {
98
101
  refreshToken?: string | undefined;
99
102
  }>;
103
+ export declare const completeOnboardingAttributesSchema: z.ZodObject<{
104
+ phone: z.ZodOptional<z.ZodString>;
105
+ skipOnboarding: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
106
+ }, "strip", z.ZodTypeAny, {
107
+ skipOnboarding: boolean;
108
+ phone?: string | undefined;
109
+ }, {
110
+ phone?: string | undefined;
111
+ skipOnboarding?: boolean | undefined;
112
+ }>;
113
+ export declare const onboardingStatusAttributesSchema: z.ZodObject<{
114
+ onboardingCompleted: z.ZodBoolean;
115
+ onboardingSkipped: z.ZodBoolean;
116
+ emailVerified: z.ZodBoolean;
117
+ hasPhone: z.ZodBoolean;
118
+ hasFarm: z.ZodBoolean;
119
+ hasActiveSubscription: z.ZodOptional<z.ZodBoolean>;
120
+ currentSubscriptionTier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
121
+ canUpgrade: z.ZodOptional<z.ZodBoolean>;
122
+ recommendedTier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
123
+ }, "strip", z.ZodTypeAny, {
124
+ onboardingCompleted: boolean;
125
+ onboardingSkipped: boolean;
126
+ emailVerified: boolean;
127
+ hasPhone: boolean;
128
+ hasFarm: boolean;
129
+ hasActiveSubscription?: boolean | undefined;
130
+ currentSubscriptionTier?: string | null | undefined;
131
+ canUpgrade?: boolean | undefined;
132
+ recommendedTier?: string | null | undefined;
133
+ }, {
134
+ onboardingCompleted: boolean;
135
+ onboardingSkipped: boolean;
136
+ emailVerified: boolean;
137
+ hasPhone: boolean;
138
+ hasFarm: boolean;
139
+ hasActiveSubscription?: boolean | undefined;
140
+ currentSubscriptionTier?: string | null | undefined;
141
+ canUpgrade?: boolean | undefined;
142
+ recommendedTier?: string | null | undefined;
143
+ }>;
100
144
  export declare const loginSchema: z.ZodObject<{
101
145
  type: z.ZodLiteral<"auth">;
102
146
  attributes: z.ZodObject<{
@@ -128,14 +172,17 @@ export declare const signupSchema: z.ZodObject<{
128
172
  name: z.ZodString;
129
173
  email: z.ZodString;
130
174
  password: z.ZodString;
175
+ phone: z.ZodOptional<z.ZodString>;
131
176
  }, "strip", z.ZodTypeAny, {
132
177
  email: string;
133
178
  password: string;
134
179
  name: string;
180
+ phone?: string | undefined;
135
181
  }, {
136
182
  email: string;
137
183
  password: string;
138
184
  name: string;
185
+ phone?: string | undefined;
139
186
  }>;
140
187
  }, "strip", z.ZodTypeAny, {
141
188
  type: "users";
@@ -143,6 +190,7 @@ export declare const signupSchema: z.ZodObject<{
143
190
  email: string;
144
191
  password: string;
145
192
  name: string;
193
+ phone?: string | undefined;
146
194
  };
147
195
  }, {
148
196
  type: "users";
@@ -150,6 +198,7 @@ export declare const signupSchema: z.ZodObject<{
150
198
  email: string;
151
199
  password: string;
152
200
  name: string;
201
+ phone?: string | undefined;
153
202
  };
154
203
  }>;
155
204
  export declare const googleAuthInitiateSchema: z.ZodObject<{
@@ -347,6 +396,31 @@ export declare const logoutSchema: z.ZodObject<{
347
396
  refreshToken?: string | undefined;
348
397
  };
349
398
  }>;
399
+ export declare const completeOnboardingSchema: z.ZodObject<{
400
+ type: z.ZodLiteral<"onboarding">;
401
+ attributes: z.ZodObject<{
402
+ phone: z.ZodOptional<z.ZodString>;
403
+ skipOnboarding: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
404
+ }, "strip", z.ZodTypeAny, {
405
+ skipOnboarding: boolean;
406
+ phone?: string | undefined;
407
+ }, {
408
+ phone?: string | undefined;
409
+ skipOnboarding?: boolean | undefined;
410
+ }>;
411
+ }, "strip", z.ZodTypeAny, {
412
+ type: "onboarding";
413
+ attributes: {
414
+ skipOnboarding: boolean;
415
+ phone?: string | undefined;
416
+ };
417
+ }, {
418
+ type: "onboarding";
419
+ attributes: {
420
+ phone?: string | undefined;
421
+ skipOnboarding?: boolean | undefined;
422
+ };
423
+ }>;
350
424
  export declare const authUserAttributesSchema: z.ZodObject<{
351
425
  name: z.ZodString;
352
426
  email: z.ZodString;
@@ -1070,6 +1144,234 @@ export declare const emailVerificationResponseSchema: z.ZodObject<{
1070
1144
  message: string;
1071
1145
  };
1072
1146
  }>;
1147
+ export declare const onboardingStatusResourceSchema: z.ZodObject<{
1148
+ type: z.ZodLiteral<string>;
1149
+ id: z.ZodString;
1150
+ attributes: z.ZodObject<{
1151
+ onboardingCompleted: z.ZodBoolean;
1152
+ onboardingSkipped: z.ZodBoolean;
1153
+ emailVerified: z.ZodBoolean;
1154
+ hasPhone: z.ZodBoolean;
1155
+ hasFarm: z.ZodBoolean;
1156
+ hasActiveSubscription: z.ZodOptional<z.ZodBoolean>;
1157
+ currentSubscriptionTier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1158
+ canUpgrade: z.ZodOptional<z.ZodBoolean>;
1159
+ recommendedTier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1160
+ }, "strip", z.ZodTypeAny, {
1161
+ onboardingCompleted: boolean;
1162
+ onboardingSkipped: boolean;
1163
+ emailVerified: boolean;
1164
+ hasPhone: boolean;
1165
+ hasFarm: boolean;
1166
+ hasActiveSubscription?: boolean | undefined;
1167
+ currentSubscriptionTier?: string | null | undefined;
1168
+ canUpgrade?: boolean | undefined;
1169
+ recommendedTier?: string | null | undefined;
1170
+ }, {
1171
+ onboardingCompleted: boolean;
1172
+ onboardingSkipped: boolean;
1173
+ emailVerified: boolean;
1174
+ hasPhone: boolean;
1175
+ hasFarm: boolean;
1176
+ hasActiveSubscription?: boolean | undefined;
1177
+ currentSubscriptionTier?: string | null | undefined;
1178
+ canUpgrade?: boolean | undefined;
1179
+ recommendedTier?: string | null | undefined;
1180
+ }>;
1181
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1182
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1183
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1184
+ }, "strip", z.ZodTypeAny, {
1185
+ type: string;
1186
+ id: string;
1187
+ attributes: {
1188
+ onboardingCompleted: boolean;
1189
+ onboardingSkipped: boolean;
1190
+ emailVerified: boolean;
1191
+ hasPhone: boolean;
1192
+ hasFarm: boolean;
1193
+ hasActiveSubscription?: boolean | undefined;
1194
+ currentSubscriptionTier?: string | null | undefined;
1195
+ canUpgrade?: boolean | undefined;
1196
+ recommendedTier?: string | null | undefined;
1197
+ };
1198
+ relationships?: Record<string, unknown> | undefined;
1199
+ links?: Record<string, string> | undefined;
1200
+ meta?: Record<string, unknown> | undefined;
1201
+ }, {
1202
+ type: string;
1203
+ id: string;
1204
+ attributes: {
1205
+ onboardingCompleted: boolean;
1206
+ onboardingSkipped: boolean;
1207
+ emailVerified: boolean;
1208
+ hasPhone: boolean;
1209
+ hasFarm: boolean;
1210
+ hasActiveSubscription?: boolean | undefined;
1211
+ currentSubscriptionTier?: string | null | undefined;
1212
+ canUpgrade?: boolean | undefined;
1213
+ recommendedTier?: string | null | undefined;
1214
+ };
1215
+ relationships?: Record<string, unknown> | undefined;
1216
+ links?: Record<string, string> | undefined;
1217
+ meta?: Record<string, unknown> | undefined;
1218
+ }>;
1219
+ export declare const onboardingStatusResponseSchema: z.ZodObject<{
1220
+ data: z.ZodObject<{
1221
+ type: z.ZodLiteral<string>;
1222
+ id: z.ZodString;
1223
+ attributes: z.ZodObject<{
1224
+ onboardingCompleted: z.ZodBoolean;
1225
+ onboardingSkipped: z.ZodBoolean;
1226
+ emailVerified: z.ZodBoolean;
1227
+ hasPhone: z.ZodBoolean;
1228
+ hasFarm: z.ZodBoolean;
1229
+ hasActiveSubscription: z.ZodOptional<z.ZodBoolean>;
1230
+ currentSubscriptionTier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1231
+ canUpgrade: z.ZodOptional<z.ZodBoolean>;
1232
+ recommendedTier: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1233
+ }, "strip", z.ZodTypeAny, {
1234
+ onboardingCompleted: boolean;
1235
+ onboardingSkipped: boolean;
1236
+ emailVerified: boolean;
1237
+ hasPhone: boolean;
1238
+ hasFarm: boolean;
1239
+ hasActiveSubscription?: boolean | undefined;
1240
+ currentSubscriptionTier?: string | null | undefined;
1241
+ canUpgrade?: boolean | undefined;
1242
+ recommendedTier?: string | null | undefined;
1243
+ }, {
1244
+ onboardingCompleted: boolean;
1245
+ onboardingSkipped: boolean;
1246
+ emailVerified: boolean;
1247
+ hasPhone: boolean;
1248
+ hasFarm: boolean;
1249
+ hasActiveSubscription?: boolean | undefined;
1250
+ currentSubscriptionTier?: string | null | undefined;
1251
+ canUpgrade?: boolean | undefined;
1252
+ recommendedTier?: string | null | undefined;
1253
+ }>;
1254
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1255
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1256
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1257
+ }, "strip", z.ZodTypeAny, {
1258
+ type: string;
1259
+ id: string;
1260
+ attributes: {
1261
+ onboardingCompleted: boolean;
1262
+ onboardingSkipped: boolean;
1263
+ emailVerified: boolean;
1264
+ hasPhone: boolean;
1265
+ hasFarm: boolean;
1266
+ hasActiveSubscription?: boolean | undefined;
1267
+ currentSubscriptionTier?: string | null | undefined;
1268
+ canUpgrade?: boolean | undefined;
1269
+ recommendedTier?: string | null | undefined;
1270
+ };
1271
+ relationships?: Record<string, unknown> | undefined;
1272
+ links?: Record<string, string> | undefined;
1273
+ meta?: Record<string, unknown> | undefined;
1274
+ }, {
1275
+ type: string;
1276
+ id: string;
1277
+ attributes: {
1278
+ onboardingCompleted: boolean;
1279
+ onboardingSkipped: boolean;
1280
+ emailVerified: boolean;
1281
+ hasPhone: boolean;
1282
+ hasFarm: boolean;
1283
+ hasActiveSubscription?: boolean | undefined;
1284
+ currentSubscriptionTier?: string | null | undefined;
1285
+ canUpgrade?: boolean | undefined;
1286
+ recommendedTier?: string | null | undefined;
1287
+ };
1288
+ relationships?: Record<string, unknown> | undefined;
1289
+ links?: Record<string, string> | undefined;
1290
+ meta?: Record<string, unknown> | undefined;
1291
+ }>;
1292
+ included: z.ZodOptional<z.ZodArray<z.ZodObject<{
1293
+ type: z.ZodString;
1294
+ id: z.ZodString;
1295
+ attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1296
+ relationships: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1297
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1298
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1299
+ }, "strip", z.ZodTypeAny, {
1300
+ type: string;
1301
+ id: string;
1302
+ attributes?: Record<string, unknown> | undefined;
1303
+ relationships?: Record<string, unknown> | undefined;
1304
+ links?: Record<string, string> | undefined;
1305
+ meta?: Record<string, unknown> | undefined;
1306
+ }, {
1307
+ type: string;
1308
+ id: string;
1309
+ attributes?: Record<string, unknown> | undefined;
1310
+ relationships?: Record<string, unknown> | undefined;
1311
+ links?: Record<string, string> | undefined;
1312
+ meta?: Record<string, unknown> | undefined;
1313
+ }>, "many">>;
1314
+ meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1315
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1316
+ }, "strip", z.ZodTypeAny, {
1317
+ data: {
1318
+ type: string;
1319
+ id: string;
1320
+ attributes: {
1321
+ onboardingCompleted: boolean;
1322
+ onboardingSkipped: boolean;
1323
+ emailVerified: boolean;
1324
+ hasPhone: boolean;
1325
+ hasFarm: boolean;
1326
+ hasActiveSubscription?: boolean | undefined;
1327
+ currentSubscriptionTier?: string | null | undefined;
1328
+ canUpgrade?: boolean | undefined;
1329
+ recommendedTier?: string | null | undefined;
1330
+ };
1331
+ relationships?: Record<string, unknown> | undefined;
1332
+ links?: Record<string, string> | undefined;
1333
+ meta?: Record<string, unknown> | undefined;
1334
+ };
1335
+ links?: Record<string, string> | undefined;
1336
+ meta?: Record<string, unknown> | undefined;
1337
+ included?: {
1338
+ type: string;
1339
+ id: string;
1340
+ attributes?: Record<string, unknown> | undefined;
1341
+ relationships?: Record<string, unknown> | undefined;
1342
+ links?: Record<string, string> | undefined;
1343
+ meta?: Record<string, unknown> | undefined;
1344
+ }[] | undefined;
1345
+ }, {
1346
+ data: {
1347
+ type: string;
1348
+ id: string;
1349
+ attributes: {
1350
+ onboardingCompleted: boolean;
1351
+ onboardingSkipped: boolean;
1352
+ emailVerified: boolean;
1353
+ hasPhone: boolean;
1354
+ hasFarm: boolean;
1355
+ hasActiveSubscription?: boolean | undefined;
1356
+ currentSubscriptionTier?: string | null | undefined;
1357
+ canUpgrade?: boolean | undefined;
1358
+ recommendedTier?: string | null | undefined;
1359
+ };
1360
+ relationships?: Record<string, unknown> | undefined;
1361
+ links?: Record<string, string> | undefined;
1362
+ meta?: Record<string, unknown> | undefined;
1363
+ };
1364
+ links?: Record<string, string> | undefined;
1365
+ meta?: Record<string, unknown> | undefined;
1366
+ included?: {
1367
+ type: string;
1368
+ id: string;
1369
+ attributes?: Record<string, unknown> | undefined;
1370
+ relationships?: Record<string, unknown> | undefined;
1371
+ links?: Record<string, string> | undefined;
1372
+ meta?: Record<string, unknown> | undefined;
1373
+ }[] | undefined;
1374
+ }>;
1073
1375
  export type LoginAttributes = z.infer<typeof loginAttributesSchema>;
1074
1376
  export type SignupAttributes = z.infer<typeof signupAttributesSchema>;
1075
1377
  export type LoginInput = z.infer<typeof loginSchema>;
@@ -1083,6 +1385,9 @@ export type ChangePasswordInput = z.infer<typeof changePasswordSchema>;
1083
1385
  export type VerifyEmailInput = z.infer<typeof verifyEmailSchema>;
1084
1386
  export type ResendVerificationInput = z.infer<typeof resendVerificationSchema>;
1085
1387
  export type LogoutInput = z.infer<typeof logoutSchema>;
1388
+ export type CompleteOnboardingInput = z.infer<typeof completeOnboardingSchema>;
1389
+ export type CompleteOnboardingAttributes = z.infer<typeof completeOnboardingAttributesSchema>;
1390
+ export type OnboardingStatusAttributes = z.infer<typeof onboardingStatusAttributesSchema>;
1086
1391
  export type AuthUserAttributes = z.infer<typeof authUserAttributesSchema>;
1087
1392
  export type AuthSessionAttributes = z.infer<typeof authSessionAttributesSchema>;
1088
1393
  export type AuthUserResource = z.infer<typeof authUserResourceSchema>;
@@ -1090,4 +1395,5 @@ export type AuthSessionResource = z.infer<typeof authSessionResourceSchema>;
1090
1395
  export type AuthResponse = z.infer<typeof authResponseSchema>;
1091
1396
  export type GoogleAuthInitiateResponse = z.infer<typeof googleAuthInitiateResponseSchema>;
1092
1397
  export type RefreshTokenResponse = z.infer<typeof refreshTokenResponseSchema>;
1398
+ export type OnboardingStatusResponse = z.infer<typeof onboardingStatusResponseSchema>;
1093
1399
  //# sourceMappingURL=auth.schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/auth.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB;;GAEG;AAGH,e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CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AACvD,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC/E,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAC1F,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAC1F,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
@@ -15,6 +15,7 @@ export const signupAttributesSchema = z.object({
15
15
  password: z.string().min(8).regex(/[A-Z]/, 'Password must contain at least one uppercase letter')
16
16
  .regex(/[a-z]/, 'Password must contain at least one lowercase letter')
17
17
  .regex(/[0-9]/, 'Password must contain at least one number'),
18
+ phone: z.string().regex(/^\+?[1-9]\d{1,14}$/, 'Phone number must be in E.164 format').optional(),
18
19
  });
19
20
  // Google OAuth initiate attributes
20
21
  export const googleAuthInitiateAttributesSchema = z.object({
@@ -59,6 +60,23 @@ export const resendVerificationAttributesSchema = z.object({
59
60
  export const logoutAttributesSchema = z.object({
60
61
  refreshToken: z.string().optional(),
61
62
  });
63
+ // Onboarding completion attributes
64
+ export const completeOnboardingAttributesSchema = z.object({
65
+ phone: z.string().regex(/^\+?[1-9]\d{1,14}$/, 'Phone number must be in E.164 format').optional(),
66
+ skipOnboarding: z.boolean().optional().default(false),
67
+ });
68
+ // Onboarding status attributes
69
+ export const onboardingStatusAttributesSchema = z.object({
70
+ onboardingCompleted: z.boolean(),
71
+ onboardingSkipped: z.boolean(),
72
+ emailVerified: z.boolean(),
73
+ hasPhone: z.boolean(),
74
+ hasFarm: z.boolean(),
75
+ hasActiveSubscription: z.boolean().optional(),
76
+ currentSubscriptionTier: z.string().nullable().optional(),
77
+ canUpgrade: z.boolean().optional(),
78
+ recommendedTier: z.string().nullable().optional(),
79
+ });
62
80
  // JSON:API input schemas
63
81
  export const loginSchema = z.object({
64
82
  type: z.literal('auth'),
@@ -104,6 +122,10 @@ export const logoutSchema = z.object({
104
122
  type: z.literal('auth'),
105
123
  attributes: logoutAttributesSchema,
106
124
  });
125
+ export const completeOnboardingSchema = z.object({
126
+ type: z.literal('onboarding'),
127
+ attributes: completeOnboardingAttributesSchema,
128
+ });
107
129
  // User attributes schema (for auth responses)
108
130
  export const authUserAttributesSchema = z.object({
109
131
  name: z.string(),
@@ -154,3 +176,7 @@ export const refreshTokenResponseSchema = jsonApiSingleResponseSchema(refreshTok
154
176
  export const passwordResetResponseSchema = jsonApiSuccessResponseSchema;
155
177
  export const logoutResponseSchema = jsonApiSuccessResponseSchema;
156
178
  export const emailVerificationResponseSchema = jsonApiSuccessResponseSchema;
179
+ // Onboarding status resource
180
+ export const onboardingStatusResourceSchema = createJsonApiResourceSchema('onboarding-status', onboardingStatusAttributesSchema);
181
+ // Onboarding status response
182
+ export const onboardingStatusResponseSchema = jsonApiSingleResponseSchema(onboardingStatusResourceSchema);