Applicants: 1→N contact methods with types (phone/email/Instagram/Telegram/Bale/site)
- ContactMethod entity (Type + Value + SortOrder) 1→N on TalentListing (+ migration). - Parser extracts ALL contacts: multiple phones + landlines, email, and socials (Instagram/Telegram/Bale/WhatsApp/website) via URLs and Persian keyword cues; primary Phone kept for cards. - ContactInfo helper: per-type label/icon/clickable href (tel:/mailto:/t.me/…). - Ingestion attaches contacts to each (fanned-out) talent listing; manual Review re-parses to attach them + the admin-typed phone. - Talent details renders the full contact list as buttons; falls back to the single phone, then the Divar source link. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,49 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace JobsMedical.Web.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class ContactMethods : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ContactMethods",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
TalentListingId = table.Column<int>(type: "integer", nullable: false),
|
||||
Type = table.Column<int>(type: "integer", nullable: false),
|
||||
Value = table.Column<string>(type: "character varying(250)", maxLength: 250, nullable: false),
|
||||
SortOrder = table.Column<int>(type: "integer", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ContactMethods", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_ContactMethods_TalentListings_TalentListingId",
|
||||
column: x => x.TalentListingId,
|
||||
principalTable: "TalentListings",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_ContactMethods_TalentListingId",
|
||||
table: "ContactMethods",
|
||||
column: "TalentListingId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "ContactMethods");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -285,6 +285,35 @@ namespace JobsMedical.Web.Migrations
|
||||
b.ToTable("Cities");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("JobsMedical.Web.Models.ContactMethod", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("integer");
|
||||
|
||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("SortOrder")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("TalentListingId")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Value")
|
||||
.IsRequired()
|
||||
.HasMaxLength(250)
|
||||
.HasColumnType("character varying(250)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("TalentListingId");
|
||||
|
||||
b.ToTable("ContactMethods");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("JobsMedical.Web.Models.District", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -1218,6 +1247,17 @@ namespace JobsMedical.Web.Migrations
|
||||
b.Navigation("Shift");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("JobsMedical.Web.Models.ContactMethod", b =>
|
||||
{
|
||||
b.HasOne("JobsMedical.Web.Models.TalentListing", "TalentListing")
|
||||
.WithMany("Contacts")
|
||||
.HasForeignKey("TalentListingId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.Navigation("TalentListing");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("JobsMedical.Web.Models.District", b =>
|
||||
{
|
||||
b.HasOne("JobsMedical.Web.Models.City", "City")
|
||||
@@ -1500,6 +1540,11 @@ namespace JobsMedical.Web.Migrations
|
||||
b.Navigation("Applications");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("JobsMedical.Web.Models.TalentListing", b =>
|
||||
{
|
||||
b.Navigation("Contacts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("JobsMedical.Web.Models.User", b =>
|
||||
{
|
||||
b.Navigation("Applications");
|
||||
|
||||
Reference in New Issue
Block a user