«

GET - /api/admin/shop-discount -- Lấy danh sách shop discount

Params: { "page": 0, "size": 1, "sort": "string", "shopName": "string", "shopId": "string", "category": 0, "dealer": "string", "status": "string", "discountType": "string", "createdFrom": "2024-05-30T02:21:56.942Z", "createdTo": "2024-05-30T02:21:56.942Z" }

  • Tags: @AUTOMATED, @TNK-7782

    Trả về 401 khi gửi request lấy danh sách shop discount mà không gửi token

    • When Request có header là
      X-Tenantm26
    • And Gửi request "GET" đến "/admin/shop-discount"
    • Then Trả về status code 401
  • Tags: @AUTOMATED, @TNK-7782

    Trả về 401 khi gửi request lấy danh sách shop discount với token không hợp lệ

    • Given Token đã hết hạn
    • When Request có header là
      X-Tenantm26
    • And Gửi request "GET" đến "/admin/shop-discount"
    • Then Trả về status code 401
  • Tags: @AUTOMATED, @TNK-7782

    Trả về 403 khi không có quyền SUPPLIER:VIEW_SUPPLIER_LIST

    • Given Tôi có token của tài khoản có thông tin
      accountpermissionGrouppermissionGroupNamepermission
      suppliersupplier_groupsupplier_grouptrừ quyền SUPPLIER:VIEW_SUPPLIER_LIST
    • When Request có header là
      X-Tenantm26
    • And Gửi request "GET" đến "/admin/shop-discount"
    • Then Trả về status code 403
  • Tags: @AUTOMATED, @TNK-7782

    Trả về 200 và danh sách shop rỗng khi gửi header không hợp lệ

    • Given Có token full quyền
    • When Request có header là
      X-Tenant<tenant>
    • And Gửi request "GET" đến "/admin/shop-discount"
    • Then Trả về status code 200
    • And Response có body là một mảng có 0 phần tử

    Examples:

    tenant
    m2
  • Tags: @AUTOMATED, @TNK-7782

    Gửi request thành công khi gửi request hợp lệ không truyền lên params

    • Given Tồn tại shop discount có thông tin
      idcategorystatusdealerdiscountRatecustomerDiscountRatedealerCommissionRatemarketingPartnerCommissionRate
      ID01Vật liệu xây dựngACTIVEadmin15601515
    • And Có token full quyền
    • When Request có header là
      X-Tenantm26
    • And Gửi request "GET" đến "/admin/shop-discount"
    • Then Trả về status code 200
    • And Response có body thỏa mãn schema "schemas/get_shop_discount.json"
    • And Response có body là một mảng có ít nhất 1 phần tử
  • Tags: @AUTOMATED, @TNK-7782

    Có thể giới hạn bạn ghi trả về

    • Given Tồn tại shop discount có thông tin
      id
      ID01
    • And Có token full quyền
    • When Request có header là
      X-Tenantm26
    • And Gửi request "GET" đến "/admin/shop-discount?size=1"
    • Then Trả về status code 200
    • And Response có body là một mảng có tối đa 1 phần tử
  • Tags: @AUTOMATED, @TNK-7782

    Có thể tìm kiếm shop discount theo các thông tin shopName, shopId, dealer, status, discountType

    • Given Tồn tại shop discount có thông tin
      idcategorystatusdealershopNameshopIddiscountType
      ID01Vật liệu xây dựngACTIVEadmintestshopId01ALL_PRODUCT
    • And Có token full quyền
    • When Request có header là
      X-Tenantm26
    • And Gửi request "GET" đến "/admin/shop-discount" với params
      <param><value>
    • Then Trả về status code 200
    • And Response có body là một mảng gồm các phần tử có đối tượng thỏa mãn
      fieldconditionvalue
      <field><condition><valueResponse>

    Examples:

    param value field condition valueResponse
    shopName test shopName chứa chuỗi test
    shopId shopId01 shopId bằng shopId01
    dealer admin dealer bằng admin
    status ACTIVE shopStatus bằng ACTIVE
    discountType ALL_PRODUCT discountType bằng ALL_PRODUCT
  • Tags: @AUTOMATED, @TNK-7782

    Có thể tìm kiếm shop discount theo category

    • Given Hệ thống Admin Sabomall tồn tại thông tin category
      categoryIdname
      1Vật liệu xây dựng
    • And Tồn tại shop discount có thông tin
      idcategory
      ID01Vật liệu xây dựng
    • And Có token full quyền
    • When Request có header là
      X-Tenantm26
    • And Gửi request "GET" đến "/admin/shop-discount" với params
      category1
    • Then Trả về status code 200
  • Tags: @AUTOMATED, @TNK-7782

    Có thể tìm kiếm shop discount theo khoảng thời gian tạo

    • Given Tồn tại shop discount có thông tin
      idcategorystatusdealershopNameshopIddiscountTypecreatedAt
      ID01Vật liệu xây dựngACTIVEadmintestshopId01ALL_PRODUCT2024-05-25T02:21:56.942Z
      ID02Vật liệu xây dựngACTIVEadmintest2shopId02SOME_PRODUCT2024-05-30T02:21:56.942Z
    • And Có token full quyền
    • When Request có header là
      X-Tenantm26
    • And Gửi request "GET" đến "/admin/shop-discount" với params
      createdFrom<createdFrom>
      createdTo<createdTo>
    • Then Trả về status code 200
    • And Response có body là một mảng gồm các phần tử có đối tượng thỏa mãn
      fieldconditionvalue
      createdAt<condition><value>

    Examples:

    createdFrom createdTo condition value
    2024-05-25T02:21:56.942Z 2024-05-30T02:21:56.942Z là thời gian nằm trong khoảng 2024-05-25T02:21:56.942Z/2024-05-30T02:21:56.942Z
    2024-05-25T02:21:56.942Z sau thời điểm 2024-05-25T02:21:56.942Z
    2024-05-30T02:21:56.942Z trước thời điểm 2024-05-30T02:21:56.942Z
  • Tags: @AUTOMATED, @TNK-7782

    Có thể tìm kiếm shop discount kết hợp nhiều điều kiện

    • Given Tồn tại shop discount có thông tin
      idcategorystatusdealershopNameshopIddiscountTypecreatedAt
      ID01Vật liệu xây dựngACTIVEadmintestshopId01ALL_PRODUCT2024-05-25T02:21:56.942Z
      ID02Vật liệu xây dựngACTIVEadmintest2shopId02SOME_PRODUCT2024-05-30T02:21:56.942Z
    • And Có token full quyền
    • When Request có header là
      X-Tenantm26
    • And Gửi request "GET" đến "/admin/shop-discount" với params
      dealeradmin
      statusACTIVE
      createdFrom2024-05-25T02:21:56.942Z
      createdTo2024-05-30T02:21:56.942Z
      discountTypeALL_PRODUCT
    • Then Trả về status code 200
    • And Response có body là một mảng gồm các phần tử có đối tượng thỏa mãn
      fieldconditionvalue
      createdAtlà thời gian nằm trong khoảng2024-05-25T02:21:56.942Z/2024-05-30T02:21:56.942Z
      dealerbằngadmin
      shopStatusbằngACTIVE
      discountTypebằngALL_PRODUCT
  • Tags: @AUTOMATED, @TNK-7782

    Trả về status 200, và response rỗng khi không có kết quả tìm kiếm

    • Given Có token full quyền
    • When Request có header là
      X-Tenantm26
    • And Gửi request "GET" đến "/admin/shop-discount?dealer=taolaoxito"
    • Then Trả về status code 200
    • And Response có body là một mảng có 0 phần tử
  • Tags: @AUTOMATED, @TNK-7782

    Có thể sắp xếp bản ghi trả về theo ngày tạo

    • Given Tồn tại shop discount có thông tin
      idcategorystatusdealershopNameshopIddiscountType
      ID01Vật liệu xây dựngACTIVEadmintestshopId01ALL_PRODUCT
    • And Có token full quyền
    • When Request có header là
      X-Tenantm26
    • And Gửi request "GET" đến "/admin/shop-discount?sort=createdAt:<sort>"
    • Then Trả về status code 200
    • And Response có body là một mảng có các phần tử được sắp xếp theo
      fieldcreatedAt
      direction<sort>

    Examples:

    sort
    desc
    asc