openapi: 3.0.1
info:
  title: gwb-hmb-api API
  description: "# Summary \ngwb-hmb-api API \n\n# Contact \nIf you'd like to reach\
    \ out to the gwb-hmb-api team please email: [launchpad_support@glic.com](mailto:launchpad_support@glic.com)\
    \ 
    \ \n\n# Versioning \nThe API uses url path prefixing to maintain\
    \ different versions of the api. The format used is a 'v' followed by the version\
    \ number. At present there is only one version so all api endpoints (except meta)\
    \ should be prefixed with /v1/ \n\n# Status Codes \nStatus Code  | Description\
    \ \n-------------|------------- \n200| Everything worked as expected. See response\
    \ if applicable. \n400| Bad Request. See error response with message. \n404| Not\
    \ Found. Either no api endpoint found or no results for given parameters. \n500|\
    \ Internal Server Error. Something blew up on our side. This shouldn't happen.\
    \ We logged the error and we will try to fix it asap.\n# Troubleshooting \nWith\
    \ every request that reaches API's servers we return a Unique Universal Identifier\
    \ (UUID) as a header called ```x-glic-request-id```. Please reference your correlation\
    \ id when contacting our support team. \n\nWe also return the server response time\
    \ as the header ```x-glic-response-time``` which can help to diagnose any request time\
    \ issues. \n# Endpoints \nApi uses predictable, resource-oriented URLs. JSON is\
    \ returned by all API responses, including errors. Aside from the Meta endpoints\
    \ (which aren't versioned), the API endpoints are constructed with the following\
    \ pattern: ```{environment_base_url}/{api_version}/{api_endpoint}```"
  version: "1.0.0"
servers:
  - url: http://localhost:8080
  - url: https://apiinternal.uat.aws.glic.com/gwb-hmb-api/
tags:
  - name: Values
paths:
  /membershipinfo:
    post:
      tags:
        - Create Membership
      summary: Create Membership 
      description: Create Membership 
      operationId: createMembershipInfo
      requestBody:
        description: New Member
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemberIDInput'
        required: false
      responses:
        200:
          description: Response with success status true or false, with Member Object with member id value if creation of member is successful
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/CreateMemberResponse'
        400:
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        404:
          description: Not Found
          content: {}
        500:
          description: Internal Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      deprecated: false      
  /members/{member_first_nm}/{member_last_nm}:
    get:
      tags:
        - GetAllMembersFromFirstNameAndLastName
      summary: Get All Members from First Name and Last Name
      description: Get all members from First Name and Last Name
      responses:
        200:
          description: Response with success status true or false, with Member Object with member id value if creation of member is successful
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/CreateMemberResponse'
        400:
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        404:
          description: Not Found
          content: {}
        500:
          description: Internal Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      deprecated: false 
  /membershipearningsinfo/{memberId}:
    get:
      tags:
        - GetMemberEarningInformationFromMemberId
      summary: Get Member Earning Information from Member Id
      description: Get Member Earning Information from Member Id
      responses:
        200:
          description: Response with success status true or false, with Member Object with member id value if creation of member is successful
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/MembershipEarningResponse'
        400:
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        404:
          description: Not Found
          content: {}
        500:
          description: Internal Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      deprecated: false 
  /membershipearninginfo/{earning_id}:
    get:
      tags:
          - GetMemberEarningInformationFromEarningId
      summary: Get All Membership Earning Info by Earning Id
      description: Get All Membership Earning Info by Earning Id
      responses:
        200:
          description: Response with success status true or false, with Member Object with member id value if creation of member is successful
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/MembershipEarningResponse'
        400:
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        404:
          description: Not Found
          content: {}
        500:
          description: Internal Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      deprecated: false 
  /membershipearningsinfobyupi/{unfd_prty_id}:
    get:
      tags:
        - GetMemberEarningInformationFromUPI
      summary: Get All Membership Earning Info by UPI
      description: Get All Membership Earning Info by UPI
      responses:
        200:
          description: Response with success status true or false, with Member Object with member id value if creation of member is successful
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/MembershipEarningResponse'
        400:
          description: Bad Request
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        404:
          description: Not Found
          content: {}
        500:
          description: Internal Error
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      deprecated: false 
     
components:
  schemas:
    ErrorResponse:
      title: ErrorResponse
      type: object
      properties:
        message:
          type: string
        status:
          type: integer
          format: int32
    CreateMemberResponse:
      type: object
      properties:
        from_cache:
          type: string
          description: is it returned from cache.
        success:
          type: string
          description: Member Key ID created (true) or not (false).
        message:
          type: string
          description: Any error message if there is any issue.
        data:
          $ref: '#/components/schemas/Member'
          # description: Member Data with member id created.
        correlation_id:
          type: string
          description: Correlation ID that can be used to track the requests.

    MembershipEarningResponse:
      type: object
      properties:
        from_cache:
          type: string
          description: is it returned from cache.
        success:
          type: string
          description: Member Key ID created (true) or not (false).
        message:
          type: string
          description: Any error message if there is any issue.
        data:
          $ref: '#/components/schemas/MembershipEarning'
          # description: Membership Earning Data.
        correlation_id:
          type: string
          description: Correlation ID that can be used to track the requests.          

    MemberIDInput:
      title: Create Member Input
      type: object
      properties:
        unfd_prty_id:
          type: integer
          format: int32
          description: Member UPI.
        user_id:
          type: string
          description: OKTA Userid ID.


    Member:
      title: Member
      type: object
      properties:
        member_id:
          type: integer
          format: int32
          description: Unqiue Member ID.
        unfd_prty_id:
          type: integer
          format: int32
          description: Member UPI.
        load_dt:
          type: string
          description: Member ID Created on.
        user_id:
          type: string
          description: OKTA Userid ID.

    MembershipEarning:
      title: MembershipEarning
      type: object
      properties:
        earning_id:
          type: string
          description: Unique Earning ID.
        earn_pts:
          type: integer
          format: int32
          description: Earning points.
        member_id:
          type: integer
          format: int32
          description: Unique Member ID.
        unfd_prty_id:
          type: integer
          format: int32
          description: UPI.
        member_acct_status:
          type: string
          description: Member Account Status.
        member_source_id:
          type: string
          description: Member Source Id.
        member_consent_in:
          type: string
          description: Member Consent Indicator.
        member_consent_dt:
          type: string
          description: Member Consent Date.
        member_first_nm:
          type: string
          description: Member First Name.
        member_last_nm:
          type: string
          description: Member Last Name.
        member_sex:
          type: string
          description: Member Gender.
        member_phone_nr:
          type: string
          description: Member Phone Number.
        member_email_tx:
          type: string
          description: Member Email.
        member_join_dt:
          type: string
          description: Member Join Date.
        member_brth_dt:
          type: string
          description: Member Birth Date.
        source_nm:
          type: string
          description: Source ID.
        earning_currency_nm:
          type: string
          description: Member Earnings Currency Ind.
        earning_slot:
          type: integer
          format: int32
          description: Member Earning Slot.
        earning_prd:
          type: integer
          format: int32
          description: Member Earning Period.
        sub_cat:
          type: string
          description: Member Earning Sub Category.
        main_cat:
          type: string
          description: Member Earning Main Category.
        earning_model_nm:
          type: string
          description: Member Earning Model.
        earning_cust_nm:
          type: string
          description: Member Earning Description.
        earning_event_dtl:
          type: string
          description: Member Earning Event Details.
        earning_platfrm:
          type: string
          description: Member Earning Platform.