openapi: 3.0.0
info:
  description: ePlanning STRA Management API
  version: v1
  title: ePlanning STRA Management API
  termsOfService: http://swagger.io/terms/
  contact:
    email: api@environment.nsw.gov.au
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
paths:
  /PropertyDetails/{PropertyID}/{Postcode}:
    get:
      summary: PropertyDetails
      description: >-
        This operation will enable the booking platforms to know the current
        status and day limit count (current year and next year) of a particular
        property on the STRA  register.
      operationId: propertydetails
      parameters:
        - name: BookingProvider
          description: Name of the booking provider
          in: header
          required: false
          schema:
            type: string
        - name: PropertyID
          in: path
          description: Property ID in STRA example PID-STRA-NumericValue
          required: true
          schema:
            type: string
        - name: Postcode
          in: path
          description: Postcode of the property in STRA
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Response-PropertyDetails'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Error-PropertyDetails'
        '404':
          description: STRA Errors
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Error-PropertyDetails'
  /SubmitBulkBooking:
    post:
      summary: SubmitBulkBooking
      description: >-
        This operation will enable the consumer of the API to submit NEW,MODIFY
        and CANCEL booking requests in STRA.
      operationId: submitbulkbooking
      parameters:
        - name: BookingProvider
          description: Name of the booking provider
          in: header
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Request-SubmitBulkBooking'
        description: Body of the request
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Response-SubmitBulkBooking'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Error-SubmitBulkBooking'
        '404':
          description: STRA Errors
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Error-SubmitBulkBooking'
  /ResponseBulkBooking:
    post:
      summary: ResponseBulkBooking
      description: >-
        This operation will enable the booking providers to get the status of
        previous Bulk Booking call.
      operationId: responsebulkbooking
      parameters:
        - name: BookingProvider
          description: Name of the booking provider
          in: header
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Request-ResponseBulkBooking'
        description: Body of the request
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Response-ResponseBulkBooking'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Error-ResponseBulkBooking'
        '404':
          description: STRA Errors
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Error-ResponseBulkBooking'
  /GetBulkPropertyDetails:
    get:
      summary: GetBulkPropertyDetails
      description: This operation will return all property details stored in STRA register.
      operationId: getbulkpropertydetails
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Response-GetBulkPropertyDetails'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Error-GetBulkPropertyDetails'
        '404':
          description: STRA Errors
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Error-GetBulkPropertyDetails'
  /ManageBooking/{PropertyID}:
    post:
      summary: ManageBooking
      operationId: managebooking
      description: >-
        This operation will enable the booking platforms to update the STRA
        register with new bookings or modifications of existing bookings
        (including cancellations).
      parameters:
        - name: BookingProvider
          in: header
          required: false
          description: Name of the booking provider
          schema:
            type: string
        - name: PropertyID
          description: Property ID in STRA example PID-STRA-NumericValue
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Request-ManageBooking'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Response-ManageBooking'
        '400':
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Error-ManageBooking'
        '404':
          description: STRA Errors
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/Error-ManageBooking'
servers:
  - url: https://api-uat.apps1.nsw.gov.au/planning/STRAMgmt/v1
components:
  securitySchemes:
    api_key:
      type: apiKey
      name: api-key
      in: header
  schemas:
    Response-PropertyDetails:
      type: object
      properties:
        StatusMessage:
          type: string
          description: >-
            Indicates if property is present in STRA.Sample values are Property
            found in STRA ,Property not found in STRA
        DayLimCoutCurRenYr:
          type: integer
          description: Total number of STRA days booked in current renewal year
        DayLimCoutCurRenYrBalance:
          type: integer
          description: Total number of days available to book in current renewal year
        DwellingNumber:
          type: string
          description: Dwelling Number when a lot of land contains more than one dwelling
        DayLimCoutNxtRenYrBalance:
          type: integer
          description: Total number of days available to book in next renewal year
        DayLimCoutNxtRenYr:
          type: integer
          description: Total number of STRA days booked in next renewal year
        HostingType:
          type: string
          description: >-
            Indicates if property is hosted in STRA or not. Sample values are
            Hosted,Non-Hosted
        EndDateNxtRenYr:
          type: string
          description: End date for the next renewal year. Example "19-05-2022"
          format: date
          example: 19-05-2022
        StatusValue:
          type: string
          description: HTTP status code
        PropertyStatus:
          type: string
          description: >-
            Current status of the property in STRA. Sample values are
            Registered,De-registered,Blocked,Excluded
        AddressID:
          type: string
          description: AddressID of property in STRA example PID-STRA-NumericValue
        FULLADDRESS:
          type: string
          description: >-
            Full address of property in STRA Example "53 533-539 KENT STREET
            SYDNEY 2000"
        EndDateCurRenYr:
          type: string
          description: End date for current renewal year.Example "19-05-2021"
          format: date
          example: 19-05-2021
        DayLimCoutLstRenYr:
          type: integer
          description: Total number of STRA days booked in last renewal year
        DayLimCoutLstRenYrBalance:
          type: integer
          description: Total number of days available to book in last renewal year
        EndDateLstRenYr:
          type: string
          description: End date for last(third) renewal year.Example "19-05-2023"
          format: date
          example: 19-05-2023
    Request-ManageBooking:
      type: object
      required:
        - BookingRefNo
        - RequestType
        - TransactionID
        - StartDate
        - EndDate
      properties:
        RequestType:
          maxLength: 21
          type: string
          description: Specifies if the request is of which type Example:New,Modify,Cancel
        BookingRefNo:
          description: >-
            Mandatory for Modify/Cancel Booking - ID field returned in response
            for New Booking
          type: string
        TransactionID:
          description: Mandatory ( Unique Transaction identifier)-Must be an unique ID
          type: string
        StartDate:
          description: Booking start date in dd-mm-yyyy format
          type: string
          format: date
          example: 21-05-2021
        EndDate:
          description: Booking end date in dd-mm-yyyy format
          type: string
          format: date
          example: 24-05-2021
    Response-ManageBooking:
      type: object
      properties:
        DayLimCoutCurRenYr:
          type: integer
          description: Total number of STRA days booked in current renewal year
        StatusMessage:
          type: string
          description: >-
            Indicates if property is present in STRA.Sample values are Property
            found in STRA ,Property not found in STRA
        DayLimCoutCurRenYrBalance:
          type: integer
          description: Total number of days available to book in current renewal year
        DwellingNumber:
          type: string
          description: Dwelling Number when a lot of land contains more than one dwelling
        DayLimCoutNxtRenYrBalance:
          type: integer
          description: Total number of days available to book in next renewal year
        DayLimCoutNxtRenYr:
          type: integer
          description: Total number of STRA days booked in next renewal year
        DayLimCoutLstRenYr:
          type: integer
          description: Total number of STRA days booked in last renewal year
        DayLimCoutLstRenYrBalance:
          type: integer
          description: Total number of days available to book in last renewal year
        EndDateLstRenYr:
          type: string
          description: End date for last(third) renewal year.Example "19-05-2022"
          format: date
          example: 19-05-2021
        HostingType:
          type: string
          description: >-
            Indicates if property is hosted in STRA or not. Example
            Hosted/Non-Hosted
        EndDateNxtRenYr:
          type: string
          description: End date for current renewal year.Example "19-05-2022"
          format: date
          example: 19-05-2022
        PropertyStatus:
          type: string
          description: >-
            Current status of the property in STRA. Sample values are
            Registered,De-registered,Blocked,Excluded
        BookingRefNo:
          type: string
          description: Booking reference number
        AddressID:
          type: string
          description: AddressID of property in STRA example PID-STRA-NumericValue
        FULLADDRESS:
          type: string
          description: >-
            Full address of property in STRA Example "53 533-539 KENT STREET
            SYDNEY 2000"
        EndDateCurRenYr:
          type: string
          format: date
          description: End date for current renewal year.Example "19-05-2021"
          example: 19-05-2021
    Request-SubmitBulkBooking:
      type: object
      properties:
        filename:
          type: string
          description: Specifies the name of the file should be uniquely identifiable
          example: BulkbookingRequest_Timestamp
        filecontent:
          type: string
          description: Specifies the base64 content of the file
    Response-SubmitBulkBooking:
      type: object
      properties:
        StatusMessage:
          type: string
          description: Status of the submit booking request
          example: Request has been processed
    Request-ResponseBulkBooking:
      type: object
      properties:
        filename:
          type: string
          description: >-
            Specifies the name of the file for which response is to being
            requested
    Response-ResponseBulkBooking:
      type: object
      properties:
        filename:
          type: string
          description: Specifies the name of the response file
        filecontent:
          type: string
          description: Specifies the base 64 content of the response file
    Response-GetBulkPropertyDetails:
      type: object
      properties:
        filename:
          type: string
          description: Specifies the name of the file
        filecontent:
          type: string
          description: Specifies the base64 content of the file
        timestamp:
          type: string
          description: Timestamp of the generated file
    Error-PropertyDetails:
      type: object
      required:
        - statusCode
        - errorCode
      properties:
        statusCode:
          type: integer
          example: 40X
        message:
          type: string
        activityId:
          type: string
        errorCode:
          type: string
          example: STRA_API_000
        errorDetails:
          type: string
          example: Message detail text in STRA
    Error-ManageBooking:
      type: object
      required:
        - statusCode
        - errorCode
      properties:
        statusCode:
          type: integer
          example: 40X
        message:
          type: string
        activityId:
          type: string
        errorCode:
          type: string
          example: STRA_API_000
        errorDetails:
          type: string
          example: Message detail text in STRA
    Error-SubmitBulkBooking:
      type: object
      required:
        - statusCode
        - errorCode
      properties:
        statusCode:
          type: integer
          example: 40X
        message:
          type: string
        activityId:
          type: string
        errorCode:
          type: string
          example: STRA_API_000
        errorDetails:
          type: string
          example: Message detail text in STRA
    Error-GetBulkPropertyDetails:
      type: object
      required:
        - statusCode
        - errorCode
      properties:
        statusCode:
          type: integer
          example: 40X
        message:
          type: string
        activityId:
          type: string
        errorCode:
          type: string
          example: STRA_API_000
        errorDetails:
          type: string
          example: Message detail text in STRA
    Error-ResponseBulkBooking:
      type: object
      required:
        - statusCode
        - errorCode
      properties:
        statusCode:
          type: integer
          example: 40X
        message:
          type: string
        activityId:
          type: string
        errorCode:
          type: string
          example: STRA_API_000
        errorDetails:
          type: string
          example: Message detail text in STRA
