-
Notifications
You must be signed in to change notification settings - Fork 0
/
preset_users.yml
115 lines (104 loc) · 2.94 KB
/
preset_users.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#
# JBZoo Toolbox - Csv-Blueprint.
#
# This file is part of the JBZoo Toolbox project.
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
#
# @license MIT
# @copyright Copyright (C) JBZoo.com, All rights reserved.
# @see https://github.com/JBZoo/Csv-Blueprint
#
name: Common presets for user data
description: >
This schema contains common presets for user data.
It can be used as a base for other schemas.
filename_pattern: /users-.*\.csv$/i
csv:
delimiter: ';'
columns:
- name: login
description: User's login name
example: johndoe
rules:
not_empty: true
is_trimmed: true
is_lowercase: true
is_slug: true
length_min: 3
length_max: 20
is_alnum: true
aggregate_rules:
is_unique: true
- name: password
description: User's password
example: '9RfzE$8NKD'
rules:
not_empty: true
is_trimmed: true
is_password_safe_chars: true
password_strength_min: 7
contains_none: [ "password", "123456", "qwerty", " " ]
charset: UTF-8
length_min: 6
length_max: 20
- name: full_name
description: User's full name
example: 'John Doe Smith'
rules:
not_empty: true
is_trimmed: true
charset: UTF-8
contains: " "
word_count_min: 2
word_count_max: 8
is_capitalize: true
aggregate_rules:
is_unique: true
- name: email
description: User's email address
example: [email protected]
rules:
not_empty: true
is_trimmed: true
is_email: true
is_lowercase: true
aggregate_rules:
is_unique: true
- name: birthday
description: Validates the user's birthday.
example: '1990-01-01'
rules:
not_empty: true # The birthday field must not be empty.
is_trimmed: true # Trims the value before validation.
date_format: Y-m-d # Checks if the date matches the YYYY-MM-DD format.
is_date: true # Validates if the value is a valid date.
date_age_greater: 0 # Ensures the date is in the past.
date_age_less: 150 # Ensures the user is not older than 150 years.
date_max: now # Ensures the date is not in the future.
- name: phone_number
description: User's phone number in US
example: '+1 650 253 00 00'
rules:
not_empty: true
is_trimmed: true
starts_with: '+1'
phone: US
- name: balance
description: User's balance in USD
example: '100.00'
rules:
not_empty: true
is_trimmed: true
is_float: true
num_min: 0.00
num_max: 1000000000.00 # 1 billion is max amount in our system.
precision: 2
- name: short_description
description: A brief description of the item
example: 'Lorem ipsum dolor sit amet'
rules:
not_empty: true
contains: " "
length_max: 255
is_trimmed: true