using System; namespace RecruitmentDAL.DTO.Agency { // MRECRUITMENTAGENCY — a placement agency that submits candidates on GB5's behalf (see // CandidateDTO.Source/ApplicationDTO.ApplicationSource = 3 "Agency"). Modeled the same way // Phase 3's candidate-portal integration modeled a candidate against DXP, but for an agency // the plan explicitly calls for a DXP *Party* (not a partyless DXP User account) — an agency // is a legal entity DXP's Party model already fits, unlike an individual candidate (see // RecruitmentBLL.CandidatePortal.CandidatePortalBLL's doc comment for why candidates // deliberately skip Party). // // Split of "what DXP Party stores" vs. "what needs a Recruitment-side extension table" (per // DXPDAL.Party.PartyDTO, read before designing this): // DXP MDXPPARTY (cross-host, global, no TenantId) owns: LegalName, PartyTypeCode, identity // hashes (GSTIN/PAN/mobile/email), and the merge/status lifecycle. This is the "one legal // entity across every tenant that uses DXP" record. // MRECRUITMENTAGENCY (this table, tenant-scoped, lives in the Recruitment tenant DB) owns // everything genuinely recruitment-specific: contact person, contract terms/commission %, // specialization tags, and this tenant's own ACTIVE/INACTIVE status for the relationship // (independent of DXP Party's own Status — a tenant can deactivate its relationship with // an agency without that agency's DXP Party record being suspended/merged/deleted). // AGENCYNAME is intentionally denormalized here (mirrors DxpPartyId's LegalName at save // time) — DXP's MDXPPARTY lives in a different, cross-host database, so every list/search/ // report screen in this module needs the name available locally without a cross-database // join, same reasoning as every other cross-boundary reference in this repo. // // PartyTypeCode mapping — DXP's PartyTypeCode is a closed vendor/customer taxonomy with no // dedicated "Agency" value (1=Vendor 2=Customer 3=Dealer 4=ServiceFranchisee 5=Consumer — see // PartyDTO.cs). A placement agency is functionally a services vendor to the tenant, so this // module maps it to PartyTypeCode=1 (Vendor) — see AgencyBLL.DxpAgencyPartyTypeCode. DXPDAL is // out of this task's lane (only GB5Solution/Recruitment/**, Constant.cs, Resource/**, and // DB/Migrations/** may be touched), so adding a dedicated DXP-side "Agency" PartyTypeCode is // explicitly out of scope here — flagged as an open question in this task's final report. // // DXPPARTYID is FK-by-convention only (not enforced) — same cross-database pattern already // established by BgVerificationDTO.ReportAttachmentId / OBJECTRECRUITMENTCANDIDATEDOC: DXP's // MDXPPARTY lives in a separate, cross-host database that this tenant DB cannot FK into. public class AgencyDTO { #region PrivateMembers private int recruitmentagencyid; private int dxppartyid = -1; // FK-by-convention -> DXP MDXPPARTY.DXPPARTYID (cross-host, not enforced) private string agencyname = string.Empty; // Denormalized mirror of the DXP Party's LegalName private string? contactpersonname; private string? contactemail; private string? contactmobile; private string? contractterms; // Free-text contract/commercial terms summary private decimal? commissionpercentage; // e.g. 8.50 = 8.5% private string? specializationtags; // Comma-separated, e.g. "IT,Engineering,Executive Search" #region Standard private short sortorder = 9999; private byte status = 1; // 1=Active 2=Deleted 4=Inactive (repo-wide STATUS convention) private short version; private int tenantid; #endregion #region Base private int createdbyid; private DateTime createdon; private string? createdbyname; private int modifiedbyid; private DateTime modifiedon; private string? modifiedbyname; #endregion #endregion #region PublicMembers public int RecruitmentAgencyId { get { return recruitmentagencyid; } set { recruitmentagencyid = value; } } public int DxpPartyId { get { return dxppartyid; } set { dxppartyid = value; } } public string AgencyName { get { return agencyname; } set { agencyname = value; } } public string? ContactPersonName { get { return contactpersonname; } set { contactpersonname = value; } } public string? ContactEmail { get { return contactemail; } set { contactemail = value; } } public string? ContactMobile { get { return contactmobile; } set { contactmobile = value; } } public string? ContractTerms { get { return contractterms; } set { contractterms = value; } } public decimal? CommissionPercentage { get { return commissionpercentage; } set { commissionpercentage = value; } } public string? SpecializationTags { get { return specializationtags; } set { specializationtags = value; } } #region Standard public short SortOrder { get { return sortorder; } set { sortorder = value; } } public byte Status { get { return status; } set { status = value; } } public short Version { get { return version; } set { version = value; } } public int TenantId { get { return tenantid; } set { tenantid = value; } } #endregion #region Base public int CreatedById { get { return createdbyid; } set { createdbyid = value; } } public DateTime CreatedOn { get { return createdon; } set { createdon = value; } } public string? CreatedByName { get { return createdbyname; } set { createdbyname = value; } } public int ModifiedById { get { return modifiedbyid; } set { modifiedbyid = value; } } public DateTime ModifiedOn { get { return modifiedon; } set { modifiedon = value; } } public string? ModifiedByName { get { return modifiedbyname; } set { modifiedbyname = value; } } #endregion #endregion } }