- Configure project metadata and dependencies - Setup Vite with React and TypeScript - Add environment configuration and .gitignore - Implement initial application entry point and assets
137 lines
3.5 KiB
YAML
137 lines
3.5 KiB
YAML
openapi: 3.0.0
|
|
info:
|
|
title: Canina Iran API
|
|
description: API Documentation for Canina Iran Pet Health & Supplement Platform
|
|
version: 1.0.0
|
|
servers:
|
|
- url: https://api.canina.ir/v1
|
|
description: Production Server
|
|
|
|
paths:
|
|
/auth/login:
|
|
post:
|
|
summary: User Login
|
|
tags: [Auth]
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
mobile: { type: string }
|
|
role: { type: string, enum: [User_PetOwner, User_Partner] }
|
|
responses:
|
|
200:
|
|
description: Successful Login
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
token: { type: string }
|
|
user: { $ref: '#/components/schemas/UserProfile' }
|
|
|
|
/products:
|
|
get:
|
|
summary: List Products
|
|
tags: [Products]
|
|
parameters:
|
|
- name: category
|
|
in: query
|
|
schema: { type: string }
|
|
- name: petType
|
|
in: query
|
|
schema: { type: string, enum: [سگ, گربه, all] }
|
|
- name: query
|
|
in: query
|
|
schema: { type: string }
|
|
responses:
|
|
200:
|
|
description: List of products
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: array
|
|
items: { $ref: '#/components/schemas/Product' }
|
|
|
|
/pets:
|
|
post:
|
|
summary: Register new pet
|
|
tags: [Pets]
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema: { $ref: '#/components/schemas/PetProfile' }
|
|
responses:
|
|
201:
|
|
description: Pet created
|
|
content:
|
|
application/json:
|
|
schema: { $ref: '#/components/schemas/PetProfile' }
|
|
|
|
/orders:
|
|
post:
|
|
summary: Place an order
|
|
tags: [Orders]
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
items:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
productId: { type: string }
|
|
quantity: { type: integer }
|
|
charityDonation: { type: number }
|
|
petId: { type: string }
|
|
responses:
|
|
201:
|
|
description: Order placed
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
orderId: { type: string }
|
|
trackingNumber: { type: string }
|
|
|
|
components:
|
|
schemas:
|
|
UserProfile:
|
|
type: object
|
|
properties:
|
|
firstName: { type: string }
|
|
lastName: { type: string }
|
|
email: { type: string }
|
|
walletBalance: { type: number }
|
|
charityDonationTotal: { type: number }
|
|
|
|
PetProfile:
|
|
type: object
|
|
properties:
|
|
name: { type: string }
|
|
type: { type: string, enum: [سگ, گربه] }
|
|
breed: { type: string }
|
|
age: { type: number }
|
|
weight: { type: number }
|
|
activityLevel: { type: string }
|
|
medicalConditions:
|
|
type: array
|
|
items: { type: string }
|
|
|
|
Product:
|
|
type: object
|
|
properties:
|
|
id: { type: string }
|
|
name: { type: string }
|
|
priceValue: { type: number }
|
|
category: { type: string }
|
|
artNo: { type: string }
|