Code Monkey home page Code Monkey logo

swedish-identification-number's People

Contributors

advfredriksvensson avatar andersjarl avatar psafth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

andersjarl

swedish-identification-number's Issues

Example project

Include a project which shows the usage and examples for this library.

Simplify Split method in Luhn.cs

The following code snipped is already implemented in the built in Math-library.

return new int[] { input / 10, input % 10 };

This should be changed to use Math.DivRem instead

var q = Math.DivRem(input, 10, out int rem);
return new int[] { q, rem };

ToFriendlyName -> ToFormalString

Rename the interface and abstractions for IIdentificationNumber;

Change string ToFriendlyName(); to string ToFormalString(); in:
+IdentificationNumber.cs
+Entities/BusinessRegistrationNumber.cs
+Interfaces/IIdentificationNumber.cs

Feature: Validation attribute

Implement a custom validation attribute which can be used in model validation.

Key features

  • Options on what and how to validate
    • Person/Coordination/Business or a combination

Feat: Business registration number

  • Parsing of a string to an business registration number
  • Validation
  • Businessform as follows

1 – Dödsbon
2 – Stat, regioner, kommuner, församlingar
3 – Utländska företag som bedriver näringsverksamhet eller äger fastigheter i Sverige
5 – Aktiebolag
7 – Ekonomiska föreningar, bostadsrättsföreningar och samfällighetsföreningar
8 – Ideella föreningar och stiftelser
9 – Handelsbolag, kommanditbolag

Feat: ToIdentificationNumber

Implement an string extension for parsing an identification number.

Usage:

var strVal= "195809132896";
var identificationNumber = strVal.ToIdentificationNumber()

The library does not adhere to design guidelines

The library does not adhere to the naming conventions / guidelines given by Microsoft here: https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/names-of-namespaces

psafth.IdentificationNumber would be a more suitable namespace.

The library would also be very much in need of refactoring and splitted to allow easier and broader extensions.

psafth.IdentificationNumber or psafth.IdentificationNumber.Core would contain the core functionality, interfaces and base classes.

Country specific entities would be placed in the psafth.IdentificationNumber.Swedish library which would extend the core library.

In that way all countries/nations identification numbers could have their own extension (theoretically).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.