Igris/pkg/zohal/types.go

51 lines
1.3 KiB
Go

package zohal
type respMatched struct {
Matched bool `json:"matched"`
}
type personIdentity struct {
Matched bool `json:"matched"`
LastName string `json:"last_name"`
FirstName string `json:"first_name"`
FatherName string `json:"father_name"`
NationalCode string `json:"national_code"`
IsDead bool `json:"is_dead"`
Alive bool `json:"alive"`
}
type respBody[T any] struct {
Data T `json:"data"`
Message string `json:"message"`
}
type zohalResp[T any] struct {
StatusCode int `json:"status_code"`
Body respBody[T] `json:"response_body"`
}
type (
// https://service.zohal.io/api/v0/services/inquiry/shahkar
ZohalShahkarReq struct {
Phone string `json:"mobile"`
NationalID string `json:"national_code"`
}
ZohalShahkarResp struct {
zohalResp[respMatched]
}
// https://service.zohal.io/api/v0/services/inquiry/national_identity_inquiry
ZohalIdentityReq struct {
NationalID string `json:"national_code"`
BirthDate string `json:"birth_date"`
}
ZohalIdentityResp struct {
zohalResp[personIdentity]
}
// https://service.zohal.io/api/v0/services/inquiry/check_iban_with_national_code
ZohalIbanReq struct {
NationalID string `json:"national_code"`
IBAN string `json:"IBAN"`
BirthDate string `json:"birth_date"`
}
ZohalIbanResp struct {
zohalResp[respMatched]
}
)