Skip to content

Commit

Permalink
Create converter untdid2005 - untdid2475 (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
AurelienPillevesse authored Oct 15, 2024
1 parent 97327e8 commit d572b93
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

namespace Tiime\EN16931\Converter;

use Tiime\EN16931\Codelist\TimeReferencingCodeUNTDID2005;
use Tiime\EN16931\Codelist\TimeReferencingCodeUNTDID2475;

final readonly class TimeReferencingCodeUNTDID2005ToTimeReferencingCodeUNTDID2475
{
public static function convertToUNTDID2475(TimeReferencingCodeUNTDID2005 $code): TimeReferencingCodeUNTDID2475
{
return match ($code) {
TimeReferencingCodeUNTDID2005::INVOICE_DOCUMENT_ISSUE_DATE_TIME => TimeReferencingCodeUNTDID2475::DATE_OF_INVOICE,
TimeReferencingCodeUNTDID2005::DELIVERY_DATE_TIME_ACTUAL => TimeReferencingCodeUNTDID2475::DATE_OF_DELIVERY_OF_GOODS_TO_ESTABLISHMENTS_DOMICILE_SITE,
TimeReferencingCodeUNTDID2005::PAID_TO_DATE => TimeReferencingCodeUNTDID2475::PAYMENT_DATE
};
}

public static function convertToUNTDID2005(TimeReferencingCodeUNTDID2475 $code): TimeReferencingCodeUNTDID2005
{
return match ($code) {
TimeReferencingCodeUNTDID2475::DATE_OF_INVOICE => TimeReferencingCodeUNTDID2005::INVOICE_DOCUMENT_ISSUE_DATE_TIME,
TimeReferencingCodeUNTDID2475::DATE_OF_DELIVERY_OF_GOODS_TO_ESTABLISHMENTS_DOMICILE_SITE => TimeReferencingCodeUNTDID2005::DELIVERY_DATE_TIME_ACTUAL,
TimeReferencingCodeUNTDID2475::PAYMENT_DATE => TimeReferencingCodeUNTDID2005::PAID_TO_DATE
};
}
}

0 comments on commit d572b93

Please sign in to comment.