Commit 5232c302 authored by Jigish Chauhan's avatar Jigish Chauhan
Browse files

Issue #3274589: Refer and Earn

parent 4ebc6bc0
Loading
Loading
Loading
Loading
+45 −0
Original line number Diff line number Diff line
@@ -14,3 +14,48 @@ function commerce_user_points_uninstall() {
  $content_type = \Drupal::entityTypeManager()->getStorage('node_type')->load('user_points');
  $content_type->delete();
}

/**
 * Implements hook_schema().
 */
function commerce_user_points_schema() {
  $schema['user_points_referral'] = [
    'description' => 'The base table for managing to refer and earn.',
    'fields' => [
      'id' => [
        'description' => 'The primary identifier for referral',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
      'uid' => [
        'description' => '',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ],
      'referral_link_code' => [
        'description' => 'Referral link',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ],
      'timestamp' => [
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => "Timestamp",
      ],
      'status' => [
        'description' => 'Active/Deactive',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ],
    ],
    'primary key' => ['id'],
  ];

  return $schema;
}
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
referral_link_library:
  js:
    js/custom.js: {}
+10 −0
Original line number Diff line number Diff line
@@ -7,3 +7,13 @@ commerce_user_points.admin_threshold_amount_settings:
  title: 'Threshold Amount Configuration'
  route_name: commerce_user_points.admin_threshold_amount_settings
  base_route: commerce_user_points.admin_settings

commerce_user_points.admin_referral_settings:
  title: 'Referral Points Configuration'
  route_name: commerce_user_points.admin_referral_settings
  base_route: commerce_user_points.admin_settings

referral.link:
  route_name: referral.link
  title: 'Referral url'
  base_route: entity.node.canonical
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
@@ -4,3 +4,6 @@ services:
    arguments: ['@entity_type.manager']
    tags:
      - { name: event_subscriber }

  commerce_user_points.referral_link:
    class: Drupal\commerce_user_points\ReferralLinkService
 No newline at end of file
+2 −0
Original line number Diff line number Diff line
sender_referral_points: '50'
new_user_referral_points: '50'
Loading