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

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

    \    \"nin\": \"21234565890198768129\",\r

    \    \"firstName\": \"Rujumbaa\",\r

    \    \"lastName\": \"Mugasaa\",\r

    \    \"middleName\": \"Platin\",\r

    \    \"email\": null,\r

    \    \"noOfShares\": 0,\r

    \    \"savingAmount\": 0,\r

    \    \"dateOfBirth\": \"2000-10-21\",\r

    \    \"phoneNumber\": \"255721780978\",\r

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

    \    \"referenceNumber\": \"328\",\r

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

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

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

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

    \    \"tinNumber\": null,\r

    \    \"educationLevelUid\": \"c6c11d69-b80f-4b0e-811e-70b54b9b6b6a\",\r

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

    \    \"contactPerson\": false,\r

    \    \"steeringCommittee\": false,\r

    \    \"externalMemberSuccessors\": [\r

    \        {\r

    \            \"nin\": \"21234565890198765431\",\r

    \            \"firstName\": \"Mufa\",\r

    \            \"lastName\": \"ADAA\",\r

    \            \"middleName\": \"AAAA\",\r

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

    \            \"dateOfBirth\": \"2000-03-02\",\r

    \            \"phoneNumber\": \"255621780972\",\r

    \            \"referenceNumber\": \"127\",\r

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

    \            \"email\": null,\r

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

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

    \        }\r

    \    ]\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
