$kind: http-request
description: New Cooperative member registration
url: "{{csmisUrl}}/cooperative/members"
method: POST
headers:
  cooperativeApiToken: "{{COOPERATIVEAPITOKEN}}"
body:
  type: json
  content: "{\r

    \  \"registrationType\": \"MEMBER\",\r

    \  \"nin\": \"12345678900987654341\",\r

    \  \"firstName\": \"first\",\r

    \  \"middleName\": \"middle\",\r

    \  \"lastName\": \"last\",\r

    \  \"gender\": \"MALE\",\r

    \  \"dateOfBirth\": \"2000-12-30\",\r

    \  \"phoneNumber\": \"255686137451\",\r

    \  \"noOfShares\": 0.00,\r

    \  \"savingAmount\": 0.00,\r

    \  \"wardPostCode\": \"23513\",\r

    \  \"referenceNumber\": \"1234\",\r

    \  \"maritalStatus\": \"SINGLE\",\r

    \  \"villageStreet\": \"villageStreet_c4c3d127bb9d\",\r

    \  \"address\": \"address_dd2eb6c88102\",\r

    \  \"tinNumber\": null,\r

    \  \"email\": null,\r

    \  \"educationLevelUid\": null,\r

    \  \"externalMemberSuccessors\": [\r

    \    {\r

    \      \"nin\": null,\r

    \      \"firstName\": \"first\",\r

    \      \"middleName\": \"middle\",\r

    \      \"lastName\": \"last\",\r

    \      \"gender\": \"MALE\",\r

    \      \"dateOfBirth\": \"2000-01-01\",\r

    \      \"phoneNumber\": null,\r

    \      \"referenceNumber\": \"referenceNumber_acf18c6a71e4\",\r

    \      \"address\": \"address_3b9ba46d8c4e\",\r

    \      \"email\": null,\r

    \      \"relationshipType\": \"son\",\r

    \      \"nationality\": \"nationality_486f80a85898\"\r

    \    }\r

    \  ],\r

    \  \"nationality\": \"nationality_adc7b84d5454\",\r

    \  \"contactPerson\": false,\r

    \  \"steeringCommittee\": false\r

    }"
scripts:
  - type: afterResponse
    code: >-
      pm.test("Response status code is 400", function () {
          pm.expect(pm.response.code).to.equal(400);
      });



      pm.test("Response has the required fields - statusCode, data, and
      message", function () {
          const responseData = pm.response.json();
          
          pm.expect(responseData).to.be.an('object');
          pm.expect(responseData.statusCode).to.exist;
          pm.expect(responseData.data).to.exist;
          pm.expect(responseData.message).to.exist;
      });



      pm.test("Data is null", function () {
          const responseData = pm.response.json();
          pm.expect(responseData.data).to.be.null;
      });



      pm.test("Message is an empty string", function () {
        const responseData = pm.response.json();
        
        pm.expect(responseData.message).to.equal("");
      });



      pm.test("Content-Type is application/json", function () {
        pm.expect(pm.response.headers.get("Content-Type")).to.include("application/json");
      });
    language: text/javascript
order: 2000
