@deepintel-ltd/farmpro-contracts 1.5.18 → 1.5.20
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/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/routes/agents.routes.d.ts +192 -18
- package/dist/routes/agents.routes.d.ts.map +1 -1
- package/dist/routes/index.d.ts +9 -0
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +6 -0
- package/dist/routes/invoices.routes.d.ts +3608 -0
- package/dist/routes/invoices.routes.d.ts.map +1 -0
- package/dist/routes/invoices.routes.js +98 -0
- package/dist/routes/organizations.routes.d.ts +1669 -0
- package/dist/routes/organizations.routes.d.ts.map +1 -0
- package/dist/routes/organizations.routes.js +63 -0
- package/dist/routes/subscriptions.routes.d.ts +232 -0
- package/dist/routes/subscriptions.routes.d.ts.map +1 -1
- package/dist/routes/subscriptions.routes.js +25 -2
- package/dist/routes/waybills.routes.d.ts +3225 -0
- package/dist/routes/waybills.routes.d.ts.map +1 -0
- package/dist/routes/waybills.routes.js +95 -0
- package/dist/schemas/agents.schemas.d.ts +760 -49
- package/dist/schemas/agents.schemas.d.ts.map +1 -1
- package/dist/schemas/agents.schemas.js +21 -1
- package/dist/schemas/invoices.schemas.d.ts +1533 -0
- package/dist/schemas/invoices.schemas.d.ts.map +1 -0
- package/dist/schemas/invoices.schemas.js +85 -0
- package/dist/schemas/organizations.schemas.d.ts +509 -0
- package/dist/schemas/organizations.schemas.d.ts.map +1 -0
- package/dist/schemas/organizations.schemas.js +39 -0
- package/dist/schemas/waybills.schemas.d.ts +1261 -0
- package/dist/schemas/waybills.schemas.d.ts.map +1 -0
- package/dist/schemas/waybills.schemas.js +70 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizations.routes.d.ts","sourceRoot":"","sources":["../../src/routes/organizations.routes.ts"],"names":[],"mappings":"AACA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4D9B,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { initContract } from '@ts-rest/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { createOrganizationSchema, updateOrganizationSchema, organizationResponseSchema, organizationListResponseSchema, } from '../schemas/organizations.schemas';
|
|
4
|
+
import { jsonApiErrorResponseSchema, idParamSchema, jsonApiPaginationQuerySchema, jsonApiSortQuerySchema, } from '../schemas/common.schemas';
|
|
5
|
+
const c = initContract();
|
|
6
|
+
export const organizationsRouter = c.router({
|
|
7
|
+
// List all organizations for the authenticated user
|
|
8
|
+
listOrganizations: {
|
|
9
|
+
method: 'GET',
|
|
10
|
+
path: '/organizations',
|
|
11
|
+
query: jsonApiPaginationQuerySchema
|
|
12
|
+
.merge(jsonApiSortQuerySchema),
|
|
13
|
+
responses: {
|
|
14
|
+
200: organizationListResponseSchema,
|
|
15
|
+
401: jsonApiErrorResponseSchema,
|
|
16
|
+
},
|
|
17
|
+
summary: 'List all organizations',
|
|
18
|
+
description: 'Get a paginated list of organizations for the authenticated user',
|
|
19
|
+
},
|
|
20
|
+
// Create a new organization
|
|
21
|
+
createOrganization: {
|
|
22
|
+
method: 'POST',
|
|
23
|
+
path: '/organizations',
|
|
24
|
+
body: z.object({ data: createOrganizationSchema }),
|
|
25
|
+
responses: {
|
|
26
|
+
201: organizationResponseSchema,
|
|
27
|
+
400: jsonApiErrorResponseSchema,
|
|
28
|
+
401: jsonApiErrorResponseSchema,
|
|
29
|
+
422: jsonApiErrorResponseSchema,
|
|
30
|
+
},
|
|
31
|
+
summary: 'Create a new organization',
|
|
32
|
+
description: 'Create a new organization. The creator automatically becomes the primary contact person.',
|
|
33
|
+
},
|
|
34
|
+
// Get organization by ID
|
|
35
|
+
getOrganization: {
|
|
36
|
+
method: 'GET',
|
|
37
|
+
path: '/organizations/:id',
|
|
38
|
+
pathParams: idParamSchema,
|
|
39
|
+
responses: {
|
|
40
|
+
200: organizationResponseSchema,
|
|
41
|
+
404: jsonApiErrorResponseSchema,
|
|
42
|
+
401: jsonApiErrorResponseSchema,
|
|
43
|
+
},
|
|
44
|
+
summary: 'Get organization by ID',
|
|
45
|
+
description: 'Get detailed information about a specific organization',
|
|
46
|
+
},
|
|
47
|
+
// Update organization
|
|
48
|
+
updateOrganization: {
|
|
49
|
+
method: 'PATCH',
|
|
50
|
+
path: '/organizations/:id',
|
|
51
|
+
pathParams: idParamSchema,
|
|
52
|
+
body: z.object({ data: updateOrganizationSchema }),
|
|
53
|
+
responses: {
|
|
54
|
+
200: organizationResponseSchema,
|
|
55
|
+
400: jsonApiErrorResponseSchema,
|
|
56
|
+
404: jsonApiErrorResponseSchema,
|
|
57
|
+
401: jsonApiErrorResponseSchema,
|
|
58
|
+
422: jsonApiErrorResponseSchema,
|
|
59
|
+
},
|
|
60
|
+
summary: 'Update organization',
|
|
61
|
+
description: 'Update organization information',
|
|
62
|
+
},
|
|
63
|
+
});
|
|
@@ -4020,5 +4020,237 @@ export declare const subscriptionsRouter: {
|
|
|
4020
4020
|
}>;
|
|
4021
4021
|
};
|
|
4022
4022
|
};
|
|
4023
|
+
confirmSubscriptionPayment: {
|
|
4024
|
+
query: z.ZodObject<{
|
|
4025
|
+
trxref: z.ZodOptional<z.ZodString>;
|
|
4026
|
+
reference: z.ZodOptional<z.ZodString>;
|
|
4027
|
+
}, "strip", z.ZodTypeAny, {
|
|
4028
|
+
reference?: string | undefined;
|
|
4029
|
+
trxref?: string | undefined;
|
|
4030
|
+
}, {
|
|
4031
|
+
reference?: string | undefined;
|
|
4032
|
+
trxref?: string | undefined;
|
|
4033
|
+
}>;
|
|
4034
|
+
summary: "Confirm subscription payment";
|
|
4035
|
+
description: "Public endpoint for payment gateway redirect callback. Verifies payment and activates subscription. Redirects to success page or returns JSON response.";
|
|
4036
|
+
method: "GET";
|
|
4037
|
+
path: "/subscriptions/confirm";
|
|
4038
|
+
responses: {
|
|
4039
|
+
200: z.ZodObject<{
|
|
4040
|
+
status: z.ZodLiteral<"success">;
|
|
4041
|
+
message: z.ZodString;
|
|
4042
|
+
data: z.ZodObject<{
|
|
4043
|
+
subscriptionId: z.ZodString;
|
|
4044
|
+
farmId: z.ZodString;
|
|
4045
|
+
tier: z.ZodString;
|
|
4046
|
+
}, "strip", z.ZodTypeAny, {
|
|
4047
|
+
farmId: string;
|
|
4048
|
+
tier: string;
|
|
4049
|
+
subscriptionId: string;
|
|
4050
|
+
}, {
|
|
4051
|
+
farmId: string;
|
|
4052
|
+
tier: string;
|
|
4053
|
+
subscriptionId: string;
|
|
4054
|
+
}>;
|
|
4055
|
+
}, "strip", z.ZodTypeAny, {
|
|
4056
|
+
status: "success";
|
|
4057
|
+
message: string;
|
|
4058
|
+
data: {
|
|
4059
|
+
farmId: string;
|
|
4060
|
+
tier: string;
|
|
4061
|
+
subscriptionId: string;
|
|
4062
|
+
};
|
|
4063
|
+
}, {
|
|
4064
|
+
status: "success";
|
|
4065
|
+
message: string;
|
|
4066
|
+
data: {
|
|
4067
|
+
farmId: string;
|
|
4068
|
+
tier: string;
|
|
4069
|
+
subscriptionId: string;
|
|
4070
|
+
};
|
|
4071
|
+
}>;
|
|
4072
|
+
302: z.ZodAny;
|
|
4073
|
+
400: z.ZodObject<{
|
|
4074
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
4075
|
+
id: z.ZodOptional<z.ZodString>;
|
|
4076
|
+
links: z.ZodOptional<z.ZodObject<{
|
|
4077
|
+
about: z.ZodOptional<z.ZodString>;
|
|
4078
|
+
}, "strip", z.ZodTypeAny, {
|
|
4079
|
+
about?: string | undefined;
|
|
4080
|
+
}, {
|
|
4081
|
+
about?: string | undefined;
|
|
4082
|
+
}>>;
|
|
4083
|
+
status: z.ZodOptional<z.ZodString>;
|
|
4084
|
+
code: z.ZodOptional<z.ZodString>;
|
|
4085
|
+
title: z.ZodOptional<z.ZodString>;
|
|
4086
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
4087
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
4088
|
+
pointer: z.ZodOptional<z.ZodString>;
|
|
4089
|
+
parameter: z.ZodOptional<z.ZodString>;
|
|
4090
|
+
}, "strip", z.ZodTypeAny, {
|
|
4091
|
+
pointer?: string | undefined;
|
|
4092
|
+
parameter?: string | undefined;
|
|
4093
|
+
}, {
|
|
4094
|
+
pointer?: string | undefined;
|
|
4095
|
+
parameter?: string | undefined;
|
|
4096
|
+
}>>;
|
|
4097
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4098
|
+
}, "strip", z.ZodTypeAny, {
|
|
4099
|
+
status?: string | undefined;
|
|
4100
|
+
code?: string | undefined;
|
|
4101
|
+
id?: string | undefined;
|
|
4102
|
+
links?: {
|
|
4103
|
+
about?: string | undefined;
|
|
4104
|
+
} | undefined;
|
|
4105
|
+
meta?: Record<string, unknown> | undefined;
|
|
4106
|
+
title?: string | undefined;
|
|
4107
|
+
detail?: string | undefined;
|
|
4108
|
+
source?: {
|
|
4109
|
+
pointer?: string | undefined;
|
|
4110
|
+
parameter?: string | undefined;
|
|
4111
|
+
} | undefined;
|
|
4112
|
+
}, {
|
|
4113
|
+
status?: string | undefined;
|
|
4114
|
+
code?: string | undefined;
|
|
4115
|
+
id?: string | undefined;
|
|
4116
|
+
links?: {
|
|
4117
|
+
about?: string | undefined;
|
|
4118
|
+
} | undefined;
|
|
4119
|
+
meta?: Record<string, unknown> | undefined;
|
|
4120
|
+
title?: string | undefined;
|
|
4121
|
+
detail?: string | undefined;
|
|
4122
|
+
source?: {
|
|
4123
|
+
pointer?: string | undefined;
|
|
4124
|
+
parameter?: string | undefined;
|
|
4125
|
+
} | undefined;
|
|
4126
|
+
}>, "many">;
|
|
4127
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4128
|
+
}, "strip", z.ZodTypeAny, {
|
|
4129
|
+
errors: {
|
|
4130
|
+
status?: string | undefined;
|
|
4131
|
+
code?: string | undefined;
|
|
4132
|
+
id?: string | undefined;
|
|
4133
|
+
links?: {
|
|
4134
|
+
about?: string | undefined;
|
|
4135
|
+
} | undefined;
|
|
4136
|
+
meta?: Record<string, unknown> | undefined;
|
|
4137
|
+
title?: string | undefined;
|
|
4138
|
+
detail?: string | undefined;
|
|
4139
|
+
source?: {
|
|
4140
|
+
pointer?: string | undefined;
|
|
4141
|
+
parameter?: string | undefined;
|
|
4142
|
+
} | undefined;
|
|
4143
|
+
}[];
|
|
4144
|
+
meta?: Record<string, unknown> | undefined;
|
|
4145
|
+
}, {
|
|
4146
|
+
errors: {
|
|
4147
|
+
status?: string | undefined;
|
|
4148
|
+
code?: string | undefined;
|
|
4149
|
+
id?: string | undefined;
|
|
4150
|
+
links?: {
|
|
4151
|
+
about?: string | undefined;
|
|
4152
|
+
} | undefined;
|
|
4153
|
+
meta?: Record<string, unknown> | undefined;
|
|
4154
|
+
title?: string | undefined;
|
|
4155
|
+
detail?: string | undefined;
|
|
4156
|
+
source?: {
|
|
4157
|
+
pointer?: string | undefined;
|
|
4158
|
+
parameter?: string | undefined;
|
|
4159
|
+
} | undefined;
|
|
4160
|
+
}[];
|
|
4161
|
+
meta?: Record<string, unknown> | undefined;
|
|
4162
|
+
}>;
|
|
4163
|
+
404: z.ZodObject<{
|
|
4164
|
+
errors: z.ZodArray<z.ZodObject<{
|
|
4165
|
+
id: z.ZodOptional<z.ZodString>;
|
|
4166
|
+
links: z.ZodOptional<z.ZodObject<{
|
|
4167
|
+
about: z.ZodOptional<z.ZodString>;
|
|
4168
|
+
}, "strip", z.ZodTypeAny, {
|
|
4169
|
+
about?: string | undefined;
|
|
4170
|
+
}, {
|
|
4171
|
+
about?: string | undefined;
|
|
4172
|
+
}>>;
|
|
4173
|
+
status: z.ZodOptional<z.ZodString>;
|
|
4174
|
+
code: z.ZodOptional<z.ZodString>;
|
|
4175
|
+
title: z.ZodOptional<z.ZodString>;
|
|
4176
|
+
detail: z.ZodOptional<z.ZodString>;
|
|
4177
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
4178
|
+
pointer: z.ZodOptional<z.ZodString>;
|
|
4179
|
+
parameter: z.ZodOptional<z.ZodString>;
|
|
4180
|
+
}, "strip", z.ZodTypeAny, {
|
|
4181
|
+
pointer?: string | undefined;
|
|
4182
|
+
parameter?: string | undefined;
|
|
4183
|
+
}, {
|
|
4184
|
+
pointer?: string | undefined;
|
|
4185
|
+
parameter?: string | undefined;
|
|
4186
|
+
}>>;
|
|
4187
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4188
|
+
}, "strip", z.ZodTypeAny, {
|
|
4189
|
+
status?: string | undefined;
|
|
4190
|
+
code?: string | undefined;
|
|
4191
|
+
id?: string | undefined;
|
|
4192
|
+
links?: {
|
|
4193
|
+
about?: string | undefined;
|
|
4194
|
+
} | undefined;
|
|
4195
|
+
meta?: Record<string, unknown> | undefined;
|
|
4196
|
+
title?: string | undefined;
|
|
4197
|
+
detail?: string | undefined;
|
|
4198
|
+
source?: {
|
|
4199
|
+
pointer?: string | undefined;
|
|
4200
|
+
parameter?: string | undefined;
|
|
4201
|
+
} | undefined;
|
|
4202
|
+
}, {
|
|
4203
|
+
status?: string | undefined;
|
|
4204
|
+
code?: string | undefined;
|
|
4205
|
+
id?: string | undefined;
|
|
4206
|
+
links?: {
|
|
4207
|
+
about?: string | undefined;
|
|
4208
|
+
} | undefined;
|
|
4209
|
+
meta?: Record<string, unknown> | undefined;
|
|
4210
|
+
title?: string | undefined;
|
|
4211
|
+
detail?: string | undefined;
|
|
4212
|
+
source?: {
|
|
4213
|
+
pointer?: string | undefined;
|
|
4214
|
+
parameter?: string | undefined;
|
|
4215
|
+
} | undefined;
|
|
4216
|
+
}>, "many">;
|
|
4217
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4218
|
+
}, "strip", z.ZodTypeAny, {
|
|
4219
|
+
errors: {
|
|
4220
|
+
status?: string | undefined;
|
|
4221
|
+
code?: string | undefined;
|
|
4222
|
+
id?: string | undefined;
|
|
4223
|
+
links?: {
|
|
4224
|
+
about?: string | undefined;
|
|
4225
|
+
} | undefined;
|
|
4226
|
+
meta?: Record<string, unknown> | undefined;
|
|
4227
|
+
title?: string | undefined;
|
|
4228
|
+
detail?: string | undefined;
|
|
4229
|
+
source?: {
|
|
4230
|
+
pointer?: string | undefined;
|
|
4231
|
+
parameter?: string | undefined;
|
|
4232
|
+
} | undefined;
|
|
4233
|
+
}[];
|
|
4234
|
+
meta?: Record<string, unknown> | undefined;
|
|
4235
|
+
}, {
|
|
4236
|
+
errors: {
|
|
4237
|
+
status?: string | undefined;
|
|
4238
|
+
code?: string | undefined;
|
|
4239
|
+
id?: string | undefined;
|
|
4240
|
+
links?: {
|
|
4241
|
+
about?: string | undefined;
|
|
4242
|
+
} | undefined;
|
|
4243
|
+
meta?: Record<string, unknown> | undefined;
|
|
4244
|
+
title?: string | undefined;
|
|
4245
|
+
detail?: string | undefined;
|
|
4246
|
+
source?: {
|
|
4247
|
+
pointer?: string | undefined;
|
|
4248
|
+
parameter?: string | undefined;
|
|
4249
|
+
} | undefined;
|
|
4250
|
+
}[];
|
|
4251
|
+
meta?: Record<string, unknown> | undefined;
|
|
4252
|
+
}>;
|
|
4253
|
+
};
|
|
4254
|
+
};
|
|
4023
4255
|
};
|
|
4024
4256
|
//# sourceMappingURL=subscriptions.routes.d.ts.map
|
|
@@ -1 +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;AAmBxB,eAAO,MAAM,mBAAmB
|
|
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;AAmBxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmO9B,CAAC"}
|
|
@@ -172,7 +172,6 @@ export const subscriptionsRouter = c.router({
|
|
|
172
172
|
summary: 'Get current usage',
|
|
173
173
|
description: 'Get current usage for a specific resource type in the current period',
|
|
174
174
|
},
|
|
175
|
-
// Verify and activate subscription after payment
|
|
176
175
|
verifyAndActivateSubscription: {
|
|
177
176
|
method: 'POST',
|
|
178
177
|
path: '/farms/:farmId/subscriptions/verify-payment',
|
|
@@ -181,7 +180,7 @@ export const subscriptionsRouter = c.router({
|
|
|
181
180
|
data: z.object({
|
|
182
181
|
type: z.literal('subscriptions'),
|
|
183
182
|
attributes: z.object({
|
|
184
|
-
paymentReference: z.string(),
|
|
183
|
+
paymentReference: z.string(),
|
|
185
184
|
}),
|
|
186
185
|
}),
|
|
187
186
|
}),
|
|
@@ -194,4 +193,28 @@ export const subscriptionsRouter = c.router({
|
|
|
194
193
|
summary: 'Verify and activate subscription',
|
|
195
194
|
description: 'Verify payment and automatically upgrade subscription. Typically called after payment redirect or when webhook fails.',
|
|
196
195
|
},
|
|
196
|
+
confirmSubscriptionPayment: {
|
|
197
|
+
method: 'GET',
|
|
198
|
+
path: '/subscriptions/confirm',
|
|
199
|
+
query: z.object({
|
|
200
|
+
trxref: z.string().optional(),
|
|
201
|
+
reference: z.string().optional(),
|
|
202
|
+
}),
|
|
203
|
+
responses: {
|
|
204
|
+
200: z.object({
|
|
205
|
+
status: z.literal('success'),
|
|
206
|
+
message: z.string(),
|
|
207
|
+
data: z.object({
|
|
208
|
+
subscriptionId: z.string().uuid(),
|
|
209
|
+
farmId: z.string().uuid(),
|
|
210
|
+
tier: z.string(),
|
|
211
|
+
}),
|
|
212
|
+
}),
|
|
213
|
+
302: z.any(),
|
|
214
|
+
400: jsonApiErrorResponseSchema,
|
|
215
|
+
404: jsonApiErrorResponseSchema,
|
|
216
|
+
},
|
|
217
|
+
summary: 'Confirm subscription payment',
|
|
218
|
+
description: 'Public endpoint for payment gateway redirect callback. Verifies payment and activates subscription. Redirects to success page or returns JSON response.',
|
|
219
|
+
},
|
|
197
220
|
});
|