Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 127 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# Contributing

Thanks for your interest in contributing! Please read carefully through our guidelines below to ensure that your contribution adheres to our project's standards.

## Code of Conduct

To hold a safe space for all contributors, we expect all project participants to adhere to our [Code of Conduct](https://talegen.com/open-source-code-of-conduct). Please do not skip reading this so that you can understand what actions will and will not be tolerated.

## Issue Tracking

For this Project, we use [GitHub Issues](https://github.com/Talegen/Talegen.Common.Models/issues) to track all tasks related to this project.

## Style Guide

We follow the [Talegen Style Guide for C#](https://talegen.com/c-programming-style-guide/).

**We will not accept contributions with StyleCop errors.**

## Build the project locally

In order to contribute to a project on GitHub, you must first get a copy of the project running locally on your computer. This process is sometimes called a "build process", and every project's process will have different requirements. Some requirements are due to the project being hosted on GitHub, some are due to the programming language used, some are due to the project's dependencies.

There are five steps to building this project:

1. [Set up Git and Install Visual Stuido](#set-up-git-and-install-visualstudio)
1. [Fork the repository](#fork-the-repository)
1. [Clone your fork](#clone-your-fork)
1. [Install dependencies](#install-dependencies)
1. [Run the project](#run-the-project)

Once you get the project built, see if you can fix some [issues](https://github.com/Talegen/Talegen.Common.Models/issues).

### Set up Git and Install Visual Studio

> **If you've never written C# before, don't sweat!** This exercise only requires fundamental language skills, you should be able to adapt from your favorite language.

All GitHub projects are backed by a version control software called *Git*. You'll need to [set up Git](https://duckduckgo.com/?q=setting+up+git&atb=v134-1&ia=web) in order to contribute to *any* project on GitHub.

This specific project is written in C# and was built with Visual Studio. You can use this IDE or Visual Studio Code.

### Fork the repository

A *fork* is a copy of a repository. Forking a repository lets you to make changes to your copy without affecting any of the original code.

Click **Fork** (in the top-right corner of the page) to copy this repository to your GitHub account.

### Clone your fork

A *clone* is a downloaded version of a repository. Cloning our fork lets you download a copy of the repository to your computer.

Use `git` to clone your fork

```
$ git clone https://github.com/YOUR-USERNAME/Talegen.Common.Models
```

### Install dependencies

Did you know that the author usually does not write all of the code in a project?

The beauty of open source is that you can install and use code that other people have written, allowing you to focus on the unique requirements of your project. Third-party code that your project installs is called a *dependency* because it is required to work.

This project uses [nuget.org](https://www.nuget.org/), a package repository for .NET projects, to maintain third-party dependencies.

Package retrieval should be automatic at build time. There is no need for commands to retrieve these dependencies.

**Dependency version control will be handled by Talegen. Do not submit dependency changes without specific required changes.**

### Run the project

You should build the project with 0 warnings and 0 errors before submitting any changes.

## Submit a Pull Request

Remember how making changes on a *fork* doesn't affect the original code? Well, in order to fix an issue in the main project, you *want* to change the original code. A *pull request* is a GitHub feature that lets you do just that!

There are three steps to submitting a pull request:
1. [Save your changes locally](#save-your-changes-locally)
2. [Send your changes to your fork](#send-your-changes-to-your-fork)
3. [Open a Pull Request](#open-a-pull-request)

These instructions are designed to explain the bare minimum steps in a beginner-friendly way. If you find yourself hungry for more details (or get stuck), I applaud and encourage you to continue research on your own. You'll find no lack of amazing articles on this topic.

### Save your changes locally

First, get a list of all the files you have changed.
```
$ git status
```

Next, *stage* the file you want to save. This will add the file to a new list that is ready to be saved.
```
$ git add src/calculator.cs
```

Next, verify that the file has been staged correctly. Notice that the text color has changed, and your file is now in a list that says "Changes to be committed" instead of "Changes not staged for commit"
```
$ git status
```

Finally, save your staged files.
```
$ git commit -m "Implement _check"
```

You'll often hear this process called *committing* changes. It's the exact same thing.

### Send your changes to your fork

With one simple `git` command, you can send the changes you just committed locally to your *fork* on GitHub.

```
$ git push origin master
```

### Open a Pull Request

1. Find the [New Pull Request](https://github.com/danthareja/contribute-to-open-source/compare/) button
2. Select the option to **compare across forks**
3. Select **your username** in the `head fork` option
4. Select **your username** in the `base` option
4. Click **Create Pull Request**



## License
By contributing, you agree that your contributions will be licensed under its Apache 2.0 license.
43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,43 @@
# Talegen.Common.Models
Talegen Common Models Used By many other Model libraries

Talegen **Common** Model Library

This repository ([Talegen.Common.Models](https://github.com/Talegen/Talegen.Common.Models)) is where we (Talegen) develop the Talegen Common Models library. The source code here is available to everyone under the standard [Apache 2.0 license](https://github.com/talegen/Talegen.PureBlue.Models/blob/main/LICENSE).

The purpose of this library is to provide common/useful models typically used by applications created by Talegen.

## Contributing

There are many ways in which you can participate in the project, for example:

- Submit bugs and feature requests, and help us verify as they are checked in.
- Review source code changes.
- Review the documentation and make pull requests for anything from typos to new content.

If you are interested in fixing issues and contributing directly to the code base, please see the document How to Contribute, which covers the following:

- How to build and run from source
- The development workflow, including debugging and running tests.
- Coding and style guidelines
- Submitting code changes (pull requests)
- Contributing to translations

## Feedback

- Ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/Talegen)
- [Request a new feature](https://github.com/talegen/Talegen.Common.Models/blob/main/CONTRIBUTING.md).
- Up vote [popular feature requests](https://github.com/talegen/Talegen.Common.Models/issues?q=is:open%20is:issue%20label:feature-request%20sort:reactions-%2b1-desc).
- [File an issue](https://github.com/talegen/Talegen.Common.Models/issues).
- Follow [@TalegenInc](https://twitter.com/TalegenInc) and let us know what you think!

## Related Projects

Many projects and products rely on this Talegen Common Models library. Many of these projects live in their own repositories on GitHub. For example, the Talegen.Tenant.Models utilizes the common models.

## Code of Conduct

This project has adopted the [Talegen Open Source Code of Conduct](https://talegen.com/open-source-code-of-conduct/). For more information see the Code of Conduct FAQ or [contact us](https://talegen.com/contact/) with additional questions or comments.

## License

Copyright © Talegen, LLC. All rights reserved.
Binary file added src/Assets/logo.ico
Binary file not shown.
Binary file added src/Assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions src/Constants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
*
* (c) Copyright Talegen, LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

namespace Talegen.Common.Models
{
using System.Collections.Generic;

/// <summary>
/// Contains a static set of common default values.
/// </summary>
public static class Defaults
{
/// <summary>
/// The default language code. English.
/// </summary>
public const string DefaultLanguageCode = "en";

/// <summary>
/// The default time zone offset.
/// </summary>
public const string DefaultTimeZone = "UTC";

/// <summary>
/// Available common titles.
/// </summary>
public static List<string> CommonNamePrefixes => new List<string> { "Dr.", "Miss", "Mr.", "Mrs.", "Ms.", "Prof.", "Sir" };
}
}
124 changes: 124 additions & 0 deletions src/Contacts/Address.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/*
*
* (c) Copyright Talegen, LLC.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

namespace Talegen.Common.Models.Contacts
{
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

/// <summary>
/// Contains an enumerated list of address types.
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum AddressTypes
{
/// <summary>
/// A home address.
/// </summary>
Home,

/// <summary>
/// A work address.
/// </summary>
Work,

/// <summary>
/// A business address.
/// </summary>
Business,

/// <summary>
/// Other type of address.
/// </summary>
Other
}

/// <summary>
/// Contains an enumerated list of commerce address types
/// </summary>
public enum CommerceAddressTypes
{
/// <summary>
/// The billing address.
/// </summary>
Billing,

/// <summary>
/// The mailing address.
/// </summary>
Mailing
}

/// <summary>
/// This class represents the basic postal address for an entity.
/// </summary>
public class Address
{
/// <summary>
/// Gets or sets the primary address street.
/// </summary>
/// <value>The primary address street.</value>
public string Street1 { get; set; }

/// <summary>
/// Gets or sets the secondary address street.
/// </summary>
/// <value>The secondary address street.</value>
public string Street2 { get; set; }

/// <summary>
/// Gets or sets the address city.
/// </summary>
/// <value>The address city.</value>
public string City { get; set; }

/// <summary>
/// Gets or sets the address state/region.
/// </summary>
/// <value>The state of the address state/region.</value>
public string RegionState { get; set; }

/// <summary>
/// Gets or sets the address postal/zip code.
/// </summary>
/// <value>The state of the address postal/zip code.</value>
public string PostalCode { get; set; }

/// <summary>
/// Gets or sets the address country.
/// </summary>
/// <value>The address country.</value>
public string Country { get; set; }

/// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>The type.</value>
public AddressTypes Type { get; set; }

/// <summary>
/// Gets or sets the type of the commerce.
/// </summary>
/// <value>The type of the commerce.</value>
public CommerceAddressTypes CommerceType { get; set; }

/// <summary>
/// Gets or sets a value indicating whether this <see cref="Address" /> is primary.
/// </summary>
/// <value><c>true</c> if primary; otherwise, <c>false</c>.</value>
public bool Primary { get; set; }
}
}
Loading