ComfortSearchSet in VehicleType, ComfortSearchSet komplett redundant #5

Open
opened 2024-06-10 13:54:07 +02:00 by Daniel_Hassert · 0 comments
Member

Update 18.06.

ComfortSearchSets kann komplett entfallen, da die gleichen Infos über /Filters abgerufen werden können. Siehe Issue Redundante Models

Damit ist alles folgenden nichtig.

ComfortSearchSets in VehicleType ist nicht intuitiv.

Aktuell wäre halt ComfortSearchSets versteckt in VehicleTypes. Der Aufbau setzt Wissen voraus. Besser wäre es andersrum zu gestalten, sodass VehicleType ein "sauberes" Model hat und damit auch exakt gleich zu allen anderen in Filter aufgezählten Eigenschaften ist.

Dann kann im ComfortSearchSet die Eigenschaft VehicleTypes die zugeordneten Typen haben. Daraus ergibt sich dann so ungefähr folgendes (evtl. unvollständig):

Implementierung Model Aktuell

export interface VehicleType { 
    Guid: string;
    Designation: string;
    ComfortSearchSets: Array<{ 
      Designation: string;
      Type: string;
    }> | null;
}

Ziel/Vorschlag:

export interface ComfortSearchSet { 
    Guid: string;
    Designation: string;
    VehicleTypes: Array<VehicleType>;
}

export interface VehicleType { 
    Guid: string;
    Designation: string;
}

Doku Aktuell

VehicleType:
    type: "object"
    required:
        - "Guid"
        - "Designation"
    properties:
        Guid:
            type: "string"
        Designation:
            type: "string"
        ComfortSearchSets:
            type: "array"
            items:
                type: "object"
                required:
                    - "Designation"
                    - "Type"
                properties:
                    Designation:
                        type: "string"
                    Type:
                        type: "string"

Vorschlag:

/VehicleTypes:
  get:
    tags:
    - "Filters"
    parameters:
    - $ref: "#/components/parameters/GuidOnlineService"
    - $ref: "#/components/parameters/RequiredGuidMaterialType"
    responses:
        200:
          description: "successful operation"
          content:
            application/json:
            schema:
              type: "array"
              items:
                $ref: "#/components/schemas/VehicleType"
        default:
          $ref: "#/components/responses/GenericError"
    security: 
    - SessionScheme: []

/ComfortSearchSets:
  get:
    parameters:
    - $ref: "#/components/parameters/GuidOnlineService"
    - name: "VehicleTypes"
      in: "query"
      required: true
      schema:
        type: "array"
        items:
          type: "string"
          format: "uuid"
    responses:
        200:
          description: "successful operation"
          content:
            application/json:
            schema:
              type: "array"
              items:
                $ref: "#/components/schemas/ComfortSearchSet"
        default:
          $ref: "#/components/responses/GenericError"
    security: 
    - SessionScheme: []
ComfortSearchSet:
  type: "object"
  required:
    - "Designation"
    - "VehicleTypes"
  properties:
    Designation:
      type: "string"
    VehicleTypes:
      type: "array"
      items: 
        $ref: "#/components/schemas/VehicleType"

VehicleType:
  type: "object"
  required:
    - "Guid"
    - "Designation"
  properties:
    Guid:
      type: "string"
    Designation:
      type: "string"

## Update 18.06. `ComfortSearchSets` kann komplett entfallen, da die gleichen Infos über `/Filters` abgerufen werden können. Siehe Issue [Redundante Models](https://git.prod.rz2.prm-ag.de/PRM_Software_AG/api-documentation/issues/6) Damit ist alles folgenden nichtig. ## ComfortSearchSets in VehicleType ist nicht intuitiv. Aktuell wäre halt `ComfortSearchSets` versteckt in `VehicleTypes`. Der Aufbau setzt Wissen voraus. Besser wäre es andersrum zu gestalten, sodass `VehicleType` ein "sauberes" Model hat und damit auch exakt gleich zu allen anderen in `Filter` aufgezählten Eigenschaften ist. Dann kann im `ComfortSearchSet` die Eigenschaft `VehicleTypes` die zugeordneten Typen haben. Daraus ergibt sich dann so ungefähr folgendes (evtl. unvollständig): ## Implementierung Model Aktuell ```typescript export interface VehicleType { Guid: string; Designation: string; ComfortSearchSets: Array<{ Designation: string; Type: string; }> | null; } ``` ### Ziel/Vorschlag: ```typescript export interface ComfortSearchSet { Guid: string; Designation: string; VehicleTypes: Array<VehicleType>; } export interface VehicleType { Guid: string; Designation: string; } ``` ## Doku Aktuell ```yaml VehicleType: type: "object" required: - "Guid" - "Designation" properties: Guid: type: "string" Designation: type: "string" ComfortSearchSets: type: "array" items: type: "object" required: - "Designation" - "Type" properties: Designation: type: "string" Type: type: "string" ``` ### Vorschlag: ```yaml /VehicleTypes: get: tags: - "Filters" parameters: - $ref: "#/components/parameters/GuidOnlineService" - $ref: "#/components/parameters/RequiredGuidMaterialType" responses: 200: description: "successful operation" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/VehicleType" default: $ref: "#/components/responses/GenericError" security: - SessionScheme: [] /ComfortSearchSets: get: parameters: - $ref: "#/components/parameters/GuidOnlineService" - name: "VehicleTypes" in: "query" required: true schema: type: "array" items: type: "string" format: "uuid" responses: 200: description: "successful operation" content: application/json: schema: type: "array" items: $ref: "#/components/schemas/ComfortSearchSet" default: $ref: "#/components/responses/GenericError" security: - SessionScheme: [] ``` ```yaml ComfortSearchSet: type: "object" required: - "Designation" - "VehicleTypes" properties: Designation: type: "string" VehicleTypes: type: "array" items: $ref: "#/components/schemas/VehicleType" VehicleType: type: "object" required: - "Guid" - "Designation" properties: Guid: type: "string" Designation: type: "string" ```
Daniel_Hassert added a new dependency 2024-06-18 15:05:33 +02:00
Daniel_Hassert changed title from ComfortSearchSet in VehicleType to ComfortSearchSet in VehicleType, ComfortSearchSet komplett redundant 2024-06-18 15:07:19 +02:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Depends on
#8 Redundante Parameter für Endpunkte in Doku
PRM_Software_AG/api-documentation
Reference: PRM_Software_AG/api-documentation#5
No description provided.