Created
July 27, 2018 10:42
-
-
Save Banane9/29466d28d933a8f785af232293fe5432 to your computer and use it in GitHub Desktop.
Idea for how to implement the restraints of the Telegram Passport elements
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class PassportElement | |
{ | |
public abstract string Name { get; } | |
} | |
public interface ICompatibility<TWith> | |
{ } | |
public sealed class PassportElementErrorDriverLicense : PassportElement, ICompatibility<PassportElementErrorDataField> | |
{ | |
public override string Name => "driver_license"; | |
} | |
public sealed class PassportElementErrorIdentityCard : PassportElement, ICompatibility<PassportElementErrorDataField>, ICompatibility<PassportElementErrorFrontSide> | |
{ | |
public override string Name => "identity_card"; | |
} | |
public sealed class PassportElementErrorFrontSide // : PassportError | |
{ | |
public PassportElementErrorFrontSide(ICompatibility<PassportElementErrorFrontSide> errorType) | |
{ } | |
} | |
public sealed class PassportElementErrorDataField // : PassportError | |
{ | |
public PassportElementErrorDataField(ICompatibility<PassportElementErrorDataField> errorType) | |
{ } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment