Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 157 additions & 0 deletions backend/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,54 @@ const docTemplate = `{
}
}
},
"/api/v1/trip-invites/{code}/join": {
"post": {
"description": "Adds the authenticated user to a trip using an invite code",
"produces": [
"application/json"
],
"tags": [
"memberships"
],
"summary": "Join trip by invite code",
"operationId": "joinTripByInvite",
"parameters": [
{
"type": "string",
"description": "Invite code",
"name": "code",
"in": "path",
"required": true
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/models.Membership"
}
},
"400": {
"description": "Invalid or expired invite code",
"schema": {
"$ref": "#/definitions/errs.APIError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/errs.APIError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/errs.APIError"
}
}
}
}
},
"/api/v1/trips": {
"get": {
"description": "Retrieves trips with cursor-based pagination. Use limit and cursor query params.",
Expand Down Expand Up @@ -876,6 +924,78 @@ const docTemplate = `{
}
}
},
"/api/v1/trips/{tripID}/invites": {
"post": {
"description": "Creates a shareable invite for the trip. Caller must be a trip member.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"trips"
],
"summary": "Create a trip invite",
"operationId": "createTripInvite",
"parameters": [
{
"type": "string",
"description": "Trip ID",
"name": "tripID",
"in": "path",
"required": true
},
{
"description": "Optional expires_at; default 7 days",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.CreateTripInviteRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/models.TripInviteAPIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/errs.APIError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/errs.APIError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/errs.APIError"
}
},
"422": {
"description": "Unprocessable Entity",
"schema": {
"$ref": "#/definitions/errs.APIError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/errs.APIError"
}
}
}
}
},
"/api/v1/trips/{tripID}/memberships": {
"get": {
"description": "Retrieves all members of a trip",
Expand Down Expand Up @@ -1783,6 +1903,14 @@ const docTemplate = `{
}
}
},
"models.CreateTripInviteRequest": {
"type": "object",
"properties": {
"expires_at": {
"type": "string"
}
}
},
"models.CreateTripRequest": {
"type": "object",
"required": [
Expand Down Expand Up @@ -2171,6 +2299,35 @@ const docTemplate = `{
}
}
},
"models.TripInviteAPIResponse": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"created_at": {
"type": "string"
},
"created_by": {
"type": "string"
},
"expires_at": {
"type": "string"
},
"id": {
"type": "string"
},
"is_revoked": {
"type": "boolean"
},
"join_url": {
"type": "string"
},
"trip_id": {
"type": "string"
}
}
},
"models.UpdateCommentRequest": {
"type": "object",
"required": [
Expand Down
157 changes: 157 additions & 0 deletions backend/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,54 @@
}
}
},
"/api/v1/trip-invites/{code}/join": {
"post": {
"description": "Adds the authenticated user to a trip using an invite code",
"produces": [
"application/json"
],
"tags": [
"memberships"
],
"summary": "Join trip by invite code",
"operationId": "joinTripByInvite",
"parameters": [
{
"type": "string",
"description": "Invite code",
"name": "code",
"in": "path",
"required": true
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/models.Membership"
}
},
"400": {
"description": "Invalid or expired invite code",
"schema": {
"$ref": "#/definitions/errs.APIError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/errs.APIError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/errs.APIError"
}
}
}
}
},
"/api/v1/trips": {
"get": {
"description": "Retrieves trips with cursor-based pagination. Use limit and cursor query params.",
Expand Down Expand Up @@ -870,6 +918,78 @@
}
}
},
"/api/v1/trips/{tripID}/invites": {
"post": {
"description": "Creates a shareable invite for the trip. Caller must be a trip member.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"trips"
],
"summary": "Create a trip invite",
"operationId": "createTripInvite",
"parameters": [
{
"type": "string",
"description": "Trip ID",
"name": "tripID",
"in": "path",
"required": true
},
{
"description": "Optional expires_at; default 7 days",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.CreateTripInviteRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/models.TripInviteAPIResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/errs.APIError"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/errs.APIError"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/errs.APIError"
}
},
"422": {
"description": "Unprocessable Entity",
"schema": {
"$ref": "#/definitions/errs.APIError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/errs.APIError"
}
}
}
}
},
"/api/v1/trips/{tripID}/memberships": {
"get": {
"description": "Retrieves all members of a trip",
Expand Down Expand Up @@ -1777,6 +1897,14 @@
}
}
},
"models.CreateTripInviteRequest": {
"type": "object",
"properties": {
"expires_at": {
"type": "string"
}
}
},
"models.CreateTripRequest": {
"type": "object",
"required": [
Expand Down Expand Up @@ -2165,6 +2293,35 @@
}
}
},
"models.TripInviteAPIResponse": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"created_at": {
"type": "string"
},
"created_by": {
"type": "string"
},
"expires_at": {
"type": "string"
},
"id": {
"type": "string"
},
"is_revoked": {
"type": "boolean"
},
"join_url": {
"type": "string"
},
"trip_id": {
"type": "string"
}
}
},
"models.UpdateCommentRequest": {
"type": "object",
"required": [
Expand Down
Loading
Loading