<?php

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

use Carbon_Fields\Field\Field;
use Gigneo\Modules;
use Gigneo\Post_Meta\Serialized;

$gigneo_platform_type = gigneo_platform_type();
$gigneo_currency      = get_woocommerce_currency();

if ( 'jobs' !== $gigneo_platform_type ) {
	$gigneo_fee_fields[] =
		Field::make( 'text', 'gigneo_pm_service_percentage_fee', esc_html__( 'Service fee percentage', 'gigneo' ) )
			->set_attribute( 'type', 'number' )
			->set_attribute( 'placeholder', '%' )
			->set_attribute( 'min', 0 )
			->set_attribute( 'max', 100 )
			->set_attribute( 'data-regex', '^[0-9]+$' );

	$gigneo_fee_fields[] =
		Field::make( 'text', 'gigneo_pm_service_fixed_amount_fee', esc_html__( 'Service fee flat', 'gigneo' ) )
			->set_attribute( 'type', 'number' )
			->set_attribute( 'placeholder', $gigneo_currency )
			->set_attribute( 'data-regex', '^[0-9]+$' );
}

if ( 'services' !== $gigneo_platform_type ) {
	$gigneo_fee_fields[] =
		Field::make( 'text', 'gigneo_pm_job_percentage_fee', esc_html__( 'Job fee percentage', 'gigneo' ) )
			->set_attribute( 'type', 'number' )
			->set_attribute( 'placeholder', '%' )
		->set_attribute( 'min', 0 )
		->set_attribute( 'max', 100 )
		->set_attribute( 'data-regex', '^[0-9]+$' );

	$gigneo_fee_fields[] =
	Field::make( 'text', 'gigneo_pm_job_fixed_amount_fee', esc_html__( 'Job fee flat', 'gigneo' ) )
		->set_attribute( 'type', 'number' )
		->set_attribute( 'placeholder', $gigneo_currency )
		->set_attribute( 'data-regex', '^[0-9]+$' );
}

$gigneo_fee_fields = apply_filters( 'gigneo_profile_fee_fields', $gigneo_fee_fields, $gigneo_platform_type, $gigneo_currency );
