date | amount_signed | reference | details |
---|---|---|---|
2018-08-11 | 4000 | 001FTЗЗ182121504 | Credit received - invoice 12345 |
2018-08-15 | -0.6 | 001ЗЗMRBGNL55001 | Account maintenance fee |
2018-08-15 | -1.4 | 001ЗЗMRBGNL55001 | Account maintenance fee |
2018-08-16 | -25.96 | 001AЗЗF182149938 | POS merchant sale - Visa |
2018-08-18 | -200 | 001AЗЗ4182122509 | ATM withdrawal |
2018-08-18 | -1.06 | 001AЗЗ4182122509 | ATM withdrawal fee |
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 class BankAccount | |
{ | |
public string Id { get; } | |
public Money Balance { get; private set; } | |
public BankAccount(string id, Money balance) | |
{ | |
if(string.IsNullOrEmpty(id)) | |
{ |
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 class BankAccount | |
{ | |
public string Id { get; set; } | |
public decimal Balance { get; set } | |
public string Currency { get; set; } | |
} |
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
using (var context = new CompanyContext()) | |
{ | |
var company = new Company(Guid.NewGuid(), "My Company"); | |
company.AssignAddress(new CompanyAddress("Sofia", "Mladost 4")); | |
company.AssignAddress(new CompanyAddress("Plovdiv", "blvd. Bulgaria 105")); | |
context.Companies.Add(company); | |
context.SaveChanges(); | |
} |
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
protected override void OnModelCreating(ModelBuilder modelBuilder) | |
{ | |
modelBuilder.Entity<Company>().OwnsMany<CompanyAddress>("Addresses", a => | |
{ | |
a.HasForeignKey("CompanyId"); | |
a.Property(ca => ca.City); | |
a.Property(ca => ca.AddressLine1); | |
a.HasKey("CompanyId", "City", "AddressLine1"); | |
}); | |
} |
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 class Company | |
{ | |
private List<CompanyAddress> addresses = new List<CompanyAddress>(); | |
public Company(Guid id, string name) | |
{ | |
Assertions.AssertNotNullAndNotEmpty(name, "Must provide name"); | |
this.Id = id; | |
this.Name = name; | |
} |
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
private static string GetHash(string xmlText) | |
{ | |
var xml = XElement.Parse(xmlText); | |
// Some xml operations omitted. | |
var xmlOutput = xml.ToString(); | |
var sha = new SHA512Managed(); | |
var hash = sha.ComputeHash(Encoding.UTF8.GetBytes(xmlOutput)); | |
return BitConverter.ToString(hash).Replace("-", String.Empty) |
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
const transformStatement = require('./bank-statement-transform'); | |
module.exports = function (context, req) { | |
if (req.body) { | |
let statement = req.body.toString(); | |
let transformedStatement = transformStatement(statement); | |
context.res = { | |
body: transformedStatement, | |
headers: { |
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
const moment = require('moment'); | |
const columnIndices = { | |
"datetime": 0, | |
"amount": 2, | |
"dtkt": 3, | |
"reference": 1, | |
"transactionName": 4, | |
} |
datetime | reference | amount | dtkt | trname |
---|---|---|---|---|
11/08/2018 11:01:07 | 001FTЗЗ182121504 | 4000.00 | K | Credit received - invoice 12345 |
15/08/2018 00:00:00 | 001ЗЗMRBGNL55001 | 0.60 | D | Account maintenance fee |
15/08/2018 00:00:00 | 001ЗЗMRBGNL55001 | 1.40 | D | Account maintenance fee |
16/08/2018 12:31:20 | 001AЗЗF182149938 | 25.96 | D | POS merchant sale - Visa |
18/08/2018 11:46:57 | 001AЗЗ4182122509 | 200.00 | D | ATM withdrawal |
18/08/2018 11:46:57 | 001AЗЗ4182122509 | 1.06 | D | ATM withdrawal fee |
NewerOlder