add se compare
Showing
5 changed files
with
145 additions
and
3 deletions
docs/se_compare.yaml
0 → 100644
This diff is collapsed.
Click to expand it.
| ... | @@ -4,4 +4,5 @@ from . import views | ... | @@ -4,4 +4,5 @@ from . import views |
| 4 | 4 | ||
| 5 | urlpatterns = [ | 5 | urlpatterns = [ |
| 6 | path(r'v1', views.CompareView.as_view()), | 6 | path(r'v1', views.CompareView.as_view()), |
| 7 | ] | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 7 | path(r'settlement/v1', views.SECompareView.as_view()), | ||
| 8 | ] | ... | ... |
| ... | @@ -47,6 +47,53 @@ usedcar_args = { | ... | @@ -47,6 +47,53 @@ usedcar_args = { |
| 47 | "firstRegistrationDate": CustomDate(required=True), | 47 | "firstRegistrationDate": CustomDate(required=True), |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | se_vehicle_args = { | ||
| 51 | 'vehicleStatus': fields.Str(required=True, validate=validate.Length(max=16)), | ||
| 52 | 'vehicleTransactionAmount': CustomDecimal(required=True), | ||
| 53 | 'vinNo': fields.Str(required=True, validate=validate.Length(max=256)), | ||
| 54 | 'dealer': fields.Str(required=True, validate=validate.Length(max=256)), | ||
| 55 | 'option': fields.Str(required=False, validate=validate.Length(max=256)), | ||
| 56 | 'msrp': CustomDecimal(required=False), | ||
| 57 | 'totalAmount': CustomDecimal(required=False), | ||
| 58 | } | ||
| 59 | |||
| 60 | se_insurance_args = { | ||
| 61 | 'insuredAmount': CustomDecimal(required=True), | ||
| 62 | 'insuranceType': fields.Str(required=True, validate=validate.Length(max=16)), | ||
| 63 | 'startDate': CustomDate(required=True), | ||
| 64 | 'endDate': CustomDate(required=True), | ||
| 65 | } | ||
| 66 | |||
| 67 | se_associated_args = { | ||
| 68 | 'service': fields.Int(required=True), | ||
| 69 | 'amount': CustomDecimal(required=True), | ||
| 70 | 'financedAmount': CustomDecimal(required=True) | ||
| 71 | } | ||
| 72 | |||
| 73 | se_payment_args = { | ||
| 74 | 'term': fields.Int(required=True), | ||
| 75 | 'amount': CustomDecimal(required=True) | ||
| 76 | } | ||
| 77 | |||
| 78 | se_bank_args = { | ||
| 79 | 'bankName': fields.Str(required=True, validate=validate.Length(max=256)), | ||
| 80 | 'branchName': fields.Str(required=True, validate=validate.Length(max=256)), | ||
| 81 | 'applicantType': fields.Str(required=True, validate=validate.Length(max=16)), | ||
| 82 | 'accountHolderName': fields.Str(required=True, validate=validate.Length(max=256)), | ||
| 83 | 'accountNo': fields.Str(required=True, validate=validate.Length(max=256)), | ||
| 84 | 'bankVerificationStatus': fields.Str(required=False, validate=validate.Length(max=16)), | ||
| 85 | 'isAllDocUploaded': fields.Boolean(required=False) | ||
| 86 | } | ||
| 87 | |||
| 88 | se_quotationt_args = { | ||
| 89 | 'totalLoanAmount': CustomDecimal(required=True), | ||
| 90 | 'loanTerm': fields.Int(required=True), | ||
| 91 | 'vehiclePrincipal': CustomDecimal(required=True), | ||
| 92 | 'associatedServicePrincipal': CustomDecimal(required=True), | ||
| 93 | 'associatedServiceInfo': fields.List(fields.Nested(se_associated_args), required=True, validate=validate.Length(min=1)), | ||
| 94 | 'monthlyPaymentInfo': fields.List(fields.Nested(se_payment_args), required=True, validate=validate.Length(min=1)), | ||
| 95 | } | ||
| 96 | |||
| 50 | corporate_args = { | 97 | corporate_args = { |
| 51 | 'customerType': fields.Str(required=True, validate=validate.OneOf(consts.CUSTOMER_TYPE)), | 98 | 'customerType': fields.Str(required=True, validate=validate.OneOf(consts.CUSTOMER_TYPE)), |
| 52 | 'customerChineseName': fields.Str(required=True, validate=validate.Length(max=256)), | 99 | 'customerChineseName': fields.Str(required=True, validate=validate.Length(max=256)), |
| ... | @@ -59,6 +106,27 @@ corporate_args = { | ... | @@ -59,6 +106,27 @@ corporate_args = { |
| 59 | "capitalRegAmount": CustomDecimal(required=True), # TODO 2位小数限制 | 106 | "capitalRegAmount": CustomDecimal(required=True), # TODO 2位小数限制 |
| 60 | } | 107 | } |
| 61 | 108 | ||
| 109 | se_corporate_args = { | ||
| 110 | 'customerType': fields.Str(required=True, validate=validate.OneOf(consts.CUSTOMER_TYPE)), | ||
| 111 | 'companyName': fields.Str(required=True, validate=validate.Length(max=256)), | ||
| 112 | 'firstIdType': fields.Str(required=True, validate=validate.Length(max=16)), | ||
| 113 | 'firstIdNo': fields.Str(required=True, validate=validate.Length(max=256)), | ||
| 114 | 'businessLicenseNo': fields.Str(required=True, validate=validate.Length(max=256)), | ||
| 115 | 'organizationCreditCode': fields.Str(required=True, validate=validate.Length(max=256)), | ||
| 116 | 'taxRegistrationCertificateNo': fields.Str(required=True, validate=validate.Length(max=256)), | ||
| 117 | "establishmentDate": CustomDate(required=True), | ||
| 118 | "incorporationDate": CustomDate(required=True), | ||
| 119 | "businessLicenseDueDate": CustomDate(required=True), | ||
| 120 | 'legalRepName': fields.Str(required=True, validate=validate.Length(max=64)), | ||
| 121 | 'organizationType': fields.Str(required=True, validate=validate.Length(max=16)), | ||
| 122 | |||
| 123 | 'fleetCustomer': fields.Boolean(required=False), | ||
| 124 | 'beneficialOwnerName': fields.Str(required=False, validate=validate.Length(max=64)), | ||
| 125 | 'beneficialOwnerIdType': fields.Str(required=False, validate=validate.Length(max=16)), | ||
| 126 | 'beneficialOwnerIdNo': fields.Str(required=False, validate=validate.Length(max=256)), | ||
| 127 | 'beneficialOwnerIdExpiryDate': CustomDate(required=False), | ||
| 128 | } | ||
| 129 | |||
| 62 | individual_args = { | 130 | individual_args = { |
| 63 | 'applicantType': fields.Str(required=True, validate=validate.OneOf(consts.APPLICANT_TYPE)), | 131 | 'applicantType': fields.Str(required=True, validate=validate.OneOf(consts.APPLICANT_TYPE)), |
| 64 | 'customerType': fields.Str(required=True, validate=validate.OneOf(consts.CUSTOMER_TYPE)), | 132 | 'customerType': fields.Str(required=True, validate=validate.OneOf(consts.CUSTOMER_TYPE)), |
| ... | @@ -74,6 +142,28 @@ individual_args = { | ... | @@ -74,6 +142,28 @@ individual_args = { |
| 74 | 'selfEmployedSubType': fields.Str(required=False, validate=validate.OneOf(consts.SUB_TYPE)), | 142 | 'selfEmployedSubType': fields.Str(required=False, validate=validate.OneOf(consts.SUB_TYPE)), |
| 75 | } | 143 | } |
| 76 | 144 | ||
| 145 | se_individual_args = { | ||
| 146 | 'customerType': fields.Str(required=True, validate=validate.OneOf(consts.CUSTOMER_TYPE)), | ||
| 147 | 'applicantType': fields.Str(required=True, validate=validate.OneOf(consts.APPLICANT_TYPE)), | ||
| 148 | 'customerName': fields.Str(required=True, validate=validate.Length(max=64)), | ||
| 149 | 'idType': fields.Str(required=True, validate=validate.OneOf(consts.ID_TYPE)), | ||
| 150 | 'idNum': fields.Str(required=True, validate=validate.Length(max=256)), | ||
| 151 | 'secondIdType': fields.Str(required=False, validate=validate.OneOf(consts.SECOND_ID_TYPE)), | ||
| 152 | 'secondIdNum': fields.Str(required=False, validate=validate.Length(max=256)), | ||
| 153 | "dateOfBirth": CustomDate(required=True), | ||
| 154 | "idExpiryDate": CustomDate(required=True), | ||
| 155 | 'nationality': fields.Str(required=False, validate=validate.Length(max=64)), | ||
| 156 | 'countryregion': fields.Str(required=False, validate=validate.Length(max=64)), | ||
| 157 | 'hukouProvince': fields.Str(required=True, validate=validate.Length(max=64)), | ||
| 158 | 'hukouCity': fields.Str(required=True, validate=validate.Length(max=64)), | ||
| 159 | 'residentialProvince': fields.Str(required=False, validate=validate.Length(max=64)), | ||
| 160 | 'residentialCity': fields.Str(required=False, validate=validate.Length(max=64)), | ||
| 161 | 'propertyDocumentPolicy': fields.Str(required=False, validate=validate.Length(max=16)), | ||
| 162 | 'companyName': fields.Str(required=False, validate=validate.Length(max=256)), | ||
| 163 | 'registeredCapital': CustomDecimal(required=False), | ||
| 164 | 'selfEmployedSubType': fields.Str(required=False, validate=validate.Length(max=16)), | ||
| 165 | } | ||
| 166 | |||
| 77 | comment_args = { | 167 | comment_args = { |
| 78 | 'comment': fields.Str(required=True, validate=validate.Length(max=1024)), | 168 | 'comment': fields.Str(required=True, validate=validate.Length(max=1024)), |
| 79 | } | 169 | } |
| ... | @@ -95,10 +185,31 @@ compare_content = { | ... | @@ -95,10 +185,31 @@ compare_content = { |
| 95 | 'corporateCusInfo': fields.Nested(corporate_args, required=False), | 185 | 'corporateCusInfo': fields.Nested(corporate_args, required=False), |
| 96 | } | 186 | } |
| 97 | 187 | ||
| 188 | se_compare_content = { | ||
| 189 | 'uniqSeq': fields.Str(required=True, validate=validate.Length(max=128)), | ||
| 190 | 'applicationId': fields.Str(required=True, validate=validate.Length(max=64)), | ||
| 191 | "applicationVersion": fields.Int(required=True), | ||
| 192 | 'applicationEntity': fields.Str(required=True, validate=validate.OneOf(consts.ENTITY)), | ||
| 193 | 'customerType': fields.Str(required=True, validate=validate.OneOf(consts.CUSTOMER_TYPE)), | ||
| 194 | "firstSubmmisonDate": CustomDate(required=True), | ||
| 195 | |||
| 196 | 'individualCusInfo': fields.List(fields.Nested(se_individual_args), | ||
| 197 | required=True, validate=validate.Length(min=1, max=4)), | ||
| 198 | 'corporateCusInfo': fields.Nested(se_corporate_args, required=False), | ||
| 199 | 'vehicleInfo': fields.Nested(se_vehicle_args, required=True), | ||
| 200 | 'insuranceInfo': fields.Nested(se_insurance_args, required=True), | ||
| 201 | 'bankInfo': fields.Nested(se_bank_args, required=True), | ||
| 202 | 'quotationtInfo': fields.Nested(se_quotationt_args, required=True), | ||
| 203 | } | ||
| 204 | |||
| 98 | compare_args = { | 205 | compare_args = { |
| 99 | 'content': fields.Nested(compare_content, required=True) | 206 | 'content': fields.Nested(compare_content, required=True) |
| 100 | } | 207 | } |
| 101 | 208 | ||
| 209 | se_compare_args = { | ||
| 210 | 'content': fields.Nested(se_compare_content, required=True) | ||
| 211 | } | ||
| 212 | |||
| 102 | application_data_args = {'applicationId': fields.Str(required=True, validate=validate.Length(max=64))} | 213 | application_data_args = {'applicationId': fields.Str(required=True, validate=validate.Length(max=64))} |
| 103 | 214 | ||
| 104 | applicant_data_args = { | 215 | applicant_data_args = { |
| ... | @@ -353,7 +464,7 @@ class CompareView(GenericView): | ... | @@ -353,7 +464,7 @@ class CompareView(GenericView): |
| 353 | 464 | ||
| 354 | post.openapi_doc = ''' | 465 | post.openapi_doc = ''' |
| 355 | tags: [info] | 466 | tags: [info] |
| 356 | summary: POS上传比对信息 | 467 | summary: POS上传CA比对信息 |
| 357 | consumes: [application/json] | 468 | consumes: [application/json] |
| 358 | produces: [application/json] | 469 | produces: [application/json] |
| 359 | parameters: | 470 | parameters: |
| ... | @@ -371,6 +482,36 @@ class CompareView(GenericView): | ... | @@ -371,6 +482,36 @@ class CompareView(GenericView): |
| 371 | ''' | 482 | ''' |
| 372 | 483 | ||
| 373 | 484 | ||
| 485 | class SECompareView(GenericView): | ||
| 486 | permission_classes = [IsAuthenticated] | ||
| 487 | authentication_classes = [OAuth2AuthenticationWithUser] | ||
| 488 | |||
| 489 | # pos上传比对信息接口 | ||
| 490 | @use_args(se_compare_args, location='data') | ||
| 491 | def post(self, request, args): | ||
| 492 | self.running_log.info('se compare in') | ||
| 493 | return response.ok() | ||
| 494 | |||
| 495 | post.openapi_doc = ''' | ||
| 496 | tags: [info] | ||
| 497 | summary: POS上传SE比对信息 | ||
| 498 | consumes: [application/json] | ||
| 499 | produces: [application/json] | ||
| 500 | parameters: | ||
| 501 | - in: body | ||
| 502 | name: body | ||
| 503 | required: true | ||
| 504 | schema: | ||
| 505 | $ref: "#/definitions/SEComparison" | ||
| 506 | |||
| 507 | responses: | ||
| 508 | 200: | ||
| 509 | description: ok | ||
| 510 | schema: | ||
| 511 | $ref: '#/definitions/ApiResponse' | ||
| 512 | ''' | ||
| 513 | |||
| 514 | |||
| 374 | class DocView(GenericView, DocHandler): | 515 | class DocView(GenericView, DocHandler): |
| 375 | 516 | ||
| 376 | # 文件列表页 | 517 | # 文件列表页 | ... | ... |
This diff is collapsed.
Click to expand it.
| ... | @@ -48,7 +48,7 @@ class Command(BaseCommand): | ... | @@ -48,7 +48,7 @@ class Command(BaseCommand): |
| 48 | view_class = view.view_class | 48 | view_class = view.view_class |
| 49 | url_path, path_parameters = pattern[0][0] | 49 | url_path, path_parameters = pattern[0][0] |
| 50 | url_path = unify_url_path_format(url_path) | 50 | url_path = unify_url_path_format(url_path) |
| 51 | if url_path not in ['/api/compare/v1']: | 51 | if url_path not in ['/api/compare/settlement/v1', '/api/compare/v1']: |
| 52 | continue | 52 | continue |
| 53 | url_path_paramters = getattr(view, 'parameters_doc', None) | 53 | url_path_paramters = getattr(view, 'parameters_doc', None) |
| 54 | if url_path_paramters: | 54 | if url_path_paramters: | ... | ... |
-
Please register or sign in to post a comment