2025-01-13 20:38:47 +00:00
|
|
|
# Copyright (C) 2024 Manuel Bustillo
|
|
|
|
|
2025-01-13 21:37:02 +01:00
|
|
|
# Copyright (C) 2024-2025 LibreWeddingPlanner contributors
|
2024-11-30 13:27:21 +00:00
|
|
|
|
2024-12-28 18:37:47 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2024-11-30 14:24:02 +01:00
|
|
|
module Swagger
|
|
|
|
module Schema
|
|
|
|
USER = {
|
|
|
|
id: { type: :string, format: :uuid },
|
2024-12-08 11:30:38 +01:00
|
|
|
email: { type: :string, format: :email },
|
|
|
|
created_at: SwaggerResponseHelper::TIMESTAMP,
|
|
|
|
updated_at: SwaggerResponseHelper::TIMESTAMP
|
2024-12-28 17:49:00 +01:00
|
|
|
}.freeze
|
2024-12-08 11:30:38 +01:00
|
|
|
|
2024-12-28 17:49:00 +01:00
|
|
|
ID = { # rubocop:disable Style/MutableConstant -- rswag modifies in: :path parameters
|
2024-12-08 14:00:53 +01:00
|
|
|
name: 'id',
|
|
|
|
in: :path,
|
|
|
|
type: :string,
|
2024-12-28 17:49:00 +01:00
|
|
|
format: :uuid
|
2024-12-08 14:00:53 +01:00
|
|
|
}
|
|
|
|
|
2024-12-08 11:30:38 +01:00
|
|
|
GROUP = {
|
|
|
|
name: { type: :string },
|
|
|
|
icon: { type: :string, example: 'pi pi-crown', description: 'The CSS classes used by the icon' },
|
|
|
|
parent_id: { type: :string, format: :uuid },
|
|
|
|
color: { type: :string, pattern: '^#(?:[0-9a-fA-F]{3}){1,2}$' }
|
2024-12-28 17:49:00 +01:00
|
|
|
}.freeze
|
2024-11-30 19:57:08 +01:00
|
|
|
|
2024-12-09 19:28:32 +01:00
|
|
|
EXPENSE = {
|
|
|
|
name: { type: :string },
|
|
|
|
amount: { type: :number, minimum: 0 },
|
|
|
|
pricing_type: { type: :string, enum: Expense.pricing_types.keys }
|
2024-12-28 17:49:00 +01:00
|
|
|
}.freeze
|
2024-12-09 19:28:32 +01:00
|
|
|
|
2024-12-28 17:49:00 +01:00
|
|
|
SLUG = { # rubocop:disable Style/MutableConstant -- rswag modifies in: :path parameters
|
2024-11-30 19:57:08 +01:00
|
|
|
name: 'slug',
|
|
|
|
in: :path,
|
2024-12-28 17:49:00 +01:00
|
|
|
type: :string,
|
2024-12-01 18:17:07 +01:00
|
|
|
pattern: Wedding::SLUG_REGEX,
|
2024-11-30 19:57:08 +01:00
|
|
|
example: :default,
|
|
|
|
description: 'Wedding slug'
|
|
|
|
}
|
2024-12-01 19:56:49 +01:00
|
|
|
|
|
|
|
CAPTCHA = {
|
|
|
|
captcha: {
|
|
|
|
type: :object,
|
|
|
|
required: %i[id answer],
|
|
|
|
properties: {
|
|
|
|
id: { type: :string, format: :uuid },
|
|
|
|
answer: { type: :string }
|
|
|
|
}
|
|
|
|
}
|
2024-12-28 17:49:00 +01:00
|
|
|
}.freeze
|
2024-11-30 14:24:02 +01:00
|
|
|
end
|
2024-12-28 17:49:00 +01:00
|
|
|
end
|