Syntax for "needs:" not clear or not working

I am trying to make my pipeline smarter by using “needs:”. However when I submit my job I get syntax errors. I have tried:

 integration_test_dev:loan:
  extends: .integration_test_dev_template
  variables:
    SERVICE_NAME: loan
  needs:
    - "build_and_test:loan"
      artifacts:true
    - "deploy_dev:loan"

and

integration_test_dev:loan:
  extends: .integration_test_dev_template
  variables:
    SERVICE_NAME: loan
  needs:
    - build_and_test:loan
      artifacts:true
    - deploy_dev:loan

and

integration_test_dev:loan:
  extends: .integration_test_dev_template
  variables:
    SERVICE_NAME: loan
  needs:
    - job:"build_and_test:loan"
      artifacts:true
    - job:"deploy_dev:loan"

I get different errors with each, even when the ci:linter says it is fine.

What is the correct syntax for needs?

I would check the official documentation, e.g. here.

I did. if you look at what I tried it follows those patterns