• expect_data = [ { "order_no": "ADD2019112700000100", "installment": 1, "sub_order_type": "global", "name": "Economy (Asia)", "name_display": "Economy", "sub_category": "InterTravelInsurance", "insurer": "AXA", "payment_method": "postpaid", "order_status": "completed", "order_type": "TA", "PLAN": "tour", "SOURCE": "1", "destination": "69", "created_at": IGNORED, "created_time": IGNORED, "installment_created_at": IGNORED, "payment_date": IGNORED, "source_name": "THAILAND", "destination_name": "JAPAN", "gross_premium": "250.0", "order_flag": "web", "promo_code": "discount-02", "total_premium": "260.0", "mpay_point_comm_rate": "5.0", "mpay_comm_rate": "15.0", "payment_ref_id": IGNORED, "discount_value": "20.0", "point_used": 100, "point_amount": "50.0", "balance_amount": "200.0", "mpay_point_comm_amount": "2.5", "mpay_comm_amount": "30.0" }, { "order_no": "ADD2019112700000100", "installment": 1, "sub_order_type": "global", "name": "Economy (Asia)", "name_display": "Economy", "sub_category": "InterTravelInsurance", "insurer": "AXA", "payment_method": "postpaid", "order_status": "completed", "order_type": "TA", "PLAN": "tour", "SOURCE": "1", "destination": "69", "created_at": IGNORED, "created_time": IGNORED, "installment_created_at": IGNORED, "payment_date": IGNORED, "source_name": "THAILAND", "destination_name": "JAPAN", "gross_premium": "250.0", "order_flag": "web", "promo_code": "discount-02", "total_premium": "260.0", "mpay_point_comm_rate": "5.0", "mpay_comm_rate": "15.0", "payment_ref_id": IGNORED, "discount_value": "0.0", "point_used": nil, "point_amount": nil, "balance_amount": nil, "mpay_point_comm_amount": "0.0", "mpay_comm_amount": "37.5" }, { "order_no": "ADD2019112700000101", "installment": 1, "sub_order_type": "sport", "name": "sport", "name_display": "sport", "sub_category": "PA sport Insurance", "insurer": "VIRIYAH", "payment_method": "postpaid", "order_status": "completed", "order_type": "PA", "PLAN": "", "SOURCE": "", "destination": "", "created_at": IGNORED, "created_time": IGNORED, "installment_created_at": IGNORED, "payment_date": IGNORED, "source_name": "", "destination_name": "", "gross_premium": "381.0", "order_flag": "web", "promo_code": "discount-02", "total_premium": "401.0", "mpay_point_comm_rate": "0.0", "mpay_comm_rate": "0.0", "payment_ref_id": IGNORED, "discount_value": "20.0", "point_used": nil, "point_amount": nil, "balance_amount": nil, "mpay_point_comm_amount": "0.0", "mpay_comm_amount": "0.0" }, { "order_no": "ADD2019112700000103", "installment": 1, "sub_order_type": "cancer", "name": "MSIG Cancer", "name_display": "แผน 1", "sub_category": "Health Cancer Insurance", "insurer": "MSIG", "payment_method": "postpaid", "order_status": "completed", "order_type": "HEALTH", "PLAN": "", "SOURCE": "", "destination": "", "created_at": IGNORED, "created_time": IGNORED, "installment_created_at": IGNORED, "payment_date": IGNORED, "source_name": "", "destination_name": "", "gross_premium": "101.0", "order_flag": "web", "promo_code": "", "total_premium": "101.0", "mpay_point_comm_rate": "0.0", "mpay_comm_rate": "0.0", "payment_ref_id": IGNORED, "discount_value": "0.0", "point_used": nil, "point_amount": nil, "balance_amount": nil, "mpay_point_comm_amount": "0.0", "mpay_comm_amount": "0.0" }, { "order_no": "ADD2019112700000104", "installment": 1, "sub_order_type": "global", "name": "UBI - 6000 KMS", "name_display": "แผน2", "sub_category": "UBI KMS", "insurer": "MSIG", "payment_method": "mobile_banking", "order_status": "completed", "order_type": "MOTOR", "PLAN": "tour", "SOURCE": "1", "destination": "69", "created_at": IGNORED, "created_time": IGNORED, "installment_created_at": IGNORED, "payment_date": IGNORED, "source_name": "THAILAND", "destination_name": "JAPAN", "gross_premium": "9600.0", "order_flag": "web", "promo_code": "", "total_premium": "9600.04", "mpay_point_comm_rate": "0.0", "mpay_comm_rate": "0.0", "payment_ref_id": IGNORED, "discount_value": "0.0", "point_used": nil, "point_amount": nil, "balance_amount": nil, "mpay_point_comm_amount": "0.0", "mpay_comm_amount": "0.0" }, { "order_no": "ADD2019112700000106", "installment": 1, "sub_order_type": "cmi", "name": "BKI CMI", "name_display": "BKI CMI", "sub_category": "BKI - CMI", "insurer": "BKI", "payment_method": "credit_or_debit_card_mpay_one", "order_status": "waiting_for_issue_policy", "order_type": "MOTOR", "PLAN": "tour", "SOURCE": "1", "destination": "69", "created_at": IGNORED, "created_time": IGNORED, "installment_created_at": IGNORED, "payment_date": IGNORED, "source_name": "THAILAND", "destination_name": "JAPAN", "gross_premium": "625.21", "order_flag": "web", "promo_code": "discount-02", "total_premium": "645.21", "mpay_point_comm_rate": "5.0", "mpay_comm_rate": "10.0", "payment_ref_id": IGNORED, "discount_value": "20.0", "point_used": 100, "point_amount": "50.0", "balance_amount": "575.21", "mpay_point_comm_amount": "2.5", "mpay_comm_amount": "57.52" }, { "order_no": "ADD2019112700000107", "installment": 1, "sub_order_type": "type_2plus", "name": "bki product plan 1", "name_display": "แผน 1", "sub_category": "BKI - 2PLUS", "insurer": "BKI", "payment_method": "credit_or_debit_card_mpay_one", "order_status": "waiting_for_issue_policy", "order_type": "MOTOR", "PLAN": "tour", "SOURCE": "1", "destination": "69", "created_at": IGNORED, "created_time": IGNORED, "installment_created_at": IGNORED, "payment_date": IGNORED, "source_name": "THAILAND", "destination_name": "JAPAN", "gross_premium": "7280.0", "order_flag": "web", "promo_code": "discount-02", "total_premium": "7300.0", "mpay_point_comm_rate": "5.0", "mpay_comm_rate": "10.0", "payment_ref_id": IGNORED, "discount_value": "20.0", "point_used": 100, "point_amount": "50.0", "balance_amount": "7230.0", "mpay_point_comm_amount": "2.5", "mpay_comm_amount": "723.0" }, { "order_no": "ADD2019112700000107", "installment": 1, "sub_order_type": "type_2plus", "name": "BKI - CMI", "name_display": "BKI CMI", "sub_category": "BKI - CMI", "insurer": "BKI", "payment_method": "credit_or_debit_card_mpay_one", "order_status": "waiting_for_issue_policy", "order_type": "MOTOR", "PLAN": "tour", "SOURCE": "1", "destination": "69", "created_at": IGNORED, "created_time": IGNORED, "installment_created_at": IGNORED, "payment_date": IGNORED, "source_name": "THAILAND", "destination_name": "JAPAN", "gross_premium": "645.21", "order_flag": "web", "promo_code": "discount-02", "total_premium": "645.21", "mpay_point_comm_rate": "5.0", "mpay_comm_rate": "10.0", "payment_ref_id": IGNORED, "discount_value": "0.0", "point_used": nil, "point_amount": nil, "balance_amount": nil, "mpay_point_comm_amount": "0.0", "mpay_comm_amount": "64.52", } ]

    decimal_keys = %i(gross_premium
                      total_premium
                      mpay_point_comm_rate
                      mpay_comm_rate
                      discount_value
                      point_amount
                      balance_amount
                      mpay_point_comm_amount
                      mpay_comm_amount)
    
    deep_to_decimal(expect_data, decimal_keys)
    Edited by Khunat Iamkaeo
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment