-
Notifications
You must be signed in to change notification settings - Fork 0
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
migration: api-depot postgres #126
Open
fufeck
wants to merge
9
commits into
master
Choose a base branch
from
fufeck_migration_api-depot-postgres
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3ce6c58
migration: api-depot postgres
fufeck 233bd1a
correct test
fufeck 475e651
update field api-depot types
fufeck 7c809e9
correct test
fufeck a750c28
Merge branch 'master' into fufeck_migration_api-depot-postgres
fufeck f2137b8
Merge branch 'master' into fufeck_migration_api-depot-postgres
fufeck bb99c2d
id not optional
fufeck 4d49a96
Merge branch 'master' into fufeck_migration_api-depot-postgres
fufeck a53fdb7
Merge branch 'master' into fufeck_migration_api-depot-postgres
fufeck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
// HABILITATION | ||
|
||
export enum StatusHabilitationEnum { | ||
ACCEPTED = 'accepted', | ||
PENDING = 'pending', | ||
REJECTED = 'rejected', | ||
} | ||
|
||
export enum TypeStrategyEnum { | ||
EMAIL = 'email', | ||
FRANCECONNECT = 'franceconnect', | ||
INTERNAL = 'internal', | ||
} | ||
|
||
export type Mandat = { | ||
nomMarital: string; | ||
nomNaissance: string; | ||
prenom: string; | ||
}; | ||
|
||
export type Strategy = { | ||
type: TypeStrategyEnum; | ||
pinCode?: string; | ||
pinCodeExpiration?: Date | null; | ||
createdAt?: Date | null; | ||
remainingAttempts?: number; | ||
// FRANCECONNECT | ||
mandat?: Mandat; | ||
authenticationError?: string; | ||
}; | ||
|
||
export type Habilitation = { | ||
id: string; | ||
clientId?: string; | ||
codeCommune: string; | ||
emailCommune: string; | ||
franceconnectAuthenticationUrl?: string; | ||
status: StatusHabilitationEnum; | ||
strategy?: Strategy | null; | ||
expiresAt?: Date; | ||
acceptedAt?: Date; | ||
rejectedAt?: Date; | ||
createdAt?: Date; | ||
updatedAt?: Date; | ||
}; | ||
|
||
// FILE | ||
|
||
export enum TypeFileEnum { | ||
BAL = 'bal', | ||
} | ||
export type File = { | ||
id: string; | ||
revisionId?: string; | ||
size?: number; | ||
hash?: string; | ||
type?: TypeFileEnum; | ||
createdAt?: Date; | ||
}; | ||
|
||
export enum StatusRevisionEnum { | ||
PENDING = 'pending', | ||
PUBLISHED = 'published', | ||
} | ||
|
||
// REVISION | ||
|
||
export type ParseError = { | ||
type: string; | ||
code: string; | ||
message: string; | ||
row: number; | ||
}; | ||
|
||
export type Validation = { | ||
valid: boolean; | ||
validatorVersion?: string; | ||
parseErrors?: ParseError[]; | ||
errors?: string[]; | ||
warnings?: string[]; | ||
infos?: string[]; | ||
rowsCount?: number; | ||
}; | ||
|
||
export type Context = { | ||
nomComplet?: string; | ||
organisation?: string; | ||
extras?: Record<string, any> | null; | ||
}; | ||
|
||
export type PublicClient = { | ||
id: string; | ||
legacyId?: string; | ||
nom: string; | ||
mandataire: string; | ||
chefDeFile?: string; | ||
chefDeFileEmail?: string; | ||
}; | ||
|
||
export type Revision = { | ||
id: string; | ||
clientId?: string; | ||
codeCommune: string; | ||
isReady: boolean; | ||
isCurrent: boolean; | ||
status: StatusRevisionEnum; | ||
context?: Context; | ||
validation?: Validation | null; | ||
habilitation?: Habilitation | null; | ||
files?: File[]; | ||
client?: PublicClient; | ||
publishedAt?: Date; | ||
createdAt: Date; | ||
updatedAt: Date; | ||
}; | ||
|
||
// CHEF DE FILE | ||
|
||
export enum TypePerimeterEnum { | ||
COMMUNE = 'commune', | ||
DEPARTEMENT = 'departement', | ||
EPCI = 'epci', | ||
} | ||
|
||
export type Perimeter = { | ||
id?: string; | ||
chefDeFileId?: string; | ||
type: TypePerimeterEnum; | ||
code: string; | ||
}; | ||
|
||
export type ChefDeFile = { | ||
id: string; | ||
nom?: string; | ||
email?: string; | ||
isEmailPublic?: boolean; | ||
isSignataireCharte?: boolean; | ||
perimeters?: Perimeter[]; | ||
createdAt?: Date; | ||
updatedAt?: Date; | ||
}; | ||
|
||
// MANDATAIRE | ||
|
||
export type Mandataire = { | ||
id: string; | ||
nom: string; | ||
email: string; | ||
createdAt: Date; | ||
updatedAt: Date; | ||
}; | ||
|
||
// CLIENT | ||
|
||
export enum AuthorizationStrategyEnum { | ||
INTERNAL = 'internal', | ||
CHEF_DE_FILE = 'chef-de-file', | ||
HABILITATION = 'habilitation', | ||
} | ||
|
||
export type Client = { | ||
id: string; | ||
mandataireId?: string; | ||
chefDeFileId?: string; | ||
legacyId: string; | ||
nom: string; | ||
isActive: boolean; | ||
isRelaxMode: boolean; | ||
token?: string; | ||
authorizationStrategy: AuthorizationStrategyEnum; | ||
createdAt: Date; | ||
updatedAt: Date; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On pourrait pas exporter ces types via OpenAPI, comme pour le signalement et mes-adresses? Je vois qu'ils sont dupliqués dans pas mal d'endroits.
ça sera plus simple à maintenir
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J'aimerais bien mais dans un second temps
On peut le faire pour l'api-depot et le moissonneur dans quasiment toutes nos briques.
Je voulais que la migration soit la plus petite possible dans un premier temps