using Gateway.Payment.Shared; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Text; namespace Gateway.POS.Models { public class FuelItemDto { public int PumpId { get; set; } public int NozzleLogicalId { get; set; } public int? SiteLevelNozzleId { get; set; } /// /// Gets or sets the fule product name this transaction consumed, like #93, #95, #DIESEL and etc. /// public string FuelProductName { get; set; } public string FuelProductCode { get; set; } public decimal Qualtity { get; set; } public decimal Price { get; set; } public decimal Amount { get; set; } public decimal? TotalVolume { get; set; } public string FuelTrxSequenceNumber { get; set; } public DateTime? FuelingStartTime { get; set; } public DateTime? FuelingEndTime { get; set; } } public class FuelItem { public int Id { get; set; } public int PumpId { get; set; } public int NozzleLogicalId { get; set; } public int? SiteLevelNozzleId { get; set; } /// /// Gets or sets the fule product name this transaction consumed, like #93, #95, #DIESEL and etc. /// public string FuelProductName { get; set; } public string FuelProductCode { get; set; } public decimal Qualtity { get; set; } public decimal Price { get; set; } public decimal Amount { get; set; } public decimal? TotalVolume { get; set; } public string FuelTrxSequenceNumber { get; set; } public DateTime? FuelingStartTime { get; set; } public DateTime? FuelingEndTime { get; set; } [System.ComponentModel.DataAnnotations.Schema.ForeignKey("Transaction")] public int TransactionId { get; set; } public Transaction Transaction { get; set; } } public enum TransactionTypeEnum { Sale, Refund, EndOfShift, EndOfDay, } public enum TransactionStateEnum { Finished, Open, } public enum DiscountTypeEnum { PriceSubstract, TrxTotalAmountSubstract, TrxTotalAmountPercentage, } /// /// used for create a discount definition. /// public class DiscountDto { public int? Id { get; set; } public string Name { get; set; } public string Description { get; set; } public DiscountTypeEnum DiscountType { get; set; } public DateTime? StartTime { get; set; } public DateTime? EndTime { get; set; } public string TargetFuelProductCode { get; set; } public string Command { get; set; } } public class Discount { public int Id { get; set; } public bool IsMarkedAsDeletion { get; set; } public string Name { get; set; } public string Description { get; set; } public DiscountTypeEnum DiscountType { get; set; } public DateTime? StartTime { get; set; } public DateTime? EndTime { get; set; } public DateTime CreatedTime { get; set; } public DateTime? ModifiedTime { get; set; } public string TargetFuelProductCode { get; set; } public string Command { get; set; } } public enum PaymentMethodEnum { Cash, WX_SCAN, ALI_SCAN, ALL_IN_SCAN, ALL_IN_SCAN_V2, ClassicCpuCard, /// /// 直接从作为入口的sub account 上的profit account, or its account's profit account with type fund里扣 /// DirectMembershipProfitAccountFundRedeem, } public class PaymentInputDto { public PaymentMethodEnum Method { get; set; } public string CardReaderName { get; set; } public int? TargetMembershipAccountId { get; set; } public int? TargetMembershipSubAccountId { get; set; } /// /// Gets or sets 用户授权码, 当商户用扫码枪扫用户的条形码时得到的字符串 /// public string AuthCode { get; set; } public decimal ExpectAmount { get; set; } } public class Payment { public int Id { get; set; } public PaymentMethodEnum Method { get; set; } public string CardReaderName { get; set; } public int? TargetMembershipAccountId { get; set; } public int? TargetMembershipSubAccountId { get; set; } /// /// Gets or sets 用户授权码, 当商户用扫码枪扫用户的条形码时得到的字符串 /// public string AuthCode { get; set; } /// /// unique per trx and will be used in refund to link with original trx in remote payment service provider. /// public string BillNumber { get; set; } public decimal ExpectAmount { get; set; } public decimal PaidAmount { get; set; } public TradeStatusEnum TradeStatus { get; set; } [System.ComponentModel.DataAnnotations.Schema.ForeignKey("Transaction")] public int TransactionId { get; set; } public Transaction Transaction { get; set; } public string Comment { get; set; } } public class PaymentOutputDto { public PaymentMethodEnum Method { get; set; } public string CardReaderName { get; set; } public int? TargetMembershipAccountId { get; set; } public int? TargetMembershipSubAccountId { get; set; } /// /// Gets or sets 用户授权码, 当商户用扫码枪扫用户的条形码时得到的字符串 /// public decimal ExpectAmount { get; set; } public decimal PaidAmount { get; set; } public TradeStatusEnum TradeStatus { get; set; } public string Comment { get; set; } } public class AppliedDiscount { public int Id { get; set; } [System.ComponentModel.DataAnnotations.Schema.ForeignKey("Discount")] public int DiscountId { get; set; } public Discount Discount { get; set; } public decimal DiscountedAmount { get; set; } } public class TransactionInputDto { public int? RefundTrxId { get; set; } public TransactionTypeEnum TransactionType { get; set; } public TransactionSubTypeEnum? TransactionSubType { get; set; } public decimal? TotalAmount { get; set; } /// /// the final charge will based on this value. /// public decimal? NetAmount { get; set; } public List Payments { get; set; } public int OperatorId { get; set; } /// /// Gets or sets the terminal id for submit this order /// public string TerminalId { get; set; } public DateTime? ClientSideTimestamp { get; set; } public List FuelItems { get; set; } public string Comment { get; set; } } public enum TransactionSubTypeEnum { MembershipProfitAccount_Redeem_Loyalty, MembershipProfitAccount_Redeem_Coupon, MembershipProfitAccount_Recharge_Fund_ToSubAccount_ByCard, MembershipProfitAccount_Recharge_Fund_ToSubAccount_ById, MembershipProfitAccount_Recharge_Fund_ToAccount_ById } public class TransactionCommitState { public int StateCode { get; set; } public string Reason { get; set; } } public class TransactionOutputDto { public int? Id { get; set; } public TransactionCommitState CommitState { get; set; } public TransactionTypeEnum TransactionType { get; set; } public System.Nullable TransactionSubType { get; set; } public decimal? TotalAmount { get; set; } /// /// the final charge will based on this value. /// public decimal? NetAmount { get; set; } public List Payments { get; set; } public MembershipProfitAccountRechargeOutputDto MembershipProfitAccountRecharge { get; set; } public MembershipProfitAccountRedeemOutputDto MembershipProfitAccountRedeem { get; set; } public string ReceiptId { get; set; } public OperatorOutputDto Operator { get; set; } public string ShiftId { get; set; } /// /// Gets or sets the terminal id for submit this order /// public string TerminalId { get; set; } public string SiteId { get; set; } public List FuelItems { get; set; } public List AppliedDiscounts { get; set; } } public class Transaction { public int Id { get; set; } public TransactionTypeEnum TransactionType { get; set; } public TransactionSubTypeEnum? TransactionSubType { get; set; } public decimal? TotalAmount { get; set; } /// /// the final charge will based on this value. /// public decimal? NetAmount { get; set; } public List Payments { get; set; } //public int? MembershipProfitAccountRechargeId { get; set; } [System.ComponentModel.DataAnnotations.Schema.ForeignKey("MembershipProfitAccountRechargeId")] public MembershipProfitAccountRecharge MembershipProfitAccountRecharge { get; set; } //public int? MembershipProfitAccountRedeemId { get; set; } [System.ComponentModel.DataAnnotations.Schema.ForeignKey("MembershipProfitAccountRedeemId")] public MembershipProfitAccountRedeem MembershipProfitAccountRedeem { get; set; } public string ReceiptId { get; set; } [System.ComponentModel.DataAnnotations.Schema.ForeignKey("Operator")] public int OperatorId { get; set; } public Operator Operator { get; set; } public string ShiftId { get; set; } /// /// Gets or sets the terminal id for submit this order /// public string TerminalId { get; set; } public string SiteId { get; set; } public DateTime? ClientSideTimestamp { get; set; } public DateTime ServerSideTimestamp { get; set; } public List FuelItems { get; set; } public List AppliedDiscounts { get; set; } public string Comment { get; set; } } public class Operator { public int Id { get; set; } public string Name { get; set; } public List OperatorCards { get; set; } public string Password { get; set; } public string Description { get; set; } public DateTime CreatedTimestamp { get; set; } } public class OperatorOutputDto { public int Id { get; set; } public string Name { get; set; } public string Description { get; set; } public DateTime CreatedTimestamp { get; set; } } public enum MembershipLevelEnum { FirstLevel, SecondLevel, ThirdLevel, FourthLevel, FifthLevel, } public class MemberGroup { public int Id { get; set; } public string Name { get; set; } public string Description { get; set; } } public class MembershipAccount { public int Id { get; set; } [Required] public string Name { get; set; } public string CompanyName { get; set; } public int Age { get; set; } public string PhoneNumber { get; set; } public string Address { get; set; } public string Email { get; set; } public DateTime? Birth { get; set; } public bool IsMale { get; set; } public string Description { get; set; } public string InvoiceTaxNumber { get; set; } public string InvoiceCompanyName { get; set; } public MembershipLevelEnum? MembershipLevel { get; set; } public List SubAccounts { get; set; } public bool AllowSubAccountAccessProfitAccounts { get; set; } public bool EnableProfitAccountBalanceChangeNotify { get; set; } public System.Collections.Generic.List ProfitAccounts { get; set; } public System.Collections.Generic.List AccountTags { get; set; } public string ConsumeRestrictionComplexData { get; set; } public System.DateTime? ClientSideTimestamp { get; set; } public System.DateTime? ServerSideLastModifiedTimestamp { get; set; } public System.DateTime ServerSideCreatedTimestamp { get; set; } public System.DateTime? SuspendStateStartTime { get; set; } public System.DateTime? SuspendStateEndTime { get; set; } public int? CreateByOperatorId { get; set; } public Operator CreateByOperator { get; set; } } public class MembershipAccountInputDto { public int? Id { get; set; } public string Name { get; set; } public string CompanyName { get; set; } public int Age { get; set; } public string PhoneNumber { get; set; } public string Address { get; set; } public string Email { get; set; } public System.DateTime? Birth { get; set; } public bool IsMale { get; set; } public string Description { get; set; } public string InvoiceTaxNumber { get; set; } public string InvoiceCompanyName { get; set; } public bool AllowSubAccountAccessProfitAccounts { get; set; } public bool EnableProfitAccountBalanceChangeNotify { get; set; } public System.Collections.Generic.List AccountTags { get; set; } public string ConsumeRestrictionComplexData { get; set; } public System.DateTime? ClientSideTimestamp { get; set; } public System.DateTime? SuspendStateStartTime { get; set; } public System.DateTime? SuspendStateEndTime { get; set; } public int? CreateByOperatorId { get; set; } } public class MembershipAccountOutputDto { public int Id { get; set; } public string Name { get; set; } public string CompanyName { get; set; } public int Age { get; set; } public string PhoneNumber { get; set; } public string Address { get; set; } public string Email { get; set; } public System.DateTime? Birth { get; set; } public bool IsMale { get; set; } public string Description { get; set; } public string InvoiceTaxNumber { get; set; } public string InvoiceCompanyName { get; set; } public MembershipLevelEnum? MembershipLevel { get; set; } public bool AllowSubAccountAccessProfitAccounts { get; set; } public bool EnableProfitAccountBalanceChangeNotify { get; set; } public List SubAccounts { get; set; } public List ProfitAccounts { get; set; } public List AccountTags { get; set; } public DateTime? ServerSideLastModifiedTimestamp { get; set; } public DateTime ServerSideCreatedTimestamp { get; set; } public DateTime? SuspendStateStartTime { get; set; } public DateTime? SuspendStateEndTime { get; set; } public int? CreateByOperatorId { get; set; } } public class MembershipProfitAccount { public int Id { get; set; } public MembershipProfitAccountRedeemAuthModeEnum RedeemAuthMode { get; set; } public string RedeemAuthPassword { get; set; } public MembershipProfitAccountProfitTypeEnum ProfitType { get; set; } public decimal? Balance { get; set; } public string BalanceComplexData { get; set; } public System.Collections.Generic.List ProfitRecharges { get; set; } public System.Collections.Generic.List ProfitRedeems { get; set; } public int? MembershipAccountId { get; set; } [System.ComponentModel.DataAnnotations.Schema.ForeignKey("MembershipAccountId")] public MembershipAccount Account { get; set; } public int? MembershipSubAccountId { get; set; } [System.ComponentModel.DataAnnotations.Schema.ForeignKey("MembershipSubAccountId")] public MembershipSubAccount SubAccount { get; set; } public System.DateTime? ServerSideLastModifiedTimestamp { get; set; } public System.DateTime ServerSideCreatedTimestamp { get; set; } } public class MembershipProfitAccountInputDto { public int? Id { get; set; } public MembershipProfitAccountRedeemAuthModeEnum RedeemAuthMode { get; set; } public string RedeemAuthPassword { get; set; } public MembershipProfitAccountProfitTypeEnum ProfitType { get; set; } public int? MembershipAccountId { get; set; } public int? MembershipSubAccountId { get; set; } } public enum MembershipProfitAccountProfitTypeEnum { Loyalty, Fund, Coupon } public class MembershipProfitAccountOutputDto { public int Id { get; set; } public MembershipProfitAccountRedeemAuthModeEnum RedeemAuthMode { get; set; } public MembershipProfitAccountProfitTypeEnum ProfitType { get; set; } public decimal? Balance { get; set; } public string BalanceComplexData { get; set; } public System.Collections.Generic.List ProfitRecharges { get; set; } public System.Collections.Generic.List ProfitRedeems { get; set; } public int? MembershipAccountId { get; set; } public int? MembershipSubAccountId { get; set; } } public enum ProfitAccountRechargeSourceEnum { BySystemTrx, OffSystemCash, OffSystemManualHandbookDebit, OffSystemBankTransfer } public class MembershipProfitAccountRecharge { public int Id { get; set; } public ProfitAccountRechargeSourceEnum RechargeSource { get; set; } public decimal? RechargeAmount { get; set; } public decimal? ProfitAccountAmountBalance { get; set; } public System.DateTime? InvoiceIssuedDateTime { get; set; } public string Description { get; set; } public System.DateTime Timestamp { get; set; } public int MembershipProfitAccountId { get; set; } [System.ComponentModel.DataAnnotations.Schema.ForeignKey("MembershipProfitAccountId")] public MembershipProfitAccount ProfitAccount { get; set; } public int? CreateByOperatorId { get; set; } public Operator CreateByOperator { get; set; } public int? SourceTrxId { get; set; } /// /// in most case the redeem operation is started by a trx. /// [System.ComponentModel.DataAnnotations.Schema.ForeignKey("SourceTrxId")] public Transaction SourceTrx { get; set; } } public class MembershipProfitAccountRechargeRequest { public ProfitAccountRechargeSourceEnum RechargeSource { get; set; } public decimal RechargeAmount { get; set; } public string Description { get; set; } public int? CreateByOperatorId { get; set; } public Transaction SourceTrx { get; set; } } public class MembershipProfitAccountRechargeOutputDto { public int Id { get; set; } public ProfitAccountRechargeSourceEnum RechargeSource { get; set; } public int? SourceTrxId { get; set; } //public int? RechargeSourceTrxId { get; set; } public decimal? RechargeAmount { get; set; } public decimal? ProfitAccountAmountBalance { get; set; } public System.DateTime? InvoiceIssuedDateTime { get; set; } public string Description { get; set; } public System.DateTime Timestamp { get; set; } public int MembershipProfitAccountId { get; set; } //public MembershipProfitAccountOutputDto ProfitAccount { get; set; } public int? CreateByOperatorId { get; set; } /// /// in most case the redeem operation is started by a trx. /// //public TransactionOutputDto SourceTrx { get; set; } } public class MembershipProfitAccountRedeem { public int Id { get; set; } public string Purpose { get; set; } public decimal? RedeemedProfitAmount { get; set; } public string RedeemedProfitComplexData { get; set; } public decimal? ProfitAccountAmountBalance { get; set; } public string Description { get; set; } public System.DateTime Timestamp { get; set; } public int MembershipProfitAccountId { get; set; } [System.ComponentModel.DataAnnotations.Schema.ForeignKey("MembershipProfitAccountId")] public MembershipProfitAccount ProfitAccount { get; set; } public int? CreateByOperatorId { get; set; } public Operator CreateByOperator { get; set; } public int? SourceTrxId { get; set; } /// /// in most case the redeem operation is started by a trx. /// [System.ComponentModel.DataAnnotations.Schema.ForeignKey("SourceTrxId")] public Transaction SourceTrx { get; set; } } public enum MembershipProfitAccountRedeemAuthModeEnum { None, Password, SMS } /// /// a dedicated object for carry input, cannot mapping to MembershipProfitAccountRedeem /// public class MembershipProfitAccountRedeemRequest { public MembershipProfitAccountProfitTypeEnum ProfitAccountType { get; set; } public string RedeemAuthCode { get; set; } public string Purpose { get; set; } public decimal? RedeemProfitAmount { get; set; } public string RedeemProfitComplexData { get; set; } public string Description { get; set; } public MembershipSubAccountIdentityInputDto SubAccountIdentity { get; set; } public int? CreateByOperatorId { get; set; } public Transaction SourceTrx { get; set; } } public class MembershipProfitAccountRedeemOutputDto { public int Id { get; set; } public string Purpose { get; set; } public decimal? RedeemedProfitAmount { get; set; } public string RedeemedProfitComplexData { get; set; } public decimal? ProfitAccountAmountBalance { get; set; } public string Description { get; set; } public System.DateTime Timestamp { get; set; } public int MembershipProfitAccountId { get; set; } public int? CreateByOperatorId { get; set; } public int? SourceTrxId { get; set; } /// /// in most case the redeem operation is started by a trx. /// //public TransactionOutputDto SourceTrx { get; set; } } public class MembershipSubAccountIdentityInputDto { public int? Id { get; set; } //public int MembershipSubAccountId { get; set; } public MembershipSubAccountIdentityCarrierTypeEnum IdentityCarrierType { get; set; } public string Identity { get; set; } public string Description { get; set; } } public class MembershipSubAccountIdentityOutputDto { public int? Id { get; set; } public int MembershipSubAccountId { get; set; } public MembershipSubAccountIdentityCarrierTypeEnum IdentityCarrierType { get; set; } public string Identity { get; set; } public string Description { get; set; } } public class MembershipSubAccountIdentity { public int Id { get; set; } public int MembershipSubAccountId { get; set; } [System.ComponentModel.DataAnnotations.Schema.ForeignKey("MembershipSubAccountId")] public MembershipSubAccount SubAccount { get; set; } public MembershipSubAccountIdentityCarrierTypeEnum IdentityCarrierType { get; set; } [Required] public string Identity { get; set; } public string Description { get; set; } } public class MembershipSubAccount { public int Id { get; set; } public int MembershipAccountId { get; set; } [System.ComponentModel.DataAnnotations.Schema.ForeignKey("MembershipAccountId")] public MembershipAccount Account { get; set; } public List ProfitAccounts { get; set; } public List Identities { get; set; } public MembershipSubAccountStateEnum AccountState { get; set; } public System.DateTime? LastAccountStateUpdateTime { get; set; } public string LastAccountStateUpdateReason { get; set; } public System.DateTime? SuspendStateStartTime { get; set; } public System.DateTime? SuspendStateEndTime { get; set; } public System.DateTime ServerSideCreatedTimestamp { get; set; } public System.DateTime? ServerSideLastModifiedTimestamp { get; set; } public string SubAccountHolderName { get; set; } public string SubAccountHolderPhoneNumber { get; set; } public string SubAccountHolderEmail { get; set; } public string SubAccountHolderAddress { get; set; } public bool EnableProfitAccountBalanceChangeNotify { get; set; } public System.Nullable MembershipLevel { get; set; } public System.Collections.Generic.List SubAccountTags { get; set; } public string ConsumeRestrictionComplexData { get; set; } public string Description { get; set; } public int? CreateByOperatorId { get; set; } public Operator CreateByOperator { get; set; } } public class MembershipSubAccount_M2M_MembershipTag { public int MembershipSubAccountId { get; set; } public MembershipSubAccount SubAccount { get; set; } public int MembershipTagId { get; set; } public MembershipTag Tag { get; set; } } public class MembershipSubAccount_M2M_MembershipTagDto { public int? MembershipTagId { get; set; } public MembershipTagDto Tag { get; set; } } public enum MembershipSubAccountIdentityCarrierTypeEnum { Card_DesFireEv1, Wechat_MiniProgram } public class MembershipSubAccountInputDto { public int? Id { get; set; } public int AccountId { get; set; } public List Identities { get; set; } public MembershipSubAccountStateEnum AccountState { get; set; } public string LastAccountStateUpdateReason { get; set; } public System.DateTime? SuspendStateStartTime { get; set; } public System.DateTime? SuspendStateEndTime { get; set; } public string SubAccountHolderName { get; set; } public string SubAccountHolderPhoneNumber { get; set; } public string SubAccountHolderEmail { get; set; } public string SubAccountHolderAddress { get; set; } public bool EnableProfitAccountBalanceChangeNotify { get; set; } public System.Collections.Generic.List SubAccountTags { get; set; } public string ConsumeRestrictionComplexData { get; set; } public string Description { get; set; } public int? CreateByOperatorId { get; set; } } public class MembershipSubAccountOutputDto { public int? Id { get; set; } public int MembershipAccountId { get; set; } public List ProfitAccounts { get; set; } public List Identities { get; set; } public MembershipSubAccountStateEnum AccountState { get; set; } public System.DateTime? SuspendStateStartTime { get; set; } public System.DateTime? SuspendStateEndTime { get; set; } public System.DateTime ServerSideCreatedTimestamp { get; set; } public System.DateTime? ServerSideLastModifiedTimestamp { get; set; } public string SubAccountHolderName { get; set; } public string SubAccountHolderPhoneNumber { get; set; } public string SubAccountHolderEmail { get; set; } public string SubAccountHolderAddress { get; set; } public bool EnableProfitAccountBalanceChangeNotify { get; set; } public Models.MembershipLevelEnum? MembershipLevel { get; set; } public List SubAccountTags { get; set; } public string ConsumeRestrictionComplexData { get; set; } public string Description { get; set; } public int? CreateByOperatorId { get; set; } } public enum MembershipSubAccountStateEnum { Normal, Suspend, ReportLost, ReportBroken } public class MembershipTag { public int Id { get; set; } public string Name { get; set; } public string Description { get; set; } public List AccountTags { get; set; } public List SubAccountTags { get; set; } } public class MembershipTagDto { public int? Id { get; set; } public string Name { get; set; } public string Description { get; set; } public bool MarkForDeletion { get; set; } } public class MembershipAccount_M2M_MembershipTag { public int MembershipAccountId { get; set; } public MembershipAccount Account { get; set; } public int MembershipTagId { get; set; } public MembershipTag Tag { get; set; } } public class MembershipAccount_M2M_MembershipTagDto { public int? MembershipTagId { get; set; } public MembershipTagDto Tag { get; set; } } public class MembershipConsumeRestrictionDto { public int Id { get; set; } public string Name { get; set; } public string AllowProductCodesStr { get; set; } public string DisallowProductCodesStr { get; set; } public string AllowCarRegistrationNumbersStr { get; set; } public decimal? MaxConsumeAmountPerDay { get; set; } public decimal? MaxConsumeTimesPerDay { get; set; } public decimal? MaxConsumeAmountPerWeek { get; set; } public decimal? MaxConsumeTimesPerWeek { get; set; } public decimal? MaxConsumeAmountPerMonth { get; set; } public decimal? MaxConsumeTimesPerMonth { get; set; } public string AllowSiteLevelNozzleIdsStr { get; set; } public string DisallowSiteLevelNozzleIdsStr { get; set; } public string AllowPumpAndNozzleLogicalIdsStr { get; set; } public string DisallowPumpAndNozzleLogicalIdsStr { get; set; } } }