Some checks are pending
Playwright Tests / test (push) Waiting to run
init test test test 划分美管加、慧来客、智荟宝项目 新增美管加demo 新增npm命令 测试智荟宝 test test ii csv test init test test init init
49 lines
1.4 KiB
JavaScript
49 lines
1.4 KiB
JavaScript
import { faker } from '@faker-js/faker/locale/zh_CN';
|
|
|
|
export class Customer {
|
|
/**
|
|
* @param {1 | 2} store - 门店
|
|
* @param {1 | 2} department - 部门
|
|
* @param {string} [username=faker.person.fullName()] - 用户名
|
|
* @param {string} [phone=faker.helpers.fromRegExp(/1[3-9][0-9]{6}/)] - 手机号
|
|
* @param {string} [archive=""] - 档案号
|
|
* @param {number} [gender=0] - 性别
|
|
* @param {number} [source=1] - 顾客来源
|
|
* @param {Object} [birthday=undefined] - 生日
|
|
* @param {number} [birthday.year] - 年
|
|
* @param {number} [birthday.month] - 月
|
|
* @param {number} [birthday.day] - 月
|
|
* @param {string} [remark=undefined]
|
|
* @param {Array} [employee=undefined]
|
|
* @constructor
|
|
* @example
|
|
* const customer = new Client(1, 2, { username: '22' });
|
|
* const customer = new Customer(1, 2);
|
|
*/
|
|
constructor(
|
|
store,
|
|
department,
|
|
{
|
|
username = faker.person.fullName(),
|
|
phone = faker.helpers.fromRegExp(/1[3-9][0-9]{6}/),
|
|
archive = '',
|
|
gender = 0,
|
|
source = 1,
|
|
birthday = undefined,
|
|
remark = undefined,
|
|
employee = undefined,
|
|
} = {}
|
|
) {
|
|
this.store = store;
|
|
this.department = department;
|
|
this.username = username;
|
|
this.phone = phone;
|
|
this.archive = archive;
|
|
this.gender = gender;
|
|
this.source = source;
|
|
this.birthday = birthday;
|
|
this.remark = remark;
|
|
this.employee = employee;
|
|
}
|
|
}
|