---
openapi: 3.0.3
info:
  title: sap-salesforce-integration API
  version: RC-1.0.0
paths:
  /api/account:
    post:
      tags:
      - Account Controller
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountDto'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: string
  /api/asset:
    post:
      tags:
      - Asset Controller
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssetDto'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: string
  /api/asset/sendAssetToSap:
    post:
      tags:
      - Asset Controller
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssetFromSFDto'
      responses:
        "200":
          description: OK
        "401":
          description: Not Authorized
        "403":
          description: Not Allowed
      security:
      - SecurityScheme:
        - '**'
  /api/case:
    post:
      tags:
      - Case Controller
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CaseDto'
      responses:
        "200":
          description: OK
          content:
            text/plain:
              schema:
                type: string
  /api/product:
    post:
      tags:
      - Product Controller
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductDto'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: string
  /api/product/infaPostCommunication:
    post:
      tags:
      - Master Data Controller
      requestBody:
        content:
          application/json:
            schema:
              type: string
      responses:
        "201":
          description: Created
  /api/product/sapCommunication:
    post:
      tags:
      - Master Data Controller
      requestBody:
        content:
          application/json:
            schema:
              type: string
      responses:
        "200":
          description: OK
  /login:
    post:
      tags:
      - Salesforce Login Controller
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LoginRequestFromSalesforce'
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LoginResponseFromKeycloak'
components:
  schemas:
    AccountDto:
      type: object
      properties:
        ParentId:
          type: string
          xml:
            name: ParentId
        Name:
          type: string
          xml:
            name: Name
        Account_Active__c:
          type: boolean
          xml:
            name: Account_Active__c
        CurrencyIsoCode:
          type: string
          xml:
            name: CurrencyIsoCode
        Client_SAP__c:
          type: string
          xml:
            name: Client_SAP__c
        VAT_Number__c:
          type: string
          xml:
            name: VAT_Number__c
        DV_Tax_Number_2__c:
          type: string
          xml:
            name: DV_Tax_Number_2__c
        Client_Group__c:
          type: string
          xml:
            name: Client_Group__c
        RFC_TAX_Number_1__c:
          type: string
          xml:
            name: RFC_TAX_Number_1__c
        RUC_Tax_Number_5__c:
          type: string
          xml:
            name: RUC_Tax_Number_5__c
        Tax_Number_3__c:
          type: string
          xml:
            name: Tax_Number_3__c
        Tax_Number_4__c:
          type: string
          xml:
            name: Tax_Number_4__c
        Tax_Number_6__c:
          type: string
          xml:
            name: Tax_Number_6__c
        Continent__c:
          type: string
          xml:
            name: Continent__c
        City__c:
          type: string
          xml:
            name: City__c
        Country__c:
          type: string
          xml:
            name: Country__c
        Functional_Location__c:
          type: string
          xml:
            name: Functional_Location__c
        Post_Code__c:
          type: string
          xml:
            name: Post_Code__c
        Province__c:
          type: string
          xml:
            name: Province__c
        Region__c:
          type: string
          xml:
            name: Region__c
        BillingCountry:
          type: string
          xml:
            name: BillingCountry
        BillingCity:
          type: string
          xml:
            name: BillingCity
        BillingState:
          type: string
          xml:
            name: BillingState
        BillingPostalCode:
          type: string
          xml:
            name: BillingPostalCode
        BillingStreet:
          type: string
          xml:
            name: BillingStreet
        ShippingCountry:
          type: string
          xml:
            name: ShippingCountry
        ShippingCity:
          type: string
          xml:
            name: ShippingCity
        ShippingState:
          type: string
          xml:
            name: ShippingState
        ShippingPostalCode:
          type: string
          xml:
            name: ShippingPostalCode
        ShippingStreet:
          type: string
          xml:
            name: ShippingStreet
        RecordTypeId:
          type: string
          xml:
            name: RecordTypeId
        Location__c:
          type: string
          xml:
            name: Location__c
      xml:
        name: Account
    AssetDto:
      type: object
      properties:
        AccountId:
          type: string
          xml:
            name: AccountId
        Name:
          type: string
          xml:
            name: Name
        SerialNumber:
          type: string
          xml:
            name: SerialNumber
        Equipment_Number__c:
          type: string
          xml:
            name: Equipment_Number__c
        ParentId:
          type: string
          xml:
            name: ParentId
        Product2Id:
          type: string
          xml:
            name: Product2Id
        Factory_Number__c:
          type: string
          xml:
            name: Factory_Number__c
        RecordTypeId:
          type: string
          xml:
            name: RecordTypeId
        Parent_Asset_Serial_Number__c:
          type: string
          xml:
            name: Parent_Asset_Serial_Number__c
        Parent_Asset_Product_Code__c:
          type: string
          xml:
            name: Parent_Asset_Product_Code__c
        Parent_Asset_Equipment_Number__c:
          type: string
          xml:
            name: Parent_Asset_Equipment_Number__c
        Functional_Location__c:
          type: string
          xml:
            name: Functional_Location__c
        End_Warranty__c:
          type: string
          xml:
            name: End_Warranty__c
        Asset_Name_Bulgarian__c:
          type: string
          xml:
            name: Asset_Name_Bulgarian__c
        Asset_Name_Czech__c:
          type: string
          xml:
            name: Asset_Name_Czech__c
        Asset_Name_ESP__c:
          type: string
          xml:
            name: Asset_Name_ESP__c
        Asset_Name_Romanian__c:
          type: string
          xml:
            name: Asset_Name_Romanian__c
        Asset_Name_Serbian_SH__c:
          type: string
          xml:
            name: Asset_Name_Serbian_SH__c
        Asset_Name_Serbian_SP__c:
          type: string
          xml:
            name: Asset_Name_Serbian_SP__c
        Equipment_Number_SAP__c:
          type: string
          xml:
            name: Equipment_Number_SAP__c
      xml:
        name: Equipment
    AssetFromSFDto:
      type: object
      properties:
        Assets:
          type: array
          items:
            $ref: '#/components/schemas/AssetDto'
    CaseDto:
      type: object
      properties:
        SAP_Notification_Number__c:
          type: string
          xml:
            name: SAP_Notification_Number__c
        Description:
          type: string
        Subject:
          type: string
          xml:
            name: Subject
        Nofitication_type__c:
          type: string
          xml:
            name: Nofitication_type__c
        Priority:
          type: string
        AccountId:
          type: string
          xml:
            name: AccountId
        Comments:
          type: string
          xml:
            name: Comments
        Origin:
          type: string
          xml:
            name: Origin
        RecordTypeId:
          type: string
          xml:
            name: RecordTypeId
        IsClosedOnCreate:
          type: boolean
          xml:
            name: IsClosedOnCreate
        Is_it_DVLM__c:
          type: boolean
          xml:
            name: Is_it_DVLM__c
        notified__c:
          type: boolean
          xml:
            name: notified__c
        Status:
          type: string
          xml:
            name: Status
        Items:
          allOf:
          - $ref: '#/components/schemas/ItemsDto'
          - xml:
              name: Items
      xml:
        name: Case
    ItemDto:
      type: object
      properties:
        asset__c:
          type: string
          xml:
            name: asset__c
        Case__c:
          type: string
          xml:
            name: Case__c
        Sales_Order_SAP__c:
          type: string
          xml:
            name: Sales_Order_SAP__c
    ItemsDto:
      type: object
      properties:
        Item:
          type: array
          items:
            $ref: '#/components/schemas/ItemDto'
          xml:
            name: Item
    LoginRequestFromSalesforce:
      type: object
      properties:
        grantType:
          type: string
        clientId:
          type: string
        clientSecret:
          type: string
        username:
          type: string
        password:
          type: string
    LoginResponseFromKeycloak:
      type: object
      properties:
        accessToken:
          type: string
        expiresIn:
          format: int64
          type: integer
        tokenType:
          type: string
    ProductDto:
      type: object
      properties:
        Name:
          type: string
          xml:
            name: Name
        ProductCode:
          type: string
          xml:
            name: ProductCode
        QuantityUnitOfMeasure:
          type: string
          xml:
            name: QuantityUnitOfMeasure
        isActive:
          type: boolean
        Product_Name_Serbian_SR__c:
          type: string
          xml:
            name: Product_Name_Serbian_SR__c
        Product_Name_Serbian_SH__c:
          type: string
          xml:
            name: Product_Name_Serbian_SH__c
        Product_Name_RO__c:
          type: string
          xml:
            name: Product_Name_RO__c
        Product_Name_ESP__c:
          type: string
          xml:
            name: Product_Name_ESP__c
        Product_Name_Czech__c:
          type: string
          xml:
            name: Product_Name_Czech__c
        Product_Name_BG__c:
          type: string
          xml:
            name: Product_Name_BG__c
      xml:
        name: Product
  securitySchemes:
    SecurityScheme:
      type: http
      description: Authentication
      scheme: basic
