arshia-gh / Project-Aid-Hub

Project Aid Hub

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Applicants can be registered with mobileNo or email only

arshia-gh opened this issue · comments

As the title says, applicants can be registered through the back-end API without providing
email and mobileNo fields.
This is acceptable if neither of the fields are provided.
However as it can be seen from the below example they can also be registered while providing one of the mentioned fields.

Input

fullname: Arshia Gh
IDno: 101010101768
householdIncome: 100
address: Jalan Test
email: arshia@gmail.com

Expected Output

{
	"error": {
		"message": "some fields did not meet the validation requirements",
		"name": "ValidationError",
		"fields": {
			"mobileNo": "mobileNo is required",
		}
	},
	"code": 400
}

Actual Output

{
	"result": {
		"fullname": "Arshia Gh",
		"IDno": "101010101768",
		"householdIncome": 100,
		"address": "Jalan Test",
		"email": "arshia@gmail.com",
		"username": "AP000000000008",
		"userType": "APPLICANT",
		"orgId": 1000,
		"password": "kaxocufofepo"
	},
	"code": 200
}

fixed