Error while calling a function from client side when the function is in serverside

frappe.ready(function() {
// bind events here
frappe.web_form.validate = () => {
frappe.msgprint(‘validating’)
}
})
frappe.call({
method: ‘healthcare.loyalty.web_form.registration_loyalty_program.create_user_and_assign_role’,
args: {
data: {
email: $(‘#email’).val(),
first_name: $(‘#first_name’).val(),
last_name: $(‘#last_name’).val()
}
},
callback: function(response) {
// Handle the response
console.log(‘response:’, response);
}
});
this is the content of the js file

@frappe.whitelist()
def validate_user(username, password):Preformatted text
return f’{username} {password} in validate_user()’

@frappe.whitelist()
def create_user_and_assign_role(data):
data = frappe.parse_json(data)
user = frappe.get_doc({
“doctype”: “User”,
“email”: data.email,
“first_name”: data.first_name,
“last_name”: data.last_name,
“send_welcome_email”: True
})
user.insert()
user.add_roles(“Loyalty Customer”)

def get_context(context):
# do your magic here
pass
this is the content of python file

both the files are in same directory ie., /frappe-bench/apps/healthcare/healthcare/loyalty/web_form/registration_loyalty_program

when i opened the web form it is showing the below error
Failed to get method for command healthcare.loyalty.create_user_and_assign_role with module ‘healthcare.loyalty’ has no attribute ‘create_user_and_assign_role’

what is the issue

this path is wrong
please check location of this function

example

healthcare.healthcare.web_form.patient_appointments.patient_appointments.#function_name

i changed the path according to @Viral_Kansodiya reply
frappe.ready(function(){
console.log(‘in ready’);
frappe.call({
method: ‘healthcare.loyalty.web_form.registration_loyalty_program.registration_loyalty_program.create_user_and_assign_role’,
args: {
data: {
email: $(‘#email’).val(),
// first_name: $(‘#first_name’).val(),
// last_name: $(‘#last_name’).val()
}
},
callback: function(response) {
// Handle the response
console.log(‘response:’, response);
}
});
})
but still i am getting this error
Failed to get method for command healthcare.loyalty.web_form.registration_loyalty_program.registration_loyalty_program.create_user_and_assign_role with module ‘healthcare.loyalty.web_form.registration_loyalty_program.registration_loyalty_program’ has no attribute ‘create_user_and_assign_role’

.py file contains the create_user_and_assign_role() function
import frappe

@frappe.whitelist()
def validate_user(username, password):
return f’{username} {password} in validate_user()’

@frappe.whitelist()
def create_user_and_assign_role(data):
data = frappe.parse_json(data)
user = frappe.get_doc({
“doctype”: “User”,
“email”: data.email,
“first_name”: data.first_name,
“last_name”: data.last_name,
“send_welcome_email”: True
})
user.insert()
user.add_roles(“Loyalty Customer”)

def get_context(context):
pass
both js and py files are in same directory ie.,
~/frappe-bench/apps/healthcare/healthcare/loyalty/web_form/registration_loyalty_program
still why i am getting this error