<commit_before>'use strict';


/**
 * @module Counter
 * @name Counter
 * @description A record of service request(issue) ticket number.
 *
 *              Used to generate sequencial ticket number for 
 *              service request(issue) based on jurisdiction, service and year.
 *
 *              The format for the ticket number is as below:
 *              jurisdiction code - service code - year(2digits) - sequence(4digits)
 *              i.e ILLK170001
 *              
 *              At any time the above combo is ensured to be unique for better
 *              ticket number generation.
 *
 * @see {@link ServiceRequest}
 * @see {@link Jurisdiction}
 * @see {@link Service}
 * @see {@link https://docs.mongodb.com/v3.0/tutorial/create-an-auto-incrementing-field/}
 * @see {@link https://momentjs.com/|moment}
 * @author <NAME> <<EMAIL>>
 * @since 0.1.0
 * @version 0.1.0
 * @public
 */


//dependencies
const _ = require('lodash');
const moment = require('moment');
const conf = require('config');
const mongoose = require('mongoose');
const Schema = mongoose.Schema;


//default year digits to use
const YEAR_FORMAT = 'YY'; //TODO move this to configurations
const COUNTER_PREFIX = config.get('counter.prefix');

/**
 * @name CounterSchema
 * @type {Schema}
 * @since 0.1.0<commit_msg>enforce service request ticket number counter prefix<commit_after>'use strict';


/**
 * @module Counter
 * @name Counter
 * @description A record of service request(issue) ticket number.
 *
 *              Used to generate sequencial ticket number for 
 *              service request(issue) based on jurisdiction, service and year.
 *
 *              The format for the ticket number is as below:
 *              jurisdiction code - service code - year(2digits) - sequence(4digits)
 *              i.e ILLK170001
 *              
 *              At any time the above combo is ensured to be unique for better
 *              ticket number generation.
 *
 * @see {@link ServiceRequest}
 * @see {@link Jurisdiction}
 * @see {@link Service}
 * @see {@link https://docs.mongodb.com/v3.0/tutorial/create-an-auto-incrementing-field/}
 * @see {@link https://momentjs.com/|moment}
 * @author <NAME> <<EMAIL>>
 * @since 0.1.0
 * @version 0.1.0
 * @public
 */


//dependencies
const _ = require('lodash');
const moment = require('moment');
const config = require('config');
const mongoose = require('mongoose');
const Schema = mongoose.Schema;


//default year digits to use
const YEAR_FORMAT = 'YY'; //TODO move this to configurations
const COUNTER_PREFIX = config.get('counter.prefix');

/**
 * @name CounterSchema
 * @type {Schema}
 * @since 0.1.0
{'fraction_non_alphanumeric': 0.12561483163072265, 'fraction_numerical': 0.014377601210745366, 'mean_word_length': 2.815295815295815, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 4, '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': '3920889', 'n_tokens_mistral': 798, 'n_tokens_neox': 755, 'n_words': 249}