feat: parse project metadata from PF links
This commit is contained in:
@@ -51,6 +51,16 @@ type Suggestion struct {
|
||||
IsActive bool `json:"is_active"`
|
||||
}
|
||||
|
||||
type ParsedOwnListing struct {
|
||||
Title *string `json:"title"`
|
||||
OurPrice *float64 `json:"our_price"`
|
||||
DLDPermit *string `json:"dld_permit"`
|
||||
Building *string `json:"building"`
|
||||
Bedrooms *int64 `json:"bedrooms"`
|
||||
SizeSqft *float64 `json:"size_sqft"`
|
||||
Currency *string `json:"currency"`
|
||||
}
|
||||
|
||||
type SuggestionsResponse struct {
|
||||
OurPermit *string `json:"our_permit"`
|
||||
BayutEnabled bool `json:"bayut_enabled"`
|
||||
@@ -108,6 +118,14 @@ func (w *Worker) Suggest(ctx context.Context, projectID int64) (*SuggestionsResp
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func (w *Worker) ParseOwnListing(ctx context.Context, url string) (*ParsedOwnListing, error) {
|
||||
var out ParsedOwnListing
|
||||
if err := w.call(ctx, "parse-own-listing", map[string]any{"url": url}, &out); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &out, nil
|
||||
}
|
||||
|
||||
func (w *Worker) Health(ctx context.Context) error {
|
||||
var out HealthResult
|
||||
if err := w.call(ctx, "health", map[string]any{}, &out); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user