Snippets Collections
<head>
  <meta charset="utf-8" />
  <title>My test page</title>
</head>
// Total number of reviews for current product [count_reviews
add_shortcode('count_reviews', function() {
    $product_id = get_queried_object_id();

    if ( ! $product_id ) {
        return '';
    }

    $args = array(
        'post_type'      => 'simple-reviews',
        'post_status'    => 'publish',
        'posts_per_page' => -1,
        'meta_query'     => array(
            array(
                'key'     => 'review_post_id',
                'value'   => $product_id,
                'compare' => '=',
            ),
            array(
                'key'     => 'rating_review',
                'value'   => '',
                'compare' => '!=',
            ),
        ),
        'fields' => 'ids',
    );

    $query = new WP_Query($args);
    $total_reviews = count($query->posts);

    $label = plural_form($total_reviews, 'отзыв', 'отзыва', 'отзывов');

    return "{$total_reviews} {$label}";
});

// Функция склонения слов по числам
function plural_form($number, $form1, $form2, $form5) {
    $n = abs($number) % 100;
    $n1 = $n % 10;
    if ($n > 10 && $n < 20) return $form5;
    if ($n1 > 1 && $n1 < 5) return $form2;
    if ($n1 == 1) return $form1;
    return $form5;
}
import React, { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { McButton, McInput } from '@maersk-global/mds-react-wrapper';
import { McSelect } from '@maersk-global/mds-react-wrapper/components-core/mc-select';
import { McOption } from '@maersk-global/mds-react-wrapper/components-core/mc-option';
import styles from '../styles/CreateRule.module.css';
import data from '../data/PnLGroup.json';

const CreateRules = () => {
  const navigate = useNavigate();
  const [activeTab, setActiveTab] = useState('ruleInfo');
  const [ruleData, setRuleData] = useState({
    num: '',
    name: '',
    desc: '',
    custRefID: '',
    ruleGroup: '',
    isActive: 'Y',
    pnlGroup: '',
  });
  const [steps, setSteps] = useState([
    {
      stepNo: '',
      stepName: 'Single Step',
      StepDesc: '',
      stepType: 'S',
      preAggregatorColumns: '',
      sourceTable: '',
      sourceFilters: '',
      joinColumns: '',
      allocationColumns: '',
      driverTableID: '',
      driverWeightColumn: '',
      driverFilters: '',
    },
  ]);
  const [errors, setErrors] = useState({ rule: {}, steps: [{}] });

  // Extract PnL Group options from JSON, with fallback for empty data
  const pnlGroups = data.PnLGroups ? Object.keys(data.PnLGroups) : [];

  // Get Rule Group options based on selected PnL Group, with fallback
  const ruleGroups = ruleData.pnlGroup && data.PnLGroups[ruleData.pnlGroup]
    ? data.PnLGroups[ruleData.pnlGroup].RuleGroups || []
    : [];

  const addStep = () => {
    setSteps((prevSteps) => [
      ...prevSteps,
      {
        stepNo: '',
        stepName: 'Single Step',
        StepDesc: '',
        stepType: 'S',
        preAggregatorColumns: '',
        sourceTable: '',
        sourceFilters: '',
        joinColumns: '',
        allocationColumns: '',
        driverTableID: '',
        driverWeightColumn: '',
        driverFilters: '',
      },
    ]);
    setErrors((prevErrors) => ({
      ...prevErrors,
      steps: [...prevErrors.steps, {}],
    }));
  };

  const validateForm = () => {
    const newErrors = { rule: {}, steps: steps.map(() => ({})) };
    let isValid = true;

    // Validate rule data
    Object.keys(ruleData).forEach((key) => {
      if (key !== 'isActive' && !ruleData[key]) {
        newErrors.rule[key] = 'This field is required';
        isValid = false;
      }
    });

    // Validate steps
    steps.forEach((step, index) => {
      const stepErrors = {};
      Object.keys(step).forEach((key) => {
        if (key !== 'stepName' && key !== 'stepType' && !step[key]) {
          stepErrors[key] = 'This field is required';
          isValid = false;
        }
      });
      newErrors.steps[index] = stepErrors;
    });

    setErrors(newErrors);
    return isValid;
  };

  const handleInputChange = (e, stepIndex = null) => {
    const { name, value } = e.target;
    console.log(`Input changed: ${name} = ${value}${stepIndex !== null ? ` (Step ${stepIndex + 1})` : ''}`);
    
    if (stepIndex !== null) {
      setSteps((prevSteps) => {
        const newSteps = [...prevSteps];
        newSteps[stepIndex] = { ...newSteps[stepIndex], [name]: value };
        return newSteps;
      });
      setErrors((prevErrors) => ({
        ...prevErrors,
        steps: prevErrors.steps.map((stepErrors, i) =>
          i === stepIndex ? { ...stepErrors, [name]: '' } : stepErrors
        ),
      }));
    } else {
      setRuleData((prevData) => ({
        ...prevData,
        [name]: value,
        ...(name === 'pnlGroup' ? { ruleGroup: '' } : {}),
      }));
      setErrors((prevErrors) => ({
        ...prevErrors,
        rule: { ...prevErrors.rule, [name]: '' },
      }));
    }
  };

  const handleSelectChange = (e) => {
    const { name, value } = e.target;
    console.log(`Select changed: ${name} = ${value}`);
    setRuleData((prevData) => ({
      ...prevData,
      [name]: value,
      ...(name === 'pnlGroup' ? { ruleGroup: '' } : {}),
    }));
    setErrors((prevErrors) => ({
      ...prevErrors,
      rule: { ...prevErrors.rule, [name]: '' },
    }));
  };

  const handleSave = async () => {
    if (!validateForm()) {
      console.log('Validation failed:', errors);
      alert('Please fill out all required fields.');
      return;
    }

    // Parse comma-separated columns and filters
    const parseColumns = (input) => input.split(',').map((item) => item.trim()).filter((item) => item);
    const parseFilters = (input) => {
      const filters = input.split(';').map((item) => item.trim()).filter((item) => item);
      return filters.map((filter) => {
        const [name, filterType, values] = filter.split(':').map((item) => item.trim());
        return { name, filterType, values };
      });
    };

    const ruleJson = {
      rules: {
        rule: [
          {
            num: ruleData.num,
            name: ruleData.name,
            desc: ruleData.desc,
            custRefID: ruleData.custRefID,
            ruleGroup: ruleData.ruleGroup,
            isActive: ruleData.isActive,
            Step: steps.map((step, index) => ({
              stepNo: step.stepNo || `${ruleData.num}.${index + 1}`,
              stepName: step.stepName === 'Single Step' ? 'single' : 'multi',
              StepDesc: step.StepDesc,
              stepType: step.stepType,
              isActive: 'Y',
              SourceTable: {
                id: '1',
                Name: step.sourceTable,
              },
              sourceFilters: {
                columns: parseFilters(step.sourceFilters),
              },
              preAggregator: {
                columns: parseColumns(step.preAggregatorColumns),
              },
              join: {
                columns: parseColumns(step.joinColumns),
              },
              allocation: {
                columns: parseColumns(step.allocationColumns),
              },
              driver: {
                driverTableID: step.driverTableID,
                driverWeightColumn: step.driverWeightColumn,
                driverFilters: {
                  columns: parseFilters(step.driverFilters),
                },
              },
            })),
          },
        ],
      },
    };

    console.log('Saving Rule Data:', JSON.stringify(ruleJson, null, 2));

    try {
      const response = await fetch('/api/rules', {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
        },
        body: JSON.stringify(ruleJson),
      });

      if (response.ok) {
        console.log('Rule created successfully');
        navigate('/');
      } else {
        console.error('Failed to create rule:', response.statusText);
        alert('Failed to create rule. Please try again.');
      }
    } catch (error) {
      console.error('Error during API call:', error);
      alert('An error occurred while saving the rule.');
    }
  };

  const handleCancel = () => {
    console.log('Cancelling rule creation');
    navigate('/');
  };

  const renderTabContent = () => {
    console.log('Rendering tab:', activeTab);
    switch (activeTab) {
      case 'ruleInfo':
        return (
          <div className={styles.tabContent}>
            <h3 className={styles.sectionTitle}>Rule Information</h3>
            <div className={styles.formGrid}>
              <div className={styles.gridItem}>
                <McSelect
                  label="PnL Group"
                  name="pnlGroup"
                  value={ruleData.pnlGroup}
                  optionselected={handleSelectChange}
                  placeholder="Select a PnL Group"
                  required
                  invalid={!!errors.rule.pnlGroup}
                  invalidmessage={errors.rule.pnlGroup}
                >
                  {pnlGroups.map((group) => (
                    <McOption key={group} value={group}>
                      {group}
                    </McOption>
                  ))}
                </McSelect>
              </div>
              <div className={styles.gridItem}>
                <McSelect
                  label="Rule Group"
                  name="ruleGroup"
                  value={ruleData.ruleGroup}
                  optionselected={handleSelectChange}
                  placeholder={ruleGroups.length ? "Select a Rule Group" : "Select a PnL Group first"}
                  required
                  disabled={!ruleData.pnlGroup || !ruleGroups.length}
                  invalid={!!errors.rule.ruleGroup}
                  invalidmessage={errors.rule.ruleGroup}
                >
                  {ruleGroups.map((group) => (
                    <McOption key={group} value={group}>
                      {group}
                    </McOption>
                  ))}
                </McSelect>
              </div>
            </div>
            <div className={styles.inputGroup}>
              <McInput
                label="Rule Number"
                name="num"
                value={ruleData.num}
                input={handleInputChange}
                placeholder="Enter rule number"
                required
                invalid={!!errors.rule.num}
                invalidmessage={errors.rule.num}
              />
            </div>
            <div className={styles.inputGroup}>
              <McInput
                label="Rule Name"
                name="name"
                value={ruleData.name}
                input={handleInputChange}
                placeholder="Enter rule name"
                required
                invalid={!!errors.rule.name}
                invalidmessage={errors.rule.name}
              />
            </div>
            <div className={styles.inputGroup}>
              <McInput
                label="Description"
                name="desc"
                value={ruleData.desc}
                input={handleInputChange}
                placeholder="Enter rule description"
                multiline
                rows={3}
                required
                invalid={!!errors.rule.desc}
                invalidmessage={errors.rule.desc}
              />
            </div>
            <div className={styles.inputGroup}>
              <McInput
                label="Customer Reference ID"
                name="custRefID"
                value={ruleData.custRefID}
                input={handleInputChange}
                placeholder="Enter customer reference ID"
                required
                invalid={!!errors.rule.custRefID}
                invalidmessage={errors.rule.custRefID}
              />
            </div>
          </div>
        );
      case 'step':
        return (
          <div className={styles.tabContent}>
            <h3 className={styles.sectionTitle}>Step Information</h3>
            {steps.map((step, index) => (
              <div key={index} className={styles.stepCase}>
                <h4>Step {index + 1}</h4>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Step Number"
                    name="stepNo"
                    value={step.stepNo}
                    input={(e) => handleInputChange(e, index)}
                    placeholder={`Enter step number (e.g., ${ruleData.num}.${index + 1})`}
                    required
                    invalid={!!errors.steps[index].stepNo}
                    invalidmessage={errors.steps[index].stepNo}
                  />
                </div>
                <div className={styles.inputGroup}>
                  <McSelect
                    label="Step Name"
                    name="stepName"
                    value={step.stepName}
                    optionselected={(e) => handleInputChange(e, index)}
                    required
                    placeholder="Select Step Name"
                    invalid={!!errors.steps[index].stepName}
                    invalidmessage={errors.steps[index].stepName}
                  >
                    <McOption value="Single Step">Single Step</McOption>
                    <McOption value="Multi Step">Multi Step</McOption>
                  </McSelect>
                </div>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Step Description"
                    name="StepDesc"
                    value={step.StepDesc}
                    input={(e) => handleInputChange(e, index)}
                    placeholder="Enter step description"
                    multiline
                    rows={3}
                    required
                    invalid={!!errors.steps[index].StepDesc}
                    invalidmessage={errors.steps[index].StepDesc}
                  />
                </div>
                <div className={styles.inputGroup}>
                  <McSelect
                    label="Step Type"
                    name="stepType"
                    value={step.stepType}
                    optionselected={(e) => handleInputChange(e, index)}
                    required
                    placeholder="Select a PnL Group"
                    invalid={!!errors.steps[index].stepType}
                    invalidmessage={errors.steps[index].stepType}
                  >
                    <McOption value="S">S</McOption>
                    <McOption value="M">M</McOption>
                  </McSelect>
                </div>
              </div>
            ))}
            <div className={styles.buttonContainer}>
              <McButton
                label="Add Step"
                appearance="secondary"
                click={addStep}
                className={styles.actionButton}
              />
            </div>
          </div>
        );
      case 'preAggregate':
        return (
          <div className={styles.tabContent}>
            <h3 className={styles.sectionTitle}>Pre-Aggregate Columns</h3>
            {steps.map((step, index) => (
              <div key={index} className={styles.stepCase}>
                <h4>Step {index + 1}</h4>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Pre-Aggregator Columns"
                    name="preAggregatorColumns"
                    value={step.preAggregatorColumns}
                    input={(e) => handleInputChange(e, index)}
                    placeholder="Enter columns (comma-separated)"
                    multiline
                    rows={3}
                    required
                    invalid={!!errors.steps[index].preAggregatorColumns}
                    invalidmessage={errors.steps[index].preAggregatorColumns}
                  />
                </div>
              </div>
            ))}
          </div>
        );
      case 'source':
        return (
          <div className={styles.tabContent}>
            <h3 className={styles.sectionTitle}>Source Information</h3>
            {steps.map((step, index) => (
              <div key={index} className={styles.stepCase}>
                <h4>Step {index + 1}</h4>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Source Table"
                    name="sourceTable"
                    value={step.sourceTable}
                    input={(e) => handleInputChange(e, index)}
                    placeholder="Enter source table name"
                    required
                    invalid={!!errors.steps[index].sourceTable}
                    invalidmessage={errors.steps[index].sourceTable}
                  />
                </div>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Source Filters"
                    name="sourceFilters"
                    value={step.sourceFilters}
                    input={(e) => handleInputChange(e, index)}
                    placeholder="Enter filters (e.g., PNL_LINE:IN:PnL.DVC.214,PnL.DVC.215;MOVE_TYPE:EQ:EX)"
                    multiline
                    rows={3}
                    required
                    invalid={!!errors.steps[index].sourceFilters}
                    invalidmessage={errors.steps[index].sourceFilters}
                  />
                </div>
              </div>
            ))}
          </div>
        );
      case 'join':
        return (
          <div className={styles.tabContent}>
            <h3 className={styles.sectionTitle}>Join Columns</h3>
            {steps.map((step, index) => (
              <div key={index} className={styles.stepCase}>
                <h4>Step {index + 1}</h4>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Join Columns"
                    name="joinColumns"
                    value={step.joinColumns}
                    input={(e) => handleInputChange(e, index)}
                    placeholder="Enter columns (comma-separated)"
                    multiline
                    rows={3}
                    required
                    invalid={!!errors.steps[index].joinColumns}
                    invalidmessage={errors.steps[index].joinColumns}
                  />
                </div>
              </div>
            ))}
          </div>
        );
      case 'allocation':
        return (
          <div className={styles.tabContent}>
            <h3 className={styles.sectionTitle}>Allocation Columns</h3>
            {steps.map((step, index) => (
              <div key={index} className={styles.stepCase}>
                <h4>Step {index + 1}</h4>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Allocation Columns"
                    name="allocationColumns"
                    value={step.allocationColumns}
                    input={(e) => handleInputChange(e, index)}
                    placeholder="Enter columns (comma-separated)"
                    multiline
                    rows={3}
                    required
                    invalid={!!errors.steps[index].allocationColumns}
                    invalidmessage={errors.steps[index].allocationColumns}
                  />
                </div>
              </div>
            ))}
          </div>
        );
      case 'driver':
        return (
          <div className={styles.tabContent}>
            <h3 className={styles.sectionTitle}>Driver Information</h3>
            {steps.map((step, index) => (
              <div key={index} className={styles.stepCase}>
                <h4>Step {index + 1}</h4>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Driver Table ID"
                    name="driverTableID"
                    value={step.driverTableID}
                    input={(e) => handleInputChange(e, index)}
                    placeholder="Enter driver table ID"
                    required
                    invalid={!!errors.steps[index].driverTableID}
                    invalidmessage={errors.steps[index].driverTableID}
                  />
                </div>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Driver Weight Column"
                    name="driverWeightColumn"
                    value={step.driverWeightColumn}
                    input={(e) => handleInputChange(e, index)}
                    placeholder="Enter driver weight column"
                    required
                    invalid={!!errors.steps[index].driverWeightColumn}
                    invalidmessage={errors.steps[index].driverWeightColumn}
                  />
                </div>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Driver Filters"
                    name="driverFilters"
                    value={step.driverFilters}
                    input={(e) => handleInputChange(e, index)}
                    placeholder="Enter filters (e.g., ALLOC_MOVE:IN:GATE-IN,ON-RAIL;MCHE_SHP:NTEQ:0)"
                    multiline
                    rows={3}
                    required
                    invalid={!!errors.steps[index].driverFilters}
                    invalidmessage={errors.steps[index].driverFilters}
                  />
                </div>
              </div>
            ))}
          </div>
        );
      default:
        return <div className={styles.tabContent}>No Tab Selected</div>;
    }
  };

  return (
    <div className={styles.pageWrapper}>
      <div className={styles.container}>
        <div className={styles.card}>
          <div className={styles.buttonContainer}>
            <McButton
              label="Back"
              appearance="neutral"
              click={handleCancel}
              className={styles.actionButton}
            />
            <McButton
              label="Save"
              appearance="primary"
              click={handleSave}
              className={styles.actionButton}
            />
          </div>

          <div className={styles.tabs}>
            <button
              className={`${styles.tabButton} ${activeTab === 'ruleInfo' ? styles.activeTab : ''}`}
              onClick={() => setActiveTab('ruleInfo')}
            >
              Rule Info
            </button>
            <button
              className={`${styles.tabButton} ${activeTab === 'step' ? styles.activeTab : ''}`}
              onClick={() => setActiveTab('step')}
            >
              Step
            </button>
            <button
              className={`${styles.tabButton} ${activeTab === 'preAggregate' ? styles.activeTab : ''}`}
              onClick={() => setActiveTab('preAggregate')}
            >
              Pre-Aggregate
            </button>
            <button
              className={`${styles.tabButton} ${activeTab === 'source' ? styles.activeTab : ''}`}
              onClick={() => setActiveTab('source')}
            >
              Source
            </button>
            <button
              className={`${styles.tabButton} ${activeTab === 'join' ? styles.activeTab : ''}`}
              onClick={() => setActiveTab('join')}
            >
              Join
            </button>
            <button
              className={`${styles.tabButton} ${activeTab === 'allocation' ? styles.activeTab : ''}`}
              onClick={() => setActiveTab('allocation')}
            >
              Allocation
            </button>
            <button
              className={`${styles.tabButton} ${activeTab === 'driver' ? styles.activeTab : ''}`}
              onClick={() => setActiveTab('driver')}
            >
              Driver
            </button>
          </div>

          {renderTabContent()}
        </div>
      </div>
    </div>
  );
};

export default CreateRules;



import React, { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { McButton, McInput } from '@maersk-global/mds-react-wrapper';
import { McSelect } from '@maersk-global/mds-react-wrapper/components-core/mc-select';
import { McOption } from '@maersk-global/mds-react-wrapper/components-core/mc-option';
import styles from '../styles/CreateRule.module.css';
import data from '../data/PnLGroup.json';

const CreateRules = () => {
  const navigate = useNavigate();
  const [activeTab, setActiveTab] = useState('ruleInfo');
  const [ruleData, setRuleData] = useState({
    num: '',
    name: '',
    desc: '',
    custRefID: '',
    ruleGroup: '',
    isActive: 'Y',
    pnlGroup: '',
  });
  const [steps, setSteps] = useState([
    {
      stepNo: '',
      stepName: 'Single Step',
      StepDesc: '',
      stepType: 'S',
      preAggregatorColumns: '',
      sourceTable: '',
      sourceFilters: '',
      joinColumns: '',
      allocationColumns: '',
      driverTableID: '',
      driverWeightColumn: '',
      driverFilters: '',
    },
  ]);
  const [errors, setErrors] = useState({ rule: {}, steps: [{}] });

  // Extract PnL Group options from JSON, with fallback for empty data
  const pnlGroups = data.PnLGroups ? Object.keys(data.PnLGroups) : [];

  // Get Rule Group options based on selected PnL Group, with fallback
  const ruleGroups = ruleData.pnlGroup && data.PnLGroups[ruleData.pnlGroup]
    ? data.PnLGroups[ruleData.pnlGroup].RuleGroups || []
    : [];

  const addStep = () => {
    setSteps((prevSteps) => [
      ...prevSteps,
      {
        stepNo: '',
        stepName: '',
        StepDesc: '',
        stepType: '',
        preAggregatorColumns: '',
        sourceTable: '',
        sourceFilters: '',
        joinColumns: '',
        allocationColumns: '',
        driverTableID: '',
        driverWeightColumn: '',
        driverFilters: '',
      },
    ]);
    setErrors((prevErrors) => ({
      ...prevErrors,
      steps: [...prevErrors.steps, {}],
    }));
  };

  const validateForm = () => {
    const newErrors = { rule: {}, steps: steps.map(() => ({})) };
    let isValid = true;

    // Validate rule data (all fields are mandatory)
    Object.keys(ruleData).forEach((key) => {
      if (!ruleData[key]) {
        newErrors.rule[key] = 'This field is required';
        isValid = false;
      }
    });

    // Validate steps (all fields are mandatory)
    steps.forEach((step, index) => {
      const stepErrors = {};
      Object.keys(step).forEach((key) => {
        if (!step[key]) {
          stepErrors[key] = 'This field is required';
          isValid = false;
        }
      });
      newErrors.steps[index] = stepErrors;
    });

    setErrors(newErrors);
    return isValid;
  };

  const handleInputChange = (e, stepIndex = null) => {
    const { name, value } = e.target;
    console.log(`Input changed: ${name} = ${value}${stepIndex !== null ? ` (Step ${stepIndex + 1})` : ''}`);
    
    if (stepIndex !== null) {
      setSteps((prevSteps) => {
        const newSteps = [...prevSteps];
        newSteps[stepIndex] = { ...newSteps[stepIndex], [name]: value };
        return newSteps;
      });
      setErrors((prevErrors) => ({
        ...prevErrors,
        steps: prevErrors.steps.map((stepErrors, i) =>
          i === stepIndex ? { ...stepErrors, [name]: '' } : stepErrors
        ),
      }));
    } else {
      setRuleData((prevData) => ({
        ...prevData,
        [name]: value,
        ...(name === 'pnlGroup' ? { ruleGroup: '' } : {}),
      }));
      setErrors((prevErrors) => ({
        ...prevErrors,
        rule: { ...prevErrors.rule, [name]: '' },
      }));
    }
  };

  const handleSelectChange = (e) => {
    const { name, value } = e.target;
    console.log(`Select changed: ${name} = ${value}`);
    setRuleData((prevData) => ({
      ...prevData,
      [name]: value,
      ...(name === 'pnlGroup' ? { ruleGroup: '' } : {}),
    }));
    setErrors((prevErrors) => ({
      ...prevErrors,
      rule: { ...prevErrors.rule, [name]: '' },
    }));
  };

  const handleSave = async () => {
    if (!validateForm()) {
      console.log('Validation failed:', JSON.stringify(errors, null, 2));
      alert('Please fill out all required fields.');
      return;
    }

    // Parse comma-separated columns and filters
    const parseColumns = (input) => input.split(',').map((item) => item.trim()).filter((item) => item);
    const parseFilters = (input) => {
      const filters = input.split(';').map((item) => item.trim()).filter((item) => item);
      return filters.map((filter) => {
        const [name, filterType, values] = filter.split(':').map((item) => item.trim());
        return { name, filterType, values };
      });
    };

    const ruleJson = {
      rules: {
        rule: [
          {
            num: ruleData.num,
            name: ruleData.name,
            desc: ruleData.desc,
            custRefID: ruleData.custRefID,
            ruleGroup: ruleData.ruleGroup,
            isActive: ruleData.isActive,
            Step: steps.map((step, index) => ({
              stepNo: step.stepNo || `${ruleData.num}.${index + 1}`,
              stepName: step.stepName === 'Single Step' ? 'single' : 'multi',
              StepDesc: step.StepDesc,
              stepType: step.stepType,
              isActive: 'Y',
              SourceTable: {
                id: '1',
                Name: step.sourceTable,
              },
              sourceFilters: {
                columns: parseFilters(step.sourceFilters),
              },
              preAggregator: {
                columns: parseColumns(step.preAggregatorColumns),
              },
              join: {
                columns: parseColumns(step.joinColumns),
              },
              allocation: {
                columns: parseColumns(step.allocationColumns),
              },
              driver: {
                driverTableID: step.driverTableID,
                driverWeightColumn: step.driverWeightColumn,
                driverFilters: {
                  columns: parseFilters(step.driverFilters),
                },
              },
            })),
          },
        ],
      },
    };

    console.log('Saving Rule Data:', JSON.stringify(ruleJson, null, 2));

    try {
      const response = await fetch('/api/rules', {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'Accept': 'application/json',
        },
        body: JSON.stringify(ruleJson),
      });

      if (response.ok) {
        console.log('Rule created successfully');
        alert('Rule created successfully!');
        navigate('/');
      } else {
        const errorText = await response.text();
        console.error('Failed to create rule:', response.status, errorText);
        alert(`Failed to create rule: ${errorText || response.statusText}`);
      }
    } catch (error) {
      console.error('Error during API call:', error.message);
      alert('An error occurred while saving the rule. Please try again.');
    }
  };

  const handleCancel = () => {
    console.log('Cancelling rule creation');
    navigate('/');
  };

  const renderTabContent = () => {
    console.log('Rendering tab:', activeTab);
    switch (activeTab) {
      case 'ruleInfo':
        return (
          <div className={styles.tabContent}>
            <h3 className={styles.sectionTitle}>Rule Information</h3>
            <div className={styles.formGrid}>
              <div className={styles.gridItem}>
                <McSelect
                  label="PnL Group"
                  name="pnlGroup"
                  value={ruleData.pnlGroup}
                  optionselected={handleSelectChange}
                  placeholder="Select a PnL Group"
                  required
                  invalid={!!errors.rule.pnlGroup}
                  invalidmessage={errors.rule.pnlGroup}
                >
                  {pnlGroups.map((group) => (
                    <McOption key={group} value={group}>
                      {group}
                    </McOption>
                  ))}
                </McSelect>
              </div>
              <div className={styles.gridItem}>
                <McSelect
                  label="Rule Group"
                  name="ruleGroup"
                  value={ruleData.ruleGroup}
                  optionselected={handleSelectChange}
                  placeholder={ruleGroups.length ? "Select a Rule Group" : "Select a PnL Group first"}
                  required
                  disabled={!ruleData.pnlGroup || !ruleGroups.length}
                  invalid={!!errors.rule.ruleGroup}
                  invalidmessage={errors.rule.ruleGroup}
                >
                  {ruleGroups.map((group) => (
                    <McOption key={group} value={group}>
                      {group}
                    </McOption>
                  ))}
                </McSelect>
              </div>
            </div>
            <div className={styles.inputGroup}>
              <McInput
                label="Rule Number"
                name="num"
                value={ruleData.num}
                input={handleInputChange}
                placeholder="Enter rule number"
                required
                invalid={!!errors.rule.num}
                invalidmessage={errors.rule.num}
              />
            </div>
            <div className={styles.inputGroup}>
              <McInput
                label="Rule Name"
                name="name"
                value={ruleData.name}
                input={handleInputChange}
                placeholder="Enter rule name"
                required
                invalid={!!errors.rule.name}
                invalidmessage={errors.rule.name}
              />
            </div>
            <div className={styles.inputGroup}>
              <McInput
                label="Description"
                name="desc"
                value={ruleData.desc}
                input={handleInputChange}
                placeholder="Enter rule description"
                multiline
                rows={3}
                required
                invalid={!!errors.rule.desc}
                invalidmessage={errors.rule.desc}
              />
            </div>
            <div className={styles.inputGroup}>
              <McInput
                label="Customer Reference ID"
                name="custRefID"
                value={ruleData.custRefID}
                input={handleInputChange}
                placeholder="Enter customer reference ID"
                required
                invalid={!!errors.rule.custRefID}
                invalidmessage={errors.rule.custRefID}
              />
            </div>
            <div className={styles.inputGroup}>
              <McSelect
                label="Is Active"
                name="isActive"
                value={ruleData.isActive}
                optionselected={handleSelectChange}
                required
                invalid={!!errors.rule.isActive}
                invalidmessage={errors.rule.isActive}
              >
                <McOption value="Y">Yes</McOption>
                <McOption value="N">No</McOption>
              </McSelect>
            </div>
          </div>
        );
      case 'step':
        return (
          <div className={styles.tabContent}>
            <h3 className={styles.sectionTitle}>Step Information</h3>
            {steps.map((step, index) => (
              <div key={index} className={styles.stepCase}>
                <h4>Step {index + 1}</h4>
                <div className={styles.inputGroup}>
                  <McInput
                    minutiae
                    label="Step Number"
                    name="stepNo"
                    value={step.stepNo}
                    input={(e) => handleInputChange(e, index)}
                    placeholder={`Enter step number (e.g., ${ruleData.num}.${index + 1})`}
                    required
                    invalid={!!errors.steps[index].stepNo}
                    invalidmessage={errors.steps[index].stepNo}
                  />
                </div>
                <div className={styles.inputGroup}>
                  <McSelect
                    label="Step Name"
                    name="stepName"
                    value={step.stepName}
                    optionselected={(e) => handleInputChange(e, index)}
                    required
                    placeholder="Select Step Name"
                    invalid={!!errors.steps[index].stepName}
                    invalidmessage={errors.steps[index].stepName}
                  >
                    <McOption value="Single Step">Single Step</McOption>
                    <McOption value="Multi Step">Multi Step</McOption>
                  </McSelect>
                </div>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Step Description"
                    name="StepDesc"
                    value={step.StepDesc}
                    input={(e) => handleInputChange(e, index)}
                    placeholder="Enter step description"
                    multiline
                    rows={3}
                    required
                    invalid={!!errors.steps[index].StepDesc}
                    invalidmessage={errors.steps[index].StepDesc}
                  />
                </div>
                <div className={styles.inputGroup}>
                  <McSelect
                    label="Step Type"
                    name="stepType"
                    value={step.stepType}
                    optionselected={(e) => handleInputChange(e, index)}
                    required
                    placeholder="Select Step Type"
                    invalid={!!errors.steps[index].stepType}
                    invalidmessage={errors.steps[index].stepType}
                  >
                    <McOption value="S">S</McOption>
                    <McOption value="M">M</McOption>
                  </McSelect>
                </div>
              </div>
            ))}
            <div className={styles.buttonContainer}>
              <McButton
                label="Add Step"
                appearance="secondary"
                click={addStep}
                className={styles.actionButton}
              />
            </div>
          </div>
        );
      case 'preAggregate':
        return (
          <div className={styles.tabContent}>
            <h3 className={styles.sectionTitle}>Pre-Aggregate Columns</h3>
            {steps.map((step, index) => (
              <div key={index} className={styles.stepCase}>
                <h4>Step {index + 1}</h4>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Pre-Aggregator Columns"
                    name="preAggregatorColumns"
                    value={step.preAggregatorColumns}
                    input={(e) => handleInputChange(e, index)}
                    placeholder="Enter columns (comma-separated)"
                    multiline
                    rows={3}
                    required
                    invalid={!!errors.steps[index].preAggregatorColumns}
                    invalidmessage={errors.steps[index].preAggregatorColumns}
                  />
                </div>
              </div>
            ))}
          </div>
        );
      case 'source':
        return (
          <div className={styles.tabContent}>
            <h3 className={styles.sectionTitle}>Source Information</h3>
            {steps.map((step, index) => (
              <div key={index} className={styles.stepCase}>
                <h4>Step {index + 1}</h4>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Source Table"
                    name="sourceTable"
                    value={step.sourceTable}
                    input={(e) => handleInputChange(e, index)}
                    placeholder="Enter source table name"
                    required
                    invalid={!!errors.steps[index].sourceTable}
                    invalidmessage={errors.steps[index].sourceTable}
                  />
                </div>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Source Filters"
                    name="sourceFilters"
                    value={step.sourceFilters}
                    input={(e) => handleInputChange(e, index)}
                    placeholder="Enter filters (e.g., PNL_LINE:IN:PnL.DVC.214,PnL.DVC.215;MOVE_TYPE:EQ:EX)"
                    multiline
                    rows={3}
                    required
                    invalid={!!errors.steps[index].sourceFilters}
                    invalidmessage={errors.steps[index].sourceFilters}
                  />
                </div>
              </div>
            ))}
          </div>
        );
      case 'join':
        return (
          <div className={styles.tabContent}>
            <h3 className={styles.sectionTitle}>Join Columns</h3>
            {steps.map((step, index) => (
              <div key={index} className={styles.stepCase}>
                <h4>Step {index + 1}</h4>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Join Columns"
                    name="joinColumns"
                    value={step.joinColumns}
                    input={(e) => handleInputChange(e, index)}
                    placeholder="Enter columns (comma-separated)"
                    multiline
                    rows={3}
                    required
                    invalid={!!errors.steps[index].joinColumns}
                    invalidmessage={errors.steps[index].joinColumns}
                  />
                </div>
              </div>
            ))}
          </div>
        );
      case 'allocation':
        return (
          <div className={styles.tabContent}>
            <h3 className={styles.sectionTitle}>Allocation Columns</h3>
            {steps.map((step, index) => (
              <div key={index} className={styles.stepCase}>
                <h4>Step {index + 1}</h4>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Allocation Columns"
                    name="allocationColumns"
                    value={step.allocationColumns}
                    input={(e) => handleInputChange(e, index)}
                    placeholder="Enter columns (comma-separated)"
                    multiline
                    rows={3}
                    required
                    invalid={!!errors.steps[index].allocationColumns}
                    invalidmessage={errors.steps[index].allocationColumns}
                  />
                </div>
              </div>
            ))}
          </div>
        );
      case 'driver':
        return (
          <div className={styles.tabContent}>
            <h3 className={styles.sectionTitle}>Driver Information</h3>
            {steps.map((step, index) => (
              <div key={index} className={styles.stepCase}>
                <h4>Step {index + 1}</h4>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Driver Table ID"
                    name="driverTableID"
                    value={step.driverTableID}
                    input={(e) => handleInputChange(e, index)}
                    placeholder="Enter driver table ID"
                    required
                    invalid={!!errors.steps[index].driverTableID}
                    invalidmessage={errors.steps[index].driverTableID}
                  />
                </div>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Driver Weight Column"
                    name="driverWeightColumn"
                    value={step.driverWeightColumn}
                    input={(e) => handleInputChange(e, index)}
                    placeholder="Enter driver weight column"
                    required
                    invalid={!!errors.steps[index].driverWeightColumn}
                    invalidmessage={errors.steps[index].driverWeightColumn}
                  />
                </div>
                <div className={styles.inputGroup}>
                  <McInput
                    label="Driver Filters"
                    name="driverFilters"
                    value={step.driverFilters}
                    input={(e) => handleInputChange(e, index)}
                    placeholder="Enter filters"
                    multiline
                    rows={3}
                    required
                    invalid={!!errors.steps[index].driverFilters}
                    invalidmessage={errors.steps[index].driverFilters}
                  />
                </div>
              </div>
            ))}
          </div>
        );
      default:
        return <div className={styles.tabContent}>No Tab Selected</div>;
    }
  };

  return (
    <div className={styles.pageWrapper}>
      <div className={styles.container}>
        <div className={styles.card}>
          <div className={styles.buttonContainer}>
            <McButton
              label="Back"
              appearance="neutral"
              click={handleCancel}
              className={styles.actionButton}
            />
            <McButton
              label="Save"
              appearance="primary"
              click={handleSave}
              className={styles.actionButton}
            />
          </div>

          <div className={styles.tabs}>
            <button
              className={`${styles.tabButton} ${activeTab === 'ruleInfo' ? styles.activeTab : ''}`}
              onClick={() => setActiveTab('ruleInfo')}
            >
              Rule Info
            </button>
            <button
              className={`${styles.tabButton} ${activeTab === 'step' ? styles.activeTab : ''}`}
              onClick={() => setActiveTab('step')}
            >
              Step
            </button>
            <button
              className={`${styles.tabButton} ${activeTab === 'preAggregate' ? styles.activeTab : ''}`}
              onClick={() => setActiveTab('preAggregate')}
            >
              Pre-Aggregate
            </button>
            <button
              className={`${styles.tabButton} ${activeTab === 'source' ? styles.activeTab : ''}`}
              onClick={() => setActiveTab('source')}
            >
              Source
            </button>
            <button
              className={`${styles.tabButton} ${activeTab === 'join' ? styles.activeTab : ''}`}
              onClick={() => setActiveTab('join')}
            >
              Join
            </button>
            <button
              className={`${styles.tabButton} ${activeTab === 'allocation' ? styles.activeTab : ''}`}
              onClick={() => setActiveTab('allocation')}
            >
              Allocation
            </button>
            <button
              className={`${styles.tabButton} ${activeTab === 'driver' ? styles.activeTab : ''}`}
              onClick={() => setActiveTab('driver')}
            >
              Driver
            </button>
          </div>

          {renderTabContent()}
        </div>
      </div>
    </div>
  );
};

export default CreateRules;
Launch your own pro-level crypto exchange with Hivelance’s Coinbase Clone Script integrated with AI-powered trading bots. Built for expert traders, it features advanced order types, real-time analytics, top-tier security, and goes live in just 10 days. Fast, customizable, and ready for the bull market!

🔥 Key Features of Coinbase Clone Script

✅ Smart Trading Bots for 24/7 automated trading
✅ Advanced Order Types – Limit, Stop, Market, and more
✅ Real-Time Price Charts & Analytics
✅ High-Speed Matching Engine
✅ Bank-Grade Security Protocols
✅ KYC/AML Integration for Compliance
✅ Multi-Currency & Wallet Support
✅ Responsive Web & Mobile Interface
✅ 100% Customizable & Bug-Free Script
✅ And More

💡 Ideal for entrepreneurs & crypto startups

📞 Contact us now & dominate the crypto trading market!

Website - https://www.hivelance.com/coinbase-clone-script
Telegram - https://telegram.me/HiveLance
Call/WhatsApp - 918438595928
-- Merchant_PerTxnLimit_Check
DROP TABLE team_kingkong.offus_Merchant_PerTxnLimit_Check_breaches;

-- CREATE TABLE team_kingkong.offus_Merchant_PerTxnLimit_Check_breaches AS
INSERT INTO team_kingkong.offus_Merchant_PerTxnLimit_Check_breaches
SELECT transactionid, txn_amount, txn_date, paytmmerchantid, txn_timestamp, paymethod
, case when edc_mid is not null then 'EDC' else 'QR' end as mid_type
, C.per_txn_limit
, C.limit_date
, 'per txn amt limit breached' as breach_reason
FROM
    (SELECT DISTINCT pg_mid from cdo.total_offline_merchant_base_snapshot_v3) f
INNER join
    (select distinct transactionid
    , cast(eventamount as double)/100 as txn_amount
    , paytmmerchantid
    , globalcardindex
    , DATE(dl_last_updated) AS txn_date
    , CAST(velocitytimestamp AS DOUBLE) AS txn_timestamp
    , paymethod
    from cdp_risk_transform.maquette_flattened_offus_snapshot_v3
    where dl_last_updated BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    and paymethod in ('UPI')
    AND actionrecommended <> 'BLOCK' AND responsestatus = 'SUCCESS') a
on a.paytmmerchantid = f.pg_mid
LEFT JOIN
    (SELECT DISTINCT mid AS edc_mid FROM paytmpgdb.entity_edc_info_snapshot_v3
    WHERE terminal_status = 'ACTIVE' AND dl_last_updated >= DATE '2010-01-01') b
ON a.paytmmerchantid = b.edc_mid
INNER JOIN
    (SELECT content as mid, CAST(comment AS DOUBLE) as per_txn_limit, "timestamp" as limit_date
    FROM team_kingkong.merchant_limit_list)C
ON a.paytmmerchantid = C.mid AND a.txn_date > DATE(FROM_UNIXTIME(CAST(limit_date AS double) / 1000))
INNER JOIN
    (select distinct txn_id as pg_txn_id
    from dwh.pg_olap
    where ingest_date BETWEEN DATE'2025-01-01' AND DATE'2025-01-31' 
    and txn_started_at BETWEEN  DATE'2025-01-01' AND DATE'2025-01-31'
    and txn_status = 'SUCCESS') d
on a.transactionid = d.pg_txn_id
WHERE a.txn_amount > C.per_txn_limit;
-- CCUPI_vpa_mid_hourly_limit
DROP TABLE team_kingkong.offus_CCUPI_vpa_mid_hourly_limit_breaches;

-- CREATE TABLE team_kingkong.offus_CCUPI_vpa_mid_hourly_limit_breaches AS
INSERT INTO team_kingkong.offus_CCUPI_vpa_mid_hourly_limit_breaches
with offus_txn as
(SELECT DISTINCT transactionid, txn_amount, txn_date, paytmmerchantid, txn_timestamp, small_vpa
, case when edc_mid is not null then 'EDC' else 'QR' end as mid_type FROM
    (SELECT pg_mid from cdo.total_offline_merchant_base_snapshot_v3) f
INNER join
    (select transactionid
    , cast(eventamount as double)/100 as txn_amount
    , paytmmerchantid
    , DATE(dl_last_updated) AS txn_date
    , CAST(velocitytimestamp AS DOUBLE) AS txn_timestamp
    , small_vpa
    from cdp_risk_transform.maquette_flattened_offus_snapshot_v3
    where dl_last_updated BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    AND isupicc = 'true' AND actionrecommended <> 'BLOCK' AND responsestatus = 'SUCCESS') a
on a.paytmmerchantid = f.pg_mid
LEFT JOIN
    (SELECT mid AS edc_mid FROM paytmpgdb.entity_edc_info_snapshot_v3
    WHERE terminal_status = 'ACTIVE' AND dl_last_updated >= DATE '2010-01-01') b
ON a.paytmmerchantid = b.edc_mid
INNER JOIN
    (select distinct txn_id as pg_txn_id
    from dwh.pg_olap
    where ingest_date BETWEEN DATE'2025-01-01' AND DATE'2025-01-31' 
    and txn_started_at BETWEEN  DATE'2025-01-01' AND DATE'2025-01-31'
    and txn_status = 'SUCCESS') d
on a.transactionid = d.pg_txn_id)

SELECT *, '1 hr txn cnt & amt threshold breach' as breach_reason FROM
    (SELECT A.transactionid, A.txn_amount, A.txn_date, A.paytmmerchantid, A.small_vpa, A.mid_type, 'CCUPI_vpa_mid_hourly_limit' AS rule_name, A.txn_timestamp
    , COUNT(B.transactionid) as txn1_hr
    , 3 as txn1_hr_threshold
    , SUM(B.txn_amount) as amt1_hr
    , 2000 as amt1_hr_threshold
    FROM
        (SELECT * FROM offus_txn
        WHERE txn_date BETWEEN date '2025-01-01' AND DATE'2025-01-31')A
    INNER JOIN
        (SELECT * FROM offus_txn)B
    ON A.small_vpa = B.small_vpa AND A.paytmmerchantid = B.paytmmerchantid AND (A.txn_timestamp - B.txn_timestamp) BETWEEN 0 AND 3600000 -- <= 1hour
    AND A.transactionid <> B.transactionid
    GROUP BY 1,2,3,4,5,6,7,8)
WHERE (txn1_hr >= txn1_hr_threshold) AND ((amt1_hr + txn_amount) > amt1_hr_threshold)
;
-- CCUPI_vpa_mid_daily_limit
DROP TABLE team_kingkong.offus_CCUPI_vpa_mid_daily_limit_breaches;
 
-- CREATE TABLE team_kingkong.offus_CCUPI_vpa_mid_daily_limit_breaches AS
INSERT INTO team_kingkong.offus_CCUPI_vpa_mid_daily_limit_breaches
with offus_txn as
(SELECT transactionid, txn_amount, txn_date, paytmmerchantid, txn_timestamp, small_vpa
, case when edc_mid is not null then 'EDC' else 'QR' end as mid_type FROM
    (SELECT DISTINCT pg_mid from cdo.total_offline_merchant_base_snapshot_v3) f
INNER join
    (select distinct transactionid
    , cast(eventamount as double)/100 as txn_amount
    , paytmmerchantid
    , DATE(dl_last_updated) AS txn_date
    , CAST(velocitytimestamp AS DOUBLE) AS txn_timestamp
    , small_vpa
    from cdp_risk_transform.maquette_flattened_offus_snapshot_v3
    where dl_last_updated BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    AND isupicc = 'true' AND actionrecommended <> 'BLOCK') a
on a.paytmmerchantid = f.pg_mid
LEFT JOIN
    (SELECT DISTINCT mid AS edc_mid FROM paytmpgdb.entity_edc_info_snapshot_v3
    WHERE terminal_status = 'ACTIVE' AND dl_last_updated >= DATE '2010-01-01') b
ON a.paytmmerchantid = b.edc_mid
INNER JOIN
    (select distinct txn_id as pg_txn_id, mcc
    from dwh.pg_olap
    where ingest_date BETWEEN DATE'2025-01-01' AND DATE(DATE'2025-01-31' + INTERVAL '1' DAY)
    and txn_started_at BETWEEN  DATE'2025-01-01' AND DATE(DATE'2025-01-31' + INTERVAL '1' DAY)
    and txn_status = 'SUCCESS') d
on a.transactionid = d.pg_txn_id)
 
SELECT *, '1 day txn cnt threshold breached' as breach_reason FROM
    (SELECT A.transactionid, A.txn_amount, A.txn_date, A.paytmmerchantid, A.small_vpa, A.mid_type, 'CCUPI_vpa_mid_daily_limit' AS rule_name, A.txn_timestamp
    , COUNT(B.transactionid) as txn1_day
    , 5 as txn1_day_threshold
    FROM
        (SELECT * FROM offus_txn
        WHERE txn_date BETWEEN date '2025-01-01' AND DATE'2025-01-31'
        AND txn_amount <= 2000)A
    INNER JOIN
        (SELECT * FROM offus_txn)B
    ON A.small_vpa = B.small_vpa AND A.paytmmerchantid = B.paytmmerchantid AND (A.txn_timestamp - B.txn_timestamp) BETWEEN 0 AND 3600000 -- <= 1hour
    AND A.transactionid <> B.transactionid
    GROUP BY 1,2,3,4,5,6,7,8)
WHERE txn1_day >= txn1_day_threshold;

SELECT MIN(txn_date) FROM team_kingkong.offus_CCUPI_vpa_mid_daily_limit_breaches 
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":aboriginal_flag: Xero Boost Days - What's On :aboriginal_flag:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Good Morning Meanjin, and welcome to Reconciliation Week!\n\n *Reconciliation Week (27 May – 3 June)* is a time for all Australians to learn about our shared histories, cultures, and achievements, and to explore how we can contribute to reconciliation in Australia. \n\n For Aboriginal and Torres Strait Islander peoples, it’s a powerful reminder of ongoing resilience, the importance of truth-telling, and the work still needed to achieve genuine equity and justice."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-3: Monday, 26th May",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Enjoy free coffee and café-style beverages from our Cafe partner *Edwards*.\n:Lunch: *Lunch*: from *12pm* in the kitchen.\n:massage:*Wellbeing*: Pilates at *SP Brisbane City* is bookable every Monday!"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-28: Wednesday, 28th May",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Café Partnership*: Enjoy free coffee and café-style beverages from our Cafe partner *Edwards*.\n:lunch: *Reconciliation Week Morning Tea* provided by <https://jarrahcatering.com.au/|Jarrah Catering> from *9:30am* in the kitchen! \n\n :microphone: We will also have a video of our very own *Tony Davison* talking on behalf of the #reconciliation-au ERG around Xero's Reconciliation plan and what this week means! \n\n :slack: In the thread we will also have a special background for you to use on Google Meet if you would like to participate."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-30: Friday, 30th May",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":cheers-9743: *Social Happy Hour* from 3pm - 4pm in the kitchen! Wind down for the week over some delicious drinks & nibbles."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0?cid=Y19uY2M4cDN1NDRsdTdhczE0MDhvYjZhNnRjb0Bncm91cC5jYWxlbmRhci5nb29nbGUuY29t|*Brisbane Social Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;

// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED - Do not modify or remove comment markers above or below:

if ( !function_exists( 'chld_thm_cfg_locale_css' ) ):
    function chld_thm_cfg_locale_css( $uri ){
        if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) )
            $uri = get_template_directory_uri() . '/rtl.css';
        return $uri;
    }
endif;
add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' );
         
if ( !function_exists( 'child_theme_configurator_css' ) ):
    function child_theme_configurator_css() {
        wp_enqueue_style( 'chld_thm_cfg_child', trailingslashit( get_stylesheet_directory_uri() ) . 'style.css', array( 'hello-elementor','hello-elementor','hello-elementor-theme-style','hello-elementor-header-footer' ) );
    }
endif;
add_action( 'wp_enqueue_scripts', 'child_theme_configurator_css', 10 );

// END ENQUEUE PARENT ACTION



/*
Theme Name: Hello Elementor Child
Theme URI: https://elementor.com/hello-theme/?utm_source=wp-themes&utm_campaign=theme-uri&utm_medium=wp-dash
Template: hello-elementor
Author: Elementor Team
Author URI: https://elementor.com/?utm_source=wp-themes&utm_campaign=author-uri&utm_medium=wp-dash
Description: Hello Elementor is a lightweight and minimalist WordPress theme that was built specifically to work seamlessly with the Elementor site builder plugin. The theme is free, open-source, and designed for users who want a flexible, easy-to-use, and customizable website. The theme, which is optimized for performance, provides a solid foundation for users to build their own unique designs using the Elementor drag-and-drop site builder. Its simplicity and flexibility make it a great choice for both beginners and experienced Web Creators.
Tags: accessibility-ready,flexible-header,custom-colors,custom-menu,custom-logo,featured-images,rtl-language-support,threaded-comments,translation-ready
Version: 3.3.0.1744009168
Updated: 2025-04-07 06:59:28

*/

<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;

// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED - Do not modify or remove comment markers above or below:

if ( !function_exists( 'chld_thm_cfg_locale_css' ) ):
    function chld_thm_cfg_locale_css( $uri ){
        if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) )
            $uri = get_template_directory_uri() . '/rtl.css';
        return $uri;
    }
endif;
add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' );
         
if ( !function_exists( 'child_theme_configurator_css' ) ):
    function child_theme_configurator_css() {
        wp_enqueue_style( 'chld_thm_cfg_child', trailingslashit( get_stylesheet_directory_uri() ) . 'style.css', array( 'hello-elementor','hello-elementor','hello-elementor-theme-style','hello-elementor-header-footer' ) );
    }
endif;
add_action( 'wp_enqueue_scripts', 'child_theme_configurator_css', 10 );

// END ENQUEUE PARENT ACTION



/*
Theme Name: Hello Elementor Child
Theme URI: https://elementor.com/hello-theme/?utm_source=wp-themes&utm_campaign=theme-uri&utm_medium=wp-dash
Template: hello-elementor
Author: Elementor Team
Author URI: https://elementor.com/?utm_source=wp-themes&utm_campaign=author-uri&utm_medium=wp-dash
Description: Hello Elementor is a lightweight and minimalist WordPress theme that was built specifically to work seamlessly with the Elementor site builder plugin. The theme is free, open-source, and designed for users who want a flexible, easy-to-use, and customizable website. The theme, which is optimized for performance, provides a solid foundation for users to build their own unique designs using the Elementor drag-and-drop site builder. Its simplicity and flexibility make it a great choice for both beginners and experienced Web Creators.
Tags: accessibility-ready,flexible-header,custom-colors,custom-menu,custom-logo,featured-images,rtl-language-support,threaded-comments,translation-ready
Version: 3.3.0.1744009168
Updated: 2025-04-07 06:59:28

*/

-- MONTHLY BREACH COUNT
-- team_kingkong.offus_MID_CCDC_Daily_TXN_limit_Check_breaches
SELECT substr(cast(txn_date as varchar(30)), 1, 7) as year_month
, COUNT(transactionid) AS breach_cnt
, SUM(txn_amount) as breach_amt
, COUNT(DISTINCT globalcardindex) as card_cnt
FROM
(SELECT DISTINCT *
FROM team_kingkong.offus_MID_CCDC_Daily_TXN_limit_Check_breaches)
GROUP BY 1 ORDER BY 1;

-- team_kingkong.offus_edc_card_velocity_count_breaches
SELECT substr(cast(txn_date as varchar(30)), 1, 7) as year_month
, COUNT(transactionid) AS breach_cnt
, SUM(txn_amount) as breach_amt
, COUNT(DISTINCT globalcardindex) as card_cnt
FROM
(SELECT DISTINCT *
FROM team_kingkong.offus_edc_card_velocity_count_breaches)
GROUP BY 1 ORDER BY 1;

-- team_kingkong.offus_Merchant_PerTxnLimit_Check_breaches
SELECT substr(cast(txn_date as varchar(30)), 1, 7) as year_month
, COUNT(transactionid) AS breach_cnt
, SUM(txn_amount) as breach_amt
-- , COUNT(DISTINCT globalcardindex) as card_cnt
FROM
(SELECT DISTINCT *
FROM team_kingkong.offus_Merchant_PerTxnLimit_Check_breaches)
GROUP BY 1 ORDER BY 1;

-- team_kingkong.offus_edc_card_velocity_amount_breaches
SELECT substr(cast(txn_date as varchar(30)), 1, 7) as year_month
, COUNT(transactionid) AS breach_cnt
, SUM(txn_amount) as breach_amt
, COUNT(DISTINCT globalcardindex) as card_cnt
FROM
(SELECT DISTINCT *
FROM team_kingkong.offus_edc_card_velocity_amount_breaches)
GROUP BY 1 ORDER BY 1;

-- team_kingkong.offus_MID_UPI_Daily_TXN_limit_Check_breaches
SELECT substr(cast(txn_date as varchar(30)), 1, 7) as year_month
, COUNT(transactionid) AS breach_cnt
, SUM(txn_amount) as breach_amt
, COUNT(DISTINCT globalcardindex) as card_cnt
FROM
(SELECT DISTINCT *
FROM team_kingkong.offus_MID_UPI_Daily_TXN_limit_Check_breaches)
GROUP BY 1 ORDER BY 1;

-- team_kingkong.offus_oil_gas_dc_limit_EDC_breaches
SELECT substr(cast(txn_date as varchar(30)), 1, 7) as year_month
, COUNT(transactionid) AS breach_cnt
, SUM(txn_amount) as breach_amt
, COUNT(DISTINCT globalcardindex) as card_cnt
FROM
(SELECT DISTINCT *
FROM team_kingkong.offus_oil_gas_dc_limit_EDC_breaches)
GROUP BY 1 ORDER BY 1;

-- team_kingkong.offus_ICA_Unsafe_Country_Transactions_breaches
SELECT substr(cast(txn_date as varchar(30)), 1, 7) as year_month
, COUNT(transactionid) AS breach_cnt
, SUM(txn_amount) as breach_amt
, COUNT(DISTINCT globalcardindex) as card_cnt
FROM
(SELECT DISTINCT *
FROM team_kingkong.offus_ICA_Unsafe_Country_Transactions_breaches)
GROUP BY 1 ORDER BY 1;
DROP TABLE team_kingkong.offus_edc_card_velocity_amount_breaches;

-- CREATE TABLE team_kingkong.offus_edc_card_velocity_amount_breaches AS
INSERT INTO team_kingkong.offus_edc_card_velocity_amount_breaches
with offus_txn as
(SELECT DISTINCT globalcardindex, transactionid, txn_amount, txn_date, paytmmerchantid, txn_timestamp FROM
    (SELECT DISTINCT pg_mid from cdo.total_offline_merchant_base_snapshot_v3) f
INNER join
    (select transactionid
    , cast(eventamount as double)/100 as txn_amount
    , paytmmerchantid
    , globalcardindex
    , DATE(dl_last_updated) AS txn_date
    , CAST(velocitytimestamp AS DOUBLE) AS txn_timestamp
    from cdp_risk_transform.maquette_flattened_offus_snapshot_v3
    where dl_last_updated BETWEEN date'2025-01-01' AND DATE'2025-01-31'
    and paymethod in ('CREDIT_CARD','DEBIT_CARD','EMI','EMI_DC')
    AND actionrecommended <> 'BLOCK' AND responsestatus = 'SUCCESS'
    AND paytmmerchantid IS NOT NULL AND paytmmerchantid <> '' AND paytmmerchantid <> ' '
    AND globalcardindex IS NOT NULL AND globalcardindex <> '' AND globalcardindex <> ' ') a
on a.paytmmerchantid = f.pg_mid
LEFT JOIN
    (SELECT mid AS edc_mid FROM paytmpgdb.entity_edc_info_snapshot_v3
    WHERE terminal_status = 'ACTIVE' AND dl_last_updated >= DATE '2010-01-01') b 
ON a.paytmmerchantid = b.edc_mid
INNER JOIN
    (select distinct txn_id as pg_txn_id
    from dwh.pg_olap
    where ingest_date BETWEEN DATE'2025-01-01' AND DATE'2025-06-30' 
    and txn_started_at BETWEEN  DATE'2025-01-01' AND DATE'2025-06-30'
    and txn_status = 'SUCCESS') d
on a.transactionid = d.pg_txn_id)

SELECT *, CASE
  WHEN (amt6_hr + txn_amount) > 1000000 AND (amt24_hr + txn_amount) > 2000000 THEN 'amt6_hr + txn_amount breach, amt24_hr + txn_amount breach'
  WHEN (amt6_hr + txn_amount) > 1000000 THEN 'amt6_hr + txn_amount breach'
  WHEN (amt24_hr + txn_amount) > 2000000 THEN 'amt24_hr + txn_amount breach'
  ELSE NULL END as breach_reason FROM 
    (SELECT A.globalcardindex, A.transactionid, A.txn_amount, A.txn_date, A.paytmmerchantid, 'edc_card_velocity_amount' AS rule_name, A.txn_timestamp
    , SUM(IF((A.txn_timestamp - B.txn_timestamp) BETWEEN 0 AND 21600000, B.txn_amount, NULL)) AS amt6_hr
    , 1000000 AS amt6_hr_threshold
    , SUM(B.txn_amount) as amt24_hr
    , 2000000 AS amt4_hr_threshold
    FROM
        (SELECT * FROM offus_txn
        WHERE txn_date BETWEEN date'2025-01-01' AND DATE'2025-01-31')A
    INNER JOIN
        (SELECT * FROM offus_txn)B
    ON A.globalcardindex = b.globalcardindex AND A.paytmmerchantid = B.paytmmerchantid AND A.transactionid <> B.transactionid
    AND (A.txn_timestamp - B.txn_timestamp) BETWEEN 0 AND 86400000 -- <= 1d
    GROUP BY 1,2,3,4,5,6,7)
WHERE ((amt6_hr + txn_amount) > 1000000) OR ((amt24_hr + txn_amount) > 2000000);
DROP TABLE team_kingkong.offus_ICA_Unsafe_Country_Transactions_breaches;
 
-- CREATE TABLE team_kingkong.offus_ICA_Unsafe_Country_Transactions_breaches AS
INSERT INTO team_kingkong.offus_ICA_Unsafe_Country_Transactions_breaches
SELECT globalcardindex, transactionid, txn_amount, txn_date, paytmmerchantid, txn_timestamp, paymethod
, case when edc_mid is not null then 'EDC' else 'QR' end as mid_type, bankcountry, small_vpa, country_bl_date
,'txn from blacklisted country' as breach_reason FROM
    (SELECT DISTINCT pg_mid from cdo.total_offline_merchant_base_snapshot_v3) f
INNER join
    (select distinct transactionid, bankcountry, small_vpa
    , cast(eventamount as double)/100 as txn_amount
    , paytmmerchantid
    , globalcardindex
    , DATE(dl_last_updated) AS txn_date
    , CAST(velocitytimestamp AS DOUBLE) AS txn_timestamp
    , paymethod
    from cdp_risk_transform.maquette_flattened_offus_snapshot_v3
    where dl_last_updated BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    AND actionrecommended <> 'BLOCK' AND responsestatus = 'SUCCESS'
    AND isindian = 'false' AND bankcountry IS NOT NULL) a
on a.paytmmerchantid = f.pg_mid
LEFT JOIN
    (SELECT DISTINCT mid AS edc_mid FROM paytmpgdb.entity_edc_info_snapshot_v3
    WHERE terminal_status = 'ACTIVE' AND dl_last_updated >= DATE '2010-01-01') b
ON a.paytmmerchantid = b.edc_mid
INNER JOIN
    (SELECT content as country, "timestamp" AS country_bl_date
    FROM team_kingkong.high_risk_country_list
    WHERE DATE(FROM_UNIXTIME(CAST("timestamp" AS double) / 1000)) <= DATE'2025-01-31')C
ON a.bankcountry = C.country AND DATE(FROM_UNIXTIME(CAST(country_bl_date AS double) / 1000)) < a.txn_date
INNER JOIN
    (select distinct txn_id as pg_txn_id
    from dwh.pg_olap
    where ingest_date BETWEEN DATE'2025-01-01' AND DATE'2025-01-31' 
    and txn_started_at BETWEEN  DATE'2025-01-01' AND DATE'2025-01-31'
    and txn_status = 'SUCCESS') d
on a.transactionid = d.pg_txn_id;
@media (max-width: 480px){
	.campaign-zone .wrapper {
    padding-top: 0px;
}

.campaign-zone{
	width: 100%;
	padding-top: 0px;
}

.wrapper{
	padding: 0px;
}
}
-- MID_UPI_Daily_TXN_limit_Check
-- DROP TABLE team_kingkong.offus_MID_UPI_Daily_TXN_limit_Check_breaches;

-- CREATE TABLE team_kingkong.offus_MID_UPI_Daily_TXN_limit_Check_breaches AS
INSERT INTO team_kingkong.offus_MID_UPI_Daily_TXN_limit_Check_breaches
with offus_txn as
(SELECT globalcardindex, transactionid, txn_amount, txn_date, paytmmerchantid, txn_timestamp, paymethod
, case when edc_mid is not null then 'EDC' else 'QR' end as mid_type
, 5 AS threshold_5min
, 40 AS threshold_1day
FROM
    (SELECT DISTINCT pg_mid from cdo.total_offline_merchant_base_snapshot_v3) f
INNER join
    (select distinct transactionid
    , cast(eventamount as double)/100 as txn_amount
    , paytmmerchantid
    , globalcardindex
    , DATE(dl_last_updated) AS txn_date
    , CAST(velocitytimestamp AS DOUBLE) AS txn_timestamp
    , paymethod
    from cdp_risk_transform.maquette_flattened_offus_snapshot_v3
    where dl_last_updated BETWEEN DATE(DATE'2025-08-15' - INTERVAL '1' DAY) AND DATE'2025-08-21'
    and paymethod in ('UPI')
    AND actionrecommended <> 'BLOCK' AND responsestatus = 'SUCCESS') a
on a.paytmmerchantid = f.pg_mid
LEFT JOIN
    (SELECT DISTINCT mid AS edc_mid FROM paytmpgdb.entity_edc_info_snapshot_v3
    WHERE terminal_status = 'ACTIVE' AND dl_last_updated >= DATE '2010-01-01') b
ON a.paytmmerchantid = b.edc_mid
INNER JOIN
    (select distinct txn_id as pg_txn_id
    from dwh.pg_olap
    where ingest_date BETWEEN DATE'2025-08-15' AND DATE(DATE'2025-08-21' + INTERVAL '1' DAY)
    and txn_started_at BETWEEN  DATE'2025-08-15' AND DATE(DATE'2025-08-21' + INTERVAL '1' DAY)
    and txn_status = 'SUCCESS') d
on a.transactionid = d.pg_txn_id)

SELECT *, CASE
    WHEN (txn5_min >= threshold_5min) AND (txn1_day >= threshold_1day) THEN '5 min txn threshold breach, 1 day txn threshold breach'
    WHEN (txn5_min >= threshold_5min) THEN '5 min txn threshold breach'
    WHEN (txn1_day >= threshold_1day) THEN '1 day txn threshold breach'
    ELSE NULL END AS breach_reason FROM
    (SELECT a.globalcardindex, A.transactionid, A.txn_amount, A.txn_date, A.paytmmerchantid, A.txn_timestamp
    , A.mid_type, A.paymethod
    , A.threshold_5min
    , A.threshold_1day
    , COUNT(IF((A.txn_timestamp - B.txn_timestamp) BETWEEN 0 AND 300000, B.transactionid, NULL)) AS txn5_min
    , COUNT(B.transactionid) as txn1_day
    , 'MID_UPI_Daily_TXN_limit_Check' AS rule_name
    FROM
        (SELECT * FROM offus_txn
        WHERE txn_date BETWEEN DATE'2025-08-15' AND  DATE'2025-08-21')A
    INNER JOIN
        (SELECT * FROM offus_txn)B
    ON A.globalcardindex = b.globalcardindex AND A.paytmmerchantid = B.paytmmerchantid
    AND A.transactionid <> B.transactionid
    AND (A.txn_timestamp - B.txn_timestamp) BETWEEN 0 AND 86400000 -- <= 1d
    GROUP BY 1,2,3,4,5,6,7,8,9,10)
WHERE (txn5_min >= threshold_5min) OR (txn1_day >= threshold_1day);
-- DROP TABLE team_kingkong.offus_MID_UPI_Daily_TXN_limit_Check_breaches;

-- CREATE TABLE team_kingkong.offus_MID_UPI_Daily_TXN_limit_Check_breaches AS
INSERT INTO team_kingkong.offus_MID_UPI_Daily_TXN_limit_Check_breaches
with offus_txn as
(SELECT globalcardindex, transactionid, txn_amount, txn_date, paytmmerchantid, txn_timestamp, paymethod
, case when edc_mid is not null then 'EDC' else 'QR' end as mid_type
, 5 AS threshold_5min
, 40 AS threshold_1day
FROM
    (SELECT DISTINCT pg_mid from cdo.total_offline_merchant_base_snapshot_v3) f
INNER join
    (select distinct transactionid
    , cast(eventamount as double)/100 as txn_amount
    , paytmmerchantid
    , globalcardindex
    , DATE(dl_last_updated) AS txn_date
    , CAST(velocitytimestamp AS DOUBLE) AS txn_timestamp
    , paymethod
    from cdp_risk_transform.maquette_flattened_offus_snapshot_v3
    where dl_last_updated BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31' -- BETWEEN date'2025-01-31' AND
    and paymethod in ('UPI')
    AND actionrecommended <> 'BLOCK') a
on a.paytmmerchantid = f.pg_mid
LEFT JOIN
    (SELECT DISTINCT mid AS edc_mid FROM paytmpgdb.entity_edc_info_snapshot_v3
    WHERE terminal_status = 'ACTIVE' AND dl_last_updated >= DATE '2010-01-01') b
ON a.paytmmerchantid = b.edc_mid
INNER JOIN
    (select distinct txn_id as pg_txn_id
    from dwh.pg_olap
    where ingest_date BETWEEN DATE'2025-01-01' AND DATE(DATE'2025-01-31' + INTERVAL '1' DAY)
    and txn_started_at BETWEEN  DATE'2025-01-01' AND DATE(DATE'2025-01-31' + INTERVAL '1' DAY)
    and txn_status = 'SUCCESS') d
on a.transactionid = d.pg_txn_id)

SELECT * FROM
    (SELECT a.globalcardindex, A.transactionid, A.txn_amount, A.txn_date, A.paytmmerchantid, A.txn_timestamp
    , A.mid_type, A.paymethod
    , A.threshold_5min
    , A.threshold_1day
    , COUNT(IF((A.txn_timestamp - B.txn_timestamp) BETWEEN 0 AND 300000, B.transactionid, NULL)) AS txn5_min
    , COUNT(B.transactionid) as txn1_day
    , 'MID_UPI_Daily_TXN_limit_Check' AS rule_name
    FROM
        (SELECT * FROM offus_txn
        WHERE txn_date BETWEEN DATE'2025-01-01' AND  DATE'2025-01-31')A
    INNER JOIN
        (SELECT * FROM offus_txn)B
    ON A.globalcardindex = b.globalcardindex AND A.paytmmerchantid = B.paytmmerchantid
    AND A.transactionid <> B.transactionid
    AND (A.txn_timestamp - B.txn_timestamp) BETWEEN 0 AND 86400000 -- <= 1d
    GROUP BY 1,2,3,4,5,6,7,8,9,10)
WHERE (txn5_min >= threshold_5min) OR (txn1_day >= threshold_1day);
// You are using GCC
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    cout<<"sorted array after selection sort:";
    for(int i=0;i<n;i++){
        int index=i;
        for(int j=i+1;j<n;j++){
            if(arr[j]<arr[index] || arr[j]==arr[index]){
                index=j;
            }
        }
        swap(arr[i],arr[index]);
        cout<<arr[i]<<" ";
    }
    return 0;
}
// You are using GCC
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    for(int i=0;i<n;i++){
        int min=arr[i];
        int j=i-1;
        while(j>=0 && arr[j]>min){
            arr[j+1]=arr[j];
            j--;
        }
        arr[j+1]=min;
        // cout<<"iretation "<<i+1<<":";
        // for(int k=0;k<n;k++){
        //     cout<<arr[k]<<" ";
        // }
        // cout<<endl;
    }
    cout<<"after sorted using insertion sort:"<<endl;
    for(int i=0;i<n;i++){
        cout<<arr[i]<<" ";
    }
    
    return 0;
}
// You are using GCC
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    cout<<"after sorted using bubble sort: ";
    for(int i=0;i<n-1;i++){
        for(int j=0;j<n-i-1;j++){
            if(arr[j]>arr[j+1]){
                swap(arr[j],arr[j+1]);
            //   int temp=arr[j];
            //   arr[j]=arr[j+1];
            //   arr[j+1]=temp;
            }
        }
    }
        for(int i=0;i<n;i++){
        cout<<arr[i]<<" ";
        }
    }
/*Tabs > Titles: Remove all caps, increase font size and reduce letter spacing.*/
.blocks-tabs__header-item{
  text-transform: none;
  font-size: 1.5rem;
  letter-spacing: .04rem;
}
/*Quote carousel > Progression circles and arrows: Change arrow hover colour, change progression cirle hover opacity and scale.*/
.block-quote--carousel .carousel-controls-next,
.block-quote--carousel .carousel-controls-prev {
  transition: color 0.3s;
}
.block-quote--carousel .carousel-controls-next:hover,
.block-quote--carousel .carousel-controls-prev:hover {
  color: var(--custom-carousel-prev-next-hover-colour); 
}
.carousel-controls-item-btn {
  transition: all 0.15s ease-in-out;
}
.carousel-controls-item-btn:hover {
  opacity: var(--custom-theme-colour-button-hover-opacity);
  color: var(--custom-theme-hover-bg, #202d60);
}
function allow_custom_font_uploads($mimes) {
    $mimes['woff'] = 'font/woff';
    $mimes['woff2'] = 'font/woff2';
    return $mimes;
}
add_filter('upload_mimes', 'allow_custom_font_uploads');
 
ADD THIS IN FUNCTION.PHP

THEN DOWNLOAD PLUGIN : WP Add Mime Types

THEN ADD : woff = font/woff
woff2 = font/woff2
// creates duplicate list in ascending order
List<WindRosePlotDataRecord> SortedList = _Rows.OrderByDescending(o => o.Parameter).ToList(); 

// creates duplicate list in descending order
List<WindRosePlotDataRecord> SortedList = _Rows.OrderByDescending(o => o.Parameter).ToList(); 
            
// sort-in-place in ascending order
_Rows.Sort((x, y) => x.Parameter.CompareTo(y.Parameter));  

// sort-in-place in descending order
_Rows.Sort((x, y) => y.Parameter.CompareTo(x.Parameter));  // we switched x and y in CompareTo
min-height:19px;
display:flex;
flex-direction:column;
justify-content:center;
line-height:1.2;
background-size:19px;
-- oil_gas_dc_limit_EDC
DROP TABLE team_kingkong.offus_oil_gas_dc_limit_EDC_breaches;

-- CREATE TABLE team_kingkong.offus_oil_gas_dc_limit_EDC_breaches AS
INSERT INTO team_kingkong.offus_oil_gas_dc_limit_EDC_breaches
SELECT globalcardindex, transactionid, txn_amount, txn_date, paytmmerchantid, txn_timestamp, paymethod
, case when edc_mid is not null then 'EDC' else 'QR' end as mid_type
, 'per txn threshold breached' as breach_reason FROM
    (SELECT DISTINCT pg_mid from cdo.total_offline_merchant_base_snapshot_v3) f
INNER join
    (select distinct transactionid
    , cast(eventamount as double)/100 as txn_amount
    , paytmmerchantid
    , globalcardindex
    , DATE(dl_last_updated) AS txn_date
    , CAST(velocitytimestamp AS DOUBLE) AS txn_timestamp
    , paymethod
    from cdp_risk_transform.maquette_flattened_offus_snapshot_v3
    where dl_last_updated BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    and paymethod in ('DEBIT_CARD')
    AND merchantcategory = 'Gas and Petrol' 
    AND cast(eventamount as double)/100 > 125000
    AND actionrecommended <> 'BLOCK' AND responsestatus = 'SUCCESS') a
on a.paytmmerchantid = f.pg_mid
LEFT JOIN
    (SELECT DISTINCT mid AS edc_mid FROM paytmpgdb.entity_edc_info_snapshot_v3
    WHERE terminal_status = 'ACTIVE' AND dl_last_updated >= DATE '2010-01-01') b
ON a.paytmmerchantid = b.edc_mid
INNER JOIN
    (select distinct txn_id as pg_txn_id
    from dwh.pg_olap
    where ingest_date BETWEEN DATE'2025-01-01' AND DATE'2025-01-31' 
    and txn_started_at BETWEEN  DATE'2025-01-01' AND DATE'2025-01-31'
    and txn_status = 'SUCCESS') d
on a.transactionid = d.pg_txn_id;
-- TPAP: RISK200
-- DROP TABLE team_kingkong.tpap_risk200_breaches;
 
-- CREATE TABLE team_kingkong.tpap_risk200_breaches AS
INSERT INTO team_kingkong.tpap_risk200_breaches
with temp_tpap_base as
(SELECT DISTINCT bt.txn_id,
bt.scope_cust_id,
bt.payer_vpa,
bt.payee_vpa,
bt.txn_date,
bt.txn_amount,
st.category,
COALESCE(rd.upi_subtype, CASE WHEN st.category = 'LITE_MANDATE' THEN 'UPI_LITE_MANDATE' ELSE '' END) AS upi_subtype
FROM
    (SELECT txn_id,
    scope_cust_id,
    MAX(CASE WHEN participant_type = 'PAYER' THEN vpa END) AS payer_vpa,
    MAX(CASE WHEN participant_type = 'PAYEE' THEN vpa END) AS payee_vpa,
    MAX(created_on) AS txn_date,
    MAX(amount) AS txn_amount
    FROM switch.txn_participants_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE '2025-06-01' AND DATE '2025-07-05'
    AND DATE(created_on) BETWEEN DATE '2025-06-01' AND DATE '2025-07-05'
    GROUP BY txn_id, scope_cust_id) bt
INNER JOIN
    (SELECT txn_id, category
    FROM switch.txn_info_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE '2025-06-01' AND DATE '2025-07-05'
    AND DATE(created_on) BETWEEN DATE '2025-06-01' AND DATE '2025-07-05'
    AND UPPER(status) = 'SUCCESS') st
ON bt.txn_id = st.txn_id
INNER JOIN (
    SELECT DISTINCT txnid,
    REGEXP_REPLACE(CAST(json_extract(request, '$.evaluationType') AS varchar), '"', '') AS upi_subtype
    FROM tpap_hss.upi_switchv2_dwh_risk_data_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE '2025-06-01' AND DATE '2025-07-05'
    AND (LOWER(REGEXP_REPLACE(CAST(json_extract(request, '$.requestPayload.payerVpa') AS varchar), '"', '')) LIKE '%@paytm%'
    OR LOWER(REGEXP_REPLACE(CAST(json_extract(request, '$.requestPayload.payerVpa') AS varchar), '"', '')) LIKE '%@pt%')
    AND json_extract_scalar(response, '$.action_recommended') <> 'BLOCK') rd
ON bt.txn_id = rd.txnid
WHERE (payer_vpa LIKE '%@paytm%') OR (payer_vpa LIKE '%@pt%')),
 
temp_blacklist AS
    (SELECT vpa AS blacklisted_vpa,
    DATE(FROM_UNIXTIME(CAST("timestamp" AS double) / 1000)) AS blacklist_date
    FROM team_kingkong.upi_blacklist_vpa_shivam
    WHERE "timestamp" IS NOT NULL
    AND "timestamp" <> ''
    AND DATE(FROM_UNIXTIME(CAST("timestamp" AS double) / 1000)) <= DATE '2025-07-05')
 
SELECT * FROM  
  (SELECT tb.txn_id,
  tb.scope_cust_id,
  tb.payer_vpa,
  tb.payee_vpa,
  tb.txn_date,
  tb.txn_amount,
  tb.category,
  tb.upi_subtype,
  COALESCE(pv.blacklisted_vpa, rv.blacklisted_vpa) AS blacklisted_vpa,
  COALESCE(pv.blacklist_date, rv.blacklist_date) AS blacklist_date,
  'RISK200' AS risk_code,
  'upi_blacklisted_vpa' AS rule_name
  , 'txn with blacklisted vpa' as breach_reason
FROM temp_tpap_base tb
LEFT JOIN temp_blacklist pv
  ON tb.payer_vpa = pv.blacklisted_vpa AND tb.txn_date > pv.blacklist_date
LEFT JOIN temp_blacklist rv
  ON tb.payee_vpa = rv.blacklisted_vpa AND tb.txn_date > rv.blacklist_date)
WHERE blacklisted_vpa IS NOT NULL AND blacklist_date < DATE(txn_date);
-- DROP TABLE team_kingkong.tpap_risk307_breaches;
 
-- CREATE TABLE team_kingkong.tpap_risk307_breaches AS
INSERT INTO team_kingkong.tpap_risk307_breaches
with tpap_base as
(
SELECT B.*, C.category
, IF(D.upi_subtype IS NOT NULL, D.upi_subtype, IF(C.category = 'LITE_MANDATE', 'UPI_LITE_MANDATE', '')) AS upi_subtype
FROM
    (SELECT txn_id, scope_cust_id,
    MAX(CASE WHEN participant_type = 'PAYER' THEN vpa END) AS payer_vpa,
    MAX(CASE WHEN participant_type = 'PAYEE' THEN vpa END) AS payee_vpa,
    MAX(created_on) as txn_date,
    MAX(amount) AS txn_amount,
    created_on AS txn_time
    FROM switch.txn_participants_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE(DATE'2025-07-01' - INTERVAL '1' DAY) AND DATE'2025-07-20'
    AND DATE(created_on) BETWEEN DATE(DATE'2025-07-01' - INTERVAL '1' DAY) AND DATE'2025-07-20'
    AND vpa IS NOT NULL
    GROUP BY 1,2,7)B
inner join
    (select txn_id, category
    from switch.txn_info_snapshot_v3
    where DATE(dl_last_updated) BETWEEN DATE(DATE'2025-07-01' - INTERVAL '1' DAY) AND DATE'2025-07-20'
    and DATE(created_on) BETWEEN DATE(DATE'2025-07-01' - INTERVAL '1' DAY) AND DATE'2025-07-20'
    and upper(status) in ('SUCCESS')
    AND category = 'VPA2MERCHANT') C
on B.txn_id = C.txn_id
INNER JOIN
    (SELECT DISTINCT txnid
    , regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') AS upi_subtype
    FROM tpap_hss.upi_switchv2_dwh_risk_data_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE(date'2025-07-01' - INTERVAL '1' DAY) AND DATE'2025-07-20'
    AND (lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) LIKE '%@paytm%'
    or lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) like '%@pt%')
    AND json_extract_scalar(response, '$.action_recommended') <> 'BLOCK')D
ON B.txn_id = D.txnid
WHERE (payer_vpa LIKE '%@paytm%') OR (payer_vpa LIKE '%@pt%') -- OR (payee_vpa LIKE '%@pt%') OR (payee_vpa LIKE '%@paytm%')
AND payee_vpa LIKE '%@%' AND payee_vpa <> ''
)
 
SELECT *, '24 hr txn cnt threshold breach' as breach_reason FROM
    (SELECT t1.payer_vpa,
      t1.payee_vpa,
      t1.txn_id,
      t1.txn_amount,
      t1.txn_time,
      t1.category,
      t1.upi_subtype,
      COUNT(t2.txn_id) AS prior_txns_last_24h,
      10 as threshold
    FROM tpap_base t1
    INNER JOIN tpap_base t2
      ON t1.payer_vpa = t2.payer_vpa
      AND t1.payee_vpa = t2.payee_vpa
      AND t2.txn_time BETWEEN (t1.txn_time - INTERVAL '24' HOUR) AND t1.txn_time
      AND t2.txn_amount > 1000
      AND DATE(t1.txn_time) BETWEEN DATE'2025-07-01' AND DATE'2025-07-20'
    GROUP BY t1.payer_vpa, t1.payee_vpa, t1.txn_id, t1.txn_amount, t1.txn_time, t1.category, t1.upi_subtype)
WHERE prior_txns_last_24h > threshold;
https://www.iperiusremote.com/
It is now crucial to register with the Virtual Assets Regulatory Authority (VARA) if you plan to start a cryptocurrency business in Dubai.. VARA registration ensures compliance with local laws, offering clear guidelines for businesses dealing in virtual assets. Without this registration, companies cannot legally operate within the emirate. Dubai’s focus on regulated crypto activity makes VARA registration a crucial step for businesses aiming to operate transparently and legally. Ensure your business meets the latest requirements by securing your VARA approval before beginning operations.
Beleaf Technologies is the only company offering complete VARA registration services, guiding crypto businesses in Dubai through every step to meet regulatory requirements and operate legally in the region.
Contact for free demo: https://www.beleaftechnologies.com/vara-registration
Whatsapp: +91 7904323274
Telegram: @BeleafSoftTech
Mail to: mailto:business@beleaftechnologies.com
function slow_down_site() {
    sleep(35);
}
add_action('wp', 'slow_down_site');

function slow_down_sitenocache() {
    if (!isset($_GET['nocache'])) {
        wp_redirect(add_query_arg('nocache', time())); // Force reload with new URL
        exit;
    }
    sleep(35);
}
add_action('init', 'slow_down_sitenocache');

function slow_down_site_wpdb() {
    global $wpdb;
    $wpdb->query("SELECT SLEEP(35)"); // MySQL delay
}
add_action('init', 'slow_down_site_wpdb');
const url = 'https://api.inxmail.com/taconova/rest/v1/events/subscriptions/';  // Inxmail API endpoint

// Client ID and Secret (replace these with your actual values)
const clientId = 'CAS-genesisWorld247b5346-afad-4850-b5bb-afcd21c77978';  // Removed newline
const clientSecret = 'AOcVdS5XVYBvKWnJsCWJSSlZYfSoRraQwMphKNNknftJm-9cx5lC1g-y-ZJrDHp7LlpITpGqkpMev8F3o_oftPs';  // Replace with your actual Client Secret

const email = inputData.email || '';  // Email from the form submission
const Vorname = inputData.Vorname || '';  // Optional: first name
const Name = inputData.Name || '';    // Trimmed last name to remove newline
const Firma = inputData.Firma || '';
const Anrede = inputData.Anrede
const listId = 137; // List ID (use the list where you want to add the contact)

// Encode credentials for Basic Authentication (Base64-encoded 'clientId:clientSecret')
const authValue = `${clientId}:${clientSecret}`;
const base64Auth = Buffer.from(authValue).toString('base64');  // Encoding the credentials to Base64

// Request data to send to the Inxmail API
const requestData = {
  email: email,
  listId: listId,
  attributes: {
    Vorname: Vorname,
    Name: Name,
    Anrede: Anrede,
    Firma: Firma
  },
  trackingPermission: "GRANTED",  // You can set this as "GRANTED" for accepted tracking permission
  source: "Web Form"  // Example source, you can modify as needed
};

// Request options for the fetch call
const options = {
  method: 'POST',
  headers: {
    'Authorization': `Basic ${base64Auth}`,  // Basic Auth with Base64-encoded credentials
    'Content-Type': 'application/json',  // Set the correct content type for JSON
  },
  body: JSON.stringify(requestData),  // Send the data as JSON in the request body
};

// Function to send the request
async function sendRequest() {
  try {
    const response = await fetch(url, options);

    if (!response.ok) {
      const errorText = await response.text(); // Get the error response text for debugging
      throw new Error(`Inxmail API request failed: ${errorText}`);
    }

    const responseBody = await response.json();  // Process the response as JSON

    // Return success and the response data
    return {
      success: true,
      data: responseBody,
    };
  } catch (error) {
    // Handle errors and return the error message
    return {
      success: false,
      error: error.message,
    };
  }
}

// Execute the request and assign the result to output
output = await sendRequest();
<div class="et_pb_button_module_wrapper et_pb_button_3_wrapper et_pb_button_alignment_center et_pb_module  dbdb-icon-on-right dbdb-icon-on-hover dbdb-has-custom-padding">
				<a class="et_pb_button et_pb_button_3 et_pb_bg_layout_light" href="/product-category/domestic-hot-water/">learn more</a>
			</div>
In Backend, go to:
Content- Design - Configuration
Select 	Best Deal Print theme name and edit
Other Settings - Header - Logo Image
-- CREATE TABLE team_kingkong.offus_edc_card_velocity_amount_breaches AS
INSERT INTO team_kingkong.offus_edc_card_velocity_amount_breaches
with offus_txn as
(SELECT DISTINCT globalcardindex, transactionid, txn_amount, txn_date, paytmmerchantid, txn_timestamp FROM
    (SELECT DISTINCT pg_mid from cdo.total_offline_merchant_base_snapshot_v3) f
INNER join
    (select transactionid
    , cast(eventamount as double)/100 as txn_amount
    , paytmmerchantid
    , globalcardindex
    , DATE(dl_last_updated) AS txn_date
    , CAST(velocitytimestamp AS DOUBLE) AS txn_timestamp
    from cdp_risk_transform.maquette_flattened_offus_snapshot_v3
    where dl_last_updated BETWEEN date'2025-05-01' AND DATE'2025-05-31'
    and paymethod in ('CREDIT_CARD','DEBIT_CARD','EMI','EMI_DC')
    AND actionrecommended <> 'BLOCK' AND responsestatus = 'SUCCESS'
    AND paytmmerchantid IS NOT NULL AND paytmmerchantid <> '' AND paytmmerchantid <> ' '
    AND globalcardindex IS NOT NULL AND globalcardindex <> '' AND globalcardindex <> ' ') a
on a.paytmmerchantid = f.pg_mid
LEFT JOIN
    (SELECT mid AS edc_mid FROM paytmpgdb.entity_edc_info_snapshot_v3
    WHERE terminal_status = 'ACTIVE' AND dl_last_updated >= DATE '2010-01-01') b 
ON a.paytmmerchantid = b.edc_mid)

SELECT * FROM 
    (SELECT A.globalcardindex, A.transactionid, A.txn_amount, A.txn_date, A.paytmmerchantid, 'edc_card_velocity_amount' AS rule_name, A.txn_timestamp
    , SUM(IF((A.txn_timestamp - B.txn_timestamp) BETWEEN 0 AND 21600000, B.txn_amount, NULL)) AS amt6_hr
    , 1000000 AS amt6_hr_threshold
    , SUM(B.txn_amount) as amt24_hr
    , 2000000 AS amt4_hr_threshold
    FROM
        (SELECT * FROM offus_txn
        WHERE txn_date  BETWEEN date'2025-05-01' AND DATE'2025-05-31')A
    INNER JOIN
        (SELECT * FROM offus_txn)B
    ON A.globalcardindex = b.globalcardindex AND A.paytmmerchantid = B.paytmmerchantid AND A.transactionid <> B.transactionid
    AND (A.txn_timestamp - B.txn_timestamp) BETWEEN 0 AND 86400000 -- <= 1d
    GROUP BY 1,2,3,4,5,6,7)
WHERE ((amt6_hr + txn_amount) > 1000000) OR ((amt24_hr + txn_amount) > 2000000);
DROP TABLE team_kingkong.offus_edc_card_velocity_count_breaches;

-- CREATE TABLE team_kingkong.offus_edc_card_velocity_count_breaches AS
INSERT INTO team_kingkong.offus_edc_card_velocity_count_breaches
with offus_txn as
(SELECT DISTINCT globalcardindex, transactionid, txn_amount, txn_date, paytmmerchantid, txn_timestamp FROM
    (SELECT DISTINCT pg_mid from cdo.total_offline_merchant_base_snapshot_v3) f
INNER join
    (select transactionid
    , cast(eventamount as double)/100 as txn_amount
    , paytmmerchantid
    , globalcardindex
    , DATE(dl_last_updated) AS txn_date
    , CAST(velocitytimestamp AS DOUBLE) AS txn_timestamp
    from cdp_risk_transform.maquette_flattened_offus_snapshot_v3
    where dl_last_updated BETWEEN DATE'2025-01-01' AND DATE'2025-01-31'
    and paymethod in ('CREDIT_CARD','DEBIT_CARD','EMI','EMI_DC')
    AND actionrecommended <> 'BLOCK'AND responsestatus = 'SUCCESS'
    AND globalcardindex IS NOT NULL AND globalcardindex <> '' AND globalcardindex <> ' ' 
    AND paytmmerchantid IS NOT NULL AND paytmmerchantid <> '' AND paytmmerchantid <> ' ') a
on a.paytmmerchantid = f.pg_mid
LEFT JOIN
    (SELECT mid AS edc_mid FROM paytmpgdb.entity_edc_info_snapshot_v3
    WHERE terminal_status = 'ACTIVE' AND dl_last_updated >= DATE '2010-01-01') b 
ON a.paytmmerchantid = b.edc_mid
INNER JOIN
    (select distinct txn_id as pg_txn_id
    from dwh.pg_olap
    where ingest_date BETWEEN DATE'2025-01-01' AND DATE'2025-01-31' 
    and txn_started_at BETWEEN  DATE'2025-01-01' AND DATE'2025-01-31'
    and txn_status = 'SUCCESS') d
on a.transactionid = d.pg_txn_id)

SELECT *, CASE
  WHEN txn1_min >= txn1_min_threshold 
       AND txn6_hr >= txn6_hr_threshold 
       AND txn24_hr >= txn24_hr_threshold THEN 'txn1_min, txn6_hr, txn24_hr breach'
  WHEN txn1_min >= txn1_min_threshold 
       AND txn6_hr >= txn6_hr_threshold THEN 'txn1_min, txn6_hr breach'
  WHEN txn1_min >= txn1_min_threshold 
       AND txn24_hr >= txn24_hr_threshold THEN 'txn1_min, txn24_hr breach'
  WHEN txn6_hr >= txn6_hr_threshold 
       AND txn24_hr >= txn24_hr_threshold THEN 'txn6_hr, txn24_hr breach'
  WHEN txn1_min >= txn1_min_threshold THEN 'txn1_min breach'
  WHEN txn6_hr >= txn6_hr_threshold THEN 'txn6_hr breach'
  WHEN txn24_hr >= txn24_hr_threshold THEN 'txn24_hr breach'
  ELSE NULL END as breach_reason FROM 
    (SELECT A.globalcardindex, A.transactionid, A.txn_amount, A.txn_date, A.paytmmerchantid, 'edc_card_velocity_count' AS rule_name, A.txn_timestamp
    , COUNT(DISTINCT IF((A.txn_timestamp - B.txn_timestamp) BETWEEN 0 AND 60000, B.transactionid, NULL)) AS txn1_min
    , 2 AS txn1_min_threshold
    , COUNT(DISTINCT IF((A.txn_timestamp - B.txn_timestamp) BETWEEN 0 AND 21600000, B.transactionid, NULL)) AS txn6_hr
    , 5 as txn6_hr_threshold
    , COUNT(DISTINCT B.transactionid) as txn24_hr
    , 10 AS txn24_hr_threshold
    FROM
        (SELECT * FROM offus_txn
        WHERE txn_date BETWEEN DATE'2025-01-01' AND DATE'2025-01-31')A
    INNER JOIN
        (SELECT * FROM offus_txn)B
    ON A.globalcardindex = b.globalcardindex AND A.paytmmerchantid = B.paytmmerchantid AND (A.txn_timestamp - B.txn_timestamp) BETWEEN 0 AND 86400000 -- <= 1d
    AND A.transactionid <> B.transactionid
    GROUP BY 1,2,3,4,5,6,7)
WHERE (txn1_min >= txn1_min_threshold) OR (txn6_hr >= txn6_hr_threshold) OR (txn24_hr >= txn24_hr_threshold);
-- TPAP implementation date
SELECT DISTINCT regexp_replace(cast(json_extract(response, '$.messages.cst[0]') as varchar), '"', '') as risk_code
, MIN(DATE(dl_last_updated)) as implementation_date
FROM tpap_hss.upi_switchv2_dwh_risk_data_snapshot_v3
WHERE DATE(dl_last_updated) >= date'2024-01-01'
AND (lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) LIKE '%@paytm%'
or lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) like '%@pt%')
AND json_extract_scalar(response, '$.action_recommended') = 'BLOCK'
GROUP BY 1;

-- ONUS implementation date
select json_extract_scalar(actionrecommendedrules,'$.actionRecommendedRules[0]') as strategy_name
, MIN(DATE(dateinserted)) AS implementation_date
FROM cdp_risk_transform.maquette_flattened_onus_snapshot_v3
WHERE dl_last_updated >= date '2022-01-01'
AND SOURCE = 'PG' AND actionrecommended = 'BLOCK' AND json_extract_scalar(actionrecommendedrules,'$.actionRecommendedRules[0]') IS NOT NULL
GROUP BY 1
Are you ready to capitalize on IPL excitement with your fantasy sports app? Partnering with a trusted fantasy sports app development company can help you create an engaging platform tailored for cricket fans. With expert guidance, you can offer exciting features, real-time updates, and user-friendly interfaces that attract and retain players throughout the tournament. Capture the enthusiasm of millions, boost user engagement, and turn the IPL season into a great opportunity for your app’s success.

Beleaf Technologies offers affordable solutions to develop fantasy sports apps, providing cost-effective services without compromising quality, helping you enter the market quickly and attract sports enthusiasts with ease.

Know more :https://www.beleaftechnologies.com/fantasy-sports-app-development-company

Whatsapp: +91 7904323274
Telegram: @BeleafSoftTech
Mail to: mailto:business@beleaftechnologies.com
star

Sat May 24 2025 10:35:25 GMT+0000 (Coordinated Universal Time) https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Structuring_content/Webpage_metadata

@cholillo18

star

Sat May 24 2025 06:44:32 GMT+0000 (Coordinated Universal Time) https://www.beleaftechnologies.com/crypto-algo-trading-bot-development

@raydensmith #crypto #algo #cryptoalgotradingbot

star

Fri May 23 2025 11:48:34 GMT+0000 (Coordinated Universal Time)

@mastaklance

star

Fri May 23 2025 11:14:19 GMT+0000 (Coordinated Universal Time)

@krisha_joshi

star

Fri May 23 2025 11:13:40 GMT+0000 (Coordinated Universal Time)

@krisha_joshi

star

Fri May 23 2025 11:03:10 GMT+0000 (Coordinated Universal Time) https://www.hivelance.com/coinbase-clone-script

@peterkester96 #coinbase #coinbaseclonescript

star

Fri May 23 2025 09:16:30 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Fri May 23 2025 06:44:07 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Fri May 23 2025 05:54:58 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Fri May 23 2025 02:21:08 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Thu May 22 2025 14:33:37 GMT+0000 (Coordinated Universal Time) https://www.techigator.ae/services/logo-design-dubai

@Ethanturner

star

Thu May 22 2025 14:00:32 GMT+0000 (Coordinated Universal Time)

@BilalRaza12

star

Thu May 22 2025 14:00:16 GMT+0000 (Coordinated Universal Time)

@BilalRaza12

star

Thu May 22 2025 09:58:48 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Thu May 22 2025 09:58:47 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Thu May 22 2025 09:24:54 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Thu May 22 2025 07:56:49 GMT+0000 (Coordinated Universal Time)

@maxwlrt #css

star

Thu May 22 2025 05:13:13 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/wazirx-clone-script/

@janetbrownjb #wazirxclonescript #cryptoexchangedevelopment #cryptotradingplatform #whitelabelcryptoexchange #blockchainbusiness

star

Thu May 22 2025 04:27:46 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Thu May 22 2025 04:27:45 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Thu May 22 2025 03:35:24 GMT+0000 (Coordinated Universal Time)

@RohitChanchar #c++

star

Thu May 22 2025 03:30:48 GMT+0000 (Coordinated Universal Time)

@RohitChanchar #c++

star

Thu May 22 2025 03:24:50 GMT+0000 (Coordinated Universal Time)

@RohitChanchar #c++

star

Thu May 22 2025 02:53:40 GMT+0000 (Coordinated Universal Time)

@tara.hamedani

star

Thu May 22 2025 02:43:44 GMT+0000 (Coordinated Universal Time)

@tara.hamedani

star

Wed May 21 2025 18:05:07 GMT+0000 (Coordinated Universal Time)

@shahmeeriqbal

star

Wed May 21 2025 16:36:08 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/3309188/how-to-sort-a-listt-by-a-property-in-the-object

@dhfinch #c#

star

Wed May 21 2025 15:37:45 GMT+0000 (Coordinated Universal Time) https://www.portofpalmbeach.com/admin/graphiclinks.aspx

@Cody_Gant

star

Wed May 21 2025 12:47:20 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Wed May 21 2025 11:00:03 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Wed May 21 2025 10:32:09 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Wed May 21 2025 10:24:48 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/white-label-crypto-exchange-software/

@CharleenStewar

star

Wed May 21 2025 07:21:45 GMT+0000 (Coordinated Universal Time)

@password

star

Wed May 21 2025 05:55:46 GMT+0000 (Coordinated Universal Time) https://www.beleaftechnologies.com/vara-registration

@stvejhon #crypto #cryptocurrency #exchange #meme

star

Tue May 20 2025 18:53:05 GMT+0000 (Coordinated Universal Time)

@GEYGWR

star

Tue May 20 2025 18:25:35 GMT+0000 (Coordinated Universal Time)

@shahmeeriqbal

star

Tue May 20 2025 14:33:58 GMT+0000 (Coordinated Universal Time) https://www.techigator.com/flutter-app-development

@emilyjohnson

star

Tue May 20 2025 13:13:35 GMT+0000 (Coordinated Universal Time) https://appticz.com/cryptocurrency-wallet-development

@davidscott

star

Tue May 20 2025 11:50:25 GMT+0000 (Coordinated Universal Time) https://zapier.com/editor/296374873/published/296378499/

@abm

star

Tue May 20 2025 09:10:17 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/cryptocurrency-wallet-development-company/

@CharleenStewar #cryptowallet development services #cryptowallet development

star

Tue May 20 2025 07:53:33 GMT+0000 (Coordinated Universal Time)

@abm

star

Tue May 20 2025 07:32:25 GMT+0000 (Coordinated Universal Time) https://tecsify.com/blog/codigo/texto-en-voz-tts-con-python-en-segundos/

@cholillo18

star

Tue May 20 2025 07:31:45 GMT+0000 (Coordinated Universal Time) https://tecsify.com/blog/codigo/texto-en-voz-tts-con-python-en-segundos/

@cholillo18

star

Tue May 20 2025 06:49:10 GMT+0000 (Coordinated Universal Time) https://www.yudiz.com/rummy-game-development-company/

@yudizsolutions #rummy #rummygamedevelopment #rummygamedevelopmentcompany #rummygamedevelopmentservices #rummygamedevelopers

star

Mon May 19 2025 19:00:23 GMT+0000 (Coordinated Universal Time)

@caovillanueva #magento #bdprint

star

Mon May 19 2025 12:10:13 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Mon May 19 2025 12:09:38 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Mon May 19 2025 10:10:51 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Mon May 19 2025 10:05:11 GMT+0000 (Coordinated Universal Time) https://www.beleaftechnologies.com/bc-game-clone-script

@raydensmith #bc #bcgameclonescript #casino

star

Mon May 19 2025 09:47:16 GMT+0000 (Coordinated Universal Time) https://www.beleaftechnologies.com/fantasy-sports-app-development-company

@stvejhon #crypto #cryptocurrency #exchange #meme

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension