Kind: Class
Source: Pams/Logic/Pams.Business/Entity/Organization/Company.Model.cs (line 10)
Part of: Pams
Company is a C# entity model that represents an organization company record in the PAMS business layer. It stores company identity, branding, status, web presence, and branch-sharing settings for related account and contact data.
Diagram
mermaidgraph LR Company[Company] Identity[Identity] Branding[Branding] Settings[Organization Settings] Company --> Identity Company --> Branding Company --> Settings Identity --> CompanyID[CompanyID: int] Identity --> RowGuid[RowGuid: Guid?] Branding --> Name[Name: string] Branding --> Website[Website: string] Branding --> Slogan[Slogan: string] Branding --> Subdomain[Subdomain: string] Branding --> Logo[Logo: string] Settings --> IsActive[IsActive: bool] Settings --> ShareAccount[ShareAccountWithBranches: int?] Settings --> ShareContact[ShareContactWithBranches: int?]
Usage
tstype Company = {
CompanyID: number;
RowGuid: string | null;
Name: string;
Website: string;
Slogan: string;
Subdomain: string;
IsActive: boolean;
Logo: string;
ShareAccountWithBranches: number | null;
ShareContactWithBranches: number | null;
};
async function saveCompany(companyId: number): Promise<Company> {
const company: Company = {
CompanyID: companyId,
RowGuid: null,
Name: "Example Company",
Website: "https://example.com",
Slogan: "Helping customers",
Subdomain: "example",
IsActive: true,
Logo: "/images/example-logo.svg",
ShareAccountWithBranches: null,
ShareContactWithBranches: null,
};
const response = await fetch("/api/companies", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(company),
});
if (!response.ok) {
throw new Error("Unable to save company");
}
return response.json();
}
AI Coding Instructions
- Keep
CompanyIDas the primary integer identifier and preserveRowGuidas nullable when no GUID is assigned. - Treat
ShareAccountWithBranchesandShareContactWithBranchesas nullable integer settings, not boolean values. - Preserve the current property names when mapping API payloads if the backend serializer expects PascalCase fields.
- Check
IsActivebefore presenting a company as available in organization, account, or contact workflows.
Relationships
- IMPORTS →
Company - IMPORTS →
PostedFile - IMPORTS →
EntityBase - IMPORTS →
PamsLinqDataContext
Used by
11 references from 11 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.
Imported by (11)
CompanyBranchDepartmentController—Pams/API/Pams.API/Controllers/Organization/CompanyBranchDepartmentController.cs:29CompanyBranchSettingController—Pams/API/Pams.API/Controllers/Organization/CompanyBranchSettingController.cs:24CompanyController—Pams/API/Pams.API/Controllers/Organization/CompanyController.cs:26AccountsController—Pams/API/Pams.API/Controllers/Person/AccountsController.cs:23JobDocumentController—Pams/API/Pams.API/Controllers/Sales/JobDocumentController.cs:19Company—Pams/Logic/Pams.Business/Entity/Organization/Company.Model.cs:10Person—Pams/Logic/Pams.Business/Entity/Person/Person.Model.cs:11Activity—Pams/Data/Pams.Data/CRMLinq.designer.cs:11344
…and 3 more.
Was this page helpful?