public void SetId(CompanyId id) { if (Id.Value != 0) { throw new InvalidOperationException("Id is already set"); } Id = id; }
public bool Equals(CompanyId other) { return(Value == other.Value); }
public bool CanManageWorkers(CompanyId companyId) => companyId == CompanyId && (CompanyRole == UserCompanyRole.Admin || CompanyRole == UserCompanyRole.UserAdmin);
public bool CanEdit(CompanyId companyId) => companyId == CompanyId && CompanyRole == UserCompanyRole.Admin;
public void From(CompanyId companyId) => CompanyId = companyId;
public Company(CompanyId id, string name, string number) : this(name, number) { Id = id; }