Skip to content

Commit a1b9d9a

Browse files
committed
feat: add new DTOs and OpenAPI specifications for order management
- Introduced OrderQueryDto, AssuranceOrderDto, ConsignOrderDto, SoldOrderStatDto, TravelDateNumberDto, and WaitListOrderDto to enhance order management capabilities. - Updated schemas.yaml files to include new DTO definitions and their properties. - Created OpenAPI specifications for the Order Query Service and Order Service, detailing endpoints for querying and managing orders, consignments, and food orders.
1 parent c28dfe3 commit a1b9d9a

File tree

4 files changed

+1087
-4
lines changed

4 files changed

+1087
-4
lines changed

ts-client-sdk/src/main/java/edu/fudan/common/client/dto/order/schemas.yaml

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,38 @@ components:
7171
price:
7272
type: string
7373
description: Ticket price as string to preserve formatting.
74+
OrderQueryDto:
75+
type: object
76+
description: Query payload used by the order-query service to filter orders.
77+
properties:
78+
loginId:
79+
type: string
80+
description: Account identifier issuing the query.
81+
travelDateStart:
82+
type: string
83+
description: Inclusive travel date lower bound (yyyy-MM-dd).
84+
travelDateEnd:
85+
type: string
86+
description: Exclusive travel date upper bound (yyyy-MM-dd).
87+
boughtDateStart:
88+
type: string
89+
description: Inclusive purchase date lower bound (yyyy-MM-dd).
90+
boughtDateEnd:
91+
type: string
92+
description: Exclusive purchase date upper bound (yyyy-MM-dd).
93+
state:
94+
type: integer
95+
format: int32
96+
description: Target order status when state filtering is enabled.
97+
enableTravelDateQuery:
98+
type: boolean
99+
description: Enables travel date filtering when true.
100+
enableBoughtDateQuery:
101+
type: boolean
102+
description: Enables purchase date filtering when true.
103+
enableStateQuery:
104+
type: boolean
105+
description: Enables status filtering when true.
74106
OrderInfoDto:
75107
type: object
76108
description: Request payload for querying orders with optional filters.
@@ -277,22 +309,27 @@ components:
277309
required:
278310
- orderId
279311
- typeIndex
280-
AssuranceDto:
312+
AssuranceOrderDto:
281313
type: object
282-
description: Assurance record with resolved type metadata.
314+
description: Assurance order details enriched with assurance type metadata.
283315
properties:
284316
id:
285317
type: string
318+
description: Assurance order identifier.
286319
orderId:
287320
type: string
321+
description: Ticket order identifier that the assurance binds to.
288322
typeIndex:
289323
type: integer
290324
format: int32
325+
description: Assurance type index.
291326
typeName:
292327
type: string
328+
description: Human readable assurance type name.
293329
typePrice:
294330
type: number
295331
format: double
332+
description: Price of the selected assurance type.
296333
required:
297334
- id
298335
- orderId
@@ -357,6 +394,49 @@ components:
357394
type: number
358395
format: double
359396
description: Calculated consign price (available in responses).
397+
ConsignOrderDto:
398+
type: object
399+
description: Consign order record exposed by order-service and order-query-service.
400+
properties:
401+
id:
402+
type: string
403+
description: Consign order identifier.
404+
orderId:
405+
type: string
406+
description: Ticket order identifier associated with the consign record.
407+
userId:
408+
type: string
409+
description: Account identifier that submitted the consign request.
410+
handleDate:
411+
type: string
412+
description: Date when the consign handling starts (yyyy-MM-dd).
413+
targetDate:
414+
type: string
415+
description: Intended delivery date (yyyy-MM-dd).
416+
from:
417+
type: string
418+
description: Consign origin location.
419+
to:
420+
type: string
421+
description: Consign destination location.
422+
consignee:
423+
type: string
424+
description: Recipient name.
425+
phone:
426+
type: string
427+
description: Recipient phone number.
428+
weight:
429+
type: number
430+
format: double
431+
description: Package weight in kilograms.
432+
within:
433+
type: boolean
434+
description: Whether the consign is handled within a region.
435+
price:
436+
type: number
437+
format: double
438+
nullable: true
439+
description: Calculated consign price when available.
360440
GetConsignOrdersByUserIdDto:
361441
type: object
362442
description: Request payload body for querying consign orders by user id.

ts-client-sdk/src/main/java/edu/fudan/common/client/dto/schemas.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ components:
3030
# --- Order DTO Schema ---
3131
OrderDto:
3232
$ref: 'order/schemas.yaml#/components/schemas/OrderDto'
33+
OrderQueryDto:
34+
$ref: 'order/schemas.yaml#/components/schemas/OrderQueryDto'
3335
FoodOrderDto:
3436
$ref: 'order/schemas.yaml#/components/schemas/FoodOrderDto'
3537
ModifyOrderStatusDto:
@@ -38,12 +40,14 @@ components:
3840
$ref: 'order/schemas.yaml#/components/schemas/UpdateAssuranceOrderTypeDto'
3941
CreateAssuranceOrderDto:
4042
$ref: 'order/schemas.yaml#/components/schemas/CreateAssuranceOrderDto'
41-
AssuranceDto:
42-
$ref: 'order/schemas.yaml#/components/schemas/AssuranceDto'
43+
AssuranceOrderDto:
44+
$ref: 'order/schemas.yaml#/components/schemas/AssuranceOrderDto'
4345
AssuranceTypeDto:
4446
$ref: 'order/schemas.yaml#/components/schemas/AssuranceTypeDto'
4547
ConsignDto:
4648
$ref: 'order/schemas.yaml#/components/schemas/ConsignDto'
49+
ConsignOrderDto:
50+
$ref: 'order/schemas.yaml#/components/schemas/ConsignOrderDto'
4751
ConsignPriceDto:
4852
$ref: 'order/schemas.yaml#/components/schemas/ConsignPriceDto'
4953
ConsignPriceQueryDto:
@@ -52,6 +56,12 @@ components:
5256
$ref: 'order/schemas.yaml#/components/schemas/GetConsignOrdersByUserIdDto'
5357
GetConsignOrdersByConsigneeDto:
5458
$ref: 'order/schemas.yaml#/components/schemas/GetConsignOrdersByConsigneeDto'
59+
SoldOrderStatDto:
60+
$ref: 'order/schemas.yaml#/components/schemas/SoldOrderStatDto'
61+
TravelDateNumberDto:
62+
$ref: 'order/schemas.yaml#/components/schemas/TravelDateNumberDto'
63+
WaitListOrderDto:
64+
$ref: 'order/schemas.yaml#/components/schemas/WaitListOrderDto'
5565

5666
# --- User DTO Schema ---
5767
UserDto:

0 commit comments

Comments
 (0)