Skip to content

Commit e08f07b

Browse files
Waste Notification
1 parent b229af4 commit e08f07b

File tree

10 files changed

+2095
-5
lines changed

10 files changed

+2095
-5
lines changed

build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ echo "Generating documentation: Receipt Advice"
2626
docker run --rm -i -v $PROJECT:/src -v $PROJECT/target/generated:/target --entrypoint java klakegg/saxon:9.8.0-7 -cp /saxon.jar net.sf.saxon.Transform -s:/src/structure/source/ubl-receipt-advice.xml -xsl:/src/tools/UBLInstance-To-StructureXML.xsl -o:/src/structure/syntax/ubl-receipt-advice.xml UblBaseUrl=https://raw.githubusercontent.com/OpenPEPPOL/poacc-upgrade-3/master/structure/syntax/ UblDocBaseUrl=https://docs.peppol.eu/poacc/upgrade-3/syntax/DespatchAdvice/ UblXmlReferenceFile=ubl-despatch-advice.xml -ext:on --allow-external-functions:on
2727
echo "Generating documentation: Application Response"
2828
docker run --rm -i -v $PROJECT:/src -v $PROJECT/target/generated:/target --entrypoint java klakegg/saxon:9.8.0-7 -cp /saxon.jar net.sf.saxon.Transform -s:/src/structure/source/ubl-application-response.xml -xsl:/src/tools/UBLInstance-To-StructureXML.xsl -o:/src/structure/syntax/ubl-application-response.xml UblBaseUrl=https://raw.githubusercontent.com/OpenPEPPOL/poacc-upgrade-3/master/structure/syntax/ UblDocBaseUrl=https://docs.peppol.eu/poacc/upgrade-3/syntax/DespatchAdvice/ UblXmlReferenceFile=ubl-despatch-advice.xml -ext:on --allow-external-functions:on
29+
echo "Generating documentation: Waste Notification"
30+
docker run --rm -i -v $PROJECT:/src -v $PROJECT/target/generated:/target --entrypoint java klakegg/saxon:9.8.0-7 -cp /saxon.jar net.sf.saxon.Transform -s:/src/structure/source/ubl-waste-notification.xml -xsl:/src/tools/UBLInstance-To-StructureXML.xsl -o:/src/structure/syntax/ubl-waste-notification.xml UblBaseUrl=https://raw.githubusercontent.com/OpenPEPPOL/poacc-upgrade-3/master/structure/syntax/ UblDocBaseUrl=https://docs.peppol.eu/poacc/upgrade-3/syntax/DespatchAdvice/ UblXmlReferenceFile=ubl-despatch-advice.xml -ext:on --allow-external-functions:on
2931
echo "Generating documentation: Waste Movement"
3032
docker run --rm -i -v $PROJECT:/src -v $PROJECT/target/generated:/target --entrypoint java klakegg/saxon:9.8.0-7 -cp /saxon.jar net.sf.saxon.Transform -s:/src/structure/source/ubl-waste-movement.xml -xsl:/src/tools/UBLInstance-To-StructureXML.xsl -o:/src/structure/syntax/ubl-waste-movement.xml UblBaseUrl=https://raw.githubusercontent.com/OpenPEPPOL/poacc-upgrade-3/master/structure/syntax/ UblDocBaseUrl=https://docs.peppol.eu/poacc/upgrade-3/syntax/DespatchAdvice/ UblXmlReferenceFile=ubl-despatch-advice.xml -ext:on --allow-external-functions:on
3133

@@ -50,6 +52,8 @@ echo "Generating mapping documents: Receipt Advice"
5052
docker run --rm -i -v $PROJECT:/src -v $PROJECT/target/generated:/target --entrypoint java klakegg/saxon:9.8.0-7 -cp /saxon.jar net.sf.saxon.Transform -s:/src/structure/syntax/ubl-receipt-advice.xml -xsl:/src/tools/create-mapping-document.xsl -o:/src/rules/mapping/ReceiptAdvice.xml -ext:on --allow-external-functions:on
5153
echo "Generating mapping documents: Application Response"
5254
docker run --rm -i -v $PROJECT:/src -v $PROJECT/target/generated:/target --entrypoint java klakegg/saxon:9.8.0-7 -cp /saxon.jar net.sf.saxon.Transform -s:/src/structure/syntax/ubl-application-response.xml -xsl:/src/tools/create-mapping-document.xsl -o:/src/rules/mapping/ApplicationResponse.xml -ext:on --allow-external-functions:on
55+
echo "Generating mapping documents: Waste Notification"
56+
docker run --rm -i -v $PROJECT:/src -v $PROJECT/target/generated:/target --entrypoint java klakegg/saxon:9.8.0-7 -cp /saxon.jar net.sf.saxon.Transform -s:/src/structure/syntax/ubl-waste-notification.xml -xsl:/src/tools/create-mapping-document.xsl -o:/src/rules/mapping/WasteNotification.xml -ext:on --allow-external-functions:on
5357
echo "Generating mapping documents: Waste Movement"
5458
docker run --rm -i -v $PROJECT:/src -v $PROJECT/target/generated:/target --entrypoint java klakegg/saxon:9.8.0-7 -cp /saxon.jar net.sf.saxon.Transform -s:/src/structure/syntax/ubl-waste-movement.xml -xsl:/src/tools/create-mapping-document.xsl -o:/src/rules/mapping/WasteMovement.xml -ext:on --allow-external-functions:on
5559

@@ -74,6 +78,8 @@ echo "Generating example: Receipt Advice"
7478
docker run --rm -i -v $PROJECT:/src -v $PROJECT/target/generated:/target --entrypoint java klakegg/saxon:9.8.0-7 -cp /saxon.jar net.sf.saxon.Transform -s:/src/structure/source/ubl-receipt-advice.xml -xsl:/src/tools/remove-pi.xsl -o:/src/rules/examples/ReceiptAdvice_Example_Full.xml -ext:on --allow-external-functions:on
7579
echo "Generating example: ApplicationResponse"
7680
docker run --rm -i -v $PROJECT:/src -v $PROJECT/target/generated:/target --entrypoint java klakegg/saxon:9.8.0-7 -cp /saxon.jar net.sf.saxon.Transform -s:/src/structure/source/ubl-application-response.xml -xsl:/src/tools/remove-pi.xsl -o:/src/rules/examples/ApplicationResponse_Example_Full.xml -ext:on --allow-external-functions:on
81+
echo "Generating example: Waste Notification"
82+
docker run --rm -i -v $PROJECT:/src -v $PROJECT/target/generated:/target --entrypoint java klakegg/saxon:9.8.0-7 -cp /saxon.jar net.sf.saxon.Transform -s:/src/structure/source/ubl-waste-notification.xml -xsl:/src/tools/remove-pi.xsl -o:/src/rules/examples/WasteNotification_Example_Full.xml -ext:on --allow-external-functions:on
7783
echo "Generating example: Waste Movement"
7884
docker run --rm -i -v $PROJECT:/src -v $PROJECT/target/generated:/target --entrypoint java klakegg/saxon:9.8.0-7 -cp /saxon.jar net.sf.saxon.Transform -s:/src/structure/source/ubl-waste-movement.xml -xsl:/src/tools/remove-pi.xsl -o:/src/rules/examples/WasteMovement_Example_Full.xml -ext:on --allow-external-functions:on
7985

project.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@
6868
<Path>structure/syntax/ubl-application-response.xml</Path>
6969
<Title>Peppol Logistics Application Response 1.0 (T129)</Title>
7070
</Resource>
71+
<Resource>
72+
<Type>Structure-1</Type>
73+
<Path>structure/syntax/ubl-waste-notification.xml</Path>
74+
<Title>Peppol Waste Notification 0.1 (T130)</Title>
75+
</Resource>
7176
<Resource>
7277
<Type>Structure-1</Type>
7378
<Path>structure/syntax/ubl-waste-movement.xml</Path>
@@ -136,7 +141,13 @@
136141
<Title>Business rules for Peppol Logistics Application Response transaction 1.0</Title>
137142
</Resource>
138143
<Resource>
139-
<Identifier>T128</Identifier>
144+
<Identifier>T130</Identifier>
145+
<Type>native:Schematron</Type>
146+
<Path>rules/sch/parts/PEPPOL-M-T130.sch</Path>
147+
<Title>Business rules for Waste Notification Transaction 0.1</Title>
148+
</Resource>
149+
<Resource>
150+
<Identifier>T131</Identifier>
140151
<Type>native:Schematron</Type>
141152
<Path>rules/sch/parts/PEPPOL-M-T131.sch</Path>
142153
<Title>Business rules for Waste Movement Transaction 0.1</Title>

rules/buildconfig.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<testfolder>unit-receipt-advice</testfolder>
1616
<testfolder>unit-application-response</testfolder>
1717
<testfolder>unit-waste-movement</testfolder>
18+
<testfolder>unit-waste-notification</testfolder>
1819

1920
<!-- example and snippet folders -->
2021
<testfolder>examples</testfolder>
@@ -29,6 +30,7 @@
2930
<testfolder>snippets/receipt-advice</testfolder>
3031
<testfolder>snippets/application-response</testfolder>
3132
<testfolder>snippets/waste-movement</testfolder>
33+
<testfolder>snippets/waste-notification</testfolder>
3234

3335
<!-- base config -->
3436
<configuration>
@@ -100,7 +102,14 @@
100102
<inherit>ubl-applicationresponse-2.1</inherit>
101103
<file source="sch/PEPPOLBIS-T129.sch" path="xsl/PEPPOLBIS-T129.xsl"/>
102104
</configuration>
103-
105+
106+
<configuration>
107+
<identifier>peppolbis-T130-base-1.0</identifier>
108+
<title>Waste Notification (T130)</title>
109+
<inherit>ubl-waste-notification-2.5</inherit>
110+
<file source="sch/PEPPOLBIS-T130.sch" path="xsl/PEPPOLBIS-T130.xsl"/>
111+
</configuration>
112+
104113
<configuration>
105114
<identifier>peppolbis-T131-base-1.0</identifier>
106115
<title>Waste Movement (T131)</title>

rules/sch/PEPPOLBIS-T130.sch

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<schema xmlns="http://purl.oclc.org/dsdl/schematron" xmlns:u="utils" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3+
xmlns:xi="http://www.w3.org/2001/XInclude"
4+
schemaVersion="iso" queryBinding="xslt2">
5+
6+
<title>Rules for Waste Notification transaction</title>
7+
8+
<ns uri="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2" prefix="cbc"/>
9+
<ns uri="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" prefix="cac"/>
10+
<ns uri="urn:oasis:names:specification:ubl:schema:xsd:WasteMovement-2" prefix="ubl"/>
11+
<ns uri="http://www.w3.org/2001/XMLSchema" prefix="xs"/>
12+
<ns uri="utils" prefix="u"/>
13+
14+
<xsl:key name="k_lineId" match="cac:LineItem" use="cbc:ID"/>
15+
16+
<!-- Functions -->
17+
18+
<xi:include href="parts/function/gln.xml"/>
19+
<xi:include href="parts/function/mod11.xml"/>
20+
<xi:include href="parts/function/checkCodiceIPA.xml"/>
21+
<xi:include href="parts/function/addPIVA.xml"/>
22+
<xi:include href="parts/function/checkCF.xml"/>
23+
<xi:include href="parts/function/checkCF16.xml"/>
24+
<xi:include href="parts/function/checkPIVA.xml"/>
25+
<xi:include href="parts/function/checkPIVAseIT.xml"/>
26+
<xi:include href="parts/function/mod97-0208.xml"/>
27+
<xi:include href="parts/function/abn.xml"/>
28+
<xi:include href="parts/function/checkSEOrgnr.xml"/>
29+
<!-- Rules -->
30+
31+
<include href="parts/common/empty-elements.sch"/>
32+
<include href="parts/common/rules.sch"/>
33+
<include href="../../target/generated/T130-basic.sch"/>
34+
<include href="parts/PEPPOL-M-T130.sch"/>
35+
36+
</schema>

rules/sch/parts/PEPPOL-M-T130.sch

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<pattern xmlns="http://purl.oclc.org/dsdl/schematron">
3+
4+
<rule context="cbc:CustomizationID">
5+
<assert id="PEPPOL-T130-R001"
6+
test="(normalize-space(.) = 'urn:fdc:peppol.eu:logistics:trns:waste-notification:1')"
7+
flag="fatal">CustomizationID SHALL have the value 'urn:fdc:peppol.eu:logistics:trns:waste-notification:1'.</assert>
8+
</rule>
9+
10+
<rule context="ubl:WasteNotification/cac:SenderParty">
11+
<assert id="PEPPOL-T130-R031" test="cac:PartyName or cac:PartyIdentification"
12+
flag="fatal"> [PEPPOL-T130-R031] Party must include either a party name or a party identification.</assert>
13+
</rule>
14+
<rule context="ubl:WasteNotification/cac:ReceiverParty">
15+
<assert id="PEPPOL-T130-R032" test="cac:PartyName or cac:PartyIdentification"
16+
flag="fatal"> [PEPPOL-T130-R032] Party must include either a party name or a party identification.</assert>
17+
</rule>
18+
19+
20+
</pattern>
21+
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<WasteNotification xmlns="urn:oasis:names:specification:ubl:schema:xsd:WasteNotification-2"
3+
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
4+
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
5+
<cbc:CustomizationID>urn:fdc:peppol.eu:logistics:trns:waste-movement:1</cbc:CustomizationID>
6+
<!-- tag::profile[] -->
7+
<cbc:ProfileID>urn:fdc:peppol.eu:logistics:bis:waste-movement:1</cbc:ProfileID>
8+
<!-- end::profile[] -->
9+
</WasteNotification>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<testSet xmlns="http://difi.no/xsd/vefa/validator/1.0" configuration="peppolbis-T130-base-1.0">
3+
<assert>
4+
<description>Verify that the cbc:CustomizationID is correct</description>
5+
<scope>PEPPOL-T130-R001</scope>
6+
</assert>
7+
<test id="1">
8+
<assert>
9+
<success>PEPPOL-T130-R001</success>
10+
</assert>
11+
<ubl:WasteNotification xmlns:ubl="urn:oasis:names:specification:ubl:schema:xsd:WasteNotification-2"
12+
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
13+
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
14+
<cbc:CustomizationID>urn:fdc:peppol.eu:logistics:trns:waste-movement:1</cbc:CustomizationID>
15+
<cbc:ProfileID>urn:fdc:peppol.eu:logistics:bis:waste-movement:1</cbc:ProfileID>
16+
</ubl:WasteNotification>
17+
</test>
18+
19+
<test>
20+
<assert id="2">
21+
<error>PEPPOL-T130-R001</error>
22+
</assert>
23+
<ubl:WasteNotification xmlns:ubl="urn:oasis:names:specification:ubl:schema:xsd:WasteNotification-2"
24+
xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
25+
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
26+
<cbc:CustomizationID>urn:fdc:peppol.eu:logistics:trns:waste-movements:1</cbc:CustomizationID>
27+
<cbc:ProfileID>urn:fdc:peppol.eu:logistics:bis:waste-movements:1</cbc:ProfileID>
28+
</ubl:WasteNotification>
29+
</test>
30+
31+
</testSet>

structure/namespace/ubl-waste-movement.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
<Ref card="1..1">cbc:IssueDate</Ref>
1717
<Ref card="0..1">cbc:IssueTime</Ref>
1818
<Ref card="0..1">cbc:WasteMovementTypeCode</Ref>
19-
<Ref card="0..1">cbc:SequenceID</Ref>
20-
<Ref card="0..1">cbc:TotalMovementNumeric</Ref>
19+
<Ref card="0..1">cbc:SequenceNumberID</Ref>
20+
<Ref card="0..1">cbc:ConsignmentQuantity</Ref>
2121
<Ref card="0..n">cac:Signature</Ref>
2222
<Ref card="1..1">cac:SenderParty</Ref>
2323
<Ref card="1..1">cac:ReceiverParty</Ref>
@@ -27,8 +27,8 @@
2727
<Ref card="1..1">cac:WasteProducerParty</Ref>
2828
<Ref card="1..1">cac:Shipment</Ref>
2929
<Ref card="0..1">cac:WasteNotificationDocumentReference</Ref>
30-
<Ref card="0..n">cac:DocumentReference</Ref>
3130
<Ref card="0..n">cac:WeightStatementDocumentReference</Ref>
31+
<Ref card="0..n">cac:DocumentReference</Ref>
3232
<Ref card="0..n">cac:DocumentDistribution</Ref>
3333
</Element>
3434
</Namespace>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Namespace xmlns="urn:fdc:difi.no:2017:vefa:structure:Namespace-1">
3+
<Identifier prefix="ubl">urn:oasis:names:specification:ubl:schema:xsd:WasteNotification-2</Identifier>
4+
<Version>2.5</Version>
5+
<Include prefix="cac">urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2</Include>
6+
<Include prefix="cbc">urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2</Include>
7+
<Include prefix="ext">urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2</Include>
8+
<Element name="WasteNotification">
9+
<Ref card="0..1">ext:UBLExtensions</Ref>
10+
<Ref card="0..1">cbc:UBLVersionID</Ref>
11+
<Ref card="0..1">cbc:CustomizationID</Ref>
12+
<Ref card="0..1">cbc:ProfileID</Ref>
13+
<Ref card="0..1">cbc:ProfileExecutionID</Ref>
14+
<Ref card="1..1">cbc:ID</Ref>
15+
<Ref card="0..1">cbc:UUID</Ref>
16+
<Ref card="1..1">cbc:IssueDate</Ref>
17+
<Ref card="0..1">cbc:IssueTime</Ref>
18+
<Ref card="0..1">cbc:WasteNotificationTypeCode</Ref>
19+
<Ref card="0..1">cbc:ConsignmentQuantity</Ref>
20+
<Ref card="0..n">cac:Signature</Ref>
21+
<Ref card="1..1">cac:SenderParty</Ref>
22+
<Ref card="1..1">cac:ReceiverParty</Ref>
23+
<Ref card="1..1">cac:NotifierParty</Ref>
24+
<Ref card="1..n">cac:CustomsParty</Ref>
25+
<Ref card="0..1">cac:DisposalFacilityParty</Ref>
26+
<Ref card="0..1">cac:RecoveryFacilityParty</Ref>
27+
<Ref card="1..1">cac:WasteProducerParty</Ref>
28+
<Ref card="1..1">cac:Shipment</Ref>
29+
<Ref card="0..n">cac:DocumentReference</Ref>
30+
</Element>
31+
</Namespace>

0 commit comments

Comments
 (0)