parsian inquiries implemented

This commit is contained in:
2026-06-13 12:59:15 +03:30
parent ead2e301e5
commit 0aad5a34d2
19 changed files with 771 additions and 50 deletions

View File

@@ -352,9 +352,10 @@ POST /api/inquiry/sheba
### Request Body
```json
{
"accountOwnerType": "REAL",
"nationalId": "0123456789",
"shebaId": "IR123456789012345678901234"
"accountOwnerType": "1",
"nationalCode": "0123456789",
"legalId": null,
"sheba": "IR123456789012345678901234"
}
```
@@ -362,10 +363,10 @@ POST /api/inquiry/sheba
| Field | Type | Required | Description |
|-------|------|----------|-------------|
| accountOwnerType | string | Yes | Account owner type: "REAL" (person) or "LEGAL" (company) |
| nationalId | string | Conditional | Required if accountOwnerType is "REAL" |
| legalId | string | Conditional | Required if accountOwnerType is "LEGAL" |
| shebaId | string | Yes | SHEBA/IBAN number (26 characters starting with IR) |
| accountOwnerType | string | No | Account owner type; defaults to `"1"` in providers |
| nationalCode | string | Yes | Iranian national code (10 digits) |
| legalId | string | No | Legal identifier when needed by the selected account owner type |
| sheba | string | Yes | SHEBA/IBAN number (26 characters starting with IR) |
### Success Response (200 OK)
@@ -398,12 +399,57 @@ curl -X POST https://api.example.com/api/inquiry/sheba \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key-here" \
-d '{
"accountOwnerType": "REAL",
"nationalId": "0123456789",
"shebaId": "IR123456789012345678901234"
"accountOwnerType": "1",
"nationalCode": "0123456789",
"sheba": "IR123456789012345678901234"
}'
```
## Car Policy By Chassis
### Endpoint
```
POST /api/inquiry/policyByChassis
```
### Request Body
```json
{
"chassisNo": "NAAM01E15HK123456"
}
```
## Car Policy By Plate
### Endpoint
```
POST /api/inquiry/policyByPlate
```
### Request Body
```json
{
"plk1": "12",
"plk2": "ب",
"plk3": "345",
"plksrl": "67"
}
```
## Car Policy By National Code
### Endpoint
```
POST /api/inquiry/policyByNationalCode
```
### Request Body
```json
{
"nationalCode": "0123456789"
}
```
## Error Responses
### 400 Bad Request - Invalid Input
@@ -625,4 +671,4 @@ For API support:
- **Documentation**: https://docs.example.com
- **Status Page**: https://status.example.com
- **Support Email**: support@example.com
- **Emergency**: +98-21-1234-5678
- **Emergency**: +98-21-1234-5678

View File

@@ -147,6 +147,7 @@ HAMTA_LEGAL_PERSON_URL=https://api.hamta.example.com/api/inquiry/legalPerson
HAMTA_LEGAL_PERSON_USERNAME=SabtAsnadHamta
HAMTA_LEGAL_PERSON_PASSWORD=HSY1f6?e@kSJ
HAMTA_LEGAL_PERSON_AUTH_METHOD=AMITIS
```
### MOALLEM Provider
@@ -194,6 +195,44 @@ MOALLEM_LEGAL_PERSON_PASSWORD=
MOALLEM_LEGAL_PERSON_AUTH_METHOD=SOAP
```
### PARSIAN Provider
```env
# Global Settings
PARSIAN_ENABLED=true
PARSIAN_TIMEOUT=10000
PARSIAN_MAX_RETRIES=2
# Shahkar Inquiry (X-PACKAGE-API-KEY header)
PARSIAN_SHAHKAR_URL=https://apigateway.parsianinsurance.com/shahkarinqOut
PARSIAN_SHAHKAR_API_KEY=your-package-api-key
PARSIAN_SHAHKAR_AUTH_METHOD=NONE
# Sheba/Sayah Inquiry (AMITIS auth)
PARSIAN_SHEBA_URL=https://sayah.services.centinsur.ir/api/Cisb/TatbighServiceAsync
PARSIAN_SHEBA_USERNAME=parsian.sayah
PARSIAN_SHEBA_PASSWORD=your-password
PARSIAN_SHEBA_AUTH_METHOD=AMITIS
# Car policy inquiry by chassis (SOAP auth)
PARSIAN_POLICY_BY_CHASSIS_URL=http://reinsure.centinsur.ir/CarAllPlcysV4
PARSIAN_POLICY_BY_CHASSIS_USERNAME=pa6476
PARSIAN_POLICY_BY_CHASSIS_PASSWORD=your-password
PARSIAN_POLICY_BY_CHASSIS_AUTH_METHOD=SOAP
# Car policy inquiry by national plate (SOAP auth)
PARSIAN_POLICY_BY_PLATE_URL=http://reinsure.centinsur.ir/CarAllPlcysV4
PARSIAN_POLICY_BY_PLATE_USERNAME=pa6476
PARSIAN_POLICY_BY_PLATE_PASSWORD=your-password
PARSIAN_POLICY_BY_PLATE_AUTH_METHOD=SOAP
# Car policy inquiry by national code (SOAP auth)
PARSIAN_POLICY_BY_NATIONAL_CODE_URL=http://reinsure.centinsur.ir/CarAllPlcysV4
PARSIAN_POLICY_BY_NATIONAL_CODE_USERNAME=pa6476
PARSIAN_POLICY_BY_NATIONAL_CODE_PASSWORD=your-password
PARSIAN_POLICY_BY_NATIONAL_CODE_AUTH_METHOD=SOAP
```
### TEJARATNOU Provider
```env
@@ -265,11 +304,18 @@ REAL_ESTATE_FALLBACK_PROVIDERS=
#### Shahkar Inquiry
```env
SHAHKAR_DEFAULT_PROVIDER=MOALLEM
SHAHKAR_DEFAULT_PROVIDER=PARSIAN
SHAHKAR_FALLBACK_ENABLED=false
SHAHKAR_FALLBACK_PROVIDERS=
```
#### Sheba/Sayah Inquiry
```env
SHEBA_DEFAULT_PROVIDER=PARSIAN
SHEBA_FALLBACK_ENABLED=false
SHEBA_FALLBACK_PROVIDERS=
```
## Provider Behavior Examples
### Scenario 1: All Providers Enabled
@@ -460,4 +506,4 @@ HAMTA_PERSON_AUTH_METHOD=AMITIS
- Removed `AMITIS_` prefix from provider credentials
- Added `AUTH_METHOD` to specify authentication type
- Added per-inquiry `URL` configuration
- AMITIS is now a separate authentication service, not a provider
- AMITIS is now a separate authentication service, not a provider