refactor(api): started implementing all of the tables needed for full data synchronization
BREAKING CHANGE: refer to body
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import { Company as CwCompany } from "../../generated/prisma/client";
|
||||
import { Company as ApiCompany } from "../../../api/generated/prisma/client";
|
||||
import { Translation } from "./types";
|
||||
|
||||
const companyTranslation: Translation<CwCompany, ApiCompany> = {
|
||||
values: [{ from: "" }],
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* kF - keys From
|
||||
* kT - keys To
|
||||
*/
|
||||
export type TranslationEntry<kF, kT> = {
|
||||
from: keyof kF;
|
||||
to: keyof kT;
|
||||
} & (kF extends kT
|
||||
? {
|
||||
process?: (value: kF[keyof kF]) => kT[keyof kT];
|
||||
}
|
||||
: {
|
||||
process: (value: kF[keyof kF]) => kT[keyof kT];
|
||||
});
|
||||
|
||||
export interface Translation<kF, kT> {
|
||||
values: TranslationEntry<kF, kT>[];
|
||||
}
|
||||
Reference in New Issue
Block a user