|
@@ -1,23 +1,32 @@
|
|
|
import { Rule, RuleType } from '@midwayjs/validate';
|
|
|
-import {ApiProperty} from "@midwayjs/swagger";
|
|
|
+import { ApiProperty } from '@midwayjs/swagger';
|
|
|
+import {
|
|
|
+ BusinessType,
|
|
|
+ CertificateType,
|
|
|
+ CompanyCertificateType,
|
|
|
+ CustomerType,
|
|
|
+ IndividualCertificateType,
|
|
|
+ NewCustomerType,
|
|
|
+} from '../../payment/interface/custom';
|
|
|
|
|
|
-export class CreateCustomerDTO {
|
|
|
- @ApiProperty({ example: 'out_user_id', description: '客户端用户ID'})
|
|
|
+export class CompanyDTO {
|
|
|
+ @ApiProperty({ description: '公司名称' })
|
|
|
@Rule(RuleType.string().required())
|
|
|
- out_user_id: string;
|
|
|
+ name: string;
|
|
|
|
|
|
- @ApiProperty({ example: 'webhook_url', description: '业务回调URL'})
|
|
|
- @Rule(RuleType.string().required())
|
|
|
- webhook_url: string;
|
|
|
-
|
|
|
- @ApiProperty({ example: 'webhook_url', description: '业务回调URL'})
|
|
|
- @Rule(RuleType.string().required())
|
|
|
- customer_type: string;
|
|
|
-
|
|
|
- @ApiProperty({ example: 1, description: 'The name of the Catage'})
|
|
|
- age: number;
|
|
|
-
|
|
|
- @ApiProperty({ example: 'OTHER', description: '类型,可选值如下:\n' +
|
|
|
+ @ApiProperty({
|
|
|
+ enum: [
|
|
|
+ 'OTHER',
|
|
|
+ 'PUBLIC_LIMITED_COMPANY',
|
|
|
+ 'PARTNERSHIP',
|
|
|
+ 'CHARITY',
|
|
|
+ 'PRIVATE_LIMITED_COMPANY',
|
|
|
+ 'JOINT_STOCK_COMPANY',
|
|
|
+ 'SOLE_TRADER',
|
|
|
+ 'LIMITED_LIABILITY',
|
|
|
+ ],
|
|
|
+ description:
|
|
|
+ '类型,可选值如下:\n' +
|
|
|
'\n' +
|
|
|
'OTHER:其他\n' +
|
|
|
'\n' +
|
|
@@ -33,6 +42,219 @@ export class CreateCustomerDTO {
|
|
|
'\n' +
|
|
|
'SOLE_TRADER:独资经营企业\n' +
|
|
|
'\n' +
|
|
|
- 'LIMITED_LIABILITY:有限责任公司'})
|
|
|
- type: string;
|
|
|
+ 'LIMITED_LIABILITY:有限责任公司',
|
|
|
+ })
|
|
|
+ type: BusinessType;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '国家编码' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ country_code: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '城市' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ city: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '地址栏' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ address_line: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '邮政编码' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ post_code: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '邮箱' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ email: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '手机号码' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ phone_number: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '注册号码' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ registration_number: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '联系方式' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ contact: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '注册日期' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ registration_date: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '合伙人文件编号' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ partners_document_number: string;
|
|
|
+
|
|
|
+ @ApiProperty({
|
|
|
+ enum: ['IDCARD', 'DRIVINGLICENCE', 'PASSPORT'],
|
|
|
+ description:
|
|
|
+ '对应币种所支持的国家证件类型' +
|
|
|
+ '合伙人文档类型,可选值如下:\n' +
|
|
|
+ '\n' +
|
|
|
+ 'IDCARD:身份证\n' +
|
|
|
+ '\n' +
|
|
|
+ 'DRIVINGLICENCE:驾驶证\n' +
|
|
|
+ '\n' +
|
|
|
+ 'PASSPORT:护照',
|
|
|
+ })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ partners_document_type: CertificateType;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '合伙人' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ partners_kind: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '合伙人姓名' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ partners_name: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '合伙人占比' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ partners_percentage_share: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '合伙人国家地址' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ partners_address_country: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '交易地址' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ trading_address: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '交易城市' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ trading_city: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '交易国家' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ trading_country: string;
|
|
|
+}
|
|
|
+
|
|
|
+export class IndividualDTO {
|
|
|
+ @ApiProperty({ description: '名' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ first_name: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '姓' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ last_name: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '国家编码' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ country_code: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '城市' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ city: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '地址栏' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ address_line: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '邮政编码' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ post_code: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '邮箱' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ email: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '手机号码' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ phone_number: string;
|
|
|
+
|
|
|
+ @ApiProperty({
|
|
|
+ description:
|
|
|
+ '证件类型,可选值如下:\n' +
|
|
|
+ '\n' +
|
|
|
+ 'IDCARD:身份证\n' +
|
|
|
+ '\n' +
|
|
|
+ 'DRIVINGLICENCE:驾驶证\n' +
|
|
|
+ '\n' +
|
|
|
+ 'PASSPORT:护照\n' +
|
|
|
+ '\n' +
|
|
|
+ 'TaxIdentificationNumber:税务识别号\n' +
|
|
|
+ '\n' +
|
|
|
+ 'IdentificationCodeForWorkers:劳务识别码\n' +
|
|
|
+ '\n' +
|
|
|
+ 'PersonalIdentificationCode:身份识别编号\n' +
|
|
|
+ '\n' +
|
|
|
+ 'ForeignersIDCard:外国人身份证\n' +
|
|
|
+ '\n' +
|
|
|
+ 'SpecialPermitOfStay:特殊的临时居留许可',
|
|
|
+ enum: [
|
|
|
+ 'IDCARD',
|
|
|
+ 'DRIVINGLICENCE',
|
|
|
+ 'PASSPORT',
|
|
|
+ 'TaxIdentificationNumber',
|
|
|
+ 'IdentificationCodeForWorkers',
|
|
|
+ 'PersonalIdentificationCode',
|
|
|
+ 'ForeignersIDCard',
|
|
|
+ 'SpecialPermitOfStay',
|
|
|
+ ],
|
|
|
+ })
|
|
|
+ @Rule(
|
|
|
+ RuleType.string()
|
|
|
+ .valid(...Object.values(IndividualCertificateType))
|
|
|
+ .required()
|
|
|
+ )
|
|
|
+ certificate_type: CertificateType;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '证件号码' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ id_number: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '出生日期' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ birth_date: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '有效期开始时间' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ valid_time_start: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '有效期结束时间' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ valid_time_end: string;
|
|
|
+}
|
|
|
+
|
|
|
+export class CreateCustomerDTO {
|
|
|
+ @ApiProperty({ example: 'out_user_id', description: '客户端用户ID' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ out_user_id: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '业务回调URL' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ webhook_url: string;
|
|
|
+
|
|
|
+ @ApiProperty({ description: '客户类型:公司、个人' })
|
|
|
+ @Rule(RuleType.string().required())
|
|
|
+ customer_type: string;
|
|
|
+
|
|
|
+ @ApiProperty({
|
|
|
+ enum: ['COMPANY', 'INDIVIDUAL'],
|
|
|
+ description:
|
|
|
+ '客户类型,可选值:\n' +
|
|
|
+ '\n' +
|
|
|
+ 'COMPANY:公司\n' +
|
|
|
+ '\n' +
|
|
|
+ 'INDIVIDUAL:个人',
|
|
|
+ })
|
|
|
+ @Rule(
|
|
|
+ RuleType.string()
|
|
|
+ .valid(...Object.values(NewCustomerType))
|
|
|
+ .required()
|
|
|
+ )
|
|
|
+ type: NewCustomerType;
|
|
|
+
|
|
|
+ @ApiProperty({
|
|
|
+ description: '公司',
|
|
|
+ type: CompanyDTO,
|
|
|
+ })
|
|
|
+ company: CompanyDTO;
|
|
|
+
|
|
|
+ @ApiProperty({
|
|
|
+ description: '个人',
|
|
|
+ type: IndividualDTO,
|
|
|
+ })
|
|
|
+ individual: IndividualDTO;
|
|
|
}
|