Add subuser and grant management navigation, expand openapi.yaml with subuser-related definitions, and update permissions in SubuserGrants.vue.

This commit is contained in:
Jeppe Bundgaard
2026-02-11 17:53:54 +01:00
parent c9fee21d24
commit b7bc4ec907
3 changed files with 135 additions and 27 deletions
+115 -25
View File
@@ -1,3 +1,93 @@
openapi: 3.0.3
info:
title: Copenhagen Truck Wash API
description: |
This API provides access to the Copenhagen Truck Wash system, managing orders, bookings,
departments, products, customers, and various integrations including e-conomic, Stripe,
XLVask, and more.
## Authentication
Most endpoints require authentication using a Bearer token obtained from the `/auth/login`
or `/auth/employee/login` endpoints.
## Permissions
Many endpoints require specific permissions that are assigned to user groups/roles.
version: 1.0.0
contact:
name: Copenhagen Truck Wash
email: support@truckwash.dk
servers:
- url: https://api.truckwash.dk
description: Production server
- url: http://localhost
description: Local development server
security:
- BearerAuth: []
tags:
- name: Authentication
description: User and employee authentication endpoints
- name: Users
description: User management and customer operations
- name: Orders
description: Order creation, management, and retrieval
- name: Order Items
description: Managing items within orders
- name: Bookings
description: Booking management for wash services
- name: Departments
description: Department and location management
- name: Products
description: Product catalog and pricing
- name: Categories
description: Product category management
- name: Invoices
description: Invoice generation and management
- name: Payments
description: Payment processing and collection
- name: Vehicles
description: Vehicle registration and management
- name: Notifications
description: System notifications and alerts
- name: Statistics
description: Business analytics and reporting
- name: Modules
description: Third-party integrations and modules
- name: Attachments
description: File upload and attachment management
- name: Forms
description: Form submissions and management
- name: Worker
description: System worker status and maintenance
- name: Plate Scans
description: License plate scanning operations
- name: Config
description: Module configuration management
- name: Branding
description: Branding options management
- name: Roles
description: Role and permission management
- name: Self-Serve
description: Self-serve lane operations and questions
- name: Goals
description: Department goals management
- name: Subusers
description: Subuser registration and setup
paths:
# Subusers (public registration + setup)
/subusers:
post:
tags:
- Subusers
summary: Create a subuser registration
description: |
Creates a subuser (driver) account using a company's CVR and a phone number. Validates the
CVR via e-conomic, ensures the phone number is not already in use, and if SMS is enabled
sends a setup link by SMS for the user to complete registration.
operationId: createSubuser
security: []
requestBody:
required: true
content:
@@ -5861,6 +5951,31 @@ components:
display_name:
type: string
description: User's display name
group_id:
type: integer
description: User group/role ID
phone_country_code:
type: integer
description: Phone country code
phone:
type: integer
description: Phone number
email:
type: string
format: email
description: Email address
sms_notifications_enabled:
type: boolean
description: SMS notifications enabled
email_notifications_enabled:
type: boolean
description: Email notifications enabled
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
SubuserGrant:
type: object
properties:
@@ -5962,31 +6077,6 @@ components:
type: array
items:
$ref: '#/components/schemas/PermissionNode'
group_id:
type: integer
description: User group/role ID
phone_country_code:
type: integer
description: Phone country code
phone:
type: integer
description: Phone number
email:
type: string
format: email
description: Email address
sms_notifications_enabled:
type: boolean
description: SMS notifications enabled
email_notifications_enabled:
type: boolean
description: Email notifications enabled
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
UserCreate:
type: object