This repository has been archived on 2025-04-22. You can view files and clone it, but cannot push or open issues or pull requests.
playwright-demo/tests/hlk/pom/customer.js
2024-11-07 20:36:40 +08:00

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;
}
}