<commit_before>import '../entity_export.dart';

class Project extends Entity {
  @override
  init({Map<String, dynamic> params: const {}}) {
    if (!params.containsKey('name')) {
      params['name'] = 'New Project';
    }
    super.init(params: params);
  }

  Project();

  Project.clone(Project original) : super.clone(original) {
    this.currentPrice = original.currentPrice;
    this.budgetPrice = original.budgetPrice;
    this.remainingBudgetPrice = original.remainingBudgetPrice;
    this.currentTime = original.currentTime;
    this.budgetTime = original.budgetTime;
    this.remainingBudgetTime = original.remainingBudgetTime;
    this.description = original.description;
    this.fixedPrice = original.fixedPrice;
    this.customer = original.customer;
    this.rateGroup = original.rateGroup;
    this.chargeable = original.chargeable;
    this.deadline = original.deadline;
    this.activities = original.activities;
    this.projectCategory = original.projectCategory;
    this.invoices = original.invoices;
    this.offers = original.offers;
    this.accountant = original.accountant;
    this.deletedAt = original.deletedAt;
    this.archived = original.archived;
    addFieldstoUpdate([
      'currentPrice',
      'budgetPrice',
      'remainingBudgetPrice',
      'currentTime',
      'budgetTime',
      'remainingBudgetTime',
      'description',
      'fixedPrice',
      'customer',
      'rateGroup',
      'chargeable',
      'deadline',
      // these have to be saved separately using cloneDescendants()
      //'activities',
      'projectCategory',
      //'invoices', // we probably don't want to clone all the invoices
      'offers',
      'accountant',
      'deletedAt',
      'archived'<commit_msg>Fix project duplication (again)<commit_after>import '../entity_export.dart';

class Project extends Entity {
  @override
  init({Map<String, dynamic> params: const {}}) {
    if (!params.containsKey('name')) {
      params['name'] = 'New Project';
    }
    super.init(params: params);
  }

  Project();

  Project.clone(Project original) : super.clone(original) {
    this.currentPrice = original.currentPrice;
    this.remainingBudgetPrice = original.remainingBudgetPrice;
    this.currentTime = original.currentTime;
    this.budgetTime = original.budgetTime;
    this.remainingBudgetTime = original.remainingBudgetTime;
    this.description = original.description;
    this.fixedPrice = original.fixedPrice;
    this.customer = original.customer;
    this.rateGroup = original.rateGroup;
    this.chargeable = original.chargeable;
    this.deadline = original.deadline;
    this.activities = original.activities;
    this.projectCategory = original.projectCategory;
    this.invoices = original.invoices;
    this.offers = original.offers;
    this.accountant = original.accountant;
    this.deletedAt = original.deletedAt;
    this.archived = original.archived;
    addFieldstoUpdate([
      'currentPrice',
      'remainingBudgetPrice',
      'currentTime',
      'budgetTime',
      'remainingBudgetTime',
      'description',
      'fixedPrice',
      'customer',
      'rateGroup',
      'chargeable',
      'deadline',
      // these have to be saved separately using cloneDescendants()
      //'activities',
      'projectCategory',
      //'invoices', // we probably don't want to clone all the invoices
      'offers',
      'accountant',
      'deletedAt',
      'archived'
{'fraction_non_alphanumeric': 0.11718293395675043, 'fraction_numerical': 0.0, 'mean_word_length': 3.225925925925926, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1893306', 'n_tokens_mistral': 1012, 'n_tokens_neox': 995, 'n_words': 193}