«

PATCH /api/M26/clans/{clanCode}/cancel - User tự huỷ yêu cầu tham gia phường của mình

  • Params: clanCode: string
  • Header: X-Tenant
  • Trả status 400 khi gửi request hủy yêu cầu tham gia phường nhưng không gửi header X-Tenant

    • Given Tài khoản "ownerclan" đã tạo phường với thông tin
      codenamedescriptionrequestRequired
      clan_01AutoTestCall APItrue
    • And Khách hàng "userclan" "đã gửi" yêu cầu tham gia phường
      clanCode
      clan_01
    • And Có token của tài khoản "userclan"
    • When Gửi request "PATCH" đến "/M26/clans/${clan_01}/cancel"
    • Then Tôi nhận được response có HTTP Status 400
    • And Response có body thỏa mãn giá trị như sau
      {
        "title": "Bad Request",
        "detail": "Required header 'X-Tenant' is not present."
      }
  • Trả status 404 khi request hủy yêu cầu tham gia phường với header X-Tenant không hợp lệ

    • Given Tài khoản "ownerclan" đã tạo phường với thông tin
      codenamedescriptionrequestRequired
      clan_01AutoTestCall APItrue
    • And Khách hàng "userclan" "đã gửi" yêu cầu tham gia phường
      clanCode
      clan_01
    • And Có token của tài khoản "userclan"
    • When Request có header là
      X-Tenant<x-tenant>
    • And Gửi request "PATCH" đến "/M26/clans/${clan_01}/cancel"
    • Then Tôi nhận được response có HTTP Status 404
    • And Response có body thỏa mãn giá trị như sau
      {
        "title": "request_not_found"
      }

    Examples:

    x-tenant
    null
    linhtinh
  • Trả 401 khi request hủy yêu cầu tham gia phường mà không gửi lên token

    • Given Tài khoản "ownerclan" đã tạo phường với thông tin
      codenamedescriptionrequestRequired
      clan_01AutoTestCall APItrue
    • And Khách hàng "userclan" "đã gửi" yêu cầu tham gia phường
      clanCode
      clan_01
    • When Request có header là
      X-Tenantm26
    • And Gửi request "PATCH" đến "/M26/clans/${clan_01}/cancel"
    • Then Tôi nhận được response có HTTP Status 401
  • Trả 401 khi request hủy yêu cầu tham gia phường với token không hợp lệ

    • Given Tài khoản "ownerclan" đã tạo phường với thông tin
      codenamedescriptionrequestRequired
      clan_01AutoTestCall APItrue
    • And Khách hàng "userclan" "đã gửi" yêu cầu tham gia phường
      clanCode
      clan_01
    • And Token đã hết hạn
    • When Request có header là
      X-Tenantm26
    • And Gửi request "PATCH" đến "/M26/clans/${clan_01}/cancel"
    • Then Tôi nhận được response có HTTP Status 401
  • Trả status 404 nếu member request hủy YC tham gia nhưng thực tế chưa gửi yêu cầu tham gia

    • Given Tài khoản "ownerclan" đã tạo phường với thông tin
      codenamedescriptionrequestRequired
      clan_01AutoTestCall APItrue
    • And Có token của tài khoản "userclan10"
    • When Request có header là
      X-Tenantm26
    • And Gửi request "PATCH" đến "/M26/clans/${clan_01}/cancel"
    • Then Tôi nhận được response có HTTP Status 400
    • And Response có body thỏa mãn giá trị như sau
      {
        "title": "request_not_found"
      }
  • Trả status 404 nếu hủy YC tham gia phường không tồn tại

    • Given Có token của tài khoản "userclan10"
    • When Request có header là
      X-Tenantm26
    • And Gửi request "PATCH" đến "/M26/clans/001/cancel"
    • Then Tôi nhận được response có HTTP Status 404
    • And Response có body thỏa mãn giá trị như sau
      {
        "title": "request_not_found"
      }
  • Trả status 404 khi có yêu cầu tham gia phường này, nhưng gửi request hủy yêu cầu tham gia phường khác

    • Given Tài khoản "ownerclan" đã tạo phường với thông tin
      codenamedescriptionrequestRequired
      clan_01AutoTestCall APItrue
    • And Khách hàng "userclan10" "đã gửi" yêu cầu tham gia phường
      clanCode
      clan_01
    • And Tài khoản "ownerclan01" đã tạo phường với thông tin
      codenamedescriptionrequestRequired
      clan_02AutoTestCall APItrue
    • And Có token của tài khoản "userclan10"
    • When Request có header là
      X-Tenantm26
    • And Gửi request "PATCH" đến "/M26/clans/${clan_02}/cancel"
    • Then Tôi nhận được response có HTTP Status 404
    • And Response có body thỏa mãn giá trị như sau
      {
        "title": "request_not_found"
      }
  • Trả status 404 khi tiếp tục hủy yêu cầu tham gia phường trong khi trước đó đã hủy yêu cầu thành công

    • Given Tài khoản "ownerclan" đã tạo phường với thông tin
      codenamedescriptionrequestRequired
      clan_01AutoTestCall APItrue
    • And Khách hàng "userclan10" "đã gửi" yêu cầu tham gia phường
      clanCode
      clan_01
    • And Khách hàng "userclan10" "đã hủy" yêu cầu tham gia phường
      clanCode
      clan_01
    • And Có token của tài khoản "userclan10"
    • When Request có header là
      X-Tenantm26
    • And Gửi request "PATCH" đến "/M26/clans/${clan_01}/cancel"
    • Then Tôi nhận được response có HTTP Status 404
    • And Response có body thỏa mãn giá trị như sau
      {
        "title": "request_not_found"
      }
  • Trả 200 và hủy yc tham gia phường thành công nếu đã gửi yêu cầu tham gia trước đó.

    • Given Tài khoản "ownerclan" đã tạo phường với thông tin
      codenamedescriptionrequestRequired
      clan_01AutoTestCall APItrue
    • And Khách hàng "userclan10" "đã gửi" yêu cầu tham gia phường
      clanCode
      clan_01
    • And Có token của tài khoản "userclan10"
    • When Request có header là
      X-Tenantm26
    • And Gửi request "PATCH" đến "/M26/clans/${clan_01}/cancel"
    • Then Tôi nhận được response có HTTP Status 200
    • And Response có body thỏa mãn giá trị như sau
      {
        "invitedUsername": "userclan10",
        "status": "CANCELED",
        "invited": false
      }