Skip to content
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

feat(data-modeling):create Financial.CurrencyConversion type #33

Merged
merged 5 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions src/api/financial/content-types/currency-conversion/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"kind": "collectionType",
"collectionName": "currency_conversions",
"info": {
"singularName": "currency-conversion",
"pluralName": "currency-conversions",
"displayName": "Financial.CurrencyConversions",
"description": ""
},
"options": {
"draftAndPublish": true
},
"attributes": {
"year": {
"type": "string",
"regex": "^2019|202[0-9]|203[0-9]$",
"required": true,
"maxLength": 4
},
"month": {
"type": "integer",
"required": true,
"max": 12,
"min": 1
},
"currency": {
"type": "enumeration",
"enum": [
"USD",
"GBP",
"EUR",
"LBP",
"LTL",
"RSD",
"BAM"
],
"required": true
},
"equivalentToUSD": {
"type": "float",
"required": true
},
"source": {
"type": "string"
},
"notes": {
"type": "text"
}
}
}
7 changes: 7 additions & 0 deletions src/api/financial/controllers/currency-conversion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* controller
*/

import { factories } from '@strapi/strapi'

export default factories.createCoreController('api::financial.currency-conversion');
7 changes: 7 additions & 0 deletions src/api/financial/routes/currency-conversion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* router
*/

import { factories } from '@strapi/strapi';

export default factories.createCoreRouter('api::financial.currency-conversion');
7 changes: 7 additions & 0 deletions src/api/financial/services/currency-conversion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/**
* service
*/

import { factories } from '@strapi/strapi';

export default factories.createCoreService('api::financial.currency-conversion');
52 changes: 52 additions & 0 deletions types/generated/contentTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,57 @@ export interface PluginUsersPermissionsUser extends Schema.CollectionType {
};
}

export interface ApiFinancialCurrencyConversion extends Schema.CollectionType {
collectionName: 'currency_conversions';
info: {
singularName: 'currency-conversion';
pluralName: 'currency-conversions';
displayName: 'Financial.CurrencyConversions';
description: '';
};
options: {
draftAndPublish: true;
};
attributes: {
year: Attribute.String &
Attribute.Required &
Attribute.SetMinMaxLength<{
maxLength: 4;
}>;
month: Attribute.Integer &
Attribute.Required &
Attribute.SetMinMax<
{
min: 1;
max: 12;
},
number
>;
currency: Attribute.Enumeration<
['USD', 'GBP', 'EUR', 'LBP', 'LTL', 'RSD', 'BAM']
> &
Attribute.Required;
equivalentToUSD: Attribute.Float & Attribute.Required;
source: Attribute.String;
notes: Attribute.Text;
createdAt: Attribute.DateTime;
updatedAt: Attribute.DateTime;
publishedAt: Attribute.DateTime;
createdBy: Attribute.Relation<
'api::financial.currency-conversion',
'oneToOne',
'admin::user'
> &
Attribute.Private;
updatedBy: Attribute.Relation<
'api::financial.currency-conversion',
'oneToOne',
'admin::user'
> &
Attribute.Private;
};
}

export interface ApiGeoCountry extends Schema.CollectionType {
collectionName: 'countries';
info: {
Expand Down Expand Up @@ -1101,6 +1152,7 @@ declare module '@strapi/types' {
'plugin::users-permissions.permission': PluginUsersPermissionsPermission;
'plugin::users-permissions.role': PluginUsersPermissionsRole;
'plugin::users-permissions.user': PluginUsersPermissionsUser;
'api::financial.currency-conversion': ApiFinancialCurrencyConversion;
'api::geo.country': ApiGeoCountry;
'api::geo.region': ApiGeoRegion;
'api::geo.subregion': ApiGeoSubregion;
Expand Down