Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial draft for v2 tagging based processing - New markets PT, ES, GR #355

Draft
wants to merge 165 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
84510cb
Initial draft for v2 localization Stream + QueuePT
StefanKert Sep 12, 2024
ef709f3
Added UnitTests
StefanKert Sep 12, 2024
8ca122f
Added tests and SAFT baseline
StefanKert Sep 13, 2024
ffb6db8
Receiptcalcs
StefanKert Sep 18, 2024
97e66bb
Removed unused params
StefanKert Sep 18, 2024
0f3b406
Cleanup a few things
StefanKert Sep 19, 2024
b61c662
Merge remote-tracking branch 'origin/main' into market-pt
StefanKert Oct 2, 2024
ab5755c
Added end2end support for generation of receipts
StefanKert Oct 8, 2024
251cbba
Additional cleanup
StefanKert Oct 9, 2024
64e1c94
Added base implementation for QueueGR
StefanKert Oct 9, 2024
6147d85
Merge remote-tracking branch 'origin/main' into new-markets
StefanKert Oct 9, 2024
af80905
Added MyData Base implementation
StefanKert Oct 9, 2024
e9e9627
Added mapping
StefanKert Oct 9, 2024
1e10799
Moved to v2 receiptrequest
StefanKert Oct 9, 2024
a8e11aa
Added new way of registering for ifnos
StefanKert Oct 9, 2024
52555bc
Next step inversion of data flow
StefanKert Oct 9, 2024
48bc352
Using centralized system of storing and updating data.
StefanKert Oct 9, 2024
891d9f1
Using QueuePTBootstrapper and QueueGRBoostrapper only
StefanKert Oct 9, 2024
d5df930
Added tests
StefanKert Oct 9, 2024
2cd2d2c
Fixed some minor issues
StefanKert Oct 9, 2024
b3b76e9
Smaller adaptions
StefanKert Oct 15, 2024
6f6224b
Merge remote-tracking branch 'origin/main' into new-markets
StefanKert Oct 15, 2024
36b7a54
Changed impl
StefanKert Oct 15, 2024
02555a3
fix names of stuff
volllly Oct 15, 2024
2258378
remove debug test
volllly Oct 15, 2024
225836d
fix name
volllly Oct 15, 2024
169fee0
handle storage initialization failure
volllly Oct 15, 2024
aa485f9
queue es v2 localization init
volllly Oct 15, 2024
c0c4b3c
cleanup
volllly Oct 15, 2024
980f6ac
re add queue temporarily
volllly Oct 15, 2024
aeb3aed
Added cases
StefanKert Oct 15, 2024
3ec25b3
Move classes
StefanKert Oct 15, 2024
9c333cc
Fixed namespaces
StefanKert Oct 15, 2024
7a0ab93
Removed dependencies
StefanKert Oct 15, 2024
dd0ef8b
Smaller cleanups
StefanKert Oct 15, 2024
44c7960
Smaller fixes and intro for journalprocessor
StefanKert Oct 17, 2024
5385608
Added tests
StefanKert Oct 17, 2024
7bd67bc
Using all methods
StefanKert Oct 17, 2024
66d2376
FIxed more things
StefanKert Oct 17, 2024
712fb08
Fixed init logic
StefanKert Oct 17, 2024
8512485
Added jorunal
StefanKert Oct 18, 2024
84bcbe3
Fixedx processing
StefanKert Oct 18, 2024
5c6e865
Fix saft
StefanKert Oct 18, 2024
ba5363f
Added support for SAT
StefanKert Oct 18, 2024
3c7f953
Using receipt id
StefanKert Oct 18, 2024
74b9901
Changed mapping
StefanKert Oct 18, 2024
68b1f38
rough draft of verifactu mapping
volllly Oct 21, 2024
a750d1e
update
volllly Oct 21, 2024
9b880af
clarify
volllly Oct 22, 2024
db4dbc6
formating
volllly Oct 22, 2024
cd4e374
add open questions
volllly Oct 22, 2024
43265ce
update hash gen
volllly Oct 22, 2024
d127b9d
remove readme
volllly Oct 22, 2024
218f033
Support more gr
StefanKert Oct 25, 2024
099212f
Merge branch 'new-markets' of https://github.com/fiskaltrust/middlewa…
StefanKert Oct 25, 2024
4d4329f
Added more signatures
StefanKert Oct 25, 2024
94ccb48
use verifactu mapping in queue
volllly Oct 28, 2024
9089566
Add support for greece support
StefanKert Oct 29, 2024
c1bf5ae
use previous receipt
volllly Oct 29, 2024
efa68e2
fix es queue problems
volllly Oct 29, 2024
33aeea8
remove for now unneeded table
volllly Oct 29, 2024
784c4f0
add verifactu journal prototype
volllly Oct 30, 2024
00b74fd
Merge branch 'new-markets' of https://github.com/fiskaltrust/middlewa…
StefanKert Oct 30, 2024
491a0b1
Few improvements to GR implementation
StefanKert Nov 4, 2024
5261151
Improvemetns
StefanKert Nov 4, 2024
2a2c775
Support
StefanKert Nov 4, 2024
bf0acb9
Support invoices
StefanKert Nov 4, 2024
9f84801
More fixes
StefanKert Nov 4, 2024
6f2230b
Added more test
StefanKert Nov 4, 2024
5c83a8f
Fix
StefanKert Nov 5, 2024
b3b9af5
Aded stuff
StefanKert Nov 6, 2024
f458dc8
Added tests and finalized most receipt types
StefanKert Nov 7, 2024
3496e21
Finalized
StefanKert Nov 7, 2024
b11c26b
Fixed build
StefanKert Nov 7, 2024
63dde65
Fixtest
StefanKert Nov 7, 2024
28990ba
Okay
StefanKert Nov 7, 2024
1637cd8
UPdate version
StefanKert Nov 7, 2024
d5d668c
Improved implementation for GR
StefanKert Nov 7, 2024
3a60061
Supporting 3.1 and 3.2
StefanKert Nov 8, 2024
69c4699
Support 3.1 and 3.2
StefanKert Nov 8, 2024
6e8b529
FIxed withholding
StefanKert Nov 11, 2024
b4cb5df
Only allow receipts that match
StefanKert Nov 11, 2024
45f9c97
Fix
StefanKert Nov 11, 2024
e6e5ab4
Add support for reading transmission errors
StefanKert Nov 11, 2024
4ccc349
Okay
StefanKert Nov 11, 2024
4e34a3a
Support for retransmission
StefanKert Nov 12, 2024
17ee213
Using identification
StefanKert Nov 12, 2024
ff60582
Added qrcode url
StefanKert Nov 12, 2024
3301d0f
Workaround
StefanKert Nov 12, 2024
b943434
Add series
StefanKert Nov 13, 2024
538baa6
Support for tip
StefanKert Nov 14, 2024
9cad195
A few more things supported
StefanKert Nov 14, 2024
792a461
Fixed using android
StefanKert Nov 16, 2024
9e25b4e
Changed text of invoice
StefanKert Nov 17, 2024
285b022
Fix
StefanKert Nov 18, 2024
f34a46e
Fixed item
StefanKert Nov 18, 2024
5dab669
Let's not add series
StefanKert Nov 18, 2024
941d4c3
update models
volllly Nov 18, 2024
faebaaa
update QR code
volllly Nov 18, 2024
fbdcb79
add config
volllly Nov 18, 2024
e056e41
update es receiptidentification
volllly Nov 19, 2024
96fc98f
Fixed epsonscu
StefanKert Nov 19, 2024
a04cbad
Merge branch 'new-markets' of https://github.com/fiskaltrust/middlewa…
StefanKert Nov 19, 2024
4c1ec81
Merge remote-tracking branch 'origin/main' into new-markets
StefanKert Nov 19, 2024
412b8b3
Delete scu-it/test/fiskaltrust.Middleware.SCU.IT.EpsonRTPrinter.UnitT…
StefanKert Nov 19, 2024
ed41b3f
remove v1 configrepo experiment
volllly Nov 20, 2024
33f60bf
remove .DS_Store files
volllly Nov 20, 2024
8a02d90
remove orphans
volllly Nov 20, 2024
f85a4a9
Merge branch 'main' into new-markets
volllly Nov 20, 2024
85a0ecb
fix unimpleneted tests
volllly Nov 20, 2024
93cd4b1
fix config parsing
volllly Nov 20, 2024
1445e8f
fix confg deser
volllly Nov 20, 2024
cd7845b
skiptests
volllly Nov 20, 2024
709cdf1
hack in signature with tmp selfsigned certificate
volllly Nov 21, 2024
da1f819
fix bootstrapper init
volllly Nov 27, 2024
e4facfe
add void receipt. fix closing receipts.
volllly Nov 28, 2024
4c676bf
add support for chargeitem cases
volllly Nov 29, 2024
75d3e13
fixes
StefanKert Nov 29, 2024
e14bbc4
A few more fixes
StefanKert Nov 29, 2024
b51f2c8
Fixc
StefanKert Dec 1, 2024
e3926a9
add
StefanKert Dec 1, 2024
b2cb3fc
Fixed buid
StefanKert Dec 2, 2024
42657d5
add verifactu wsdl
volllly Dec 2, 2024
b01130d
add soap client
volllly Dec 3, 2024
e660676
fix soap errors
volllly Dec 3, 2024
a7fde32
fix xml issues
volllly Dec 4, 2024
f63c95c
fixes
volllly Dec 5, 2024
dcfcac9
add Signed QueueItem to queuees
volllly Dec 5, 2024
35e7312
Merge branch 'new-markets' of github.com:fiskaltrust/middleware into …
volllly Dec 5, 2024
9d24864
hack storage together
volllly Dec 5, 2024
4101458
fix storage and tests
volllly Dec 6, 2024
a809de0
Several fixes
StefanKert Dec 6, 2024
783f825
Using customerid
StefanKert Dec 6, 2024
c663c99
Fix
StefanKert Dec 6, 2024
1dd8f2c
Allow queueitesm
StefanKert Dec 6, 2024
0d89336
Fix
StefanKert Dec 6, 2024
d3b29ad
Fix
StefanKert Dec 6, 2024
923e330
Merge branch 'new-markets' of https://github.com/fiskaltrust/middlewa…
StefanKert Dec 6, 2024
f7f829d
fix
StefanKert Dec 6, 2024
24c253b
Merge branch 'new-markets' of https://github.com/fiskaltrust/middlewa…
StefanKert Dec 6, 2024
a0adcfd
add verifactu test
volllly Dec 6, 2024
1ef61bc
Remove taxamount
StefanKert Dec 6, 2024
1803744
Merge branch 'new-markets' of https://github.com/fiskaltrust/middlewa…
StefanKert Dec 6, 2024
2bc038e
Mapping improvements
StefanKert Dec 9, 2024
061fda4
fix hash
volllly Dec 9, 2024
3be2598
add reset receipt test
volllly Dec 9, 2024
026a675
Merge branch 'new-markets' of github.com:fiskaltrust/middleware into …
volllly Dec 9, 2024
f08b07d
fix serialization
volllly Dec 9, 2024
07c6245
add comment
volllly Dec 9, 2024
eb80230
fix time
volllly Dec 9, 2024
4162f96
Fixed saftmapping
StefanKert Dec 9, 2024
9b6f6f7
Support
StefanKert Dec 9, 2024
27d2dfb
AAd
StefanKert Dec 9, 2024
ec5a71c
refactor and fix hash
volllly Dec 9, 2024
a1f9330
Merge branch 'new-markets' of github.com:fiskaltrust/middleware into …
volllly Dec 9, 2024
23bc895
Fix
StefanKert Dec 10, 2024
84dd3b5
Merge branch 'new-markets' of https://github.com/fiskaltrust/middlewa…
StefanKert Dec 10, 2024
3f22db9
Fix
StefanKert Dec 11, 2024
cd200e3
fix qr code url
volllly Dec 11, 2024
898e09f
Merge branch 'new-markets' of github.com:fiskaltrust/middleware into …
volllly Dec 11, 2024
0377978
fix url
volllly Dec 11, 2024
b4b210b
fix journal and void
volllly Dec 11, 2024
08b22c6
update test
volllly Dec 13, 2024
7aa1cf0
fix numseriefactura in chain
volllly Dec 13, 2024
e644d95
maybe fix void chaining
volllly Dec 13, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,4 @@ _Pvt_Extensions/
ModelManifest.xml

.vscode
.DS_Store
2 changes: 1 addition & 1 deletion azure-pipelines/templates/scu-it/test.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ steps:
inputs:
command: 'test'
projects: |
$(WorkingDirectory)/**/*.UnitTest.csproj
$(WorkingDirectory)/**/fiskaltrust.Middleware.SCU.IT.EpsonRTPrinter.UnitTest.csproj
arguments: '--configuration $(BuildConfiguration) --no-restore --collect "Code coverage"'
nobuild: true
displayName: 'Run unit tests'
72 changes: 62 additions & 10 deletions queue/fiskaltrust.Middleware.sln
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,29 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "fiskaltrust.Middleware.Stor
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "fiskaltrust.Interface.Tagging", "src\fiskaltrust.Interface.Tagging\fiskaltrust.Interface.Tagging.csproj", "{FD564EEA-CEAD-47E0-BB0A-113C07F57CAA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "fiskaltrust.Interface.Tagging.UnitTests", "test\fiskaltrust.Interface.Tagging.UnitTests\fiskaltrust.Interface.Tagging.UnitTests.csproj", "{9E42B570-AEEC-498E-AC81-0AB70264229B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "fiskaltrust.Interface.Tagging.UnitTests", "test\fiskaltrust.Interface.Tagging.UnitTests\fiskaltrust.Interface.Tagging.UnitTests.csproj", "{9E42B570-AEEC-498E-AC81-0AB70264229B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "fiskaltrust.Interface.Tagging.Generator", "src\fiskaltrust.Interface.Tagging.Generator\fiskaltrust.Interface.Tagging.Generator.csproj", "{930A9188-4273-45C5-9506-922CE7B1E712}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "fiskaltrust.Interface.Tagging.Generator", "src\fiskaltrust.Interface.Tagging.Generator\fiskaltrust.Interface.Tagging.Generator.csproj", "{930A9188-4273-45C5-9506-922CE7B1E712}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "fiskaltrust.Interface.Tagging.Generator.UnitTests", "test\fiskaltrust.Interface.Tagging.Generator.UnitTests\fiskaltrust.Interface.Tagging.Generator.UnitTests.csproj", "{855013AC-6255-4A3C-80C7-5140F5BD20B9}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "fiskaltrust.Interface.Tagging.Generator.UnitTests", "test\fiskaltrust.Interface.Tagging.Generator.UnitTests\fiskaltrust.Interface.Tagging.Generator.UnitTests.csproj", "{855013AC-6255-4A3C-80C7-5140F5BD20B9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "fiskaltrust.Interface.Tagging.Generator.IntegrationTests", "test\fiskaltrust.Interface.Tagging.Generator.IntegrationTests\fiskaltrust.Interface.Tagging.Generator.IntegrationTests.csproj", "{34229319-E3C0-4B57-A2D9-F1812CBF5311}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "fiskaltrust.Interface.Tagging.Generator.IntegrationTests", "test\fiskaltrust.Interface.Tagging.Generator.IntegrationTests\fiskaltrust.Interface.Tagging.Generator.IntegrationTests.csproj", "{34229319-E3C0-4B57-A2D9-F1812CBF5311}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "fiskaltrust.Middleware.Localization.QueuePT", "src\fiskaltrust.Middleware.Localization.QueuePT\fiskaltrust.Middleware.Localization.QueuePT.csproj", "{917D658E-C488-4EA5-A645-EC0E7B78CE19}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "fiskaltrust.Middleware.Localization.v2", "src\fiskaltrust.Middleware.Localization.v2\fiskaltrust.Middleware.Localization.v2.csproj", "{C2242AC0-0031-4388-BF63-33FE2FBA1DD6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "v2", "v2", "{095CBF40-606D-4CC5-91E3-D009C271BC16}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "fiskaltrust.Middleware.Localization.QueuePT.UnitTest", "test\fiskaltrust.Middleware.Localization.QueuePT.UnitTest\fiskaltrust.Middleware.Localization.QueuePT.UnitTest.csproj", "{0A1860FF-6D00-4F85-9058-0854E95CA4CC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "fiskaltrust.Middleware.Storage", "src\fiskaltrust.Middleware.Storage\fiskaltrust.Middleware.Storage.csproj", "{AE95A622-FB4B-4C98-A0A3-725C52A736AF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "fiskaltrust.Middleware.Localization.QueueGR", "src\fiskaltrust.Middleware.Localization.QueueGR\fiskaltrust.Middleware.Localization.QueueGR.csproj", "{C823688D-1812-4864-BDDC-8BF5E45FEC18}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "fiskaltrust.Middleware.Localization.QueueGR.UnitTest", "test\fiskaltrust.Middleware.Localization.QueueGR.UnitTest\fiskaltrust.Middleware.Localization.QueueGR.UnitTest.csproj", "{6041CD04-8361-450C-91E7-6275DBF4C17B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "fiskaltrust.Middleware.Localization.QueueES.UnitTest", "test\fiskaltrust.Middleware.Localization.QueueES.UnitTest\fiskaltrust.Middleware.Localization.QueueES.UnitTest.csproj", "{EA9BED33-E964-4770-8CD8-9A90D6273996}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -349,6 +365,10 @@ Global
{7F52D143-9179-4FCF-9DC7-B5F1681BD22A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7F52D143-9179-4FCF-9DC7-B5F1681BD22A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7F52D143-9179-4FCF-9DC7-B5F1681BD22A}.Release|Any CPU.Build.0 = Release|Any CPU
{EEDA285C-82F8-4E6D-AAFA-9E42D3C4F0E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EEDA285C-82F8-4E6D-AAFA-9E42D3C4F0E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EEDA285C-82F8-4E6D-AAFA-9E42D3C4F0E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEDA285C-82F8-4E6D-AAFA-9E42D3C4F0E6}.Release|Any CPU.Build.0 = Release|Any CPU
{FD564EEA-CEAD-47E0-BB0A-113C07F57CAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FD564EEA-CEAD-47E0-BB0A-113C07F57CAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FD564EEA-CEAD-47E0-BB0A-113C07F57CAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -369,10 +389,34 @@ Global
{34229319-E3C0-4B57-A2D9-F1812CBF5311}.Debug|Any CPU.Build.0 = Debug|Any CPU
{34229319-E3C0-4B57-A2D9-F1812CBF5311}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34229319-E3C0-4B57-A2D9-F1812CBF5311}.Release|Any CPU.Build.0 = Release|Any CPU
{EEDA285C-82F8-4E6D-AAFA-9E42D3C4F0E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EEDA285C-82F8-4E6D-AAFA-9E42D3C4F0E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EEDA285C-82F8-4E6D-AAFA-9E42D3C4F0E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEDA285C-82F8-4E6D-AAFA-9E42D3C4F0E6}.Release|Any CPU.Build.0 = Release|Any CPU
{917D658E-C488-4EA5-A645-EC0E7B78CE19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{917D658E-C488-4EA5-A645-EC0E7B78CE19}.Debug|Any CPU.Build.0 = Debug|Any CPU
{917D658E-C488-4EA5-A645-EC0E7B78CE19}.Release|Any CPU.ActiveCfg = Release|Any CPU
{917D658E-C488-4EA5-A645-EC0E7B78CE19}.Release|Any CPU.Build.0 = Release|Any CPU
{C2242AC0-0031-4388-BF63-33FE2FBA1DD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C2242AC0-0031-4388-BF63-33FE2FBA1DD6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2242AC0-0031-4388-BF63-33FE2FBA1DD6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C2242AC0-0031-4388-BF63-33FE2FBA1DD6}.Release|Any CPU.Build.0 = Release|Any CPU
{0A1860FF-6D00-4F85-9058-0854E95CA4CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0A1860FF-6D00-4F85-9058-0854E95CA4CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0A1860FF-6D00-4F85-9058-0854E95CA4CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0A1860FF-6D00-4F85-9058-0854E95CA4CC}.Release|Any CPU.Build.0 = Release|Any CPU
{AE95A622-FB4B-4C98-A0A3-725C52A736AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AE95A622-FB4B-4C98-A0A3-725C52A736AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AE95A622-FB4B-4C98-A0A3-725C52A736AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AE95A622-FB4B-4C98-A0A3-725C52A736AF}.Release|Any CPU.Build.0 = Release|Any CPU
{C823688D-1812-4864-BDDC-8BF5E45FEC18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C823688D-1812-4864-BDDC-8BF5E45FEC18}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C823688D-1812-4864-BDDC-8BF5E45FEC18}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C823688D-1812-4864-BDDC-8BF5E45FEC18}.Release|Any CPU.Build.0 = Release|Any CPU
{6041CD04-8361-450C-91E7-6275DBF4C17B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6041CD04-8361-450C-91E7-6275DBF4C17B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6041CD04-8361-450C-91E7-6275DBF4C17B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6041CD04-8361-450C-91E7-6275DBF4C17B}.Release|Any CPU.Build.0 = Release|Any CPU
{EA9BED33-E964-4770-8CD8-9A90D6273996}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EA9BED33-E964-4770-8CD8-9A90D6273996}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EA9BED33-E964-4770-8CD8-9A90D6273996}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EA9BED33-E964-4770-8CD8-9A90D6273996}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -428,8 +472,8 @@ Global
{BD6E6701-2F8E-43D1-B583-F3DC1CA52D67} = {16BF88B4-3302-49F5-A5FA-5DA96DD03F0E}
{87E0049F-9DF1-4F6F-8137-7765A2B16ABA} = {5195B05E-EB55-4544-8FE6-B683747B1F9E}
{F39B38CB-B8B7-4537-9130-43131AD51FF2} = {31488E86-D7EB-4964-84F1-B7338BB5A7D1}
{27C42C72-639D-4B55-A931-6896D7095685} = {C345F1F7-C2A5-472A-A55F-987A53DF3CCE}
{65633C3A-65AA-4E05-8E56-7A348872CCC3} = {C345F1F7-C2A5-472A-A55F-987A53DF3CCE}
{27C42C72-639D-4B55-A931-6896D7095685} = {095CBF40-606D-4CC5-91E3-D009C271BC16}
{65633C3A-65AA-4E05-8E56-7A348872CCC3} = {095CBF40-606D-4CC5-91E3-D009C271BC16}
{5FAB9D88-4B90-4DF0-B1B7-1F50DF7CFCA4} = {16BF88B4-3302-49F5-A5FA-5DA96DD03F0E}
{3C0310D9-EC55-4115-A2D5-0DC8C1246645} = {C345F1F7-C2A5-472A-A55F-987A53DF3CCE}
{04B32BB6-2E1D-400F-B7B2-2638483B0825} = {16BF88B4-3302-49F5-A5FA-5DA96DD03F0E}
Expand All @@ -440,6 +484,14 @@ Global
{930A9188-4273-45C5-9506-922CE7B1E712} = {08381205-3409-4468-92EB-ACA65F8D82FB}
{855013AC-6255-4A3C-80C7-5140F5BD20B9} = {EAEEF28B-F372-48C1-8F9B-45CEB95159A2}
{34229319-E3C0-4B57-A2D9-F1812CBF5311} = {EAEEF28B-F372-48C1-8F9B-45CEB95159A2}
{917D658E-C488-4EA5-A645-EC0E7B78CE19} = {095CBF40-606D-4CC5-91E3-D009C271BC16}
{C2242AC0-0031-4388-BF63-33FE2FBA1DD6} = {095CBF40-606D-4CC5-91E3-D009C271BC16}
{095CBF40-606D-4CC5-91E3-D009C271BC16} = {C345F1F7-C2A5-472A-A55F-987A53DF3CCE}
{0A1860FF-6D00-4F85-9058-0854E95CA4CC} = {16BF88B4-3302-49F5-A5FA-5DA96DD03F0E}
{AE95A622-FB4B-4C98-A0A3-725C52A736AF} = {5195B05E-EB55-4544-8FE6-B683747B1F9E}
{C823688D-1812-4864-BDDC-8BF5E45FEC18} = {095CBF40-606D-4CC5-91E3-D009C271BC16}
{6041CD04-8361-450C-91E7-6275DBF4C17B} = {16BF88B4-3302-49F5-A5FA-5DA96DD03F0E}
{EA9BED33-E964-4770-8CD8-9A90D6273996} = {16BF88B4-3302-49F5-A5FA-5DA96DD03F0E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E8BEA609-BD83-4165-A14A-D010D2CC87AD}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using fiskaltrust.Api.POS.Models.ifPOS.v2;
using fiskaltrust.storage.V0.MasterData;

namespace fiskaltrust.Middleware.Localization.QueueES.ESSSCD;

public interface IESSSCD
{
Task<ProcessResponse> ProcessReceiptAsync(ProcessRequest request);

Task<ESSSCDInfo> GetInfoAsync();
}


public class ProcessRequest
{
public required ReceiptRequest ReceiptRequest { get; set; }

public required ReceiptResponse ReceiptResponse { get; set; }
public required ReceiptRequest? PreviousReceiptRequest { get; set; }
public required ReceiptResponse? PreviousReceiptResponse { get; set; }
}

public class ProcessResponse
{
public required ReceiptResponse ReceiptResponse { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
using System.Security.Cryptography.X509Certificates;
using System.ServiceModel;
using System.Text;
using System.Text.Json;
using System.Xml;
using fiskaltrust.Api.POS.Models.ifPOS.v2;
using fiskaltrust.Middleware.Contracts.Repositories;
using fiskaltrust.Middleware.Localization.QueueES.Exports;
using fiskaltrust.Middleware.Localization.QueueES.Factories;
using fiskaltrust.Middleware.Localization.QueueES.Interface;
using fiskaltrust.Middleware.Localization.v2.Configuration;
using fiskaltrust.Middleware.Localization.v2.Interface;
using fiskaltrust.Middleware.SCU.ES.Helpers;
using fiskaltrust.Middleware.SCU.ES.Models;
using fiskaltrust.Middleware.SCU.ES.Soap;
using fiskaltrust.Middleware.Storage.ES;
using fiskaltrust.storage.V0.MasterData;

namespace fiskaltrust.Middleware.Localization.QueueES.ESSSCD;

public class ESSSCDInfo
{
}

public class InMemorySCUConfiguration
{
public string BaseUrl { get; set; } = "https://prewww10.aeat.es";
public string QRCodeBaseUrl { get; set; } = "https://prewww2.aeat.es";

public X509Certificate2 Certificate { get; set; } = null!;

public static InMemorySCUConfiguration FromConfiguration(PackageConfiguration packageConfiguration)
=> JsonSerializer.Deserialize<InMemorySCUConfiguration>(JsonSerializer.Serialize(packageConfiguration.Configuration)) ?? new InMemorySCUConfiguration();
}

public class InMemorySCU : IESSSCD
{
private readonly InMemorySCUConfiguration _configuration;

private readonly VeriFactuMapping _veriFactuMapping;

public InMemorySCU(ftSignaturCreationUnitES _, MasterDataConfiguration masterData, InMemorySCUConfiguration configuration, IMiddlewareQueueItemRepository queueItemRepository)
{
_configuration = configuration;
_veriFactuMapping = new VeriFactuMapping(masterData, queueItemRepository, configuration.Certificate);
}

public async Task<ProcessResponse> ProcessReceiptAsync(ProcessRequest request)
{
request.ReceiptResponse.ftReceiptIdentification += $"{request.ReceiptResponse.ftQueueRow}/{request.ReceiptRequest.cbReceiptReference}";

ReceiptResponse receiptResponse;

if (request.ReceiptRequest.IsVoid())
{
if (request.PreviousReceiptRequest is null || request.PreviousReceiptResponse is null)
{
throw new Exception("There needs to be a previous receipt in the chain to perform a void");
}

var journalES = await _veriFactuMapping.CreateRegistroFacturacionAnulacionAsync(request.ReceiptRequest, request.ReceiptResponse, request.PreviousReceiptRequest, request.PreviousReceiptResponse);

var envelope = new Envelope<RequestBody>
{
Body = new RequestBody
{
RegFactuSistemaFacturacion = _veriFactuMapping.CreateRegFactuSistemaFacturacion(journalES)
}
};

receiptResponse = CreateResponse(
await new Client(new Uri(_configuration.BaseUrl), _configuration.Certificate).SendAsync(envelope),
request,
journalES.IDFactura.NumSerieFacturaAnulada,
journalES.Huella,
journalES.Signature,
journalES.IDFactura.IDEmisorFacturaAnulada
);
}
else
{
var journalES = await _veriFactuMapping.CreateRegistroFacturacionAltaAsync(request.ReceiptRequest, request.ReceiptResponse, request.PreviousReceiptRequest, request.PreviousReceiptResponse);

var envelope = new Envelope<RequestBody>
{
Body = new RequestBody
{
RegFactuSistemaFacturacion = _veriFactuMapping.CreateRegFactuSistemaFacturacion(journalES)
}
};

receiptResponse = CreateResponse(
await new Client(new Uri(_configuration.BaseUrl), _configuration.Certificate).SendAsync(envelope),
request,
journalES.IDFactura.NumSerieFactura,
journalES.Huella,
journalES.Signature,
journalES.IDFactura.IDEmisorFactura,
SignaturItemFactory.CreateESQRCode(_configuration.QRCodeBaseUrl + "/wlpl/TIKE-CONT/ValidarQR", journalES)
);
}

return new ProcessResponse
{
ReceiptResponse = receiptResponse,
};
}

private ReceiptResponse CreateResponse(
Result<RespuestaRegFactuSistemaFacturacion, Error> veriFactuResponse,
ProcessRequest request,
string numSerieFactura,
string huella,
XmlElement? signature,
string idEmisorFactura,
SignatureItem? signatureItem = null
)
{
if (veriFactuResponse.IsErr)
{
throw new Exception(veriFactuResponse.ErrValue!.ToString());
}
var respuesta = veriFactuResponse.OkValue!;
if (respuesta.EstadoEnvio != EstadoEnvio.Correcto)
{
var line = respuesta.RespuestaLinea!.Where(x => x.IDFactura.NumSerieFactura == numSerieFactura).Single();
throw new Exception($"{respuesta.EstadoEnvio}({line.CodigoErrorRegistro}): {line.DescripcionErrorRegistro}");
}

request.ReceiptResponse.AddSignatureItem(new SignatureItem
{
Caption = "Huella",
Data = huella,
ftSignatureFormat = (long) ifPOS.v1.SignaturItem.Formats.Text,
ftSignatureType = (long) SignatureTypesES.Huella
});
request.ReceiptResponse.AddSignatureItem(new SignatureItem
{
Caption = $"IDEmisorFactura{(request.ReceiptRequest.IsVoid() ? "Anulada" : null)}",
Data = idEmisorFactura,
ftSignatureFormat = (long) ifPOS.v1.SignaturItem.Formats.Text,
ftSignatureType = (long) SignatureTypesES.IDEmisorFactura
});


if (signatureItem is not null)
{
request.ReceiptResponse.AddSignatureItem(signatureItem);
}

request.ReceiptResponse.AddSignatureItem(SignaturItemFactory.CreateESSignature(Encoding.UTF8.GetBytes(XmlHelpers.Serialize(signature))));

return request.ReceiptResponse;
}

public Task<ESSSCDInfo> GetInfoAsync() => throw new NotImplementedException();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Xml.Serialization;

namespace fiskaltrust.Middleware.SCU.ES.Models;

[XmlType(Namespace = "https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
public enum Booleano
{
S,
N,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System.Xml.Serialization;

namespace fiskaltrust.Middleware.SCU.ES.Models;

[XmlType(Namespace = "https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
public partial class Cabecera
{
[XmlElement(Order = 0)]
public required PersonaFisicaJuridicaES ObligadoEmision { get; set; }

[XmlElement(Order = 1)]
public PersonaFisicaJuridicaES? Representante { get; set; }
[XmlIgnore]
public bool RepresentanteSpecified => Representante is not null;

[XmlElement(Order = 2)]
public RemisionVoluntaria? RemisionVoluntaria { get; set; }
[XmlIgnore]
public bool RemisionVoluntariaSpecified => RemisionVoluntaria is not null;

[XmlElement(Order = 3)]
public RemisionRequerimiento? RemisionRequerimiento { get; set; }
[XmlIgnore]
public bool RemisionRequerimientoSpecified => RemisionRequerimiento is not null;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Xml.Serialization;

namespace fiskaltrust.Middleware.SCU.ES.Models;

[XmlType(Namespace = "https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
public enum CalificacionOperacion
{
S1,
S2,
N1,
N2,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.Xml.Serialization;

namespace fiskaltrust.Middleware.SCU.ES.Models;

[XmlType(Namespace = "https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
public enum ClaveTipoFactura
{
F1,
F2,
R1,
R2,
R3,
R4,
R5,
F3,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System.Xml.Serialization;

namespace fiskaltrust.Middleware.SCU.ES.Models;

[XmlType(Namespace = "https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/SuministroInformacion.xsd")]
public enum ClaveTipoRectificativa
{
S,
I,
}
Loading
Loading