Delete auction
DELETE/company/auction/:service_code
Permanently delete an auction. Only applicable to auctions in 'draft' or 'empty' status.
Allow deletion of unused or erroneously created auctions.
Objective
Maintain a clean database by removing abandoned drafts.
Use Cases
- Delete accidentally created drafts
- Clean up unused empty auctions
- Permanently cancel auctions in preparation
Validations
flowchart TD
A[DELETE Request] --> B{User Authenticated?}
B -->|No| C[401 Unauthorized]
B -->|Yes| D{Auction Exists?}
D -->|No| E[404 Not Found]
D -->|Yes| F{Status = draft or empty?}
F -->|No| G[400 Cannot Delete]
F -->|Yes| H{Has Accepted Bids?}
H -->|Yes| I[400 Has Bids]
H -->|No| J[Delete Auction - 200]
Consequences:
- Permanent deletion of all auction data
- Operation CANNOT be undone
- If it has unaccepted bids, they are also deleted
Restrictions:
- Only 'draft' or 'empty' statuses can be deleted
- Company must be the owner
- Cannot have accepted bids or associated delivery
Request
Responses
- 200
- 400
- 401
- 404
Auction successfully deleted
Invalid operation
Unauthorized - Missing or invalid JWT token
Auction not found.