// SPDX-License-Identifier: Apache-2.0
import { TransformationType } from 'class-transformer';
import { SemVer } from 'semver';
import { UnsupportedOperationError } from '../../../../business/errors/unsupported-operation-error.js';
export class Transformations {
    constructor() {
        throw new UnsupportedOperationError('This class cannot be instantiated');
    }
    static SemVer = ({ value, type }) => {
        switch (type) {
            case TransformationType.PLAIN_TO_CLASS: {
                return new SemVer(value);
            }
            case TransformationType.CLASS_TO_PLAIN: {
                return value.toString();
            }
            default: {
                return value;
            }
        }
    };
    static DeploymentPhase = ({ value, type }) => {
        switch (type) {
            case TransformationType.PLAIN_TO_CLASS: {
                return value?.trim().toLowerCase().replace('_', '-');
            }
            case TransformationType.CLASS_TO_PLAIN: {
                return value.toString();
            }
            default: {
                return value;
            }
        }
    };
    static LedgerPhase = ({ value, type }) => {
        switch (type) {
            case TransformationType.PLAIN_TO_CLASS: {
                return value?.trim().toLowerCase().replace('_', '-');
            }
            case TransformationType.CLASS_TO_PLAIN: {
                return value.toString();
            }
            default: {
                return value;
            }
        }
    };
}
//# sourceMappingURL=transformations.js.map