import {
  afterEach,
  describe,
  globalExpect,
  init_dist,
  it
} from "../../chunk-D6N3USMR.mjs";
import {
  BlindPay,
  init_client
} from "../../chunk-VWWGGMMT.mjs";
import "../../chunk-FG25JHDX.mjs";
import "../../chunk-KMU6V4LW.mjs";
import "../../chunk-QGNLMN6Z.mjs";
import "../../chunk-ISHZTBAN.mjs";
import "../../chunk-UDRMLZWT.mjs";
import "../../chunk-LEPGLH7Q.mjs";
import "../../chunk-UC57SCKQ.mjs";
import "../../chunk-E7M4CJKR.mjs";
import "../../chunk-F5Z45GCA.mjs";
import "../../chunk-TBTA7A2P.mjs";
import "../../chunk-YIZJM2GU.mjs";
import "../../chunk-Z6EYX4D3.mjs";
import "../../chunk-ALHMJWQN.mjs";
import "../../chunk-B5T7AQLH.mjs";
import "../../chunk-RC5NN5UF.mjs";
import "../../chunk-VGU72ZNI.mjs";
import "../../chunk-LRHWT4JU.mjs";
import "../../chunk-WE73MTQL.mjs";
import "../../chunk-UOAM7SX3.mjs";
import {
  __async,
  __commonJS
} from "../../chunk-OBKEW4AQ.mjs";

// src/resources/receivers/receivers.test.ts
var require_receivers_test = __commonJS({
  "src/resources/receivers/receivers.test.ts"(exports) {
    init_dist();
    init_client();
    describe("Receivers", () => {
      afterEach(() => fetchMock.resetMocks());
      const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
      describe("List receivers", () => {
        it("should list receivers", () => __async(null, null, function* () {
          const mockedReceivers = {
            data: [
              {
                id: "re_Euw7HN4OdxPn",
                type: "individual",
                kyc_type: "standard",
                kyc_status: "verifying",
                is_tos_accepted: true,
                kyc_warnings: [
                  {
                    code: null,
                    message: null,
                    resolution_status: null,
                    warning_id: null
                  }
                ],
                email: "bernardo@gmail.com",
                tax_id: "12345678900",
                address_line_1: "Av. Paulista, 1000",
                address_line_2: "Apto 101",
                city: "S\xE3o Paulo",
                state_province_region: "SP",
                country: "BR",
                postal_code: "01310-100",
                ip_address: "127.0.0.1",
                image_url: "https://example.com/image.png",
                phone_number: "+5511987654321",
                proof_of_address_doc_type: "UTILITY_BILL",
                proof_of_address_doc_file: "https://example.com/image.png",
                first_name: "Bernardo",
                last_name: "Simonassi",
                date_of_birth: "1998-02-02T00:00:00.000Z",
                id_doc_country: "BR",
                id_doc_type: "PASSPORT",
                id_doc_front_file: "https://example.com/image.png",
                id_doc_back_file: "https://example.com/image.png",
                aiprise_validation_key: "",
                instance_id: "in_000000000000",
                tos_id: "to_3ZZhllJkvo5Z",
                created_at: "2021-01-01T00:00:00.000Z",
                updated_at: "2021-01-01T00:00:00.000Z",
                limit: {
                  per_transaction: 1e5,
                  daily: 2e5,
                  monthly: 1e6
                }
              },
              {
                id: "re_YuaMcI2B8zbQ",
                type: "individual",
                is_tos_accepted: true,
                kyc_type: "enhanced",
                kyc_status: "approved",
                kyc_warnings: null,
                email: "alice.johnson@example.com",
                tax_id: "98765432100",
                address_line_1: "123 Main St",
                address_line_2: null,
                city: "New York",
                state_province_region: "NY",
                country: "US",
                postal_code: "10001",
                ip_address: "192.168.1.1",
                image_url: null,
                phone_number: "+15555555555",
                proof_of_address_doc_type: "BANK_STATEMENT",
                proof_of_address_doc_file: "https://example.com/image.png",
                first_name: "Alice",
                last_name: "Johnson",
                date_of_birth: "1990-05-10T00:00:00.000Z",
                id_doc_country: "US",
                id_doc_type: "PASSPORT",
                id_doc_front_file: "https://example.com/image.png",
                id_doc_back_file: null,
                aiprise_validation_key: "enhanced-key",
                instance_id: "in_000000000001",
                source_of_funds_doc_type: "salary",
                source_of_funds_doc_file: "https://example.com/image.png",
                individual_holding_doc_front_file: "https://example.com/image.png",
                purpose_of_transactions: "investment_purposes",
                purpose_of_transactions_explanation: "Investing in stocks",
                tos_id: "to_nppX66ntvtHs",
                created_at: "2022-02-02T00:00:00.000Z",
                updated_at: "2022-02-02T00:00:00.000Z",
                limit: {
                  per_transaction: 5e4,
                  daily: 1e5,
                  monthly: 5e5
                }
              },
              {
                id: "re_IOxAUL24LG7P",
                type: "business",
                kyc_type: "standard",
                is_tos_accepted: true,
                is_fbo: false,
                kyc_status: "pending",
                kyc_warnings: null,
                email: "business@example.com",
                tax_id: "20096178000195",
                address_line_1: "1 King St W",
                address_line_2: "Suite 100",
                city: "Toronto",
                state_province_region: "ON",
                country: "CA",
                postal_code: "M5H 1A1",
                ip_address: null,
                image_url: null,
                phone_number: "+14165555555",
                proof_of_address_doc_type: "UTILITY_BILL",
                proof_of_address_doc_file: "https://example.com/image.png",
                legal_name: "Business Corp",
                alternate_name: "BizCo",
                formation_date: "2010-01-01T00:00:00.000Z",
                website: "https://businesscorp.com",
                owners: [
                  {
                    role: "beneficial_owner",
                    first_name: "Carlos",
                    last_name: "Silva",
                    date_of_birth: "1995-05-15T00:00:00.000Z",
                    tax_id: "12345678901",
                    address_line_1: "Rua Augusta, 1500",
                    address_line_2: null,
                    city: "S\xE3o Paulo",
                    state_province_region: "SP",
                    country: "BR",
                    postal_code: "01304-001",
                    id_doc_country: "BR",
                    id_doc_type: "PASSPORT",
                    id_doc_front_file: "https://example.com/image.png",
                    id_doc_back_file: "https://example.com/image.png",
                    proof_of_address_doc_type: "UTILITY_BILL",
                    proof_of_address_doc_file: "https://example.com/image.png",
                    ownership_percentage: 25,
                    title: "CEO",
                    id: "ub_000000000000"
                  }
                ],
                incorporation_doc_file: "https://example.com/image.png",
                proof_of_ownership_doc_file: "https://example.com/image.png",
                external_id: null,
                instance_id: "in_000000000002",
                tos_id: "to_nppX66ntvtHs",
                aiprise_validation_key: "",
                created_at: "2015-03-15T00:00:00.000Z",
                updated_at: "2015-03-15T00:00:00.000Z",
                limit: {
                  per_transaction: 2e5,
                  daily: 4e5,
                  monthly: 2e6
                }
              }
            ],
            pagination: {
              has_more: false,
              next_page: "",
              prev_page: ""
            }
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedReceivers), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.list();
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedReceivers);
        }));
      });
      describe("Create receiver", () => {
        it("should create an individual receiver with standard KYC", () => __async(null, null, function* () {
          const mockedReceiver = {
            id: "re_Euw7HN4OdxPn"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedReceiver), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.createIndividualWithStandardKYC({
            email: "bernardo.simonassi@gmail.com",
            country: "BR",
            tax_id: "12345678900",
            address_line_1: "Av. Paulista, 1000",
            address_line_2: "Apto 101",
            city: "S\xE3o Paulo",
            state_province_region: "SP",
            postal_code: "01310-100",
            phone_number: "+5511987654321",
            first_name: "Bernardo",
            last_name: "Simonassi",
            date_of_birth: "1998-02-02T00:00:00.000Z",
            id_doc_country: "BR",
            id_doc_type: "PASSPORT",
            id_doc_front_file: "https://example.com/image.png",
            id_doc_back_file: "https://example.com/image.png",
            proof_of_address_doc_type: "UTILITY_BILL",
            proof_of_address_doc_file: "https://example.com/image.png",
            tos_id: "to_tPiz4bM2nh5K"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual({ id: "re_Euw7HN4OdxPn" });
        }));
        it("should create an individual receiver with enhanced KYC", () => __async(null, null, function* () {
          const mockedReceiver = {
            id: "re_YuaMcI2B8zbQ"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedReceiver), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.createIndividualWithEnhancedKYC({
            email: "bernardo.simonassi@gmail.com",
            country: "BR",
            tax_id: "12345678900",
            address_line_1: "Av. Paulista, 1000",
            address_line_2: "Apto 101",
            city: "S\xE3o Paulo",
            state_province_region: "SP",
            postal_code: "01310-100",
            first_name: "Bernardo",
            last_name: "Simonassi",
            phone_number: "+5511987654321",
            date_of_birth: "1998-02-02T00:00:00.000Z",
            id_doc_country: "BR",
            id_doc_type: "PASSPORT",
            id_doc_front_file: "https://example.com/image.png",
            id_doc_back_file: "https://example.com/image.png",
            proof_of_address_doc_type: "UTILITY_BILL",
            proof_of_address_doc_file: "https://example.com/image.png",
            purpose_of_transactions: "personal_or_living_expenses",
            source_of_funds_doc_type: "savings",
            purpose_of_transactions_explanation: "I am receiving salary payments from my employer",
            source_of_funds_doc_file: "https://example.com/image.png",
            selfie_file: "https://example.com/image.png",
            tos_id: "to_3ZZhllJkvo5Z"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual({ id: "re_YuaMcI2B8zbQ" });
        }));
        it("should create a business receiver with standard KYB", () => __async(null, null, function* () {
          const mockedReceiver = {
            id: "re_IOxAUL24LG7P"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedReceiver), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.createBusinessWithStandardKYB({
            email: "contato@empresa.com.br",
            country: "BR",
            tax_id: "20096178000195",
            address_line_1: "Av. Brigadeiro Faria Lima, 400",
            address_line_2: "Sala 1201",
            city: "S\xE3o Paulo",
            state_province_region: "SP",
            postal_code: "04538-132",
            legal_name: "Empresa Exemplo Ltda",
            alternate_name: "Exemplo",
            formation_date: "2010-05-20T00:00:00.000Z",
            incorporation_doc_file: "https://example.com/image.png",
            proof_of_address_doc_type: "UTILITY_BILL",
            proof_of_address_doc_file: "https://example.com/image.png",
            proof_of_ownership_doc_file: "https://example.com/image.png",
            tos_id: "to_nppX66ntvtHs",
            website: "https://site.com/",
            business_type: "llc",
            business_description: "Software development company",
            business_industry: "541511",
            estimated_annual_revenue: "1000000_9999999",
            source_of_wealth: "affiliate_or_royalty_income",
            publicly_traded: false,
            account_purpose: "treasury_management",
            owners: [
              {
                role: "beneficial_owner",
                first_name: "Carlos",
                last_name: "Silva",
                date_of_birth: "1995-05-15T00:00:00.000Z",
                tax_id: "12345678901",
                address_line_1: "Rua Augusta, 1500",
                address_line_2: null,
                city: "S\xE3o Paulo",
                state_province_region: "SP",
                country: "BR",
                postal_code: "01304-001",
                id_doc_country: "BR",
                id_doc_type: "PASSPORT",
                id_doc_front_file: "https://example.com/image.png",
                id_doc_back_file: "https://example.com/image.png",
                proof_of_address_doc_type: "UTILITY_BILL",
                proof_of_address_doc_file: "https://example.com/image.png",
                ownership_percentage: 25,
                title: "CEO"
              }
            ]
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual({ id: "re_IOxAUL24LG7P" });
        }));
      });
      describe("Get receiver", () => {
        it("should get a receiver with new fields", () => __async(null, null, function* () {
          const mockedReceiver = {
            id: "re_YuaMcI2B8zbQ",
            is_tos_accepted: true,
            type: "individual",
            kyc_type: "standard",
            kyc_status: "approved",
            kyc_warnings: null,
            email: "john@example.com",
            tax_id: "12345678900",
            address_line_1: "123 Main St",
            city: "New York",
            state_province_region: "NY",
            country: "US",
            postal_code: "10001",
            ip_address: null,
            image_url: null,
            phone_number: "+15555555555",
            proof_of_address_doc_type: "UTILITY_BILL",
            proof_of_address_doc_file: "https://example.com/image.png",
            first_name: "John",
            last_name: "Doe",
            date_of_birth: "1990-01-01T00:00:00.000Z",
            id_doc_country: "US",
            id_doc_type: "PASSPORT",
            id_doc_front_file: "https://example.com/image.png",
            id_doc_back_file: "https://example.com/image.png",
            aiprise_validation_key: "",
            instance_id: "in_000000000000",
            tos_id: null,
            created_at: "2021-01-01T00:00:00.000Z",
            updated_at: "2021-01-01T00:00:00.000Z",
            limit: {
              per_transaction: 1e5,
              daily: 2e5,
              monthly: 1e6
            },
            fraud_warnings: [
              {
                id: "UC114",
                name: "User never used a Datacenter proxy",
                operation: "+",
                score: 10
              }
            ],
            aml_status: "clear",
            aml_hits: {
              has_sanction_match: false,
              has_pep_match: false,
              has_watchlist_match: false,
              has_crimelist_match: false,
              has_adversemedia_match: false
            },
            account_purpose_other: null,
            occupation: "Software Engineer",
            external_id: "ext_123",
            is_fbo: false
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedReceiver), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.get("re_YuaMcI2B8zbQ");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedReceiver);
        }));
        it("should get a receiver", () => __async(null, null, function* () {
          const mockedReceiver = {
            id: "re_YuaMcI2B8zbQ",
            is_tos_accepted: true,
            type: "individual",
            kyc_type: "enhanced",
            kyc_status: "verifying",
            kyc_warnings: [
              {
                code: null,
                message: null,
                resolution_status: null,
                warning_id: null
              }
            ],
            email: "bernardo.simonassi@gmail.com",
            tax_id: "12345678900",
            address_line_1: "Av. Paulista, 1000",
            address_line_2: "Apto 101",
            city: "S\xE3o Paulo",
            state_province_region: "SP",
            country: "BR",
            postal_code: "01310-100",
            ip_address: "127.0.0.1",
            image_url: "https://example.com/image.png",
            phone_number: "+5511987654321",
            proof_of_address_doc_type: "UTILITY_BILL",
            proof_of_address_doc_file: "https://example.com/image.png",
            first_name: "Bernardo",
            last_name: "Simonassi",
            date_of_birth: "1998-02-02T00:00:00.000Z",
            id_doc_country: "BR",
            id_doc_type: "PASSPORT",
            id_doc_front_file: "https://example.com/image.png",
            id_doc_back_file: "https://example.com/image.png",
            aiprise_validation_key: "",
            source_of_funds_doc_type: "savings",
            source_of_funds_doc_file: "https://example.com/image.png",
            individual_holding_doc_front_file: "https://example.com/image.png",
            purpose_of_transactions: "personal_or_living_expenses",
            purpose_of_transactions_explanation: "I am receiving salary payments from my employer",
            instance_id: "in_000000000000",
            tos_id: "to_3ZZhllJkvo5Z",
            created_at: "2021-01-01T00:00:00.000Z",
            updated_at: "2021-01-01T00:00:00.000Z",
            limit: {
              per_transaction: 1e5,
              daily: 2e5,
              monthly: 1e6
            }
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedReceiver), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.get("re_YuaMcI2B8zbQ");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedReceiver);
        }));
      });
      describe("Update receiver", () => {
        it("should update a receiver", () => __async(null, null, function* () {
          fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.update({
            receiver_id: "re_YuaMcI2B8zbQ",
            email: "bernardo.simonassi@gmail.com",
            tax_id: "12345678900",
            address_line_1: "Av. Paulista, 1000",
            address_line_2: "Apto 101",
            city: "S\xE3o Paulo",
            state_province_region: "SP",
            country: "BR",
            postal_code: "01310-100",
            ip_address: "127.0.0.1",
            image_url: "https://example.com/image.png",
            phone_number: "+5511987654321",
            proof_of_address_doc_type: "UTILITY_BILL",
            proof_of_address_doc_file: "https://example.com/image.png",
            first_name: "Bernardo",
            last_name: "Simonassi",
            date_of_birth: "1998-02-02T00:00:00.000Z",
            id_doc_country: "BR",
            id_doc_type: "PASSPORT",
            id_doc_front_file: "https://example.com/image.png",
            id_doc_back_file: "https://example.com/image.png",
            alternate_name: "Exemplo",
            formation_date: "2010-05-20T00:00:00.000Z",
            website: "https://site.com",
            owners: [
              {
                first_name: "Carlos",
                last_name: "Silva",
                role: "beneficial_owner",
                date_of_birth: "1995-05-15T00:00:00.000Z",
                tax_id: "12345678901",
                address_line_1: "Rua Augusta, 1500",
                address_line_2: null,
                city: "S\xE3o Paulo",
                state_province_region: "SP",
                country: "BR",
                postal_code: "01304-001",
                id_doc_country: "BR",
                id_doc_type: "PASSPORT",
                id_doc_front_file: "https://example.com/image.png",
                id_doc_back_file: "https://example.com/image.png",
                proof_of_address_doc_type: "UTILITY_BILL",
                proof_of_address_doc_file: "https://example.com/image.png",
                ownership_percentage: 25,
                title: "CEO"
              }
            ],
            incorporation_doc_file: "https://example.com/image.png",
            proof_of_ownership_doc_file: "https://example.com/image.png",
            source_of_funds_doc_type: "savings",
            source_of_funds_doc_file: "https://example.com/image.png",
            purpose_of_transactions: "personal_or_living_expenses",
            purpose_of_transactions_explanation: "I am receiving salary payments from my employer",
            external_id: "some-external-id",
            tos_id: "to_3ZZhllJkvo5Z"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual({ data: null });
        }));
      });
      describe("Delete receiver", () => {
        it("should delete a receiver", () => __async(null, null, function* () {
          fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.delete("re_YuaMcI2B8zbQ");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual({ data: null });
        }));
      });
      describe("Get receiver limits", () => {
        it("should get receiver limits", () => __async(null, null, function* () {
          const mockedReceiverLimits = {
            limits: {
              payin: {
                daily: 1e4,
                monthly: 5e4
              },
              payout: {
                daily: 2e4,
                monthly: 1e5
              }
            }
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedReceiverLimits), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.getLimits("re_YuaMcI2B8zbQ");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedReceiverLimits);
        }));
      });
      describe("Get limit increase requests", () => {
        it("should get limit increase requests for a receiver", () => __async(null, null, function* () {
          const mockedLimitIncreaseRequests = [
            {
              id: "rl_000000000000",
              receiver_id: "re_YuaMcI2B8zbQ",
              status: "in_review",
              daily: 5e4,
              monthly: 25e4,
              per_transaction: 25e3,
              supporting_document_file: "https://example.com/bank-statement.pdf",
              supporting_document_type: "individual_bank_statement",
              created_at: "2025-01-15T10:30:00.000Z",
              updated_at: "2025-01-15T10:30:00.000Z"
            },
            {
              id: "rl_000000000000",
              receiver_id: "re_YuaMcI2B8zbQ",
              status: "approved",
              daily: 3e4,
              monthly: 15e4,
              per_transaction: 15e3,
              supporting_document_file: "https://example.com/proof-of-income.pdf",
              supporting_document_type: "individual_proof_of_income",
              created_at: "2024-12-10T14:20:00.000Z",
              updated_at: "2024-12-12T09:45:00.000Z"
            }
          ];
          fetchMock.mockResponseOnce(JSON.stringify(mockedLimitIncreaseRequests), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.getLimitIncreaseRequests("re_YuaMcI2B8zbQ");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedLimitIncreaseRequests);
        }));
      });
      describe("Get limit increase requests with approved fields", () => {
        it("should get limit increase requests with approved amounts", () => __async(null, null, function* () {
          const mockedLimitIncreaseRequests = [
            {
              id: "rl_000000000000",
              receiver_id: "re_YuaMcI2B8zbQ",
              status: "approved",
              daily: 5e4,
              monthly: 25e4,
              per_transaction: 25e3,
              supporting_document_file: "https://example.com/bank-statement.pdf",
              supporting_document_type: "individual_bank_statement",
              created_at: "2025-01-15T10:30:00.000Z",
              updated_at: "2025-01-15T10:30:00.000Z",
              approved_per_transaction: 2e4,
              approved_daily: 4e4,
              approved_monthly: 2e5
            }
          ];
          fetchMock.mockResponseOnce(JSON.stringify(mockedLimitIncreaseRequests), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.getLimitIncreaseRequests("re_YuaMcI2B8zbQ");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedLimitIncreaseRequests);
        }));
      });
      describe("Request limit increase", () => {
        it("should request a limit increase for a receiver", () => __async(null, null, function* () {
          const mockedResponse = {
            id: "rl_000000000000"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedResponse), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.requestLimitIncrease({
            receiver_id: "re_YuaMcI2B8zbQ",
            daily: 1e5,
            monthly: 5e5,
            per_transaction: 5e4,
            supporting_document_file: "https://example.com/tax-return.pdf",
            supporting_document_type: "individual_tax_return"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedResponse);
        }));
      });
    });
  }
});
export default require_receivers_test();
